From 3fa96f28bb30643cac3b8a49d3abd7c976acb704 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Tue, 11 Jun 2019 18:40:02 +0200 Subject: libusbgx: rework g1.schema handling Add the product name at compile time so that we do not need to provide slightly different copies of the file. While at it set package arch to machine arch. The packages created are machine specific due to the g1.schema file. Signed-off-by: Max Krummenacher --- .../libusbgx/files/apalis-imx6/g1.schema | 64 ---------------------- .../libusbgx/files/colibri-imx6/g1.schema | 64 ---------------------- .../libusbgx/files/colibri-vf/g1.schema | 64 ---------------------- recipes-support/libusbgx/files/g1.schema | 1 - recipes-support/libusbgx/files/g1.schema.in | 64 ++++++++++++++++++++++ recipes-support/libusbgx/files/mx6ull/g1.schema | 64 ---------------------- recipes-support/libusbgx/files/mx7/g1.schema | 64 ---------------------- recipes-support/libusbgx/libusbgx_git.bb | 8 ++- 8 files changed, 71 insertions(+), 322 deletions(-) delete mode 100644 recipes-support/libusbgx/files/apalis-imx6/g1.schema delete mode 100644 recipes-support/libusbgx/files/colibri-imx6/g1.schema delete mode 100644 recipes-support/libusbgx/files/colibri-vf/g1.schema delete mode 100644 recipes-support/libusbgx/files/g1.schema create mode 100644 recipes-support/libusbgx/files/g1.schema.in delete mode 100644 recipes-support/libusbgx/files/mx6ull/g1.schema delete mode 100644 recipes-support/libusbgx/files/mx7/g1.schema diff --git a/recipes-support/libusbgx/files/apalis-imx6/g1.schema b/recipes-support/libusbgx/files/apalis-imx6/g1.schema deleted file mode 100644 index 5d6dab2..0000000 --- a/recipes-support/libusbgx/files/apalis-imx6/g1.schema +++ /dev/null @@ -1,64 +0,0 @@ -attrs : -{ - bcdUSB = 0x200; - bDeviceClass = 0x2; - bDeviceSubClass = 0x0; - bDeviceProtocol = 0x0; - bMaxPacketSize0 = 0x40; - idVendor = 0x1b67; - bcdDevice = 0x401; -}; -os_descs : -{ - config_id = 1; - use = 1; - qw_sign = "MSFT100"; - b_vendor_code = 0xcd; -}; -strings = ( - { - lang = 0x409; - manufacturer = "Toradex"; - product = "Toradex Apalis iMX6"; - serialnumber = "00000000"; - } ); -functions : -{ - rndis_usb0 : - { - instance = "usb0"; - type = "rndis"; - attrs : - { - dev_addr = "00:14:2d:ff:ff:ff"; - host_addr = "00:14:2d:ff:ff:fe"; - qmult = 5; - }; - os_descs = ( - { - interface = "rndis"; - compatible_id = "RNDIS"; - sub_compatible_id = "5162001"; - } ); - }; -}; -configs = ( - { - id = 1; - name = "c"; - attrs : - { - bmAttributes = 0xC0; - bMaxPower = 0x1; - }; - strings = ( - { - lang = 0x409; - configuration = "RNDIS"; - } ); - functions = ( - { - name = "rndis.usb0"; - function = "rndis_usb0"; - } ); - } ); diff --git a/recipes-support/libusbgx/files/colibri-imx6/g1.schema b/recipes-support/libusbgx/files/colibri-imx6/g1.schema deleted file mode 100644 index 300dcd2..0000000 --- a/recipes-support/libusbgx/files/colibri-imx6/g1.schema +++ /dev/null @@ -1,64 +0,0 @@ -attrs : -{ - bcdUSB = 0x200; - bDeviceClass = 0x2; - bDeviceSubClass = 0x0; - bDeviceProtocol = 0x0; - bMaxPacketSize0 = 0x40; - idVendor = 0x1b67; - bcdDevice = 0x401; -}; -os_descs : -{ - config_id = 1; - use = 1; - qw_sign = "MSFT100"; - b_vendor_code = 0xcd; -}; -strings = ( - { - lang = 0x409; - manufacturer = "Toradex"; - product = "Toradex Colibri iMX6"; - serialnumber = "00000000"; - } ); -functions : -{ - rndis_usb0 : - { - instance = "usb0"; - type = "rndis"; - attrs : - { - dev_addr = "00:14:2d:ff:ff:ff"; - host_addr = "00:14:2d:ff:ff:fe"; - qmult = 5; - }; - os_descs = ( - { - interface = "rndis"; - compatible_id = "RNDIS"; - sub_compatible_id = "5162001"; - } ); - }; -}; -configs = ( - { - id = 1; - name = "c"; - attrs : - { - bmAttributes = 0xC0; - bMaxPower = 0x1; - }; - strings = ( - { - lang = 0x409; - configuration = "RNDIS"; - } ); - functions = ( - { - name = "rndis.usb0"; - function = "rndis_usb0"; - } ); - } ); diff --git a/recipes-support/libusbgx/files/colibri-vf/g1.schema b/recipes-support/libusbgx/files/colibri-vf/g1.schema deleted file mode 100644 index 4f3a1d8..0000000 --- a/recipes-support/libusbgx/files/colibri-vf/g1.schema +++ /dev/null @@ -1,64 +0,0 @@ -attrs : -{ - bcdUSB = 0x200; - bDeviceClass = 0x2; - bDeviceSubClass = 0x0; - bDeviceProtocol = 0x0; - bMaxPacketSize0 = 0x40; - idVendor = 0x1b67; - bcdDevice = 0x401; -}; -os_descs : -{ - config_id = 1; - use = 1; - qw_sign = "MSFT100"; - b_vendor_code = 0xcd; -}; -strings = ( - { - lang = 0x409; - manufacturer = "Toradex"; - product = "Toradex Colibri VF50/VF61"; - serialnumber = "00000000"; - } ); -functions : -{ - rndis_usb0 : - { - instance = "usb0"; - type = "rndis"; - attrs : - { - dev_addr = "00:14:2d:ff:ff:ff"; - host_addr = "00:14:2d:ff:ff:fe"; - qmult = 5; - }; - os_descs = ( - { - interface = "rndis"; - compatible_id = "RNDIS"; - sub_compatible_id = "5162001"; - } ); - }; -}; -configs = ( - { - id = 1; - name = "c"; - attrs : - { - bmAttributes = 0xC0; - bMaxPower = 0x1; - }; - strings = ( - { - lang = 0x409; - configuration = "RNDIS"; - } ); - functions = ( - { - name = "rndis.usb0"; - function = "rndis_usb0"; - } ); - } ); diff --git a/recipes-support/libusbgx/files/g1.schema b/recipes-support/libusbgx/files/g1.schema deleted file mode 100644 index 6b1b583..0000000 --- a/recipes-support/libusbgx/files/g1.schema +++ /dev/null @@ -1 +0,0 @@ -# empty placeholder to allow bitbake to find a file for machines which do not provide a schema diff --git a/recipes-support/libusbgx/files/g1.schema.in b/recipes-support/libusbgx/files/g1.schema.in new file mode 100644 index 0000000..7bfaf70 --- /dev/null +++ b/recipes-support/libusbgx/files/g1.schema.in @@ -0,0 +1,64 @@ +attrs : +{ + bcdUSB = 0x200; + bDeviceClass = 0x2; + bDeviceSubClass = 0x0; + bDeviceProtocol = 0x0; + bMaxPacketSize0 = 0x40; + idVendor = 0x1b67; + bcdDevice = 0x401; +}; +os_descs : +{ + config_id = 1; + use = 1; + qw_sign = "MSFT100"; + b_vendor_code = 0xcd; +}; +strings = ( + { + lang = 0x409; + manufacturer = "Toradex"; + product = "@@PRODUCT_NAME@@"; + serialnumber = "00000000"; + } ); +functions : +{ + rndis_usb0 : + { + instance = "usb0"; + type = "rndis"; + attrs : + { + dev_addr = "00:14:2d:ff:ff:ff"; + host_addr = "00:14:2d:ff:ff:fe"; + qmult = 5; + }; + os_descs = ( + { + interface = "rndis"; + compatible_id = "RNDIS"; + sub_compatible_id = "5162001"; + } ); + }; +}; +configs = ( + { + id = 1; + name = "c"; + attrs : + { + bmAttributes = 0xC0; + bMaxPower = 0x1; + }; + strings = ( + { + lang = 0x409; + configuration = "RNDIS"; + } ); + functions = ( + { + name = "rndis.usb0"; + function = "rndis_usb0"; + } ); + } ); diff --git a/recipes-support/libusbgx/files/mx6ull/g1.schema b/recipes-support/libusbgx/files/mx6ull/g1.schema deleted file mode 100644 index 1050225..0000000 --- a/recipes-support/libusbgx/files/mx6ull/g1.schema +++ /dev/null @@ -1,64 +0,0 @@ -attrs : -{ - bcdUSB = 0x200; - bDeviceClass = 0x2; - bDeviceSubClass = 0x0; - bDeviceProtocol = 0x0; - bMaxPacketSize0 = 0x40; - idVendor = 0x1b67; - bcdDevice = 0x401; -}; -os_descs : -{ - config_id = 1; - use = 1; - qw_sign = "MSFT100"; - b_vendor_code = 0xcd; -}; -strings = ( - { - lang = 0x409; - manufacturer = "Toradex"; - product = "Toradex Colibri iMX6ULL"; - serialnumber = "00000000"; - } ); -functions : -{ - rndis_usb0 : - { - instance = "usb0"; - type = "rndis"; - attrs : - { - dev_addr = "00:14:2d:ff:ff:ff"; - host_addr = "00:14:2d:ff:ff:fe"; - qmult = 5; - }; - os_descs = ( - { - interface = "rndis"; - compatible_id = "RNDIS"; - sub_compatible_id = "5162001"; - } ); - }; -}; -configs = ( - { - id = 1; - name = "c"; - attrs : - { - bmAttributes = 0xC0; - bMaxPower = 0x1; - }; - strings = ( - { - lang = 0x409; - configuration = "RNDIS"; - } ); - functions = ( - { - name = "rndis.usb0"; - function = "rndis_usb0"; - } ); - } ); diff --git a/recipes-support/libusbgx/files/mx7/g1.schema b/recipes-support/libusbgx/files/mx7/g1.schema deleted file mode 100644 index 79b8882..0000000 --- a/recipes-support/libusbgx/files/mx7/g1.schema +++ /dev/null @@ -1,64 +0,0 @@ -attrs : -{ - bcdUSB = 0x200; - bDeviceClass = 0x2; - bDeviceSubClass = 0x0; - bDeviceProtocol = 0x0; - bMaxPacketSize0 = 0x40; - idVendor = 0x1b67; - bcdDevice = 0x401; -}; -os_descs : -{ - config_id = 1; - use = 1; - qw_sign = "MSFT100"; - b_vendor_code = 0xcd; -}; -strings = ( - { - lang = 0x409; - manufacturer = "Toradex"; - product = "Toradex Colibri iMX7"; - serialnumber = "00000000"; - } ); -functions : -{ - rndis_usb0 : - { - instance = "usb0"; - type = "rndis"; - attrs : - { - dev_addr = "00:14:2d:ff:ff:ff"; - host_addr = "00:14:2d:ff:ff:fe"; - qmult = 5; - }; - os_descs = ( - { - interface = "rndis"; - compatible_id = "RNDIS"; - sub_compatible_id = "5162001"; - } ); - }; -}; -configs = ( - { - id = 1; - name = "c"; - attrs : - { - bmAttributes = 0xC0; - bMaxPower = 0x1; - }; - strings = ( - { - lang = 0x409; - configuration = "RNDIS"; - } ); - functions = ( - { - name = "rndis.usb0"; - function = "rndis_usb0"; - } ); - } ); diff --git a/recipes-support/libusbgx/libusbgx_git.bb b/recipes-support/libusbgx/libusbgx_git.bb index 17707ee..2cd9e21 100644 --- a/recipes-support/libusbgx/libusbgx_git.bb +++ b/recipes-support/libusbgx/libusbgx_git.bb @@ -16,11 +16,16 @@ SRCBRANCH = "master" SRC_URI = " \ git://github.com/libusbgx/libusbgx.git;branch=${SRCBRANCH} \ file://usbg.service \ - file://g1.schema \ + file://g1.schema.in \ " S = "${WORKDIR}/git" +MACHINE_NAME ?= "${MACHINE}" +do_compile_append () { + sed -e "s:@@PRODUCT_NAME@@:${MACHINE_NAME}:" ${WORKDIR}/g1.schema.in > ${WORKDIR}/g1.schema +} + do_install_append () { if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then install -d ${D}${systemd_unitdir}/system/ @@ -36,6 +41,7 @@ SYSTEMD_PACKAGES = "${PN}" SYSTEMD_SERVICE_${PN} = "usbg.service" PACKAGES =+ "${PN}-examples" +PACKAGE_ARCH = "${MACHINE_ARCH}" FILES_${PN}-examples = " \ ${bindir}/gadget-* \ -- cgit v1.2.3