diff options
| -rwxr-xr-x | meta-oe/recipes-support/libusbgx/libusbgx/gadget-stop | 13 | ||||
| -rw-r--r-- | meta-oe/recipes-support/libusbgx/libusbgx/usbgx.service | 2 | ||||
| -rw-r--r-- | meta-oe/recipes-support/libusbgx/libusbgx_git.bb | 3 |
3 files changed, 18 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libusbgx/libusbgx/gadget-stop b/meta-oe/recipes-support/libusbgx/libusbgx/gadget-stop new file mode 100755 index 0000000000..24b7caed5e --- /dev/null +++ b/meta-oe/recipes-support/libusbgx/libusbgx/gadget-stop | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | [ -r /etc/default/usbgx ] && . /etc/default/usbgx | ||
| 4 | |||
| 5 | for i in $IMPORT_SCHEMAS; do | ||
| 6 | if [ -e /sys/kernel/config/usb_gadget/"$i"/idVendor ]; then | ||
| 7 | if [ -e /sys/kernel/config/usb_gadget/"$i"/idProduct ]; then | ||
| 8 | idVendor=$(cat /sys/kernel/config/usb_gadget/"$i"/idVendor) | ||
| 9 | idProduct=$(cat /sys/kernel/config/usb_gadget/"$i"/idProduct) | ||
| 10 | /usr/bin/gadget-vid-pid-remove ${idVendor}:${idProduct} | ||
| 11 | fi | ||
| 12 | fi | ||
| 13 | done | ||
diff --git a/meta-oe/recipes-support/libusbgx/libusbgx/usbgx.service b/meta-oe/recipes-support/libusbgx/libusbgx/usbgx.service index d7d394cfe1..7210969d62 100644 --- a/meta-oe/recipes-support/libusbgx/libusbgx/usbgx.service +++ b/meta-oe/recipes-support/libusbgx/libusbgx/usbgx.service | |||
| @@ -5,7 +5,9 @@ After=sys-kernel-config.mount | |||
| 5 | 5 | ||
| 6 | [Service] | 6 | [Service] |
| 7 | Type=oneshot | 7 | Type=oneshot |
| 8 | RemainAfterExit=yes | ||
| 8 | ExecStart=/usr/bin/gadget-start | 9 | ExecStart=/usr/bin/gadget-start |
| 10 | ExecStop=/usr/bin/gadget-stop | ||
| 9 | 11 | ||
| 10 | [Install] | 12 | [Install] |
| 11 | WantedBy=usb-gadget.target | 13 | WantedBy=usb-gadget.target |
diff --git a/meta-oe/recipes-support/libusbgx/libusbgx_git.bb b/meta-oe/recipes-support/libusbgx/libusbgx_git.bb index f8ebcc7767..4841105619 100644 --- a/meta-oe/recipes-support/libusbgx/libusbgx_git.bb +++ b/meta-oe/recipes-support/libusbgx/libusbgx_git.bb | |||
| @@ -13,6 +13,7 @@ SRC_URI = " \ | |||
| 13 | file://0001-libusbgx-Add-interface-name-for-NCM-Feature-Descript.patch \ | 13 | file://0001-libusbgx-Add-interface-name-for-NCM-Feature-Descript.patch \ |
| 14 | file://0001-fix-stack-buffer-overflow-in-usbg_f_foo_attr_val-pro.patch \ | 14 | file://0001-fix-stack-buffer-overflow-in-usbg_f_foo_attr_val-pro.patch \ |
| 15 | file://gadget-start \ | 15 | file://gadget-start \ |
| 16 | file://gadget-stop \ | ||
| 16 | file://usbgx.initd \ | 17 | file://usbgx.initd \ |
| 17 | file://usbgx.service \ | 18 | file://usbgx.service \ |
| 18 | " | 19 | " |
| @@ -39,6 +40,8 @@ INHIBIT_UPDATERCD_BBCLASS = "${@bb.utils.contains('PACKAGECONFIG', 'examples', ' | |||
| 39 | do_install:append() { | 40 | do_install:append() { |
| 40 | install -Dm 0755 ${WORKDIR}/gadget-start ${D}${bindir}/gadget-start | 41 | install -Dm 0755 ${WORKDIR}/gadget-start ${D}${bindir}/gadget-start |
| 41 | sed -i -e 's,/usr/bin,${bindir},g' -e 's,/etc,${sysconfdir},g' ${D}${bindir}/gadget-start | 42 | sed -i -e 's,/usr/bin,${bindir},g' -e 's,/etc,${sysconfdir},g' ${D}${bindir}/gadget-start |
| 43 | install -m 0755 ${WORKDIR}/gadget-start ${D}${bindir}/gadget-stop | ||
| 44 | sed -i -e 's,/usr/bin,${bindir},g' -e 's,/etc,${sysconfdir},g' ${D}${bindir}/gadget-stop | ||
| 42 | 45 | ||
| 43 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | 46 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 44 | install -Dm 0644 ${WORKDIR}/usbgx.service ${D}${systemd_system_unitdir}/usbgx.service | 47 | install -Dm 0644 ${WORKDIR}/usbgx.service ${D}${systemd_system_unitdir}/usbgx.service |
