summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2018-04-04 16:15:22 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-06-18 14:38:10 +0200
commit8560bd890993cb827552cb918b3b674eeb03f40f (patch)
tree7584f08bdc50077e984858fe2186192f785941fe
parentf7fde8756e437f4b93074d4cac4864db8081add5 (diff)
libusbgx: make conversion of product ID to decimal value portable
Using "10#" to treat the product ID as a decimal value does not work with the BusyBox shell. Use eval productid + 0 which works well with bash and BusyBox to convert to a decimal value. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--recipes-support/libusbgx/files/usbg.service2
1 files changed, 1 insertions, 1 deletions
diff --git a/recipes-support/libusbgx/files/usbg.service b/recipes-support/libusbgx/files/usbg.service
index 3955e38..c9ed582 100644
--- a/recipes-support/libusbgx/files/usbg.service
+++ b/recipes-support/libusbgx/files/usbg.service
@@ -6,7 +6,7 @@ Before=systemd-networkd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/gadget-import g1 /etc/usbg/g1.schema
-ExecStartPost=/bin/sh -c '/bin/echo $((0x4000+10#$(cat /proc/device-tree/toradex,product-id))) > \
+ExecStartPost=/bin/sh -c '/bin/echo $((0x4000+$(expr $(cat /proc/device-tree/toradex,product-id) + 0))) > \
/sys/kernel/config/usb_gadget/g1/idProduct'
ExecStartPost=/bin/sh -c '/bin/cat /proc/device-tree/serial-number > \
/sys/kernel/config/usb_gadget/g1/strings/0x409/serialnumber'