summaryrefslogtreecommitdiff
path: root/recipes-connectivity/usb-gadget-mode
diff options
context:
space:
mode:
authorMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2016-09-15 21:15:53 +0300
committerMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2016-09-15 21:15:53 +0300
commitd7368ef31b729511e9d630bbd935eb56dc15856f (patch)
tree5d9d18eadf3a831259bbf96ae7c35e67a5417ee8 /recipes-connectivity/usb-gadget-mode
parentad4cb1501c9ac3c364f1b5cf26fdfb5283d9c8ba (diff)
downloadmeta-mlinux-d7368ef31b729511e9d630bbd935eb56dc15856f.tar.gz
meta-mlinux-d7368ef31b729511e9d630bbd935eb56dc15856f.tar.bz2
meta-mlinux-d7368ef31b729511e9d630bbd935eb56dc15856f.zip
mtp: disable usb serial gadget for the mtp hardware
Diffstat (limited to 'recipes-connectivity/usb-gadget-mode')
-rw-r--r--recipes-connectivity/usb-gadget-mode/files/usb-gadget.conf3
-rwxr-xr-xrecipes-connectivity/usb-gadget-mode/files/usb-gadget.init5
-rw-r--r--recipes-connectivity/usb-gadget-mode/usb-gadget-mode.bb7
3 files changed, 14 insertions, 1 deletions
diff --git a/recipes-connectivity/usb-gadget-mode/files/usb-gadget.conf b/recipes-connectivity/usb-gadget-mode/files/usb-gadget.conf
index ecf0844..f3a7a6b 100644
--- a/recipes-connectivity/usb-gadget-mode/files/usb-gadget.conf
+++ b/recipes-connectivity/usb-gadget-mode/files/usb-gadget.conf
@@ -1,3 +1,6 @@
+# set to "no" to disable usb-gadget
+ENABLED="yes"
+
USB_MODE="serial"
MODULE_OPTIONS=""
diff --git a/recipes-connectivity/usb-gadget-mode/files/usb-gadget.init b/recipes-connectivity/usb-gadget-mode/files/usb-gadget.init
index 7bf456b..403fd23 100755
--- a/recipes-connectivity/usb-gadget-mode/files/usb-gadget.init
+++ b/recipes-connectivity/usb-gadget-mode/files/usb-gadget.init
@@ -10,6 +10,11 @@
#
# 20070606 - v0.0.1 - Initial release
+ENABLED="yes"
+
+[ -r /etc/default/usb-gadget ] && source /etc/default/usb-gadget
+[ "$ENABLED" == "yes" ] || exit 0
+
case "$1" in
start) usb-gadget ;;
esac
diff --git a/recipes-connectivity/usb-gadget-mode/usb-gadget-mode.bb b/recipes-connectivity/usb-gadget-mode/usb-gadget-mode.bb
index 3b547cb..6887089 100644
--- a/recipes-connectivity/usb-gadget-mode/usb-gadget-mode.bb
+++ b/recipes-connectivity/usb-gadget-mode/usb-gadget-mode.bb
@@ -10,7 +10,7 @@ SECTION = "console/network"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
PV = "0.0.2"
-PR = "r2"
+PR = "r3"
SRC_URI = "\
file://usb-gadget.conf \
@@ -29,6 +29,11 @@ do_install() {
install -m 0755 ${WORKDIR}/usb-gadget ${D}${bindir}
}
+# disbale usb-gadget for mtp hardware
+do_install_append_mtp() {
+ sed -i 's/ENABLED="yes"/ENABLED="no"/g' ${D}${sysconfdir}/default/usb-gadget
+}
+
pkg_postinst_${PN}() {
test -n "$D" && opt="-r $D"
update-rc.d $opt usb-gadget defaults 50