[PATCH 1/1] linux-firmware: remove hard-coded paths

Ian Ray
2016-01-04T13:51:15Z

The recipe uses hard-coded paths (specifically /lib) in do_install
and in FILES, however on a merged /usr system this directory might
not exist. Prefer base_libdir.

Signed-off-by: Ian Ray <ian.ray@ge.com>
---
.../linux-firmware/linux-firmware_git.bb | 134 ++++++++++-----------
1 file changed, 67 insertions(+), 67 deletions(-)

diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
index 0878ab1..4d2cc80 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -141,24 +141,24 @@ do_compile() {
}

do_install() {
- install -d ${D}/lib/firmware/
- cp -r * ${D}/lib/firmware/
+ install -d ${D}${base_libdir}/firmware/
+ cp -r * ${D}${base_libdir}/firmware/

# Avoid Makefile to be deployed
- rm ${D}/lib/firmware/Makefile
+ rm ${D}${base_libdir}/firmware/Makefile

# Remove unbuild firmware which needs cmake and bash
- rm ${D}/lib/firmware/carl9170fw -rf
+ rm ${D}${base_libdir}/firmware/carl9170fw -rf

# Remove pointless bash script
- rm ${D}/lib/firmware/configure
+ rm ${D}${base_libdir}/firmware/configure

# Libertas sd8686
- ln -sf libertas/sd8686_v9.bin ${D}/lib/firmware/sd8686.bin
- ln -sf libertas/sd8686_v9_helper.bin ${D}/lib/firmware/sd8686_helper.bin
+ ln -sf libertas/sd8686_v9.bin ${D}${base_libdir}/firmware/sd8686.bin
+ ln -sf libertas/sd8686_v9_helper.bin ${D}${base_libdir}/firmware/sd8686_helper.bin

# fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
- ( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )
+ ( cd ${D}${base_libdir}/firmware ; ln -sf ti-connectivity/* . )
}

@@ -188,21 +188,21 @@ LICENSE_${PN}-ar3k = "Firmware-atheros_firmware"
LICENSE_${PN}-ath6k = "Firmware-atheros_firmware"
LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"

-FILES_${PN}-atheros-license = "/lib/firmware/LICENCE.atheros_firmware"
+FILES_${PN}-atheros-license = "${base_libdir}/firmware/LICENCE.atheros_firmware"
FILES_${PN}-ar9170 = " \
- /lib/firmware/ar9170*.fw \
+ ${base_libdir}/firmware/ar9170*.fw \
"
FILES_${PN}-ar3k = " \
- /lib/firmware/ar3k \
+ ${base_libdir}/firmware/ar3k \
"
FILES_${PN}-ath6k = " \
- /lib/firmware/ath6k \
+ ${base_libdir}/firmware/ath6k \
"
FILES_${PN}-ath9k = " \
- /lib/firmware/ar9271.fw \
- /lib/firmware/ar7010*.fw \
- /lib/firmware/htc_9271.fw \
- /lib/firmware/htc_7010.fw \
+ ${base_libdir}/firmware/ar9271.fw \
+ ${base_libdir}/firmware/ar7010*.fw \
+ ${base_libdir}/firmware/htc_9271.fw \
+ ${base_libdir}/firmware/htc_7010.fw \
"

RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
@@ -213,9 +213,9 @@ RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
# For ralink
LICENSE_${PN}-ralink = "Firmware-ralink-firmware"

-FILES_${PN}-ralink-license = "/lib/firmware/LICENCE.ralink-firmware.txt"
+FILES_${PN}-ralink-license = "${base_libdir}/firmware/LICENCE.ralink-firmware.txt"
FILES_${PN}-ralink = " \
- /lib/firmware/rt*.bin \
+ ${base_libdir}/firmware/rt*.bin \
"

RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
@@ -223,9 +223,9 @@ RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
# For radeon
LICENSE_${PN}-radeon = "Firmware-radeon"

-FILES_${PN}-radeon-license = "/lib/firmware/LICENSE.radeon"
+FILES_${PN}-radeon-license = "${base_libdir}/firmware/LICENSE.radeon"
FILES_${PN}-radeon = " \
- /lib/firmware/radeon \
+ ${base_libdir}/firmware/radeon \
"

RDEPENDS_${PN}-radeon += "${PN}-radeon-license"
@@ -235,16 +235,16 @@ LICENSE_${PN}-sd8686 = "Firmware-Marvell"
LICENSE_${PN}-sd8787 = "Firmware-Marvell"
LICENSE_${PN}-sd8797 = "Firmware-Marvell"

-FILES_${PN}-marvell-license = "/lib/firmware/LICENCE.Marvell"
+FILES_${PN}-marvell-license = "${base_libdir}/firmware/LICENCE.Marvell"
FILES_${PN}-sd8686 = " \
- /lib/firmware/libertas/sd8686_v9* \
- /lib/firmware/sd8686* \
+ ${base_libdir}/firmware/libertas/sd8686_v9* \
+ ${base_libdir}/firmware/sd8686* \
"
FILES_${PN}-sd8787 = " \
- /lib/firmware/mrvl/sd8787_uapsta.bin \
+ ${base_libdir}/firmware/mrvl/sd8787_uapsta.bin \
"
FILES_${PN}-sd8797 = " \
- /lib/firmware/mrvl/sd8797_uapsta.bin \
+ ${base_libdir}/firmware/mrvl/sd8797_uapsta.bin \
"

RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license"
@@ -257,16 +257,16 @@ LICENSE_${PN}-rtl8192ce = "Firmware-rtlwifi_firmware"
LICENSE_${PN}-rtl8192su = "Firmware-rtlwifi_firmware"

FILES_${PN}-rtl-license = " \
- /lib/firmware/LICENCE.rtlwifi_firmware.txt \
+ ${base_libdir}/firmware/LICENCE.rtlwifi_firmware.txt \
"
FILES_${PN}-rtl8192cu = " \
- /lib/firmware/rtlwifi/rtl8192cufw*.bin \
+ ${base_libdir}/firmware/rtlwifi/rtl8192cufw*.bin \
"
FILES_${PN}-rtl8192ce = " \
- /lib/firmware/rtlwifi/rtl8192cfw*.bin \
+ ${base_libdir}/firmware/rtlwifi/rtl8192cfw*.bin \
"
FILES_${PN}-rtl8192su = " \
- /lib/firmware/rtlwifi/rtl8712u.bin \
+ ${base_libdir}/firmware/rtlwifi/rtl8712u.bin \
"

RDEPENDS_${PN}-rtl8192ce += "${PN}-rtl-license"
@@ -277,16 +277,16 @@ RDEPENDS_${PN}-rtl8192su = "${PN}-rtl-license"
LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity"

-FILES_${PN}-ti-connectivity-license = "/lib/firmware/LICENCE.ti-connectivity"
+FILES_${PN}-ti-connectivity-license = "${base_libdir}/firmware/LICENCE.ti-connectivity"
FILES_${PN}-wl12xx = " \
- /lib/firmware/wl12* \
- /lib/firmware/TI* \
- /lib/firmware/ti-connectivity \
+ ${base_libdir}/firmware/wl12* \
+ ${base_libdir}/firmware/TI* \
+ ${base_libdir}/firmware/ti-connectivity \
"
FILES_${PN}-wl18xx = " \
- /lib/firmware/wl18* \
- /lib/firmware/TI* \
- /lib/firmware/ti-connectivity \
+ ${base_libdir}/firmware/wl18* \
+ ${base_libdir}/firmware/TI* \
+ ${base_libdir}/firmware/ti-connectivity \
"

RDEPENDS_${PN}-wl12xx = "${PN}-ti-connectivity-license"
@@ -295,9 +295,9 @@ RDEPENDS_${PN}-wl18xx = "${PN}-ti-connectivity-license"
# For vt6656
LICENSE_${PN}-vt6656 = "Firmware-via_vt6656"

-FILES_${PN}-vt6656-license = "/lib/firmware/LICENCE.via_vt6656"
+FILES_${PN}-vt6656-license = "${base_libdir}/firmware/LICENCE.via_vt6656"
FILES_${PN}-vt6656 = " \
- /lib/firmware/vntwusb.fw \
+ ${base_libdir}/firmware/vntwusb.fw \
"

RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license"
@@ -314,31 +314,31 @@ LICENSE_${PN}-bcm4334 = "Firmware-broadcom_bcm43xx"
LICENSE_${PN}-bcm4354 = "Firmware-broadcom_bcm43xx"

FILES_${PN}-broadcom-license = " \
- /lib/firmware/LICENCE.broadcom_bcm43xx \
+ ${base_libdir}/firmware/LICENCE.broadcom_bcm43xx \
"
FILES_${PN}-bcm4329 = " \
- /lib/firmware/brcm/brcmfmac4329-sdio.bin \
+ ${base_libdir}/firmware/brcm/brcmfmac4329-sdio.bin \
"
FILES_${PN}-bcm4330 = " \
- /lib/firmware/brcm/brcmfmac4330-sdio.bin \
+ ${base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin \
"
FILES_${PN}-bcm4334 = " \
- /lib/firmware/brcm/brcmfmac4334-sdio.bin \
+ ${base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin \
"
FILES_${PN}-bcm4354 = " \
- /lib/firmware/brcm/brcmfmac4354-sdio.bin \
+ ${base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin \
"

-ALTERNATIVE_LINK_NAME[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac-sdio.bin"
+ALTERNATIVE_LINK_NAME[brcmfmac-sdio.bin] = "${base_libdir}/firmware/brcm/brcmfmac-sdio.bin"

ALTERNATIVE_linux-firmware-bcm4334 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm4334[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4334-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4334[brcmfmac-sdio.bin] = "${base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin"
ALTERNATIVE_linux_firmware-bcm4354 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm4354[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4354-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4354[brcmfmac-sdio.bin] = "${base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin"
ALTERNATIVE_linux-firmware-bcm4329 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm4329[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4329-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4329[brcmfmac-sdio.bin] = "${base_libdir}/firmware/brcm/brcmfmac4329-sdio.bin"
ALTERNATIVE_linux-firmware-bcm4330 = "brcmfmac-sdio.bin"
-ALTERNATIVE_TARGET_linux-firmware-bcm4330[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4330-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4330[brcmfmac-sdio.bin] = "${base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin"

RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license"
RDEPENDS_${PN}-bcm4330 += "${PN}-broadcom-license"
@@ -363,23 +363,23 @@ LICENSE_${PN}-iwlwifi-7260-9 = "Firmware-iwlwifi_firmware"
LICENSE_${PN}-iwlwifi-7265-8 = "Firmware-iwlwifi_firmware"
LICENSE_${PN}-iwlwifi-7265-9 = "Firmware-iwlwifi_firmware"

-FILES_${PN}-iwlwifi-license = "/lib/firmware/LICENCE.iwlwifi_firmware"
-FILES_${PN}-iwlwifi-135-6 = "/lib/firmware/iwlwifi-135-6.ucode"
-FILES_${PN}-iwlwifi-3160-7 = "/lib/firmware/iwlwifi-3160-7.ucode"
-FILES_${PN}-iwlwifi-3160-8 = "/lib/firmware/iwlwifi-3160-8.ucode"
-FILES_${PN}-iwlwifi-3160-9 = "/lib/firmware/iwlwifi-3160-9.ucode"
-FILES_${PN}-iwlwifi-6000-4 = "/lib/firmware/iwlwifi-6000-4.ucode"
-FILES_${PN}-iwlwifi-6000g2a-5 = "/lib/firmware/iwlwifi-6000g2a-5.ucode"
-FILES_${PN}-iwlwifi-6000g2a-6 = "/lib/firmware/iwlwifi-6000g2a-6.ucode"
-FILES_${PN}-iwlwifi-6000g2b-5 = "/lib/firmware/iwlwifi-6000g2b-5.ucode"
-FILES_${PN}-iwlwifi-6000g2b-6 = "/lib/firmware/iwlwifi-6000g2b-6.ucode"
-FILES_${PN}-iwlwifi-6050-4 = "/lib/firmware/iwlwifi-6050-4.ucode"
-FILES_${PN}-iwlwifi-6050-5 = "/lib/firmware/iwlwifi-6050-5.ucode"
-FILES_${PN}-iwlwifi-7260-7 = "/lib/firmware/iwlwifi-7260-7.ucode"
-FILES_${PN}-iwlwifi-7260-8 = "/lib/firmware/iwlwifi-7260-8.ucode"
-FILES_${PN}-iwlwifi-7260-9 = "/lib/firmware/iwlwifi-7260-9.ucode"
-FILES_${PN}-iwlwifi-7265-8 = "/lib/firmware/iwlwifi-7265-8.ucode"
-FILES_${PN}-iwlwifi-7265-9 = "/lib/firmware/iwlwifi-7265-9.ucode"
+FILES_${PN}-iwlwifi-license = "${base_libdir}/firmware/LICENCE.iwlwifi_firmware"
+FILES_${PN}-iwlwifi-135-6 = "${base_libdir}/firmware/iwlwifi-135-6.ucode"
+FILES_${PN}-iwlwifi-3160-7 = "${base_libdir}/firmware/iwlwifi-3160-7.ucode"
+FILES_${PN}-iwlwifi-3160-8 = "${base_libdir}/firmware/iwlwifi-3160-8.ucode"
+FILES_${PN}-iwlwifi-3160-9 = "${base_libdir}/firmware/iwlwifi-3160-9.ucode"
+FILES_${PN}-iwlwifi-6000-4 = "${base_libdir}/firmware/iwlwifi-6000-4.ucode"
+FILES_${PN}-iwlwifi-6000g2a-5 = "${base_libdir}/firmware/iwlwifi-6000g2a-5.ucode"
+FILES_${PN}-iwlwifi-6000g2a-6 = "${base_libdir}/firmware/iwlwifi-6000g2a-6.ucode"
+FILES_${PN}-iwlwifi-6000g2b-5 = "${base_libdir}/firmware/iwlwifi-6000g2b-5.ucode"
+FILES_${PN}-iwlwifi-6000g2b-6 = "${base_libdir}/firmware/iwlwifi-6000g2b-6.ucode"
+FILES_${PN}-iwlwifi-6050-4 = "${base_libdir}/firmware/iwlwifi-6050-4.ucode"
+FILES_${PN}-iwlwifi-6050-5 = "${base_libdir}/firmware/iwlwifi-6050-5.ucode"
+FILES_${PN}-iwlwifi-7260-7 = "${base_libdir}/firmware/iwlwifi-7260-7.ucode"
+FILES_${PN}-iwlwifi-7260-8 = "${base_libdir}/firmware/iwlwifi-7260-8.ucode"
+FILES_${PN}-iwlwifi-7260-9 = "${base_libdir}/firmware/iwlwifi-7260-9.ucode"
+FILES_${PN}-iwlwifi-7265-8 = "${base_libdir}/firmware/iwlwifi-7265-8.ucode"
+FILES_${PN}-iwlwifi-7265-9 = "${base_libdir}/firmware/iwlwifi-7265-9.ucode"

RDEPENDS_${PN}-iwlwifi-135-6 = "${PN}-iwlwifi-license"
RDEPENDS_${PN}-iwlwifi-3160-7 = "${PN}-iwlwifi-license"
@@ -429,8 +429,8 @@ LICENSE_${PN} = "\
& Firmware-xc5000 \
& Firmware-xc5000c \
"
-FILES_${PN}-license += "/lib/firmware/LICEN*"
-FILES_${PN} += "/lib/firmware/*"
+FILES_${PN}-license += "${base_libdir}/firmware/LICEN*"
+FILES_${PN} += "${base_libdir}/firmware/*"
RDEPENDS_${PN} += "${PN}-license"

# Make linux-firmware depend on all of the split-out packages.
--
2.4.5