From 75f40c695f400f22e3de4aa8497251d44852b1fe Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 7 Jun 2017 14:00:39 -0700 Subject: libusbgx: fix usb product id calculation The Toradex product ID from the config block is decimal coded ASCII with leading zeros. In C and bash, leading zeros means octal number... This leads to wrong calculation of the USB product ID and to errors if the product ID contains the number 8 or 9 (since those are not valid under the octal numeric system). Fix both issues by explicitly force decimal system for the Toradex product ID. Signed-off-by: Stefan Agner Acked-by: Marcel Ziswiler --- recipes-support/libusbgx/files/usbg.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-support/libusbgx/files/usbg.service b/recipes-support/libusbgx/files/usbg.service index a4e6f80..3955e38 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+$(cat /proc/device-tree/toradex,product-id))) > \ +ExecStartPost=/bin/sh -c '/bin/echo $((0x4000+10#$(cat /proc/device-tree/toradex,product-id))) > \ /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' -- cgit v1.2.3