Skip to contentSkip to conversation

rpm: allow arch-dependent binaries in noarch packages

PATCH New [email protected] 1 participant 3 messages May 5, 2017

lore
Share & tools
lore
#0 lore raw

cover rpm: allow arch-dependent binaries in noarch packages

From: Ng Wei Tee <[email protected]>

This patch is to handle the packaging of arch specific firmware in allarch way. In this case, the netronome binaries has ELF headers which is arch specific firmware. This is targeted to solve Bugzilla ID 11329.

Besides that, the netronome firmware is packaged in a new package with a new license setup.

This configuration are build and tested for ipk, rpm and deb packaging.

Please review and provide feedbaack if you have any. Thank you.

Regards,
Wei Tee

Ng Wei Tee (2):
rpm: allow arch-dependent binaries in noarch packages
linux-firmware: enable netronome firmware

 meta/classes/package_rpm.bbclass                   |  1 +
 .../linux-firmware/linux-firmware_git.bb           | 25 +++++++++++++++++++---
 2 files changed, 23 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 rpm: allow arch-dependent binaries in noarch packages

From: Ng Wei Tee <[email protected]>

This is needed for packages like linux-firmware which have a legitimate reason for it. Oe-core has a separate package_qa test for this situation, so any accidental inclusions of such binaries will still be caught.

[YOCTO #11329]

---
 meta/classes/package_rpm.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/package_rpm.bbclass +1 -0
index 084546f..a844c4d 100644
@@ -643,6 +643,7 @@ python do_package_rpm () {
     cmd = cmd + " --define '_builddir " + d.getVar('S') + "'"
     cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
     cmd = cmd + " --define '_use_internal_dependency_generator 0'"
+    cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'"
     if perfiledeps:
         cmd = cmd + " --define '__find_requires " + outdepends + "'"
         cmd = cmd + " --define '__find_provides " + outprovides + "'"
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 linux-firmware: enable netronome firmware

In reply to [email protected]

From: Ng Wei Tee <[email protected]>

It was previously disabled, as rpm refused to package it into noarch package, due to the firmware being considered arch-specific. This check is disabled in rpm now.

The netronome binaries has ELF headers which will trigger an arch-specific error. INSANE_SKIP variable is used to skip some package_qa check usage.

---
 .../linux-firmware/linux-firmware_git.bb           | 25 +++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +22 -3
index be5bdbd..a1b7065 100644
@@ -31,6 +31,7 @@ LICENSE = "\
     & Firmware-Marvell \
     & Firmware-moxa \
     & Firmware-myri10ge_firmware \
+    & Firmware-netronome \
     & Firmware-nvidia \
     & Firmware-OLPC \
     & Firmware-ath9k-htc \
@@ -88,6 +89,7 @@ LIC_FILES_CHKSUM = "\
     file://LICENCE.Marvell;md5=9ddea1734a4baf3c78d845151f42a37a \
     file://LICENCE.moxa;md5=1086614767d8ccf744a923289d3d4261 \
     file://LICENCE.myri10ge_firmware;md5=42e32fb89f6b959ca222e25ac8df8fed \
+    file://LICENCE.Netronome;md5=cd2a3e6effe3cdf42731575b8e9477ed \
     file://LICENCE.nvidia;md5=4428a922ed3ba2ceec95f076a488ce07 \
     file://LICENCE.OLPC;md5=5b917f9d8c061991be4f6f5f108719cd \
     file://LICENCE.open-ath9k-htc-firmware;md5=1b33c9f4d17bc4d457bdb23727046837 \
@@ -146,6 +148,7 @@ NO_GENERIC_LICENSE[Firmware-kaweth] = "LICENCE.kaweth"
 NO_GENERIC_LICENSE[Firmware-Marvell] = "LICENCE.Marvell"
 NO_GENERIC_LICENSE[Firmware-moxa] = "LICENCE.moxa"
 NO_GENERIC_LICENSE[Firmware-myri10ge_firmware] = "LICENCE.myri10ge_firmware"
+NO_GENERIC_LICENSE[Firmware-netronome] = "LICENCE.Netronome"
 NO_GENERIC_LICENSE[Firmware-nvidia] = "LICENCE.nvidia"
 NO_GENERIC_LICENSE[Firmware-OLPC] = "LICENCE.OLPC"
 NO_GENERIC_LICENSE[Firmware-ath9k-htc] = "LICENCE.open-ath9k-htc-firmware"
@@ -216,9 +219,6 @@ do_install() {
 
         # Copy the iwlwifi ucode
         cp ${WORKDIR}/iwlwifi-8000C-19.ucode ${D}${nonarch_base_libdir}/firmware/
-
-	# TODO: Remove netronome firmware until RPM packaging issue is resolved
-	rm -r ${D}${nonarch_base_libdir}/firmware/netronome/
 }
 
 
@@ -246,6 +246,7 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-i915-license ${PN}-i915 \
              ${PN}-adsp-sst-license ${PN}-adsp-sst \
              ${PN}-bnx2-mips \
+             ${PN}-netronome-license ${PN}-netronome \
              ${PN}-whence-license \
              ${PN}-license \
              "
@@ -371,6 +372,21 @@ RDEPENDS_${PN}-sd8801 += "${PN}-marvell-license"
 RDEPENDS_${PN}-sd8887 += "${PN}-marvell-license"
 RDEPENDS_${PN}-sd8897 += "${PN}-marvell-license"
 
+# For netronome
+LICENSE_${PN}-netronome = "Firmware-netronome"
+
+FILES_${PN}-netronome-license = " \
+  ${nonarch_base_libdir}/firmware/LICENCE.Netronome \
+"
+FILES_${PN}-netronome = " \
+  ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0081*.nffw \
+  ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0096*.nffw \
+  ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0097*.nffw \
+  ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0099*.nffw \
+"
+
+RDEPENDS_${PN}-netronome += "${PN}-netronome-license"
+
 # For rtl
 LICENSE_${PN}-rtl8188 = "Firmware-rtlwifi_firmware"
 LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware"
@@ -647,3 +663,6 @@ python populate_packages_prepend () {
     iwlwifi_pkgs = filter(lambda x: x.find('-iwlwifi-') != -1, firmware_pkgs)
     d.appendVar('RDEPENDS_linux-firmware-iwlwifi', ' ' + ' '.join(iwlwifi_pkgs))
 }
+
+# Netronome binaries has ELF headers and therefore triggers an arch-specific error.
+INSANE_SKIP_${PN}-netronome = "arch"
Signature · 1 line
2.7.4