summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2017-01-13 15:58:55 (GMT)
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-03-29 10:48:09 (GMT)
commitbae995232e38941a590d86c42502664dd2221035 (patch)
treefbb7121323bb55315a5311c00b17c5e3dc7fe199
parent55a857de6a40c6c35396c29ed32f127ca2ead13c (diff)
downloadmajor-bae995232e38941a590d86c42502664dd2221035.zip
major-bae995232e38941a590d86c42502664dd2221035.tar.gz
major-bae995232e38941a590d86c42502664dd2221035.tar.bz2
Add k.opasiak's filesrefs/changes/24/121924/1
Change-Id: Ib91e80a9c3a677ad51cf6034f6947dc24dc598e4
-rwxr-xr-xtct/prepare/direct_set_debug.sh59
-rw-r--r--tct/prepare/sdb-prestart.service7
-rw-r--r--tct/prepare/sdb-prestart.timer6
3 files changed, 72 insertions, 0 deletions
diff --git a/tct/prepare/direct_set_debug.sh b/tct/prepare/direct_set_debug.sh
new file mode 100755
index 0000000..5ee0f4e
--- /dev/null
+++ b/tct/prepare/direct_set_debug.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+load_usb_gadget() {
+ echo 0 > /sys/class/usb_mode/usb0/enable
+ echo 04e8 > /sys/class/usb_mode/usb0/idVendor
+ echo $1 > /sys/class/usb_mode/usb0/idProduct
+ echo $2 > /sys/class/usb_mode/usb0/funcs_fconf
+ echo $3 > /sys/class/usb_mode/usb0/funcs_sconf
+ echo 0 > /sys/class/usb_mode/usb0/bDeviceClass
+ echo 0 > /sys/class/usb_mode/usb0/bDeviceSubClass
+ echo 0 > /sys/class/usb_mode/usb0/bDeviceProtocol
+ cat /etc/id > /sys/class/usb_mode/usb0/iSerial
+ echo 1 > /sys/class/usb_mode/usb0/enable
+}
+
+unload_usb_gadget() {
+ echo 0 > /sys/class/usb_mode/usb0/enable
+}
+
+sdb_set() {
+ load_usb_gadget "6860" "" "sdb"
+ /usr/bin/systemctl start sdbd.service
+ /usr/bin/vconftool set -t int memory/sysman/usb_status 2 -f
+ echo "SDB enabled"
+}
+
+sdb_unset() {
+ unload_usb_gadget
+ /usr/bin/vconftool set -t int memory/sysman/usb_status 0 -f
+ /usr/bin/systemctl stop sdbd.service
+ echo "SDB disabled"
+}
+
+show_options() {
+ echo "direct_set_debug.sh: usage:"
+ echo " --help This message"
+ echo " --sdb-set Load sdb without usb-manager"
+ echo " --sdb-unset Unload sdb without usb-manager"
+}
+
+case "$1" in
+"--sdb-set")
+ sdb_set
+ ;;
+
+"--sdb-unset")
+ sdb_unset
+ ;;
+
+"--help")
+ show_options
+ ;;
+
+*)
+ echo "Wrong parameters. Please use option --help to check options "
+ ;;
+esac
diff --git a/tct/prepare/sdb-prestart.service b/tct/prepare/sdb-prestart.service
new file mode 100644
index 0000000..dd470e7
--- /dev/null
+++ b/tct/prepare/sdb-prestart.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Enadle SDB at boot time
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/direct_set_debug.sh --sdb-set
+
diff --git a/tct/prepare/sdb-prestart.timer b/tct/prepare/sdb-prestart.timer
new file mode 100644
index 0000000..f678614
--- /dev/null
+++ b/tct/prepare/sdb-prestart.timer
@@ -0,0 +1,6 @@
+[Unit]
+Description=SDB starter timer
+After=deviced.service
+
+[Timer]
+OnActiveSec=10s