Skip to contentSkip to conversation

Adding BCM43430 NVRAM files

RFC In review Ryan Harkin 6 participants 30 messages Aug 22, 2018 – Aug 28, 2018

lore
Share & tools
lore
#0 lore raw

cover Adding BCM43430 NVRAM files

[Resending because I sent to the wrong email address for the oe-core mailing list]

NVRAM files for the 43430 modules have been committed into the upstream Linux firmware repo. I'd like to add these files into the linux-firmware recipe.

The following files exist upstream on kernel.org:

- brcm/brcmfmac43430-sdio.AP6212.txt
- brcm/brcmfmac43430-sdio.MUR1DX.txt

The AP6212 and MUR1DX are the module types for variants of the 43430 chips.

The first patch is a simple update to the latest upstream. I guess someone else will commit a similar change before I get to it, but for now, I need to make the update to test my changes, so I thought I'd send the patch with my RFC series.

The second patch adds both NVRAM files into a single new variable. Ideally, the Linux kernel will be extended detect the module type, so having all the NVRAM files in /lib/firmware/brcm seems like a sensible thing to do. But advice here is appreciated. Perhaps I should have a separate variable for each file and allow the machine config to choose which configs to include in the filesystem, similar to how the .bin files are included since Martin Jansa's change?

The 3rd patch is trickier, I think. At the moment, the Linux kernel expects there to be only one NVRAM file, named brcmfmac43430-sdio.txt. So to make the system "just work", it seems sensible to provide a way to softlink the module specific NVRAM to the generic filename.

I'm trying to avoid each machine type having to define a softlink _append in its own config. Many different machines can use the same module type, for example. I'm just not convinced that the way I've done it is appropriate. eg. I don't like the usage of MACHINEOVERRIDE, or the variable name I've chosen. I'd hoped to do it using a MACHINE_EXTRA_RRECOMMENDS, but I'm not sure if that is possible. Again, advice is appreciated.

Ryan Harkin (3):
linux-firmware: upgrade to 1d17c18 revision
linux-firmware: add BCM43430 nvram files
linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

 .../linux-firmware/linux-firmware_git.bb           | 23 +++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

RFC 1/3 linux-firmware: upgrade to 1d17c18 revision

Following changes are applied:

1d17c18 linux-firmware: add firmware for mhdp8546
c2e0d14 qed: Add firmware 8.37.7.0
f1b95fe linux-firmware:Update firmware patch for Intel Bluetooth 7265 8813230 linux-firmware: Update firmware file for Intel Bluetooth,9560 c2d8f1b linux-firmware: Update firmware file for Intel Bluetooth,9260 9767096 linux-firmware: Update firmware file for Intel Bluetooth,8265 41bdd3b linux-firmware: Update firmware patch for Intel Bluetooth 8260 fdd3468 linux-firmware: add firmware for mt76x0
eee8208 Merge commit 'c4883661c7eeedd061eb3b483135b47dab39a88d' of 6ae7a5b qcom: update venus firmware files for v5.2
c488366 nfp: update Agilio SmartNIC flower firmware to rev AOTC-2.9.A.31 7b5835f linux-firmware: add firmware for mt76x2u
3a5103f wl18xx: update firmware file 8.9.0.0.79
b01151b Mellanox: Add new mlxsw_spectrum firmware 13.1702.6 0ff06f2 WHENCE: Remove reference to amdgpu/vegam_me_2.bin 3fcf221 linux-firmware: mediatek: add MT7622 Bluetooth firmwares and c8d6903 brcm: add 43430 based AP6212 and 1DX NVRAM
fad829d Merge git://git.marvell.com/mwifiex-firmware
0ced724 linux-firmware: update Marvell USB8801 B0 firmware image 8d69bab amdgpu: update copyright date
153a51e amdgpu: add initial VegaM firmware
10e2971 amdgpu: sync up vega10 firmware with 18.20 release 4b05dee amdgpu: sync up raven firmware with 18.20 release aeec108 amdgpu: sync up polaris12 firmware with 18.20 release 5408150 amdgpu: sync up polaris11 firmware with 18.20 release 34116bf amdgpu: sync up polaris10 firmware with 18.20 release a8a2884 amdgpu: sync up verde firmware with 18.20 release bea8c7f amdgpu: sync up pitcairn firmware with 18.20 release d47f956 amdgpu: sync up tahiti firmware with 18.20 release 1f92e00 amdgpu: sync up oland firmware with 18.20 release effed45 amdgpu: sync up hainan firmware with 18.20 release d50a667 amdgpu: sync up kaveri firmware with 18.20 release 5b8eca3 amdgpu: sync up mullins firmware with 18.20 release b4b5726 amdgpu: sync up kabini firmware with 18.20 release fc80838 amdgpu: sync up hawaii firmware with 18.20 release 5350953 amdgpu: sync up bonaire firmware with 18.20 release 8c96b0d WHENCE: Fix typo Version
6213586 cxgb4: update firmware to revision 1.20.8.0

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +3 -3
index 69f9a2a..4e0f1cc 100644
@@ -66,7 +66,7 @@ LIC_FILES_CHKSUM = "\
     file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
     file://LICENCE.adsp_sst;md5=615c45b91a5a4a9fe046d6ab9a2df728 \
     file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
-    file://LICENSE.amdgpu;md5=0aa3c2f3e736af320a08a3aeeccecf29 \
+    file://LICENSE.amdgpu;md5=88b865bc74f3ffcc54640b4ea8540b46 \
     file://LICENSE.amd-ucode;md5=3c5399dc9148d7f0e1f41e34b69cf14f \
     file://LICENCE.atheros_firmware;md5=30a14c7823beedac9fa39c64fdd01a13 \
     file://LICENSE.atmel;md5=aa74ac0c60595dee4d4e239107ea77a3 \
@@ -120,7 +120,7 @@ LIC_FILES_CHKSUM = "\
     file://LICENCE.xc4000;md5=0ff51d2dc49fce04814c9155081092f0 \
     file://LICENCE.xc5000;md5=1e170c13175323c32c7f4d0998d53f66 \
     file://LICENCE.xc5000c;md5=12b02efa3049db65d524aeb418dd87ca \
-    file://WHENCE;md5=eaaf310bac02fee05ea1b334f58c5caf \
+    file://WHENCE;md5=feb25f3efdbe10fcc121005d02d407d6 \
 "
 
 # These are not common licenses, set NO_GENERIC_LICENSE for them
@@ -184,7 +184,7 @@ NO_GENERIC_LICENSE[Firmware-xc5000] = "LICENCE.xc5000"
 NO_GENERIC_LICENSE[Firmware-xc5000c] = "LICENCE.xc5000c"
 NO_GENERIC_LICENSE[WHENCE] = "WHENCE"
 
-SRCREV = "d1147327232ec4616a66ab898df84f9700c816c1"
+SRCREV = "1d17c18226c2ddf5bc127b3f934cfa88e0c0c29f"
 PE = "1"
 PV = "0.0+git${SRCPV}"
 
Signature · 1 line
2.7.4
#2 lore raw

RFC 2/3 linux-firmware: add BCM43430 nvram files

In reply to Ryan Harkin

Add the new BCM43430 NVRAM files into the recipe.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 6 ++++++
 1 file changed, 6 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +6 -0
index 4e0f1cc..8c54f28 100644
@@ -255,6 +255,7 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-bcm43362 \
              ${PN}-bcm4339 \
              ${PN}-bcm43430 \
+             ${PN}-bcm43430-nvram \
              ${PN}-bcm43430a0 \
              ${PN}-bcm43455 \
              ${PN}-bcm4350 \
@@ -649,6 +650,9 @@ FILES_${PN}-bcm-0bb4-0306 = "${nonarch_base_libdir}/firmware/brcm/BCM-0bb4-0306.
 FILES_${PN}-bcm43340 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43340-sdio.bin"
 FILES_${PN}-bcm43362 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43362-sdio.bin"
 FILES_${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.bin"
+FILES_${PN}-bcm43430-nvram = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt \
+  ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt \
+"
 FILES_${PN}-bcm4354 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin"
 FILES_${PN}-bcm4356-pcie = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4356-pcie.bin"
 FILES_${PN}-bcm4373 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac4373-sdio.bin \
@@ -662,6 +666,8 @@ RDEPENDS_${PN}-bcm43340 += "${PN}-cypress-license"
 LICENSE_${PN}-bcm43362 = "Firmware-cypress"
 RDEPENDS_${PN}-bcm43362 += "${PN}-cypress-license"
 LICENSE_${PN}-bcm43430 = "Firmware-cypress"
+LICENSE_${PN}-bcm43430-nvram = "Firmware-GPLv2"
+RDEPENDS_${PN}-bcm43430-nvram += "${PN}-gplv2-license"
 RDEPENDS_${PN}-bcm43430 += "${PN}-cypress-license"
 LICENSE_${PN}-bcm4354 = "Firmware-cypress"
 RDEPENDS_${PN}-bcm4354 += "${PN}-cypress-license"
Signature · 1 line
2.7.4
#3 lore raw

RFC 3/3 linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Ryan Harkin

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module specific NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12 ++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +12 -0
index 8c54f28..b647abc 100644
@@ -226,6 +226,18 @@ do_install() {
 	( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a
+# softlink for the module specific NVRAM file to the filename expected
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = " ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"
+do_install_append_bcm43430-nvram-mur1dx() {
+	( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"
+do_install_append_bcm43430-nvram-ap6212() {
+	( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)
+}
+
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
Signature · 1 line
2.7.4
#4 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to be needed, just include the path in 2nd ln parameter.

Quoted 45 lines · Ryan Harkin

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module specific NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12
++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +4 -0
index 8c54f28..b647abc 100644
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf
 ti-connectivity/* . )
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a
+# softlink for the module specific NVRAM file to the filename expected
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = "

${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 =

"${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-ap6212() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -1
+}
+
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
--

2.7.4

#5 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

Quoted 3 lines · Martin Jansa

The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to be needed, just include the path in 2nd ln parameter.

I don't think that works, or at least, it doesn't work for me, so I may be doing something wrong. I'm also copying the example used in the do_install() a few lines up as I figured that would be the preferred style for this recipe.

Quoted 48 lines
Quoted 45 lines · Ryan Harkin

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module specific NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12
++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +4 -0
index 8c54f28..b647abc 100644
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf
 ti-connectivity/* . )
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a
+# softlink for the module specific NVRAM file to the filename expected
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = "

${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 =

"${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-ap6212() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -1
+}
+
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
--

2.7.4

#6 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt

is the same as

ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/fir mware/brcm/brcmfmac43430-sdio.txt

Quoted 63 lines · Ryan Harkin
Quoted 3 lines · Martin Jansa

The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to be needed, just include the path in 2nd ln parameter.

I don't think that works, or at least, it doesn't work for me, so I may be doing something wrong. I'm also copying the example used in the do_install() a few lines up as I figured that would be the preferred style for this recipe.

Quoted 48 lines
Quoted 45 lines · Ryan Harkin

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module specific NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12
++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +4 -0
index 8c54f28..b647abc 100644
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf
 ti-connectivity/* . )
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a
+# softlink for the module specific NVRAM file to the filename expected
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = "

${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 =

"${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-ap6212() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -1
+}
+
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
--

2.7.4

#7 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

This is curious!

Quoted 8 lines · Martin Jansa

cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt

is the same as

ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/fir mware/brcm/brcmfmac43430-sdio.txt

On my system, this is what happens when I'm in the root of the linux-firmware repo:

$ ls -al brcm/*.txt
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt
-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt
$ ln -sf brcm/brcmfmac43430-sdio.AP6212.txt brcm/brcmfmac43430-sdio.txt
$ ls -al brcm/*.txt
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt
-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt
lrwxrwxrwx 1 ryan ryan  34 Aug 22 18:08 brcm/brcmfmac43430-sdio.txt ->
brcm/brcmfmac43430-sdio.AP6212.txt

And the file is not valid.

$ cat brcm/brcmfmac43430-sdio.txt
cat: brcm/brcmfmac43430-sdio.txt: No such file or directory

So perhaps I'm doing something wrong. I tried your suggestion originally and it didn't work for me. Maybe I made a typo or something?

Quoted 66 lines
Quoted 63 lines · Ryan Harkin
Quoted 3 lines · Martin Jansa

The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to be needed, just include the path in 2nd ln parameter.

I don't think that works, or at least, it doesn't work for me, so I may be doing something wrong. I'm also copying the example used in the do_install() a few lines up as I figured that would be the preferred style for this recipe.

Quoted 48 lines
Quoted 45 lines · Ryan Harkin

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module specific NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12
++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +4 -0
index 8c54f28..b647abc 100644
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf
 ti-connectivity/* . )
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a
+# softlink for the module specific NVRAM file to the filename expected
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = "

${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 =

"${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-ap6212() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -1
+}
+
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
--

2.7.4

#8 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

Your 1st parameter is wrong, compare again with the example I gave you (don't include "brcm/" path in 1st param, because you want the symlink to point to just brcmfmac43430-sdio.AP6212.txt like you did in the version after cd).

Quoted 106 lines · Ryan Harkin

This is curious!

Quoted 8 lines · Martin Jansa

cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt

is the same as

ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/fir mware/brcm/brcmfmac43430-sdio.txt

On my system, this is what happens when I'm in the root of the linux-firmware repo:

$ ls -al brcm/*.txt
(quoted diff) +0 -2
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt
-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt
$ ln -sf brcm/brcmfmac43430-sdio.AP6212.txt brcm/brcmfmac43430-sdio.txt
$ ls -al brcm/*.txt
(quoted diff) +0 -2
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt
-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt

lrwxrwxrwx 1 ryan ryan 34 Aug 22 18:08 brcm/brcmfmac43430-sdio.txt -> brcm/brcmfmac43430-sdio.AP6212.txt

And the file is not valid.

$ cat brcm/brcmfmac43430-sdio.txt
cat: brcm/brcmfmac43430-sdio.txt: No such file or directory

So perhaps I'm doing something wrong. I tried your suggestion originally and it didn't work for me. Maybe I made a typo or something?

Quoted 67 lines
Quoted 64 lines · Ryan Harkin
Quoted 3 lines · Martin Jansa

The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to be needed, just include the path in 2nd ln parameter.

I don't think that works, or at least, it doesn't work for me, so I may be doing something wrong. I'm also copying the example used in the do_install() a few lines up as I figured that would be the preferred style for this recipe.

Quoted 49 lines
Quoted 46 lines · Ryan Harkin

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module specific NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12
++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +1 -0
index 8c54f28..b647abc 100644
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf
 ti-connectivity/* . )
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create

a

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +3 -0
+# softlink for the module specific NVRAM file to the filename expected
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = "

${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 =

"${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-ap6212() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -1
+}
+
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
--

2.7.4

#9 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

Quoted 5 lines · On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]> wrote:

Your 1st parameter is wrong, compare again with the example I gave you (don't include "brcm/" path in 1st param, because you want the symlink to point to just brcmfmac43430-sdio.AP6212.txt like you did in the version after cd).

That doesn't work either. I tried it with the same result, but didn't send a log of it. That works for you?

Quoted 109 lines · Ryan Harkin
Quoted 109 lines

This is curious!

Quoted 8 lines · Martin Jansa

cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt

is the same as

ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/fir mware/brcm/brcmfmac43430-sdio.txt

On my system, this is what happens when I'm in the root of the linux-firmware repo:

$ ls -al brcm/*.txt
(quoted diff) +0 -2
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt
-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt
$ ln -sf brcm/brcmfmac43430-sdio.AP6212.txt brcm/brcmfmac43430-sdio.txt
$ ls -al brcm/*.txt
(quoted diff) +0 -2
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt
-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt

lrwxrwxrwx 1 ryan ryan 34 Aug 22 18:08 brcm/brcmfmac43430-sdio.txt -> brcm/brcmfmac43430-sdio.AP6212.txt

And the file is not valid.

$ cat brcm/brcmfmac43430-sdio.txt
cat: brcm/brcmfmac43430-sdio.txt: No such file or directory

So perhaps I'm doing something wrong. I tried your suggestion originally and it didn't work for me. Maybe I made a typo or something?

Quoted 69 lines
Quoted 66 lines · Ryan Harkin
Quoted 3 lines · Martin Jansa

The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to be needed, just include the path in 2nd ln parameter.

I don't think that works, or at least, it doesn't work for me, so I may be doing something wrong. I'm also copying the example used in the do_install() a few lines up as I figured that would be the preferred style for this recipe.

Quoted 50 lines
Quoted 47 lines · Ryan Harkin

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module specific NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12
++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +1 -0
index 8c54f28..b647abc 100644
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf
 ti-connectivity/* . )
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will

create a
+# softlink for the module specific NVRAM file to the filename expected

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = "

${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 =

"${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-ap6212() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -1
+}
+
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
--

2.7.4

#10 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

I wonder how it work with meta-raspverrypi now that it has its own packing for firmware

Quoted 104 lines · Ryan Harkin
Quoted 2 lines · On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]> wrote:

Your 1st parameter is wrong, compare again with the example I gave you (don't include "brcm/" path in 1st param, because you want the symlink to point to just brcmfmac43430-sdio.AP6212.txt like you did in the version after cd).

That doesn't work either. I tried it with the same result, but didn't send a log of it. That works for you?

Quoted 81 lines · Ryan Harkin
Quoted 80 lines

This is curious!

Quoted 6 lines · Martin Jansa

cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt

is the same as

ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt

On my system, this is what happens when I'm in the root of the linux-firmware repo:

$ ls -al brcm/*.txt
(quoted diff) +0 -2
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt
-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt
$ ln -sf brcm/brcmfmac43430-sdio.AP6212.txt brcm/brcmfmac43430-sdio.txt
$ ls -al brcm/*.txt
(quoted diff) +0 -2
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt
-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt

lrwxrwxrwx 1 ryan ryan 34 Aug 22 18:08 brcm/brcmfmac43430-sdio.txt -> brcm/brcmfmac43430-sdio.AP6212.txt

And the file is not valid.

$ cat brcm/brcmfmac43430-sdio.txt
cat: brcm/brcmfmac43430-sdio.txt: No such file or directory

So perhaps I'm doing something wrong. I tried your suggestion originally and it didn't work for me. Maybe I made a typo or something?

Quoted 47 lines · Ryan Harkin
Quoted 45 lines · Martin Jansa
Quoted 2 lines

The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to be needed, just include the path in 2nd ln parameter.

I don't think that works, or at least, it doesn't work for me, so I may be doing something wrong. I'm also copying the example used in the do_install() a few lines up as I figured that would be the preferred style for this recipe.

Quoted 35 lines · Ryan Harkin
Quoted 33 lines

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module specific NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12 ++++++++++++
 1 file changed, 12 insertions(+)
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +12 -0
index 8c54f28..b647abc 100644
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a
+# softlink for the module specific NVRAM file to the filename expected
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = " ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"
+do_install_append_bcm43430-nvram-ap6212() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)
+}
+
 
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +0 -1
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
--

2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#12 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Ryan Harkin
Quoted 9 lines · Ryan Harkin
Quoted 5 lines · On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]> wrote:

Your 1st parameter is wrong, compare again with the example I gave you (don't include "brcm/" path in 1st param, because you want the symlink to point to just brcmfmac43430-sdio.AP6212.txt like you did in the version after cd).

That doesn't work either. I tried it with the same result, but didn't send a log of it. That works for you?

Martin's example is correct so maybe check your tests again for typos. It it still doesn't work then please do send a log.

The link will point to whatever you define via the first parameter, so if you changed the first parameter it shouldn't be possible to get "the same result".

  $ mkdir foo
  $ ln -sf test_target foo/test1
  $ ln -sf brcm/test_target foo/test2
  $ ls -l foo

lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -> brcm/test_target

#11 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Khem Raj
Quoted 3 lines · On Wed, 22 Aug 2018, 21:36 Khem Raj, <[email protected]> wrote:

I wonder how it work with meta-raspverrypi now that it has its own packing for firmware

Sorry Them, I don't understand your question.

Quoted 138 lines · Ryan Harkin
Quoted 6 lines · On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]> wrote:
Quoted 2 lines

Your 1st parameter is wrong, compare again with the example I gave you

(don't include "brcm/" path in 1st param, because you want the symlink to point to just brcmfmac43430-sdio.AP6212.txt like you did in the version after cd).

Quoted 3 lines

That doesn't work either. I tried it with the same result, but didn't

send a log of it. That works for you?

Quoted 3 lines
Quoted 3 lines

On Wed, Aug 22, 2018 at 7:11 PM Ryan Harkin <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines

This is curious!

On 22 August 2018 at 17:56, Martin Jansa <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

is the same as

ln -sf brcmfmac43430-sdio.AP6212.txt

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

On my system, this is what happens when I'm in the root of the

linux-firmware repo:

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
$ ls -al brcm/*.txt
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08

brcm/brcmfmac43430-sdio.AP6212.txt

Quoted 1 line
Quoted 1 line
Quoted 1 line

-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48

brcm/brcmfmac43430-sdio.MUR1DX.txt

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
$ ln -sf brcm/brcmfmac43430-sdio.AP6212.txt brcm/brcmfmac43430-sdio.txt
$ ls -al brcm/*.txt
-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08

brcm/brcmfmac43430-sdio.AP6212.txt

Quoted 1 line
Quoted 1 line
Quoted 1 line

-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48

brcm/brcmfmac43430-sdio.MUR1DX.txt

Quoted 1 line
Quoted 1 line
Quoted 1 line

lrwxrwxrwx 1 ryan ryan 34 Aug 22 18:08 brcm/brcmfmac43430-sdio.txt ->

brcm/brcmfmac43430-sdio.AP6212.txt

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

And the file is not valid.

$ cat brcm/brcmfmac43430-sdio.txt
cat: brcm/brcmfmac43430-sdio.txt: No such file or directory

So perhaps I'm doing something wrong. I tried your suggestion

originally and it didn't work for me. Maybe I made a typo or something?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

On 22 August 2018 at 17:41, Martin Jansa <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to

be needed, just include the path in 2nd ln parameter.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

I don't think that works, or at least, it doesn't work for me, so I

may be doing something wrong. I'm also copying the example used in the do_install() a few lines up as I figured that would be the preferred style for this recipe.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <[email protected]>

Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module

specific

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12

++++++++++++

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Review

Quoted 3 lines
 1 file changed, 12 insertions(+)
(quoted diff) +0 -0

linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/ linux-firmware_git.bb

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 226

Quoted 5 lines

index 8c54f28..b647abc 100644

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +0 -0
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf

ti-connectivity/* . )

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 229

Quoted 3 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +1 -0
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will

create a

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 230

Quoted 1 line
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +1 -0
+# softlink for the module specific NVRAM file to the filename

expected

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 232

Quoted 2 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = "

${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 234

Quoted 2 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 236

Quoted 2 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 =

"${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 238

Quoted 2 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-ap6212() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)

Quoted 15 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -1
+}
+
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
--

2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#13 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Andre McCurdy
Quoted 21 lines · On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]> wrote:
Quoted 4 lines · Ryan Harkin
Quoted 3 lines · On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]> wrote:

Your 1st parameter is wrong, compare again with the example I gave you (don't include "brcm/" path in 1st param, because you want the symlink

to

Quoted 4 lines
Quoted 2 lines

point to just brcmfmac43430-sdio.AP6212.txt like you did in the version after cd).

That doesn't work either. I tried it with the same result, but didn't

send a

Quoted 1 line

log of it. That works for you?

Martin's example is correct so maybe check your tests again for typos. It it still doesn't work then please do send a log.

The link will point to whatever you define via the first parameter, so if you changed the first parameter it shouldn't be possible to get "the same result".

Quoted 8 lines
  $ mkdir foo
  $ ln -sf test_target foo/test1
  $ ln -sf brcm/test_target foo/test2
  $ ls -l foo

lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -> brcm/test_target

Yes, that's essentially the same as what I'm getting.

Now try "cat foo/test1" and what happens?

There is no file called test_target in the foo directory. And neither is there a file called brcm/test_target in the foo directory.

Quoted 1 line
#14 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

Quoted 30 lines · Ryan Harkin
Quoted 21 lines · On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]> wrote:
Quoted 11 lines · Ryan Harkin
Quoted 6 lines · On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]> wrote:

Your 1st parameter is wrong, compare again with the example I gave you (don't include "brcm/" path in 1st param, because you want the symlink to
point to just brcmfmac43430-sdio.AP6212.txt like you did in the version after cd).

That doesn't work either. I tried it with the same result, but didn't send a
log of it. That works for you?

Martin's example is correct so maybe check your tests again for typos. It it still doesn't work then please do send a log.

The link will point to whatever you define via the first parameter, so if you changed the first parameter it shouldn't be possible to get "the same result".

Quoted 7 lines
  $ mkdir foo
  $ ln -sf test_target foo/test1
  $ ln -sf brcm/test_target foo/test2
  $ ls -l foo

lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -> brcm/test_target

Quoted 6 lines

Yes, that's essentially the same as what I'm getting.

Now try "cat foo/test1" and what happens?

There is no file called test_target in the foo directory. And neither is there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

  $ mkdir -p foo/brcm
  $ echo hello > foo/test_target
  $ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or after you create the symlinks).

#15 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

Quoted 50 lines · Andre McCurdy
Quoted 4 lines · Ryan Harkin
Quoted 3 lines · On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]> wrote:
Quoted 1 line · Ryan Harkin

On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Your 1st parameter is wrong, compare again with the example I gave

you

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

(don't include "brcm/" path in 1st param, because you want the

symlink

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to
point to just brcmfmac43430-sdio.AP6212.txt like you did in the

version

Quoted 21 lines
Quoted 13 lines
Quoted 5 lines
Quoted 1 line

after cd).

That doesn't work either. I tried it with the same result, but didn't send a
log of it. That works for you?

Martin's example is correct so maybe check your tests again for typos. It it still doesn't work then please do send a log.

The link will point to whatever you define via the first parameter, so if you changed the first parameter it shouldn't be possible to get "the same result".

Quoted 7 lines
  $ mkdir foo
  $ ln -sf test_target foo/test1
  $ ln -sf brcm/test_target foo/test2
  $ ls -l foo

lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -> brcm/test_target

Quoted 6 lines

Yes, that's essentially the same as what I'm getting.

Now try "cat foo/test1" and what happens?

There is no file called test_target in the foo directory. And neither is there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

Quoted 9 lines
  $ mkdir -p foo/brcm
  $ echo hello > foo/test_target
  $ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or after you create the symlinks).

So that doesn't work for me how I expect it to work. I must be missing something fundamental here.

The recipe is trying to create a soft link from a file in the current directory to a file in the sub-directory. On my system, your example creates links from a file in the sub-directory to the another file in the sub-directory.

So, to copy your example, but creating the file "test_target" from the start:

$ mkdir -p /tmp/test
$ cd /tmp/test
$ mkdir foo
$ echo 1 > test_target
$ ln -sf test_target foo/test1
$ ln -sf brcm/test_target foo/test2
$ ls -l foo
total 0
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -> test_target
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -> brcm/test_target
$ cat test_target
1
$ cat foo/test1
cat: foo/test1: No such file or directory
$ cat foo/test2
cat: foo/test2: No such file or directory
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target
bash: foo/brcm/test_target: No such file or directory
$ cat foo/test1
hello
$ cat foo/test2
cat: foo/test2: No such file or directory
$ cat test_target
1
$ tree
.
├── foo
│   ├── test1 -> test_target
│   ├── test2 -> brcm/test_target
│   └── test_target
└── test_target

1 directory, 4 files

So, neither test1 nor test2 are linked to /tmp/test/test_target. test1 is linked to /tmp/test/foo/test_target and test2 is linked to /tmp/test/brcm/test_target, which doesn't exist.

AFAIK, when creating a softlink, you have to give it either an absolute path, or a path relative to the link being created. The path cannot be relative to the original file that you want to link to.

So, this will work:

$cd /tmp/test

$ ln -sf ../test_target foo/test3
$ cat foo/test3
1
$ cat /tmp/test/foo/test3
1

But that is a strange way to create the soft link, IMO.

AFAICT, for the recipe, to get rid of the "cd", I'd have to specify an absolute path to the original file:

+do_install_append_bcm43430-nvram-mur1dx() {
+ ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

... assuming PWD is available to the recipe. There will be a proper Yocto variable I can use, of course, but I can't think of it right now.

Either way, Martin's example doesn't work for me. And adding the absolute path of the original file doesn't seem any neater or clearer than following the TI example from the do_install a few lines up in the recipe. But I'm happy to do it either way, so long as it works.

#16 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

May I suggest using the '-r, --relative' flag from 'ln':

-r, --relative
create symbolic links relative to link location

My life felt considerably better after discovering that feature :)

// Martin

Quoted 136 lines · Ryan Harkin

On 22 August 2018 at 23:55, Andre McCurdy <[email protected] <mailto:[email protected]>> wrote:

On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <[email protected] <mailto:[email protected]>> wrote:
> On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]
<mailto:[email protected]>> wrote:
>> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin
<[email protected] <mailto:[email protected]>>
>> wrote:
>> > On Wed, 22 Aug 2018, 20:02 Martin Jansa,
<[email protected] <mailto:[email protected]>> wrote:
>> >>
>> >> Your 1st parameter is wrong, compare again with the example I
gave you
>> >> (don't include "brcm/" path in 1st param, because you want
the symlink
>> >> to
>> >> point to just brcmfmac43430-sdio.AP6212.txt like you did in
the version
>> >> after cd).
>> >
>> > That doesn't work either. I tried it with the same result, but
didn't
>> > send a
>> > log of it. That works for you?
>>
>> Martin's example is correct so maybe check your tests again for
typos.
>> It it still doesn't work then please do send a log.
>>
>> The link will point to whatever you define via the first
parameter, so
>> if you changed the first parameter it shouldn't be possible to get >> "the same result".
>>
>>   $ mkdir foo
>>   $ ln -sf test_target foo/test1
>>   $ ln -sf brcm/test_target foo/test2
>>   $ ls -l foo
>>
>>   lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target >>   lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -> brcm/test_target >
> Yes, that's essentially the same as what I'm getting.
>
> Now try "cat foo/test1" and what happens?
>
> There is no file called test_target in the foo directory. And
neither is
> there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

  $ mkdir -p foo/brcm
  $ echo hello > foo/test_target
  $ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or after you create the symlinks).

So that doesn't work for me how I expect it to work. I must be missing something fundamental here.

The recipe is trying to create a soft link from a file in the current directory to a file in the sub-directory. On my system, your example creates links from a file in the sub-directory to the another file in the sub-directory.

So, to copy your example, but creating the file "test_target" from the start:

$ mkdir -p /tmp/test
$ cd /tmp/test
$ mkdir foo
$ echo 1 > test_target
$ ln -sf test_target foo/test1
$ ln -sf brcm/test_target foo/test2
$ ls -l foo
total 0
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -> test_target
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -> brcm/test_target
$ cat test_target
1
$ cat foo/test1
cat: foo/test1: No such file or directory
$ cat foo/test2
cat: foo/test2: No such file or directory
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target
bash: foo/brcm/test_target: No such file or directory
$ cat foo/test1
hello
$ cat foo/test2
cat: foo/test2: No such file or directory
$ cat test_target
1
$ tree
.
├── foo
│   ├── test1 -> test_target
│   ├── test2 -> brcm/test_target
│   └── test_target
└── test_target

1 directory, 4 files

So, neither test1 nor test2 are linked to /tmp/test/test_target. test1 is linked to /tmp/test/foo/test_target and test2 is linked to /tmp/test/brcm/test_target, which doesn't exist.

AFAIK, when creating a softlink, you have to give it either an absolute path, or a path relative to the link being created. The path cannot be relative to the original file that you want to link to.

So, this will work:

$cd /tmp/test

$ ln -sf ../test_target foo/test3
$ cat foo/test3
1
$ cat /tmp/test/foo/test3
1

But that is a strange way to create the soft link, IMO.

AFAICT, for the recipe, to get rid of the "cd", I'd have to specify an absolute path to the original file:

+do_install_append_bcm43430-nvram-mur1dx() {
+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

... assuming PWD is available to the recipe. There will be a proper Yocto variable I can use, of course, but I can't think of it right now.

Either way, Martin's example doesn't work for me. And adding the absolute path of the original file doesn't seem any neater or clearer than following the TI example from the do_install a few lines up in the recipe. But I'm happy to do it either way, so long as it works.

Signature · 10 lines
Kind regards,
Martin Hundebøll
Embedded Linux Consultant

+45 61 65 54 61
[email protected]

Geanix IVS
https://geanix.com
DK39600706
#20 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Ryan Harkin
Quoted 68 lines · Ryan Harkin
Quoted 50 lines · Andre McCurdy
Quoted 34 lines · Ryan Harkin
Quoted 25 lines · On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]> wrote:
Quoted 12 lines · Ryan Harkin
Quoted 9 lines · On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]> wrote:

Your 1st parameter is wrong, compare again with the example I gave you
(don't include "brcm/" path in 1st param, because you want the symlink
to
point to just brcmfmac43430-sdio.AP6212.txt like you did in the version
after cd).

Quoted 3 lines

That doesn't work either. I tried it with the same result, but didn't send a
log of it. That works for you?

Martin's example is correct so maybe check your tests again for typos. It it still doesn't work then please do send a log.

The link will point to whatever you define via the first parameter, so if you changed the first parameter it shouldn't be possible to get "the same result".

Quoted 7 lines
  $ mkdir foo
  $ ln -sf test_target foo/test1
  $ ln -sf brcm/test_target foo/test2
  $ ls -l foo

lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -> brcm/test_target

Quoted 6 lines

Yes, that's essentially the same as what I'm getting.

Now try "cat foo/test1" and what happens?

There is no file called test_target in the foo directory. And neither is there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

Quoted 8 lines
  $ mkdir -p foo/brcm
  $ echo hello > foo/test_target
  $ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or after you create the symlinks).

So that doesn't work for me how I expect it to work. I must be missing something fundamental here.

The recipe is trying to create a soft link from a file in the current directory to a file in the sub-directory. On my system, your example creates links from a file in the sub-directory to the another file in the sub-directory.

Quoted 7 lines

So, to copy your example, but creating the file "test_target" from the start:

$ mkdir -p /tmp/test
$ cd /tmp/test
$ mkdir foo
$ echo 1 > test_target

Here you are creating "test_target" in the directory which contains foo, not inside foo. So a symlink inside foo pointing to "test_target" isn't going to work.

Quoted 4 lines
$ ln -sf test_target foo/test1
$ ln -sf brcm/test_target foo/test2
$ ls -l foo
total 0
Quoted 8 lines
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -> test_target
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -> brcm/test_target
$ cat test_target
1
$ cat foo/test1
cat: foo/test1: No such file or directory
$ cat foo/test2
cat: foo/test2: No such file or directory

All as expected given that none of the symlink targets exist yet.

Quoted 3 lines
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target
bash: foo/brcm/test_target: No such file or directory

You can't create a file within the foo/brcm subdirectory without creating that subdirectory first. You've somehow missed that step - although it was in my example.

Quoted 14 lines
$ cat foo/test1
hello
$ cat foo/test2
cat: foo/test2: No such file or directory
$ cat test_target
1
$ tree
.
├── foo
│   ├── test1 -> test_target
│   ├── test2 -> brcm/test_target
│   └── test_target
└── test_target
Quoted 1 line

1 directory, 4 files

No real mysteries here. Everything looks as expected given the comments above about how you creating the target files.

Quoted 1 line

So, neither test1 nor test2 are linked to /tmp/test/test_target.

As expected. For a symlink which is in the foo subdirectory, the target would have to be "../test_target" to correctly point to your /tmp/test/test_target file.

Quoted 2 lines

test1 is
linked to /tmp/test/foo/test_target

Not exactly. The test1 symlink in foo just points to "test_target", there's no absolute path.

ie if you renamed the foo directory to something else then the test1 symlink would still point "test_target" and it would still be a valid link.

Quoted 2 lines

and test2 is linked to
/tmp/test/brcm/test_target, which doesn't exist.

Again, test2 is a relative symlink, not absolute. The test2 symlink points to a target which doesn't exist due to a missing "mkdir -p foo/brcm" before you tried to create the target file.

Quoted 3 lines

AFAIK, when creating a softlink, you have to give it either an absolute path, or a path relative to the link being created. The path cannot be relative to the original file that you want to link to.

The only real restriction when creating a symlink is that the directory which will contain the symlink must exist.

If you want the symlink to point to something then it's up to you to arrange that the target exists and the symlink points to it correctly
- but the symlink can still be created even if the target doesn't point to anything valid.

Quoted 10 lines

So, this will work:

$cd /tmp/test

$ ln -sf ../test_target foo/test3
$ cat foo/test3
1
$ cat /tmp/test/foo/test3
1

But that is a strange way to create the soft link, IMO.

What's strange about it?

Quoted 9 lines

AFAICT, for the recipe, to get rid of the "cd", I'd have to specify an absolute path to the original file:

(quoted diff) +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

... assuming PWD is available to the recipe. There will be a proper Yocto variable I can use, of course, but I can't think of it right now.

That definitely doesn't look right...

Quoted 4 lines

Either way, Martin's example doesn't work for me. And adding the absolute path of the original file doesn't seem any neater or clearer than following the TI example from the do_install a few lines up in the recipe. But I'm happy to do it either way, so long as it works.

Martin's example is basically saying (correctly) that this sequence:

mkdir foo
echo hello > foo/target
cd foo
ln -sf target link
cd ..

is equivalent to this one:

mkdir foo
echo hello > foo/target
ln -sf target foo/link

Notice that the first parameter to ln (the thing you want the symlink to point to) is the same in both cases. ie it isn't affected by which directory you are in when you create the symlink.

#17 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Martin Hundebøll
Quoted 7 lines · Martin Hundebøll

May I suggest using the '-r, --relative' flag from 'ln':

-r, --relative
create symbolic links relative to link location

My life felt considerably better after discovering that feature :)

Thanks Martin Hundebøll! Yes, that works for me.

So, Martin Jansa, I could make this change:

- ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf
brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)
+ ( ln -sfr
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

Of course, if I'm not going to "cd" into the firmware repo, I'll have to use absolute paths on both sides of the "ln" command anyway. So I could drop the 'r' param and it should still work. Eg:

- ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf
brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)
+ ( ln -sf ${D}${nonarch_base_libdir}/firmware/brcm/
brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/ brcmfmac43430-sdio.txt)

I'm still not sure this is any neater, though, as it involves using the path twice. Is there a maintainer here who has a preference?

FWIW, the TI line that I copied was added by Koen Kooi, who I've added to the CC:

8c7adb6 2011-10-09 linux-firmware: update, merge in OE classic updates,
fix p.. [Koen Kooi]

Quoted 169 lines

// Martin

Quoted 144 lines · Ryan Harkin

On 22 August 2018 at 23:55, Andre McCurdy <[email protected] <mailto:
[email protected]>> wrote:

On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <[email protected] <mailto:[email protected]>> wrote:
> On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]
<mailto:[email protected]>> wrote:
>> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin
<[email protected] <mailto:[email protected]>>
>> wrote:
>> > On Wed, 22 Aug 2018, 20:02 Martin Jansa,
<[email protected] <mailto:[email protected]>> wrote:
>> >>
>> >> Your 1st parameter is wrong, compare again with the example I
gave you
>> >> (don't include "brcm/" path in 1st param, because you want
the symlink
>> >> to
>> >> point to just brcmfmac43430-sdio.AP6212.txt like you did in
the version
>> >> after cd).
>> >
>> > That doesn't work either. I tried it with the same result, but
didn't
>> > send a
>> > log of it. That works for you?
>>
>> Martin's example is correct so maybe check your tests again for
typos.
>> It it still doesn't work then please do send a log.
>>
>> The link will point to whatever you define via the first
parameter, so
>> if you changed the first parameter it shouldn't be possible to get >> "the same result".
>>
>> $ mkdir foo
>> $ ln -sf test_target foo/test1
>> $ ln -sf brcm/test_target foo/test2
>> $ ls -l foo
>>
>> lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target
>> lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 ->
brcm/test_target
>
> Yes, that's essentially the same as what I'm getting.
>
> Now try "cat foo/test1" and what happens?
>
> There is no file called test_target in the foo directory. And
neither is
> there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

$ mkdir -p foo/brcm
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or after you create the symlinks).

So that doesn't work for me how I expect it to work. I must be missing something fundamental here.

The recipe is trying to create a soft link from a file in the current directory to a file in the sub-directory. On my system, your example creates links from a file in the sub-directory to the another file in the sub-directory.

So, to copy your example, but creating the file "test_target" from the start:

$ mkdir -p /tmp/test
$ cd /tmp/test
$ mkdir foo
$ echo 1 > test_target
$ ln -sf test_target foo/test1
$ ln -sf brcm/test_target foo/test2
$ ls -l foo
total 0
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -> test_target
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -> brcm/test_target
$ cat test_target
1
$ cat foo/test1
cat: foo/test1: No such file or directory
$ cat foo/test2
cat: foo/test2: No such file or directory
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target
bash: foo/brcm/test_target: No such file or directory
$ cat foo/test1
hello
$ cat foo/test2
cat: foo/test2: No such file or directory
$ cat test_target
1
$ tree
.
├── foo
│   ├── test1 -> test_target
│   ├── test2 -> brcm/test_target
│   └── test_target
└── test_target

1 directory, 4 files

So, neither test1 nor test2 are linked to /tmp/test/test_target. test1 is linked to /tmp/test/foo/test_target and test2 is linked to /tmp/test/brcm/test_target, which doesn't exist.

AFAIK, when creating a softlink, you have to give it either an absolute path, or a path relative to the link being created. The path cannot be relative to the original file that you want to link to.

So, this will work:

$cd /tmp/test

$ ln -sf ../test_target foo/test3
$ cat foo/test3
1
$ cat /tmp/test/foo/test3
1

But that is a strange way to create the soft link, IMO.

AFAICT, for the recipe, to get rid of the "cd", I'd have to specify an absolute path to the original file:

(quoted diff) +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

Quoted 9 lines

... assuming PWD is available to the recipe. There will be a proper Yocto variable I can use, of course, but I can't think of it right now.

Either way, Martin's example doesn't work for me. And adding the absolute path of the original file doesn't seem any neater or clearer than following the TI example from the do_install a few lines up in the recipe. But I'm happy to do it either way, so long as it works.

--
Kind regards,
Martin Hundebøll
Embedded Linux Consultant

+45 61 65 54 61
[email protected]

Geanix IVS
https://geanix.com
DK39600706

#21 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Andre McCurdy
Quoted 2 lines · Andre McCurdy

On Wed, Aug 22, 2018 at 11:12 PM, Ryan Harkin <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines · Andre McCurdy
Quoted 3 lines
Quoted 1 line · Ryan Harkin

On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin <[email protected]

Quoted 4 lines · wrote:
Quoted 2 lines · On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]> wrote:

Your 1st parameter is wrong, compare again with the example I

gave

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines

you
(don't include "brcm/" path in 1st param, because you want the symlink
to
point to just brcmfmac43430-sdio.AP6212.txt like you did in the version
after cd).

That doesn't work either. I tried it with the same result, but

didn't

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

send a
log of it. That works for you?

Martin's example is correct so maybe check your tests again for

typos.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

It it still doesn't work then please do send a log.

The link will point to whatever you define via the first parameter,

so

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

if you changed the first parameter it shouldn't be possible to get "the same result".

  $ mkdir foo
  $ ln -sf test_target foo/test1
  $ ln -sf brcm/test_target foo/test2
  $ ls -l foo
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -> brcm/test_target

Yes, that's essentially the same as what I'm getting.

Now try "cat foo/test1" and what happens?

There is no file called test_target in the foo directory. And

neither is

Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 1 line

there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

  $ mkdir -p foo/brcm
  $ echo hello > foo/test_target
  $ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or after you create the symlinks).

Quoted 5 lines
Quoted 5 lines

So that doesn't work for me how I expect it to work. I must be missing something fundamental here.

The recipe is trying to create a soft link from a file in the current directory to a file in the sub-directory. On my system, your example

creates

Quoted 6 lines
Quoted 6 lines

links from a file in the sub-directory to the another file in the sub-directory.

So, to copy your example, but creating the file "test_target" from the start:

Quoted 8 lines
Quoted 4 lines
$ mkdir -p /tmp/test
$ cd /tmp/test
$ mkdir foo
$ echo 1 > test_target

Here you are creating "test_target" in the directory which contains foo, not inside foo. So a symlink inside foo pointing to "test_target" isn't going to work.

Exactly my point! Martin asked me to do this:

Quoted 1 line

ln -sf brcmfmac43430-sdio.AP6212.txt

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt

Which is in essence what I'm doing above. It won't work. The file "brcmfmac43430-sdio.AP6212.txt" doesn't exist in the current directory. That's why there's a "cd" command in there.

I think, in hind sight, the problem is that there is no path specified for the original file. Hence, the email I've just sent, suggests I could make this mod:

- ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf
brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)
+ ( ln -sf
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

Quoted 24 lines
Quoted 14 lines

$ ln -sf test_target foo/test1
$ ln -sf brcm/test_target foo/test2
$ ls -l foo
total 0
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -> test_target
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -> brcm/test_target
$ cat test_target
1
$ cat foo/test1
cat: foo/test1: No such file or directory
$ cat foo/test2
cat: foo/test2: No such file or directory

All as expected given that none of the symlink targets exist yet.

Quoted 3 lines
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target
bash: foo/brcm/test_target: No such file or directory

You can't create a file within the foo/brcm subdirectory without creating that subdirectory first. You've somehow missed that step - although it was in my example.

Quoted 4 lines · your example
 $ mkdir foo
 $ ln -sf test_target foo/test1
 $ ln -sf brcm/test_target foo/test2
 $ ls -l foo

... and I was trying to show that it doesn't work. Although in fairness, you did add the "mkdir -p foo/brcm" command in a later email. So I think we're both arguing the same point and neither of us is making ourselves very clear.

So I don't think we need to continue down this track. Martin's original suggestion won't work for the reasons we've both just discussed. If I add the absolute paths to the source and target, it should be fine.

Quoted 64 lines
Quoted 15 lines
$ cat foo/test1
hello
$ cat foo/test2
cat: foo/test2: No such file or directory
$ cat test_target
1
$ tree
.
├── foo
│   ├── test1 -> test_target
│   ├── test2 -> brcm/test_target
│   └── test_target
└── test_target
Quoted 1 line

1 directory, 4 files

No real mysteries here. Everything looks as expected given the comments above about how you creating the target files.

Quoted 1 line

So, neither test1 nor test2 are linked to /tmp/test/test_target.

As expected. For a symlink which is in the foo subdirectory, the target would have to be "../test_target" to correctly point to your /tmp/test/test_target file.

Quoted 2 lines

test1 is
linked to /tmp/test/foo/test_target

Not exactly. The test1 symlink in foo just points to "test_target", there's no absolute path.

ie if you renamed the foo directory to something else then the test1 symlink would still point "test_target" and it would still be a valid link.

Quoted 2 lines

and test2 is linked to
/tmp/test/brcm/test_target, which doesn't exist.

Again, test2 is a relative symlink, not absolute. The test2 symlink points to a target which doesn't exist due to a missing "mkdir -p foo/brcm" before you tried to create the target file.

Quoted 3 lines

AFAIK, when creating a softlink, you have to give it either an absolute path, or a path relative to the link being created. The path cannot be relative to the original file that you want to link to.

The only real restriction when creating a symlink is that the directory which will contain the symlink must exist.

If you want the symlink to point to something then it's up to you to arrange that the target exists and the symlink points to it correctly
- but the symlink can still be created even if the target doesn't point to anything valid.

Quoted 9 lines

So, this will work:

$cd /tmp/test

$ ln -sf ../test_target foo/test3
$ cat foo/test3
1
$ cat /tmp/test/foo/test3
1
Quoted 12 lines
Quoted 1 line

But that is a strange way to create the soft link, IMO.

What's strange about it?

Quoted 8 lines

AFAICT, for the recipe, to get rid of the "cd", I'd have to specify an absolute path to the original file:

(quoted diff) +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

... assuming PWD is available to the recipe. There will be a proper

Yocto

Quoted 5 lines
Quoted 1 line

variable I can use, of course, but I can't think of it right now.

That definitely doesn't look right...

Quoted 1 line

Either way, Martin's example doesn't work for me. And adding the

absolute

Quoted 1 line
Quoted 1 line

path of the original file doesn't seem any neater or clearer than

following

Quoted 20 lines
Quoted 2 lines

the TI example from the do_install a few lines up in the recipe. But I'm happy to do it either way, so long as it works.

Martin's example is basically saying (correctly) that this sequence:

mkdir foo
echo hello > foo/target
cd foo
ln -sf target link
cd ..

is equivalent to this one:

mkdir foo
echo hello > foo/target
ln -sf target foo/link

Notice that the first parameter to ln (the thing you want the symlink to point to) is the same in both cases. ie it isn't affected by which directory you are in when you create the symlink.

#18 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Ryan Harkin
Quoted 11 lines · Ryan Harkin
Quoted 7 lines · Martin Hundebøll

May I suggest using the '-r, --relative' flag from 'ln':

-r, --relative
create symbolic links relative to link location

My life felt considerably better after discovering that feature :)

Thanks Martin Hundebøll! Yes, that works for me.

Quoted 7 lines

So, Martin Jansa, I could make this change:

- ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf
brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)
+ ( ln -sfr
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

This is kind of crazy - you are giving an absolute path and then asking ln to convert it into a relative path for you... but the conversion process is trivial: just remove the entire path! You don't need to ask ln to do that for you.

Quoted 9 lines

Of course, if I'm not going to "cd" into the firmware repo, I'll have to use absolute paths on both sides of the "ln" command anyway. So I could drop the 'r' param and it should still work. Eg:

- ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf
brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)
+ ( ln -sf
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

This will create a symlink which points to the target using an absolute path. ie it's not equivalent to the other examples given so far.

Quoted 8 lines

I'm still not sure this is any neater, though, as it involves using the path twice. Is there a maintainer here who has a preference?

FWIW, the TI line that I copied was added by Koen Kooi, who I've added to the CC:

8c7adb6 2011-10-09 linux-firmware: update, merge in OE classic updates,
fix p.. [Koen Kooi]

If you mean this line:

  ( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )

then it's doing something quite different to what you're now trying to do. It's creating multiple symlinks, not one.

Quoted 173 lines
Quoted 171 lines

// Martin

Quoted 147 lines · Ryan Harkin

On 22 August 2018 at 23:55, Andre McCurdy <[email protected] <mailto:[email protected]>> wrote:

On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <[email protected] <mailto:[email protected]>> wrote:
> On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]
<mailto:[email protected]>> wrote:
>> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin
<[email protected] <mailto:[email protected]>>
>> wrote:
>> > On Wed, 22 Aug 2018, 20:02 Martin Jansa,
<[email protected] <mailto:[email protected]>> wrote:
>> >>
>> >> Your 1st parameter is wrong, compare again with the example I
gave you
>> >> (don't include "brcm/" path in 1st param, because you want
the symlink
>> >> to
>> >> point to just brcmfmac43430-sdio.AP6212.txt like you did in
the version
>> >> after cd).
>> >
>> > That doesn't work either. I tried it with the same result, but
didn't
>> > send a
>> > log of it. That works for you?
>>
>> Martin's example is correct so maybe check your tests again for
typos.
>> It it still doesn't work then please do send a log. >>
>> The link will point to whatever you define via the first
parameter, so
>> if you changed the first parameter it shouldn't be possible to
get
>> "the same result".
>>
>> $ mkdir foo
>> $ ln -sf test_target foo/test1
>> $ ln -sf brcm/test_target foo/test2
>> $ ls -l foo
>>
>> lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target
>> lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 ->
brcm/test_target
>
> Yes, that's essentially the same as what I'm getting. >
> Now try "cat foo/test1" and what happens?
>
> There is no file called test_target in the foo directory. And
neither is
> there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

$ mkdir -p foo/brcm
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or
after
you create the symlinks).

So that doesn't work for me how I expect it to work. I must be missing something fundamental here.

The recipe is trying to create a soft link from a file in the current directory to a file in the sub-directory. On my system, your example creates links from a file in the sub-directory to the another file in the sub-directory.

So, to copy your example, but creating the file "test_target" from the start:

$ mkdir -p /tmp/test
$ cd /tmp/test
$ mkdir foo
$ echo 1 > test_target
$ ln -sf test_target foo/test1
$ ln -sf brcm/test_target foo/test2
$ ls -l foo
total 0
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -> test_target
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -> brcm/test_target
$ cat test_target
1
$ cat foo/test1
cat: foo/test1: No such file or directory
$ cat foo/test2
cat: foo/test2: No such file or directory
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target
bash: foo/brcm/test_target: No such file or directory
$ cat foo/test1
hello
$ cat foo/test2
cat: foo/test2: No such file or directory
$ cat test_target
1
$ tree
.
├── foo
│   ├── test1 -> test_target
│   ├── test2 -> brcm/test_target
│   └── test_target
└── test_target

1 directory, 4 files

So, neither test1 nor test2 are linked to /tmp/test/test_target. test1 is linked to /tmp/test/foo/test_target and test2 is linked to /tmp/test/brcm/test_target, which doesn't exist.

AFAIK, when creating a softlink, you have to give it either an absolute path, or a path relative to the link being created. The path cannot be relative to the original file that you want to link to.

So, this will work:

$cd /tmp/test

$ ln -sf ../test_target foo/test3
$ cat foo/test3
1
$ cat /tmp/test/foo/test3
1

But that is a strange way to create the soft link, IMO.

AFAICT, for the recipe, to get rid of the "cd", I'd have to specify an absolute path to the original file:

(quoted diff) +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

Quoted 8 lines

... assuming PWD is available to the recipe. There will be a proper Yocto variable I can use, of course, but I can't think of it right now.

Either way, Martin's example doesn't work for me. And adding the absolute path of the original file doesn't seem any neater or clearer than following the TI example from the do_install a few lines up in the recipe. But I'm happy to do it either way, so long as it works.

--
Kind regards,
Martin Hundebøll
Embedded Linux Consultant

+45 61 65 54 61
[email protected]

Geanix IVS
https://geanix.com
DK39600706

#22 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Ryan Harkin
Quoted 91 lines · Ryan Harkin
Quoted 81 lines · Andre McCurdy
Quoted 79 lines · Ryan Harkin
Quoted 57 lines · Andre McCurdy
Quoted 40 lines · Ryan Harkin
Quoted 30 lines · On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]> wrote:
Quoted 13 lines · Ryan Harkin
Quoted 10 lines · On Wed, 22 Aug 2018, 20:02 Martin Jansa, <[email protected]> wrote:

Your 1st parameter is wrong, compare again with the example I gave
you
(don't include "brcm/" path in 1st param, because you want the symlink
to
point to just brcmfmac43430-sdio.AP6212.txt like you did in the version
after cd).

Quoted 4 lines

That doesn't work either. I tried it with the same result, but didn't
send a
log of it. That works for you?

Martin's example is correct so maybe check your tests again for typos.
It it still doesn't work then please do send a log.

The link will point to whatever you define via the first parameter, so
if you changed the first parameter it shouldn't be possible to get "the same result".

Quoted 7 lines
  $ mkdir foo
  $ ln -sf test_target foo/test1
  $ ln -sf brcm/test_target foo/test2
  $ ls -l foo

lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -> brcm/test_target

Quoted 7 lines

Yes, that's essentially the same as what I'm getting.

Now try "cat foo/test1" and what happens?

There is no file called test_target in the foo directory. And neither is
there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

Quoted 8 lines
  $ mkdir -p foo/brcm
  $ echo hello > foo/test_target
  $ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or after you create the symlinks).

So that doesn't work for me how I expect it to work. I must be missing something fundamental here.

The recipe is trying to create a soft link from a file in the current directory to a file in the sub-directory. On my system, your example creates
links from a file in the sub-directory to the another file in the sub-directory.

So, to copy your example, but creating the file "test_target" from the start:

Quoted 8 lines
Quoted 4 lines
$ mkdir -p /tmp/test
$ cd /tmp/test
$ mkdir foo
$ echo 1 > test_target

Here you are creating "test_target" in the directory which contains foo, not inside foo. So a symlink inside foo pointing to "test_target" isn't going to work.

Quoted 8 lines

Exactly my point! Martin asked me to do this:

Quoted 2 lines

ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt

Which is in essence what I'm doing above. It won't work. The file "brcmfmac43430-sdio.AP6212.txt" doesn't exist in the current directory. That's why there's a "cd" command in there.

I think you're really still quite confused about something here...

You don't need to have any file existing in the current directory (or anywhere else) in order to create a symlink. The symlink exists on it's own. Creating the file that the symlink points to is an entirely separate step.

Quoted 44 lines

I think, in hind sight, the problem is that there is no path specified for the original file. Hence, the email I've just sent, suggests I could make this mod:

- ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf
brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)
+ ( ln -sf
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

Quoted 24 lines
Quoted 14 lines

$ ln -sf test_target foo/test1
$ ln -sf brcm/test_target foo/test2
$ ls -l foo
total 0
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -> test_target
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -> brcm/test_target
$ cat test_target
1
$ cat foo/test1
cat: foo/test1: No such file or directory
$ cat foo/test2
cat: foo/test2: No such file or directory

All as expected given that none of the symlink targets exist yet.

Quoted 3 lines
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target
bash: foo/brcm/test_target: No such file or directory

You can't create a file within the foo/brcm subdirectory without creating that subdirectory first. You've somehow missed that step - although it was in my example.

Quoted 4 lines · your example
 $ mkdir foo
 $ ln -sf test_target foo/test1
 $ ln -sf brcm/test_target foo/test2
 $ ls -l foo
Quoted 8 lines

... and I was trying to show that it doesn't work. Although in fairness, you did add the "mkdir -p foo/brcm" command in a later email. So I think we're both arguing the same point and neither of us is making ourselves very clear.

So I don't think we need to continue down this track. Martin's original suggestion won't work for the reasons we've both just discussed. If I add the absolute paths to the source and target, it should be fine.

If you make it down as far as the end of the previous email you'll find a simplified example of Martin's suggestion. Please try it. It does work.

Quoted 106 lines
Quoted 106 lines
Quoted 16 lines

$ cat foo/test1
hello
$ cat foo/test2
cat: foo/test2: No such file or directory
$ cat test_target
1
$ tree
.
├── foo
│   ├── test1 -> test_target
│   ├── test2 -> brcm/test_target
│   └── test_target
└── test_target
Quoted 1 line

1 directory, 4 files

No real mysteries here. Everything looks as expected given the comments above about how you creating the target files.

Quoted 1 line

So, neither test1 nor test2 are linked to /tmp/test/test_target.

As expected. For a symlink which is in the foo subdirectory, the target would have to be "../test_target" to correctly point to your /tmp/test/test_target file.

Quoted 2 lines

test1 is
linked to /tmp/test/foo/test_target

Not exactly. The test1 symlink in foo just points to "test_target", there's no absolute path.

ie if you renamed the foo directory to something else then the test1 symlink would still point "test_target" and it would still be a valid link.

Quoted 2 lines

and test2 is linked to
/tmp/test/brcm/test_target, which doesn't exist.

Again, test2 is a relative symlink, not absolute. The test2 symlink points to a target which doesn't exist due to a missing "mkdir -p foo/brcm" before you tried to create the target file.

Quoted 3 lines

AFAIK, when creating a softlink, you have to give it either an absolute path, or a path relative to the link being created. The path cannot be relative to the original file that you want to link to.

The only real restriction when creating a symlink is that the directory which will contain the symlink must exist.

If you want the symlink to point to something then it's up to you to arrange that the target exists and the symlink points to it correctly
- but the symlink can still be created even if the target doesn't point to anything valid.

Quoted 10 lines

So, this will work:

$cd /tmp/test

$ ln -sf ../test_target foo/test3
$ cat foo/test3
1
$ cat /tmp/test/foo/test3
1

But that is a strange way to create the soft link, IMO.

What's strange about it?

Quoted 10 lines

AFAICT, for the recipe, to get rid of the "cd", I'd have to specify an absolute path to the original file:

(quoted diff) +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

... assuming PWD is available to the recipe. There will be a proper Yocto
variable I can use, of course, but I can't think of it right now.

That definitely doesn't look right...

Quoted 6 lines

Either way, Martin's example doesn't work for me. And adding the absolute
path of the original file doesn't seem any neater or clearer than following
the TI example from the do_install a few lines up in the recipe. But I'm happy to do it either way, so long as it works.

Martin's example is basically saying (correctly) that this sequence:

mkdir foo
echo hello > foo/target
cd foo
ln -sf target link
cd ..

is equivalent to this one:

mkdir foo
echo hello > foo/target
ln -sf target foo/link

Notice that the first parameter to ln (the thing you want the symlink to point to) is the same in both cases. ie it isn't affected by which directory you are in when you create the symlink.

#23 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

Quoted 168 lines · Andre McCurdy
Quoted 4 lines · Ryan Harkin
Quoted 3 lines · Andre McCurdy
Quoted 1 line · Ryan Harkin

On 22 August 2018 at 23:55, Andre McCurdy <[email protected]>

Quoted 9 lines · wrote:
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <[email protected]

Quoted 6 lines · wrote:
Quoted 4 lines · On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]> wrote:
Quoted 1 line · Ryan Harkin

On Wed, 22 Aug 2018, 20:02 Martin Jansa, <

[email protected]>

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 10 lines · wrote:

Your 1st parameter is wrong, compare again with the example I gave
you
(don't include "brcm/" path in 1st param, because you want the symlink
to
point to just brcmfmac43430-sdio.AP6212.txt like you did in the version
after cd).

That doesn't work either. I tried it with the same result, but didn't
send a
log of it. That works for you?

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Martin's example is correct so maybe check your tests again for typos.
It it still doesn't work then please do send a log.

The link will point to whatever you define via the first

parameter,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

so
if you changed the first parameter it shouldn't be possible to get "the same result".

  $ mkdir foo
  $ ln -sf test_target foo/test1
  $ ln -sf brcm/test_target foo/test2
  $ ls -l foo

lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 ->

brcm/test_target

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Yes, that's essentially the same as what I'm getting.

Now try "cat foo/test1" and what happens?

There is no file called test_target in the foo directory. And

neither

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines

is
there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
  $ mkdir -p foo/brcm
  $ echo hello > foo/test_target
  $ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or

after

Quoted 23 lines
Quoted 14 lines
Quoted 14 lines
Quoted 1 line

you create the symlinks).

So that doesn't work for me how I expect it to work. I must be missing something fundamental here.

The recipe is trying to create a soft link from a file in the current directory to a file in the sub-directory. On my system, your example creates
links from a file in the sub-directory to the another file in the sub-directory.

So, to copy your example, but creating the file "test_target" from the start:

Quoted 8 lines
Quoted 4 lines
$ mkdir -p /tmp/test
$ cd /tmp/test
$ mkdir foo
$ echo 1 > test_target

Here you are creating "test_target" in the directory which contains foo, not inside foo. So a symlink inside foo pointing to "test_target" isn't going to work.

Quoted 8 lines

Exactly my point! Martin asked me to do this:

Quoted 2 lines

ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt

Which is in essence what I'm doing above. It won't work. The file "brcmfmac43430-sdio.AP6212.txt" doesn't exist in the current directory. That's why there's a "cd" command in there.

I think you're really still quite confused about something here...

You don't need to have any file existing in the current directory (or anywhere else) in order to create a symlink. The symlink exists on it's own. Creating the file that the symlink points to is an entirely separate step.

Quoted 1 line

I think, in hind sight, the problem is that there is no path specified

for

Quoted 36 lines

the original file. Hence, the email I've just sent, suggests I could make this mod:

- ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf
brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)
+ ( ln -sf
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

Quoted 17 lines
Quoted 14 lines

$ ln -sf test_target foo/test1
$ ln -sf brcm/test_target foo/test2
$ ls -l foo
total 0
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -> test_target
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -> brcm/test_target
$ cat test_target
1
$ cat foo/test1
cat: foo/test1: No such file or directory
$ cat foo/test2
cat: foo/test2: No such file or directory

All as expected given that none of the symlink targets exist yet.

Quoted 7 lines
Quoted 3 lines
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target
bash: foo/brcm/test_target: No such file or directory

You can't create a file within the foo/brcm subdirectory without creating that subdirectory first. You've somehow missed that step - although it was in my example.

Quoted 8 lines
Quoted 4 lines · your example
 $ mkdir foo
 $ ln -sf test_target foo/test1
 $ ln -sf brcm/test_target foo/test2
 $ ls -l foo

... and I was trying to show that it doesn't work. Although in fairness,

you

Quoted 1 line

did add the "mkdir -p foo/brcm" command in a later email. So I think

we're

Quoted 3 lines

both arguing the same point and neither of us is making ourselves very clear.

Quoted 8 lines
Quoted 3 lines

So I don't think we need to continue down this track. Martin's original suggestion won't work for the reasons we've both just discussed. If I add the absolute paths to the source and target, it should be fine.

If you make it down as far as the end of the previous email you'll find a simplified example of Martin's suggestion. Please try it. It does work.

I think you're right. As was Martin.

I was starting to respond to your previous email but I'll cut it short and just say that I apologise for the confusion and distraction and I'll make the mod Martin suggested and test it works.

Quoted 109 lines
Quoted 37 lines
Quoted 37 lines
Quoted 16 lines

$ cat foo/test1
hello
$ cat foo/test2
cat: foo/test2: No such file or directory
$ cat test_target
1
$ tree
.
├── foo
│   ├── test1 -> test_target
│   ├── test2 -> brcm/test_target
│   └── test_target
└── test_target
Quoted 1 line

1 directory, 4 files

No real mysteries here. Everything looks as expected given the comments above about how you creating the target files.

Quoted 1 line

So, neither test1 nor test2 are linked to /tmp/test/test_target.

As expected. For a symlink which is in the foo subdirectory, the target would have to be "../test_target" to correctly point to your /tmp/test/test_target file.

Quoted 2 lines

test1 is
linked to /tmp/test/foo/test_target

Not exactly. The test1 symlink in foo just points to "test_target", there's no absolute path.

ie if you renamed the foo directory to something else then the test1 symlink would still point "test_target" and it would still be a valid link.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

and test2 is linked to
/tmp/test/brcm/test_target, which doesn't exist.

Again, test2 is a relative symlink, not absolute. The test2 symlink points to a target which doesn't exist due to a missing "mkdir -p foo/brcm" before you tried to create the target file.

Quoted 1 line

AFAIK, when creating a softlink, you have to give it either an

absolute

Quoted 35 lines
Quoted 35 lines
Quoted 2 lines

path, or a path relative to the link being created. The path cannot be relative to the original file that you want to link to.

The only real restriction when creating a symlink is that the directory which will contain the symlink must exist.

If you want the symlink to point to something then it's up to you to arrange that the target exists and the symlink points to it correctly
- but the symlink can still be created even if the target doesn't point to anything valid.

Quoted 10 lines

So, this will work:

$cd /tmp/test

$ ln -sf ../test_target foo/test3
$ cat foo/test3
1
$ cat /tmp/test/foo/test3
1

But that is a strange way to create the soft link, IMO.

What's strange about it?

Quoted 10 lines

AFAICT, for the recipe, to get rid of the "cd", I'd have to specify an absolute path to the original file:

(quoted diff) +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

... assuming PWD is available to the recipe. There will be a proper Yocto
variable I can use, of course, but I can't think of it right now.

Quoted 7 lines
Quoted 7 lines

That definitely doesn't look right...

Quoted 5 lines

Either way, Martin's example doesn't work for me. And adding the absolute
path of the original file doesn't seem any neater or clearer than following
the TI example from the do_install a few lines up in the recipe. But

I'm

Quoted 19 lines
Quoted 19 lines
Quoted 1 line

happy to do it either way, so long as it works.

Martin's example is basically saying (correctly) that this sequence:

mkdir foo
echo hello > foo/target
cd foo
ln -sf target link
cd ..

is equivalent to this one:

mkdir foo
echo hello > foo/target
ln -sf target foo/link

Notice that the first parameter to ln (the thing you want the symlink to point to) is the same in both cases. ie it isn't affected by which directory you are in when you create the symlink.

#24 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Martin Jansa
Quoted 2 lines · Martin Jansa

The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to be

needed, just include the path in 2nd ln parameter.

Thanks Martin, and sorry for being so dumb. I'll send another series at some point, but for now, the patch looks like this:

(quoted diff) +0 -0

b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb index 8c54f28..70d4f6a 100644

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +0 -0
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/*

. )
}

+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a +# softlink for the module specific NVRAM file to the filename expected +# by the Linux kernel +FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = " ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt" +do_install_append_bcm43430-nvram-mur1dx() {
+ ln -sf brcmfmac43430-sdio.MUR1DX.txt
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt +}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt" +do_install_append_bcm43430-nvram-ap6212() {
+ ln -sf brcmfmac43430-sdio.AP6212.txt
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt +}
+

So now the ln issue is resolved, I'm not convinced my MACHINEOVERRIDES is the correct approach. Does anyone have any feedback on how I can improve that?

As per my cover letter, I originally wanted to be able to provide a MACHINE_EXTRA_RRECOMMENDS, or similar, but I'm not familiar with how to get an _append to apply based on that variable, unless I tested it incorrectly (again).

If I add, say, "linux-firmware-bcm43430-nvram-mur1dx" to MACHINE_EXTRA_RRECOMMENDS,
should this work:

+FILES_${PN}-bcm43430-nvram_append_${PN}-bcm43430-nvram-mur1dx = " ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt" +do_install_append_${PN}-bcm43430-nvram-mur1dx() {
+ ln -sf brcmfmac43430-sdio.MUR1DX.txt
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt +}

Or is there a better way of achieving this?

Quoted 3 lines

On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <[email protected]>

Quoted 10 lines · wrote:
Quoted 10 lines

The Linux kernel currently expects a single NVRAM file for BCM43430 named brcmfmac43430-sdio.txt.

Allow the machine to specify an override to link its module specific NVRAM to the filename expected by the kernel.

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12

++++++++++++

Quoted 3 lines

Review

Quoted 3 lines
 1 file changed, 12 insertions(+)
(quoted diff) +0 -0

b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

Quoted 5 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 226

Quoted 5 lines

index 8c54f28..b647abc 100644

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +0 -0
@@ -226,6 +226,18 @@ do_install() {
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf

ti-connectivity/* . )

Quoted 6 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 232

Quoted 6 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +4 -0
 }
 
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a
+# softlink for the module specific NVRAM file to the filename expected
+# by the Linux kernel
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = "

${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

Quoted 2 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 234

Quoted 2 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)

Quoted 2 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 236

Quoted 2 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+}
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 =

"${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt"

Quoted 2 lines

meta/recipes-kernel/linux-firmware/linux-firmware_git.bb do_install() { · line 238

Quoted 2 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -0
+do_install_append_bcm43430-nvram-ap6212() {
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf

brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)

Quoted 8 lines
Quoted 8 lines
meta/recipes-kernel/linux-firmware/linux-firmware_git.bb +2 -1
+}
+
 
 PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
              ${PN}-mt7601u-license ${PN}-mt7601u \
--

2.7.4

#19 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Martin Hundebøll
Quoted 8 lines · Martin Hundebøll

May I suggest using the '-r, --relative' flag from 'ln':

-r, --relative
create symbolic links relative to link location

My life felt considerably better after discovering that feature :)

ln -r is not available everywhere, but we do have lnr implemented as part of metadata see scripts/lnr so
feel free to use that

Quoted 171 lines

// Martin

Quoted 143 lines · Ryan Harkin

On 22 August 2018 at 23:55, Andre McCurdy <[email protected] <mailto:[email protected]>> wrote:

On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <[email protected] <mailto:[email protected]>> wrote:
> On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <[email protected]
<mailto:[email protected]>> wrote:
>> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin
<[email protected] <mailto:[email protected]>>
>> wrote:
>> > On Wed, 22 Aug 2018, 20:02 Martin Jansa,
<[email protected] <mailto:[email protected]>> wrote:
>> >>
>> >> Your 1st parameter is wrong, compare again with the example I
gave you
>> >> (don't include "brcm/" path in 1st param, because you want
the symlink
>> >> to
>> >> point to just brcmfmac43430-sdio.AP6212.txt like you did in
the version
>> >> after cd).
>> >
>> > That doesn't work either. I tried it with the same result, but
didn't
>> > send a
>> > log of it. That works for you?
>>
>> Martin's example is correct so maybe check your tests again for
typos.
>> It it still doesn't work then please do send a log.
>>
>> The link will point to whatever you define via the first
parameter, so
>> if you changed the first parameter it shouldn't be possible to get >> "the same result".
>>
>> $ mkdir foo
>> $ ln -sf test_target foo/test1
>> $ ln -sf brcm/test_target foo/test2
>> $ ls -l foo
>>
>> lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -> test_target
>> lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -> brcm/test_target
>
> Yes, that's essentially the same as what I'm getting.
>
> Now try "cat foo/test1" and what happens?
>
> There is no file called test_target in the foo directory. And
neither is
> there a file called brcm/test_target in the foo directory.

Correct. The above was just an example to show that you can * create symlinks * in the foo directory without cd'ing into the foo directory first.

If you'd like the symlinks in the example to point to valid targets then you need to create the targets too, e.g.

$ mkdir -p foo/brcm
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target

But note that the process of creating a symlink is always the same, regardless of whether the symlink points to a valid target or not (so you can run these extra commands to create the targets before or after you create the symlinks).

So that doesn't work for me how I expect it to work. I must be missing something fundamental here.

The recipe is trying to create a soft link from a file in the current directory to a file in the sub-directory. On my system, your example creates links from a file in the sub-directory to the another file in the sub-directory.

So, to copy your example, but creating the file "test_target" from the start:

$ mkdir -p /tmp/test
$ cd /tmp/test
$ mkdir foo
$ echo 1 > test_target
$ ln -sf test_target foo/test1
$ ln -sf brcm/test_target foo/test2
$ ls -l foo
total 0
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -> test_target
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -> brcm/test_target
$ cat test_target
1
$ cat foo/test1
cat: foo/test1: No such file or directory
$ cat foo/test2
cat: foo/test2: No such file or directory
$ echo hello > foo/test_target
$ echo hello2 > foo/brcm/test_target
bash: foo/brcm/test_target: No such file or directory
$ cat foo/test1
hello
$ cat foo/test2
cat: foo/test2: No such file or directory
$ cat test_target
1
$ tree
.
├── foo
│   ├── test1 -> test_target
│   ├── test2 -> brcm/test_target
│   └── test_target
└── test_target

1 directory, 4 files

So, neither test1 nor test2 are linked to /tmp/test/test_target. test1 is linked to /tmp/test/foo/test_target and test2 is linked to /tmp/test/brcm/test_target, which doesn't exist.

AFAIK, when creating a softlink, you have to give it either an absolute path, or a path relative to the link being created. The path cannot be relative to the original file that you want to link to.

So, this will work:

$cd /tmp/test

$ ln -sf ../test_target foo/test3
$ cat foo/test3
1
$ cat /tmp/test/foo/test3
1

But that is a strange way to create the soft link, IMO.

AFAICT, for the recipe, to get rid of the "cd", I'd have to specify an absolute path to the original file:

(quoted diff) +2 -0
+do_install_append_bcm43430-nvram-mur1dx() {
+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)

Quoted 8 lines

... assuming PWD is available to the recipe. There will be a proper Yocto variable I can use, of course, but I can't think of it right now.

Either way, Martin's example doesn't work for me. And adding the absolute path of the original file doesn't seem any neater or clearer than following the TI example from the do_install a few lines up in the recipe. But I'm happy to do it either way, so long as it works.

--
Kind regards,
Martin Hundebøll
Embedded Linux Consultant

+45 61 65 54 61
[email protected]

Geanix IVS
https://geanix.com
DK39600706
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#25 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Ryan Harkin
Quoted 4 lines · Ryan Harkin

So now the ln issue is resolved, I'm not convinced my MACHINEOVERRIDES is the correct approach. Does anyone have any feedback on how I can improve that?

If you want to make a configurable symlink then perhaps the more usual approach would be to just use a variable in the linux-firmware recipe to weakly define a default target for the symlink. Machine config files could then either do nothing (ie use the default) or provide their own value. For example, in the linux-firmware recipe:

BCM43430_NVRAM_SYMLINK ?= "brcmfmac43430-sdio.AP6212.txt"

  FILES_${PN}-bcm43430-nvram = " \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt \
  "
  do_install() {
    ...
    ln -sf ${BCM43430_NVRAM_SYMLINK}

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt
}

And then in the machine config files of machines which need the MUR1DX firmware instead of the default, add:

BCM43430_NVRAM_SYMLINK = "brcmfmac43430-sdio.MUR1DX.txt"

However... note that currently the linux-firmware recipe is architecture independent (ie it won't be rebuilt if the target is changed). Adding a machine specific symlink is going to cause problems with that, so the above is still not a full solution.

#26 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

One way to keep it allarch would be to package ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt in 2 separate packages and handle ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt symlink with update-alternatives

most MACHINEs won't install either of these packages and those which need it will pull the right one (e.g. through MACHINE_EXTRA_RRECOMMENDS).

In worst case someone will try to install both packages and based on u-a priority one of them will win (use higher priority for the more common version).

Cheers,

Quoted 37 lines · Andre McCurdy
Quoted 4 lines · Ryan Harkin

So now the ln issue is resolved, I'm not convinced my MACHINEOVERRIDES is the correct approach. Does anyone have any feedback on how I can improve that?

If you want to make a configurable symlink then perhaps the more usual approach would be to just use a variable in the linux-firmware recipe to weakly define a default target for the symlink. Machine config files could then either do nothing (ie use the default) or provide their own value. For example, in the linux-firmware recipe:

BCM43430_NVRAM_SYMLINK ?= "brcmfmac43430-sdio.AP6212.txt"

  FILES_${PN}-bcm43430-nvram = " \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt \
  "
  do_install() {
    ...
    ln -sf ${BCM43430_NVRAM_SYMLINK}

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt
}

And then in the machine config files of machines which need the MUR1DX firmware instead of the default, add:

BCM43430_NVRAM_SYMLINK = "brcmfmac43430-sdio.MUR1DX.txt"

However... note that currently the linux-firmware recipe is architecture independent (ie it won't be rebuilt if the target is changed). Adding a machine specific symlink is going to cause problems with that, so the above is still not a full solution.

#27 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

Hi Martin,

Quoted 7 lines · Martin Jansa

One way to keep it allarch would be to package ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt in 2 separate packages and handle ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt symlink with update-alternatives

Quoted 7 lines

most MACHINEs won't install either of these packages and those which need it will pull the right one (e.g. through MACHINE_EXTRA_RRECOMMENDS).

In worst case someone will try to install both packages and based on u-a priority one of them will win (use higher priority for the more common version).

Thanks, this sounds like a good approach. I'll experiment with update-alternatives as I haven't used it before and see if I can come up with something sensible.

Quoted 43 lines

Cheers,

Quoted 38 lines · Andre McCurdy
Quoted 2 lines · Ryan Harkin

So now the ln issue is resolved, I'm not convinced my MACHINEOVERRIDES

is

Quoted 2 lines

the correct approach. Does anyone have any feedback on how I can improve that?

If you want to make a configurable symlink then perhaps the more usual approach would be to just use a variable in the linux-firmware recipe to weakly define a default target for the symlink. Machine config files could then either do nothing (ie use the default) or provide their own value. For example, in the linux-firmware recipe:

BCM43430_NVRAM_SYMLINK ?= "brcmfmac43430-sdio.AP6212.txt"

  FILES_${PN}-bcm43430-nvram = " \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt \
  "
  do_install() {
    ...
    ln -sf ${BCM43430_NVRAM_SYMLINK}

${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt
}

And then in the machine config files of machines which need the MUR1DX firmware instead of the default, add:

BCM43430_NVRAM_SYMLINK = "brcmfmac43430-sdio.MUR1DX.txt"

However... note that currently the linux-firmware recipe is architecture independent (ie it won't be rebuilt if the target is changed). Adding a machine specific symlink is going to cause problems with that, so the above is still not a full solution.

Thanks Andre. It looks like it would work, but unless you see a problem, I'll look at Martin's idea first.

Cheers,
Ryan.

#28 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

In reply to Martin Jansa

I think this should be solved in the driver actually. It probably "knows" which variant is there (or could be taught using devicetree or so).

Quoted 54 lines · Martin Jansa

One way to keep it allarch would be to package ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt in 2 separate packages and handle ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt symlink with update-alternatives

most MACHINEs won't install either of these packages and those which need it will pull the right one (e.g. through MACHINE_EXTRA_RRECOMMENDS).

In worst case someone will try to install both packages and based on u-a priority one of them will win (use higher priority for the more common version).

Cheers,

On Fri, Aug 24, 2018 at 4:53 AM Andre McCurdy <[email protected] <mailto:[email protected]>> wrote:

On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin <[email protected] <mailto:[email protected]>> wrote:
>
> So now the ln issue is resolved, I'm not convinced my MACHINEOVERRIDES is > the correct approach. Does anyone have any feedback on how I can improve > that?

If you want to make a configurable symlink then perhaps the more usual approach would be to just use a variable in the linux-firmware recipe to weakly define a default target for the symlink. Machine config files could then either do nothing (ie use the default) or provide their own value. For example, in the linux-firmware recipe:

  BCM43430_NVRAM_SYMLINK ?= "brcmfmac43430-sdio.AP6212.txt"

  FILES_${PN}-bcm43430-nvram = " \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt \
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt \
  "

  do_install() {
    ...
    ln -sf ${BCM43430_NVRAM_SYMLINK}
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt
  }

And then in the machine config files of machines which need the MUR1DX firmware instead of the default, add:

  BCM43430_NVRAM_SYMLINK = "brcmfmac43430-sdio.MUR1DX.txt"

However... note that currently the linux-firmware recipe is architecture independent (ie it won't be rebuilt if the target is changed). Adding a machine specific symlink is going to cause problems with that, so the above is still not a full solution.

#29 lore raw

Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM

Quoted 2 lines · Mike Looijmans

I think this should be solved in the driver actually. It probably "knows" which variant is there (or could be taught using devicetree or so).

I agree. That's a longer term change that will take quite some time to filter through, if at all.

The device doesn't know which variant it is, but I'm *hoping* to add a device tree attribute to cover this, but there has been resistance this in the past, so it may not be an easy change to get accepted.

Quoted 72 lines · Martin Jansa
Quoted 52 lines

One way to keep it allarch would be to package ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt in 2 separate packages and handle ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt symlink with update-alternatives

most MACHINEs won't install either of these packages and those which need it will pull the right one (e.g. through MACHINE_EXTRA_RRECOMMENDS).

In worst case someone will try to install both packages and based on u-a priority one of them will win (use higher priority for the more common version).

Cheers,

On Fri, Aug 24, 2018 at 4:53 AM Andre McCurdy <[email protected] <mailto:[email protected]>> wrote:

On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin <[email protected] <mailto:[email protected]>> wrote:
>
> So now the ln issue is resolved, I'm not convinced my
MACHINEOVERRIDES is
> the correct approach. Does anyone have any feedback on how I can
improve
> that?

If you want to make a configurable symlink then perhaps the more usual approach would be to just use a variable in the linux-firmware recipe to weakly define a default target for the symlink. Machine config files could then either do nothing (ie use the default) or provide their own value. For example, in the linux-firmware recipe:

BCM43430_NVRAM_SYMLINK ?= "brcmfmac43430-sdio.AP6212.txt"

FILES_${PN}-bcm43430-nvram = " \
${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt \
${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt

\
         ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt
\
       "

       do_install() {
         ...
         ln -sf ${BCM43430_NVRAM_SYMLINK}
    ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt
       }

    And then in the machine config files of machines which need the MUR1DX
Quoted 12 lines
    firmware instead of the default, add:

       BCM43430_NVRAM_SYMLINK = "brcmfmac43430-sdio.MUR1DX.txt"

    However... note that currently the linux-firmware recipe is
    architecture independent (ie it won't be rebuilt if the target is
    changed). Adding a machine specific symlink is going to cause problems
    with that, so the above is still not a full solution.

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core