diff options
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 |