diff mbox series

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

Message ID 1534955436-729-4-git-send-email-ryan.harkin@linaro.org
State New
Headers show
Series Adding BCM43430 NVRAM files | expand

Commit Message

Ryan Harkin Aug. 22, 2018, 4:30 p.m. UTC
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.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

---
 meta/recipes-kernel/linux-firmware/linux-firmware_git.bb | 12 ++++++++++++
 1 file changed, 12 insertions(+)

-- 
2.7.4

Comments

Martin Jansa Aug. 22, 2018, 4:41 p.m. UTC | #1
The "cd ${D}${nonarch_base_libdir}/firmware/brcm/" doesn't seem to be
needed, just include the path in 2nd ln parameter.

On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <ryan.harkin@linaro.org> wrote:

> 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.

>

> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

> ---

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

> ++++++++++++

>  1 file changed, 12 insertions(+)

>

> diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

> index 8c54f28..b647abc 100644

> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

> @@ -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 \

> --

> 2.7.4

>

>
<div dir="ltr">The &quot;cd ${D}${nonarch_base_libdir}/firmware/brcm/&quot; doesn&#39;t seem to be needed, just include the path in 2nd ln parameter.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The Linux kernel currently expects a single NVRAM file for BCM43430<br>
named brcmfmac43430-sdio.txt.<br>
<br>
Allow the machine to specify an override to link its module specific<br>
NVRAM to the filename expected by the kernel.<br>
<br>
Signed-off-by: Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt;<br>

---<br>
 meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> | 12 ++++++++++++<br>
 1 file changed, 12 insertions(+)<br>
<br>
diff --git a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
index 8c54f28..b647abc 100644<br>
--- a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
+++ b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
@@ -226,6 +226,18 @@ do_install() {<br>
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )<br>
 }<br>
<br>
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a<br>
+# softlink for the module specific NVRAM file to the filename expected<br>
+# by the Linux kernel<br>
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
+do_install_append_bcm43430-nvram-mur1dx() {<br>
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = &quot;${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
+do_install_append_bcm43430-nvram-ap6212() {<br>
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+<br>
<br>
 PACKAGES =+ &quot;${PN}-ralink-license ${PN}-ralink \<br>
              ${PN}-mt7601u-license ${PN}-mt7601u \<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div>
Ryan Harkin Aug. 22, 2018, 4:47 p.m. UTC | #2
On 22 August 2018 at 17:41, Martin Jansa <martin.jansa@gmail.com> wrote:

> 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.


> On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <ryan.harkin@linaro.org>

> wrote:

>

>> 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.

>>

>> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

>> ---

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

>> ++++++++++++

>>  1 file changed, 12 insertions(+)

>>

>> diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>> index 8c54f28..b647abc 100644

>> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>> @@ -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 \

>> --

>> 2.7.4

>>

>>
<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 22 August 2018 at 17:41, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The &quot;cd ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/&quot; doesn&#39;t seem to be needed, just include the path in 2nd ln parameter.</div></blockquote><div><br></div><div>I don&#39;t think that works, or at least, it doesn&#39;t work for me, so I may be doing something wrong. I&#39;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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The Linux kernel currently expects a single NVRAM file for BCM43430<br>
named brcmfmac43430-sdio.txt.<br>
<br>
Allow the machine to specify an override to link its module specific<br>
NVRAM to the filename expected by the kernel.<br>
<br>
Signed-off-by: Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt;<br>

---<br>
 meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> | 12 ++++++++++++<br>
 1 file changed, 12 insertions(+)<br>
<br>
diff --git a/meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> b/meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
index 8c54f28..b647abc 100644<br>
--- a/meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
+++ b/meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
@@ -226,6 +226,18 @@ do_install() {<br>
        ( cd ${D}${nonarch_base_libdir}/<wbr>firmware ; ln -sf ti-connectivity/* . )<br>
 }<br>
<br>
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a<br>
+# softlink for the module specific NVRAM file to the filename expected<br>
+# by the Linux kernel<br>
+FILES_${PN}-bcm43430-nvram_<wbr>append_bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt&quot;<br>
+do_install_append_bcm43430-<wbr>nvram-mur1dx() {<br>
+       ( cd ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+FILES_${PN}-bcm43430-nvram_<wbr>append_bcm43430-nvram-ap6212 = &quot;${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt&quot;<br>
+do_install_append_bcm43430-<wbr>nvram-ap6212() {<br>
+       ( cd ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+<br>
<br>
 PACKAGES =+ &quot;${PN}-ralink-license ${PN}-ralink \<br>
              ${PN}-mt7601u-license ${PN}-mt7601u \<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div>
</div></div></blockquote></div><br></div></div>
Martin Jansa Aug. 22, 2018, 4:56 p.m. UTC | #3
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 Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin <ryan.harkin@linaro.org> wrote:

>

>

> On 22 August 2018 at 17:41, Martin Jansa <martin.jansa@gmail.com> wrote:

>

>> 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.

>

>

>> On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <ryan.harkin@linaro.org>

>> wrote:

>>

>>> 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.

>>>

>>> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

>>> ---

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

>>> ++++++++++++

>>>  1 file changed, 12 insertions(+)

>>>

>>> diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>>> index 8c54f28..b647abc 100644

>>> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>>> @@ -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 \

>>> --

>>> 2.7.4

>>>

>>>

>
<div dir="ltr"><span style="color:rgb(80,0,80)">cd ${D}${nonarch_base_libdir}/fir</span><span style="color:rgb(80,0,80)">mware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt</span><br><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)">is the same as</span></div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)">ln -sf </span><span style="color:rgb(80,0,80)">brcmfmac43430-sdio.AP6212.txt </span><span style="color:rgb(80,0,80)">${D}${nonarch_base_libdir}/fir</span><span style="color:rgb(80,0,80)">mware/brcm/</span><span style="color:rgb(80,0,80)">brcmfmac43430-sdio.txt</span></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 22 August 2018 at 17:41, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The &quot;cd ${D}${nonarch_base_libdir}/firmware/brcm/&quot; doesn&#39;t seem to be needed, just include the path in 2nd ln parameter.</div></blockquote><div><br></div><div>I don&#39;t think that works, or at least, it doesn&#39;t work for me, so I may be doing something wrong. I&#39;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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-6311599830852990523HOEnZb"><div class="m_-6311599830852990523h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The Linux kernel currently expects a single NVRAM file for BCM43430<br>
named brcmfmac43430-sdio.txt.<br>
<br>
Allow the machine to specify an override to link its module specific<br>
NVRAM to the filename expected by the kernel.<br>
<br>
Signed-off-by: Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt;<br>

---<br>
 meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> | 12 ++++++++++++<br>
 1 file changed, 12 insertions(+)<br>
<br>
diff --git a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
index 8c54f28..b647abc 100644<br>
--- a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
+++ b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
@@ -226,6 +226,18 @@ do_install() {<br>
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )<br>
 }<br>
<br>
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a<br>
+# softlink for the module specific NVRAM file to the filename expected<br>
+# by the Linux kernel<br>
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
+do_install_append_bcm43430-nvram-mur1dx() {<br>
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = &quot;${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
+do_install_append_bcm43430-nvram-ap6212() {<br>
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+<br>
<br>
 PACKAGES =+ &quot;${PN}-ralink-license ${PN}-ralink \<br>
              ${PN}-mt7601u-license ${PN}-mt7601u \<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div>
</div></div></blockquote></div><br></div></div>
</blockquote></div>
Ryan Harkin Aug. 22, 2018, 5:11 p.m. UTC | #4
This is curious!

On 22 August 2018 at 17:56, Martin Jansa <martin.jansa@gmail.com> wrote:

> 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?



> On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin <ryan.harkin@linaro.org>

> wrote:

>

>>

>>

>> On 22 August 2018 at 17:41, Martin Jansa <martin.jansa@gmail.com> wrote:

>>

>>> 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.

>>

>>

>>> On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <ryan.harkin@linaro.org>

>>> wrote:

>>>

>>>> 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.

>>>>

>>>> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

>>>> ---

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

>>>> ++++++++++++

>>>>  1 file changed, 12 insertions(+)

>>>>

>>>> diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>>>> index 8c54f28..b647abc 100644

>>>> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>>>> @@ -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 \

>>>> --

>>>> 2.7.4

>>>>

>>>>

>>
<div dir="ltr">This is curious!<br><div class="gmail_extra"><br><div class="gmail_quote">On 22 August 2018 at 17:56, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="gmail-"><span style="color:rgb(80,0,80)">cd ${D}${nonarch_base_libdir}/fir</span><span style="color:rgb(80,0,80)"><wbr>mware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt</span><br><div><span style="color:rgb(80,0,80)"><br></span></div></span><div><span style="color:rgb(80,0,80)">is the same as</span></div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)">ln -sf </span><span style="color:rgb(80,0,80)">brcmfmac43430-sdio.AP6212.<wbr>txt </span><span style="color:rgb(80,0,80)">${D}${nonarch_base_libdir}<wbr>/fir</span><span style="color:rgb(80,0,80)">mware/brcm/</span><span style="color:rgb(80,0,80)">brcmfmac43430-<wbr>sdio.txt</span></div></div></blockquote><div><br></div><div>On my system, this is what happens when I&#39;m in the root of the linux-firmware repo:<br></div><div><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">$ ls -al brcm/*.txt<br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt</div><br class="gmail-Apple-interchange-newline"><div>$ ln -sf brcm/brcmfmac43430-sdio.AP6212.txt brcm/brcmfmac43430-sdio.txt<br></div><div><br></div><div>$ ls -al brcm/*.txt<br></div><div>-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt</div><div>-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt</div><div>lrwxrwxrwx 1 ryan ryan  34 Aug 22 18:08 brcm/brcmfmac43430-sdio.txt -&gt; brcm/brcmfmac43430-sdio.AP6212.txt</div><div><br></div><div>And the file is not valid.</div><div><br></div><div>$ cat brcm/brcmfmac43430-sdio.txt</div><div>cat: brcm/brcmfmac43430-sdio.txt: No such file or directory</div><div><br></div><div>So perhaps I&#39;m doing something wrong. I tried your suggestion originally and it didn&#39;t work for me. Maybe I made a typo or something?</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 22 August 2018 at 17:41, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The &quot;cd ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/&quot; doesn&#39;t seem to be needed, just include the path in 2nd ln parameter.</div></blockquote><div><br></div><div>I don&#39;t think that works, or at least, it doesn&#39;t work for me, so I may be doing something wrong. I&#39;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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-m_5502182029538994976m_-6311599830852990523HOEnZb"><div class="gmail-m_5502182029538994976m_-6311599830852990523h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The Linux kernel currently expects a single NVRAM file for BCM43430<br>
named brcmfmac43430-sdio.txt.<br>
<br>
Allow the machine to specify an override to link its module specific<br>
NVRAM to the filename expected by the kernel.<br>
<br>
Signed-off-by: Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt;<br>

---<br>
 meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> | 12 ++++++++++++<br>
 1 file changed, 12 insertions(+)<br>
<br>
diff --git a/meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> b/meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
index 8c54f28..b647abc 100644<br>
--- a/meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
+++ b/meta/recipes-kernel/linux-<wbr>firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
@@ -226,6 +226,18 @@ do_install() {<br>
        ( cd ${D}${nonarch_base_libdir}/<wbr>firmware ; ln -sf ti-connectivity/* . )<br>
 }<br>
<br>
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a<br>
+# softlink for the module specific NVRAM file to the filename expected<br>
+# by the Linux kernel<br>
+FILES_${PN}-bcm43430-nvram_<wbr>append_bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt&quot;<br>
+do_install_append_bcm43430-<wbr>nvram-mur1dx() {<br>
+       ( cd ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+FILES_${PN}-bcm43430-nvram_<wbr>append_bcm43430-nvram-ap6212 = &quot;${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt&quot;<br>
+do_install_append_bcm43430-<wbr>nvram-ap6212() {<br>
+       ( cd ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+<br>
<br>
 PACKAGES =+ &quot;${PN}-ralink-license ${PN}-ralink \<br>
              ${PN}-mt7601u-license ${PN}-mt7601u \<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div>
</div></div></blockquote></div><br></div></div>
</blockquote></div>
</div></div></blockquote></div><br></div></div>
Martin Jansa Aug. 22, 2018, 7:02 p.m. UTC | #5
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).

On Wed, Aug 22, 2018 at 7:11 PM Ryan Harkin <ryan.harkin@linaro.org> wrote:

> This is curious!

>

> On 22 August 2018 at 17:56, Martin Jansa <martin.jansa@gmail.com> wrote:

>

>> 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?

>

>

>

>> On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin <ryan.harkin@linaro.org>

>> wrote:

>>

>>>

>>>

>>> On 22 August 2018 at 17:41, Martin Jansa <martin.jansa@gmail.com> wrote:

>>>

>>>> 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.

>>>

>>>

>>>> On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <ryan.harkin@linaro.org>

>>>> wrote:

>>>>

>>>>> 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.

>>>>>

>>>>> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

>>>>> ---

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

>>>>> ++++++++++++

>>>>>  1 file changed, 12 insertions(+)

>>>>>

>>>>> diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>>>>> index 8c54f28..b647abc 100644

>>>>> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>>>>> @@ -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 \

>>>>> --

>>>>> 2.7.4

>>>>>

>>>>>

>>>

>
<div dir="ltr">Your 1st parameter is wrong, compare again with the example I gave you (don&#39;t include &quot;brcm/&quot; 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).</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 7:11 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This is curious!<br><div class="gmail_extra"><br><div class="gmail_quote">On 22 August 2018 at 17:56, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="m_8590662322490689065gmail-"><span style="color:rgb(80,0,80)">cd ${D}${nonarch_base_libdir}/fir</span><span style="color:rgb(80,0,80)">mware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt</span><br><div><span style="color:rgb(80,0,80)"><br></span></div></span><div><span style="color:rgb(80,0,80)">is the same as</span></div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)">ln -sf </span><span style="color:rgb(80,0,80)">brcmfmac43430-sdio.AP6212.txt </span><span style="color:rgb(80,0,80)">${D}${nonarch_base_libdir}/fir</span><span style="color:rgb(80,0,80)">mware/brcm/</span><span style="color:rgb(80,0,80)">brcmfmac43430-sdio.txt</span></div></div></blockquote><div><br></div><div>On my system, this is what happens when I&#39;m in the root of the linux-firmware repo:<br></div><div><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">$ ls -al brcm/*.txt<br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt</div><br class="m_8590662322490689065gmail-Apple-interchange-newline"><div>$ ln -sf brcm/brcmfmac43430-sdio.AP6212.txt brcm/brcmfmac43430-sdio.txt<br></div><div><br></div><div>$ ls -al brcm/*.txt<br></div><div>-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt</div><div>-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt</div><div>lrwxrwxrwx 1 ryan ryan  34 Aug 22 18:08 brcm/brcmfmac43430-sdio.txt -&gt; brcm/brcmfmac43430-sdio.AP6212.txt</div><div><br></div><div>And the file is not valid.</div><div><br></div><div>$ cat brcm/brcmfmac43430-sdio.txt</div><div>cat: brcm/brcmfmac43430-sdio.txt: No such file or directory</div><div><br></div><div>So perhaps I&#39;m doing something wrong. I tried your suggestion originally and it didn&#39;t work for me. Maybe I made a typo or something?</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_8590662322490689065gmail-HOEnZb"><div class="m_8590662322490689065gmail-h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 22 August 2018 at 17:41, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The &quot;cd ${D}${nonarch_base_libdir}/firmware/brcm/&quot; doesn&#39;t seem to be needed, just include the path in 2nd ln parameter.</div></blockquote><div><br></div><div>I don&#39;t think that works, or at least, it doesn&#39;t work for me, so I may be doing something wrong. I&#39;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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_8590662322490689065gmail-m_5502182029538994976m_-6311599830852990523HOEnZb"><div class="m_8590662322490689065gmail-m_5502182029538994976m_-6311599830852990523h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The Linux kernel currently expects a single NVRAM file for BCM43430<br>
named brcmfmac43430-sdio.txt.<br>
<br>
Allow the machine to specify an override to link its module specific<br>
NVRAM to the filename expected by the kernel.<br>
<br>
Signed-off-by: Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt;<br>

---<br>
 meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> | 12 ++++++++++++<br>
 1 file changed, 12 insertions(+)<br>
<br>
diff --git a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a> b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
index 8c54f28..b647abc 100644<br>
--- a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
+++ b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer" target="_blank">linux-firmware_git.bb</a><br>
@@ -226,6 +226,18 @@ do_install() {<br>
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )<br>
 }<br>
<br>
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a<br>
+# softlink for the module specific NVRAM file to the filename expected<br>
+# by the Linux kernel<br>
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
+do_install_append_bcm43430-nvram-mur1dx() {<br>
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = &quot;${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
+do_install_append_bcm43430-nvram-ap6212() {<br>
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+<br>
<br>
 PACKAGES =+ &quot;${PN}-ralink-license ${PN}-ralink \<br>
              ${PN}-mt7601u-license ${PN}-mt7601u \<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div>
</div></div></blockquote></div><br></div></div>
</blockquote></div>
</div></div></blockquote></div><br></div></div>
</blockquote></div>
Ryan Harkin Aug. 22, 2018, 8:10 p.m. UTC | #6
On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com> 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?


On Wed, Aug 22, 2018 at 7:11 PM Ryan Harkin <ryan.harkin@linaro.org> wrote:
>

>> This is curious!

>>

>> On 22 August 2018 at 17:56, Martin Jansa <martin.jansa@gmail.com> wrote:

>>

>>> 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?

>>

>>

>>

>>> On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin <ryan.harkin@linaro.org>

>>> wrote:

>>>

>>>>

>>>>

>>>> On 22 August 2018 at 17:41, Martin Jansa <martin.jansa@gmail.com>

>>>> wrote:

>>>>

>>>>> 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.

>>>>

>>>>

>>>>> On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <ryan.harkin@linaro.org>

>>>>> wrote:

>>>>>

>>>>>> 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.

>>>>>>

>>>>>> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

>>>>>> ---

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

>>>>>> ++++++++++++

>>>>>>  1 file changed, 12 insertions(+)

>>>>>>

>>>>>> diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>>>>>> index 8c54f28..b647abc 100644

>>>>>> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>>>>>> @@ -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 \

>>>>>> --

>>>>>> 2.7.4

>>>>>>

>>>>>>

>>>>

>>
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Wed, 22 Aug 2018, 20:02 Martin Jansa, &lt;<a href="mailto:martin.jansa@gmail.com">martin.jansa@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Your 1st parameter is wrong, compare again with the example I gave you (don&#39;t include &quot;brcm/&quot; 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).</div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">That doesn&#39;t work either. I tried it with the same result, but didn&#39;t send a log of it. That works for you?</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 7:11 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This is curious!<br><div class="gmail_extra"><br><div class="gmail_quote">On 22 August 2018 at 17:56, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank" rel="noreferrer">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="m_5050295636052634530m_8590662322490689065gmail-"><span style="color:rgb(80,0,80)">cd ${D}${nonarch_base_libdir}/fir</span><span style="color:rgb(80,0,80)">mware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt</span><br><div><span style="color:rgb(80,0,80)"><br></span></div></span><div><span style="color:rgb(80,0,80)">is the same as</span></div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)">ln -sf </span><span style="color:rgb(80,0,80)">brcmfmac43430-sdio.AP6212.txt </span><span style="color:rgb(80,0,80)">${D}${nonarch_base_libdir}/fir</span><span style="color:rgb(80,0,80)">mware/brcm/</span><span style="color:rgb(80,0,80)">brcmfmac43430-sdio.txt</span></div></div></blockquote><div><br></div><div>On my system, this is what happens when I&#39;m in the root of the linux-firmware repo:<br></div><div><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">$ ls -al brcm/*.txt<br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt</div><br class="m_5050295636052634530m_8590662322490689065gmail-Apple-interchange-newline"><div>$ ln -sf brcm/brcmfmac43430-sdio.AP6212.txt brcm/brcmfmac43430-sdio.txt<br></div><div><br></div><div>$ ls -al brcm/*.txt<br></div><div>-rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt</div><div>-rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt</div><div>lrwxrwxrwx 1 ryan ryan  34 Aug 22 18:08 brcm/brcmfmac43430-sdio.txt -&gt; brcm/brcmfmac43430-sdio.AP6212.txt</div><div><br></div><div>And the file is not valid.</div><div><br></div><div>$ cat brcm/brcmfmac43430-sdio.txt</div><div>cat: brcm/brcmfmac43430-sdio.txt: No such file or directory</div><div><br></div><div>So perhaps I&#39;m doing something wrong. I tried your suggestion originally and it didn&#39;t work for me. Maybe I made a typo or something?</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_5050295636052634530m_8590662322490689065gmail-HOEnZb"><div class="m_5050295636052634530m_8590662322490689065gmail-h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 22 August 2018 at 17:41, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank" rel="noreferrer">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The &quot;cd ${D}${nonarch_base_libdir}/firmware/brcm/&quot; doesn&#39;t seem to be needed, just include the path in 2nd ln parameter.</div></blockquote><div><br></div><div>I don&#39;t think that works, or at least, it doesn&#39;t work for me, so I may be doing something wrong. I&#39;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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_5050295636052634530m_8590662322490689065gmail-m_5502182029538994976m_-6311599830852990523HOEnZb"><div class="m_5050295636052634530m_8590662322490689065gmail-m_5502182029538994976m_-6311599830852990523h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The Linux kernel currently expects a single NVRAM file for BCM43430<br>
named brcmfmac43430-sdio.txt.<br>
<br>
Allow the machine to specify an override to link its module specific<br>
NVRAM to the filename expected by the kernel.<br>
<br>
Signed-off-by: Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt;<br>

---<br>
 meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a> | 12 ++++++++++++<br>
 1 file changed, 12 insertions(+)<br>
<br>
diff --git a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a> b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a><br>
index 8c54f28..b647abc 100644<br>
--- a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a><br>
+++ b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a><br>
@@ -226,6 +226,18 @@ do_install() {<br>
        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )<br>
 }<br>
<br>
+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a<br>
+# softlink for the module specific NVRAM file to the filename expected<br>
+# by the Linux kernel<br>
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
+do_install_append_bcm43430-nvram-mur1dx() {<br>
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = &quot;${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
+do_install_append_bcm43430-nvram-ap6212() {<br>
+       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)<br>
+}<br>
+<br>
<br>
 PACKAGES =+ &quot;${PN}-ralink-license ${PN}-ralink \<br>
              ${PN}-mt7601u-license ${PN}-mt7601u \<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div>
</div></div></blockquote></div><br></div></div>
</blockquote></div>
</div></div></blockquote></div><br></div></div>
</blockquote></div>
</blockquote></div></div></div>
Khem Raj Aug. 22, 2018, 8:36 p.m. UTC | #7
I wonder how it work with meta-raspverrypi now that it has its own
packing for firmware
On Wed, Aug 22, 2018 at 1:10 PM Ryan Harkin <ryan.harkin@linaro.org> wrote:
>

>

>

> On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com> 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?

>

>

>> On Wed, Aug 22, 2018 at 7:11 PM Ryan Harkin <ryan.harkin@linaro.org> wrote:

>>>

>>> This is curious!

>>>

>>> On 22 August 2018 at 17:56, Martin Jansa <martin.jansa@gmail.com> wrote:

>>>>

>>>> 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

>>> -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?

>>>

>>>

>>>>

>>>> On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin <ryan.harkin@linaro.org> wrote:

>>>>>

>>>>>

>>>>>

>>>>> On 22 August 2018 at 17:41, Martin Jansa <martin.jansa@gmail.com> wrote:

>>>>>>

>>>>>> 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.

>>>>>

>>>>>>

>>>>>> On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <ryan.harkin@linaro.org> wrote:

>>>>>>>

>>>>>>> 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.

>>>>>>>

>>>>>>> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

>>>>>>> ---

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

>>>>>>>  1 file changed, 12 insertions(+)

>>>>>>>

>>>>>>> diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

>>>>>>> index 8c54f28..b647abc 100644

>>>>>>> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>>>>>>> @@ -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 \

>>>>>>> --

>>>>>>> 2.7.4

>>>>>>>

>>>>>

>>>

> --

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Andre McCurdy Aug. 22, 2018, 8:42 p.m. UTC | #8
On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin <ryan.harkin@linaro.org> wrote:
> On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com> 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
Ryan Harkin Aug. 22, 2018, 9:52 p.m. UTC | #9
On Wed, 22 Aug 2018, 21:36 Khem Raj, <raj.khem@gmail.com> 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.


On Wed, Aug 22, 2018 at 1:10 PM Ryan Harkin <ryan.harkin@linaro.org> wrote:
> >

> >

> >

> > On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com> 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?

> >

> >

> >> On Wed, Aug 22, 2018 at 7:11 PM Ryan Harkin <ryan.harkin@linaro.org>

> wrote:

> >>>

> >>> This is curious!

> >>>

> >>> On 22 August 2018 at 17:56, Martin Jansa <martin.jansa@gmail.com>

> wrote:

> >>>>

> >>>> 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

> >>> -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?

> >>>

> >>>

> >>>>

> >>>> On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin <ryan.harkin@linaro.org>

> wrote:

> >>>>>

> >>>>>

> >>>>>

> >>>>> On 22 August 2018 at 17:41, Martin Jansa <martin.jansa@gmail.com>

> wrote:

> >>>>>>

> >>>>>> 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.

> >>>>>

> >>>>>>

> >>>>>> On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <ryan.harkin@linaro.org>

> wrote:

> >>>>>>>

> >>>>>>> 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.

> >>>>>>>

> >>>>>>> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

> >>>>>>> ---

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

> ++++++++++++

> >>>>>>>  1 file changed, 12 insertions(+)

> >>>>>>>

> >>>>>>> diff --git a/meta/recipes-kernel/linux-firmware/

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

> linux-firmware_git.bb

> >>>>>>> index 8c54f28..b647abc 100644

> >>>>>>> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

> >>>>>>> @@ -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 \

> >>>>>>> --

> >>>>>>> 2.7.4

> >>>>>>>

> >>>>>

> >>>

> > --

> > _______________________________________________

> > Openembedded-core mailing list

> > Openembedded-core@lists.openembedded.org

> > http://lists.openembedded.org/mailman/listinfo/openembedded-core

>
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Wed, 22 Aug 2018, 21:36 Khem Raj, &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I wonder how it work with meta-raspverrypi now that it has its own<br>
packing for firmware<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Sorry Them, I don&#39;t understand your question.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Aug 22, 2018 at 1:10 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Wed, 22 Aug 2018, 20:02 Martin Jansa, &lt;<a href="mailto:martin.jansa@gmail.com" target="_blank" rel="noreferrer">martin.jansa@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Your 1st parameter is wrong, compare again with the example I gave you (don&#39;t include &quot;brcm/&quot; 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).<br>
&gt;<br>
&gt;<br>
&gt; That doesn&#39;t work either. I tried it with the same result, but didn&#39;t send a log of it. That works for you?<br>
&gt;<br>
&gt;<br>
&gt;&gt; On Wed, Aug 22, 2018 at 7:11 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; This is curious!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 22 August 2018 at 17:56, Martin Jansa &lt;<a href="mailto:martin.jansa@gmail.com" target="_blank" rel="noreferrer">martin.jansa@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; is the same as<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On my system, this is what happens when I&#39;m in the root of the linux-firmware repo:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; $ ls -al brcm/*.txt<br>
&gt;&gt;&gt; -rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt<br>
&gt;&gt;&gt; -rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; $ ln -sf brcm/brcmfmac43430-sdio.AP6212.txt brcm/brcmfmac43430-sdio.txt<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; $ ls -al brcm/*.txt<br>
&gt;&gt;&gt; -rw-rw-r-- 1 ryan ryan 875 Aug 22 18:08 brcm/brcmfmac43430-sdio.AP6212.txt<br>
&gt;&gt;&gt; -rw-rw-r-- 1 ryan ryan 831 Aug 21 14:48 brcm/brcmfmac43430-sdio.MUR1DX.txt<br>
&gt;&gt;&gt; lrwxrwxrwx 1 ryan ryan  34 Aug 22 18:08 brcm/brcmfmac43430-sdio.txt -&gt; brcm/brcmfmac43430-sdio.AP6212.txt<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; And the file is not valid.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; $ cat brcm/brcmfmac43430-sdio.txt<br>
&gt;&gt;&gt; cat: brcm/brcmfmac43430-sdio.txt: No such file or directory<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; So perhaps I&#39;m doing something wrong. I tried your suggestion originally and it didn&#39;t work for me. Maybe I made a typo or something?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Wed, Aug 22, 2018 at 6:47 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On 22 August 2018 at 17:41, Martin Jansa &lt;<a href="mailto:martin.jansa@gmail.com" target="_blank" rel="noreferrer">martin.jansa@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; The &quot;cd ${D}${nonarch_base_libdir}/firmware/brcm/&quot; doesn&#39;t seem to be needed, just include the path in 2nd ln parameter.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I don&#39;t think that works, or at least, it doesn&#39;t work for me, so I may be doing something wrong. I&#39;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.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; The Linux kernel currently expects a single NVRAM file for BCM43430<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; named brcmfmac43430-sdio.txt.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Allow the machine to specify an override to link its module specific<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; NVRAM to the filename expected by the kernel.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Signed-off-by: Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; ---<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;  meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a> | 12 ++++++++++++<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;  1 file changed, 12 insertions(+)<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; diff --git a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a> b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; index 8c54f28..b647abc 100644<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; --- a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +++ b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb" rel="noreferrer noreferrer" target="_blank">linux-firmware_git.bb</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; @@ -226,6 +226,18 @@ do_install() {<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;         ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;  }<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +# softlink for the module specific NVRAM file to the filename expected<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +# by the Linux kernel<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +do_install_append_bcm43430-nvram-mur1dx() {<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +}<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = &quot;${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +do_install_append_bcm43430-nvram-ap6212() {<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +}<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; +<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;  PACKAGES =+ &quot;${PN}-ralink-license ${PN}-ralink \<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;               ${PN}-mt7601u-license ${PN}-mt7601u \<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; 2.7.4<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt; --<br>
&gt; _______________________________________________<br>
&gt; Openembedded-core mailing list<br>
&gt; <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank" rel="noreferrer">Openembedded-core@lists.openembedded.org</a><br>
&gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div></div></div>
Ryan Harkin Aug. 22, 2018, 9:56 p.m. UTC | #10
On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com> wrote:

> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin <ryan.harkin@linaro.org>

> wrote:

> > On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com> 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.

>
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Wed, 22 Aug 2018, 21:42 Andre McCurdy, &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank" rel="noreferrer">ryan.harkin@linaro.org</a>&gt; wrote:<br>
&gt; On Wed, 22 Aug 2018, 20:02 Martin Jansa, &lt;<a href="mailto:martin.jansa@gmail.com" target="_blank" rel="noreferrer">martin.jansa@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Your 1st parameter is wrong, compare again with the example I gave you<br>
&gt;&gt; (don&#39;t include &quot;brcm/&quot; path in 1st param, because you want the symlink to<br>
&gt;&gt; point to just brcmfmac43430-sdio.AP6212.txt like you did in the version<br>
&gt;&gt; after cd).<br>
&gt;<br>
&gt; That doesn&#39;t work either. I tried it with the same result, but didn&#39;t send a<br>
&gt; log of it. That works for you?<br>
<br>
Martin&#39;s example is correct so maybe check your tests again for typos.<br>
It it still doesn&#39;t work then please do send a log.<br>
<br>
The link will point to whatever you define via the first parameter, so<br>
if you changed the first parameter it shouldn&#39;t be possible to get<br>
&quot;the same result&quot;.<br>
<br>
  $ mkdir foo<br>
  $ ln -sf test_target foo/test1<br>
  $ ln -sf brcm/test_target foo/test2<br>
  $ ls -l foo<br>
<br>
  lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -&gt; test_target<br>
  lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -&gt; brcm/test_target<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes, that&#39;s essentially the same as what I&#39;m getting.</div><div dir="auto"><br></div><div dir="auto">Now try &quot;cat foo/test1&quot; and what happens? </div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>
Andre McCurdy Aug. 22, 2018, 10:55 p.m. UTC | #11
On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org> wrote:
> On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com> wrote:

>> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin <ryan.harkin@linaro.org>

>> wrote:

>> > On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com> 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).
Ryan Harkin Aug. 23, 2018, 6:12 a.m. UTC | #12
On 22 August 2018 at 23:55, Andre McCurdy <armccurdy@gmail.com> wrote:

> On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org>

> wrote:

> > On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com> wrote:

> >> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin <ryan.harkin@linaro.org>

> >> wrote:

> >> > On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com>

> 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.
<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 22 August 2018 at 23:55, Andre McCurdy <span dir="ltr">&lt;<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt; wrote:<br>
&gt; On Wed, 22 Aug 2018, 21:42 Andre McCurdy, &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br>
&gt;&gt; On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; On Wed, 22 Aug 2018, 20:02 Martin Jansa, &lt;<a href="mailto:martin.jansa@gmail.com">martin.jansa@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Your 1st parameter is wrong, compare again with the example I gave you<br>
&gt;&gt; &gt;&gt; (don&#39;t include &quot;brcm/&quot; path in 1st param, because you want the symlink<br>
&gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; point to just brcmfmac43430-sdio.AP6212.txt like you did in the version<br>
&gt;&gt; &gt;&gt; after cd).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; That doesn&#39;t work either. I tried it with the same result, but didn&#39;t<br>
&gt;&gt; &gt; send a<br>
&gt;&gt; &gt; log of it. That works for you?<br>
&gt;&gt;<br>
&gt;&gt; Martin&#39;s example is correct so maybe check your tests again for typos.<br>
&gt;&gt; It it still doesn&#39;t work then please do send a log.<br>
&gt;&gt;<br>
&gt;&gt; The link will point to whatever you define via the first parameter, so<br>
&gt;&gt; if you changed the first parameter it shouldn&#39;t be possible to get<br>
&gt;&gt; &quot;the same result&quot;.<br>
&gt;&gt;<br>
&gt;&gt;   $ mkdir foo<br>
&gt;&gt;   $ ln -sf test_target foo/test1<br>
&gt;&gt;   $ ln -sf brcm/test_target foo/test2<br>
&gt;&gt;   $ ls -l foo<br>
&gt;&gt;<br>
&gt;&gt;   lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -&gt; test_target<br>
&gt;&gt;   lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -&gt; brcm/test_target<br>
&gt;<br>
&gt; Yes, that&#39;s essentially the same as what I&#39;m getting.<br>
&gt;<br>
&gt; Now try &quot;cat foo/test1&quot; and what happens?<br>
&gt;<br>
&gt; There is no file called test_target in the foo directory. And neither is<br>
&gt; there a file called brcm/test_target in the foo directory.<br>
<br>
</div></div>Correct. The above was just an example to show that you can * create<br>
symlinks * in the foo directory without cd&#39;ing into the foo directory<br>
first.<br>
<br>
If you&#39;d like the symlinks in the example to point to valid targets<br>
then you need to create the targets too, e.g.<br>
<br>
  $ mkdir -p foo/brcm<br>
  $ echo hello &gt; foo/test_target<br>
  $ echo hello2 &gt; foo/brcm/test_target<br>
<br>
But note that the process of creating a symlink is always the same,<br>
regardless of whether the symlink points to a valid target or not (so<br>
you can run these extra commands to create the targets before or after<br>
you create the symlinks).<br></blockquote><div><br></div><div>So that doesn&#39;t work for me how I expect it to work. I must be missing something fundamental here.</div></div><br></div><div class="gmail_extra">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.</div><div class="gmail_extra"><br></div><div class="gmail_extra">So, to copy your example, but creating the file &quot;test_target&quot; from the start:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">$ mkdir -p /tmp/test</div><div class="gmail_extra">$ cd /tmp/test<br></div><div class="gmail_extra">$ mkdir foo<br></div><div class="gmail_extra">$ echo 1 &gt; test_target<br></div><div class="gmail_extra">$ ln -sf test_target foo/test1<br></div><div class="gmail_extra">$ ln -sf brcm/test_target foo/test2<br></div><div class="gmail_extra">$ ls -l foo<br></div><div class="gmail_extra">total 0</div><div class="gmail_extra">lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -&gt; test_target</div><div class="gmail_extra">lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -&gt; brcm/test_target</div><div class="gmail_extra">$ cat test_target<br></div><div class="gmail_extra">1</div><div class="gmail_extra">$ cat foo/test1<br></div><div class="gmail_extra">cat: foo/test1: No such file or directory</div><div class="gmail_extra">$ cat foo/test2<br></div><div class="gmail_extra">cat: foo/test2: No such file or directory</div><div class="gmail_extra">$ echo hello &gt; foo/test_target<br></div><div class="gmail_extra">$ echo hello2 &gt; foo/brcm/test_target<br></div><div class="gmail_extra">bash: foo/brcm/test_target: No such file or directory</div><div class="gmail_extra">$ cat foo/test1<br></div><div class="gmail_extra">hello</div><div class="gmail_extra">$ cat foo/test2<br></div><div class="gmail_extra">cat: foo/test2: No such file or directory</div><div class="gmail_extra">$ cat test_target<br></div><div class="gmail_extra">1</div><div><div>$ tree</div><div>.</div><div>├── foo</div><div>│   ├── test1 -&gt; test_target</div><div>│   ├── test2 -&gt; brcm/test_target</div><div>│   └── test_target</div><div>└── test_target</div><div><br></div><div>1 directory, 4 files</div></div><div><br></div><div>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&#39;t exist.</div><div><br></div><div>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.</div><div><br></div><div>So, this will work:</div><div><br></div><div>$cd /tmp/test</div><div><div>$ ln -sf ../test_target foo/test3</div><div>$ cat foo/test3<br></div><div>1</div></div><div><div>$ cat /tmp/test/foo/test3</div><div>1</div></div><div><br></div><div>But that is a strange way to create the soft link, IMO.</div><div><br></div><div>AFAICT, for the recipe, to get rid of the &quot;cd&quot;, I&#39;d have to specify an absolute path to the original file:</div><div><br></div><div><div>+do_install_append_bcm43430-nvram-mur1dx() {</div><div>+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">${D}${nonarch_base_libdir}/firmware/brcm/</span>brcmfmac43430-sdio.txt)</div></div><div><br></div><div>... assuming PWD is available to the recipe. There will be a proper Yocto variable I can use, of course, but I can&#39;t think of it right now.</div><div><br></div><div>Either way, Martin&#39;s example doesn&#39;t work for me. And adding the absolute path of the original file doesn&#39;t seem any neater or clearer than following the TI example from the do_install a few lines up in the recipe. But I&#39;m happy to do it either way, so long as it works.</div></div></div>
Martin Hundebøll Aug. 23, 2018, 6:39 a.m. UTC | #13
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

On 23/08/2018 08.12, Ryan Harkin wrote:
> 

> 

> On 22 August 2018 at 23:55, Andre McCurdy <armccurdy@gmail.com 

> <mailto:armccurdy@gmail.com>> wrote:

> 

>     On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org

>     <mailto:ryan.harkin@linaro.org>> wrote:

>      > On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com

>     <mailto:armccurdy@gmail.com>> wrote:

>      >> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin

>     <ryan.harkin@linaro.org <mailto:ryan.harkin@linaro.org>>

>      >> wrote:

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

>     <martin.jansa@gmail.com <mailto:martin.jansa@gmail.com>> 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.

> 


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

+45 61 65 54 61
martin@geanix.com

Geanix IVS
https://geanix.com
DK39600706
Andre McCurdy Aug. 23, 2018, 7:06 a.m. UTC | #14
On Wed, Aug 22, 2018 at 11:12 PM, Ryan Harkin <ryan.harkin@linaro.org> wrote:
> On 22 August 2018 at 23:55, Andre McCurdy <armccurdy@gmail.com> wrote:

>> On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org>

>> wrote:

>> > On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com> wrote:

>> >> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin <ryan.harkin@linaro.org>

>> >> wrote:

>> >> > On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com>

>> >> > 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


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.

> $ 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.

> $ 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.

> $ 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


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

> 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.

> 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.

> 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.

> 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.

> 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?

> 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.


That definitely doesn't look right...

> 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.
Ryan Harkin Aug. 23, 2018, 7:08 a.m. UTC | #15
On 23 August 2018 at 07:39, Martin Hundebøll <martin@geanix.com> wrote:

> 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]



> // Martin

>

> On 23/08/2018 08.12, Ryan Harkin wrote:

>

>>

>>

>> On 22 August 2018 at 23:55, Andre McCurdy <armccurdy@gmail.com <mailto:

>> armccurdy@gmail.com>> wrote:

>>

>>     On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org

>>     <mailto:ryan.harkin@linaro.org>> wrote:

>>      > On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com

>>     <mailto:armccurdy@gmail.com>> wrote:

>>      >> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin

>>     <ryan.harkin@linaro.org <mailto:ryan.harkin@linaro.org>>

>>      >> wrote:

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

>>     <martin.jansa@gmail.com <mailto:martin.jansa@gmail.com>> 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.

>>

>>

> --

> Kind regards,

> Martin Hundebøll

> Embedded Linux Consultant

>

> +45 61 65 54 61

> martin@geanix.com

>

> Geanix IVS

> https://geanix.com

> DK39600706

>
<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 23 August 2018 at 07:39, Martin Hundebøll <span dir="ltr">&lt;<a href="mailto:martin@geanix.com" target="_blank">martin@geanix.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">May I suggest using the &#39;-r, --relative&#39; flag from &#39;ln&#39;:<br>
<br>
       -r, --relative<br>
              create symbolic links relative to link location<br>
<br>
My life felt considerably better after discovering that feature :)<br></blockquote><div><br></div><div>Thanks Martin <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hundebøll</span>! Yes, that works for me.</div><div><br></div><div>So, Martin Jansa, I could make this change:</div><div><br></div><div><span style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">-       ( cd ${D}${nonarch_base_libdir}/</span><wbr style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)</span></div><div><span style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">+      ( </span><span style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">ln -sfr <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">${D}${nonarch_base_libdir}/</span><wbr style="text-decoration-style:initial;text-decoration-color:initial"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">firmware/brcm/</span>brcmfmac43430-sdio.MUR1DX.txt <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">${D}${nonarch_base_libdir}/</span><wbr style="text-decoration-style:initial;text-decoration-color:initial"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">firmware/brcm/</span>brcmfmac43430-sdio.txt)</span><br style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Of course, if I&#39;m not going to &quot;cd&quot; into the firmware repo, I&#39;ll have to use absolute paths on both sides of the &quot;ln&quot; command anyway. So I could drop the &#39;r&#39; param and it should still work. Eg:</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">-       ( cd ${D}${nonarch_base_libdir}/</span><wbr style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)</span></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">+      (<span> </span></span><span style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">ln -sf <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">${D}${nonarch_base_libdir}/</span><wbr style="text-decoration-style:initial;text-decoration-color:initial"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">firmware/brcm/</span>brcmfmac43430-sdio.MUR1DX.txt<span> </span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">${D}${nonarch_base_libdir}/</span><wbr style="text-decoration-style:initial;text-decoration-color:initial"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">firmware/brcm/</span>brcmfmac43430-sdio.txt)</span><br style="color:rgb(80,0,80);font-size:11.2px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"></div></div><div><br></div><div>I&#39;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?</div><div><br></div><div>FWIW, the TI line that I copied was added by Koen Kooi, who I&#39;ve added to the CC:</div><div><br></div><div><div>8c7adb6  2011-10-09  linux-firmware: update, merge in OE classic updates, fix p..       [Koen Kooi]</div></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
// Martin<br>
<br>
On 23/08/2018 08.12, Ryan Harkin wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<br>
<br>
On 22 August 2018 at 23:55, Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a> &lt;mailto:<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>&gt;&gt; wrote:<br>
<br>
    On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a><br></span><span class="gmail-">
    &lt;mailto:<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a><wbr>&gt;&gt; wrote:<br>
     &gt; On Wed, 22 Aug 2018, 21:42 Andre McCurdy, &lt;<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a><br></span><span class="gmail-">
    &lt;mailto:<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>&gt;&gt; wrote:<br>
     &gt;&gt; On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin<br></span>
    &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a> &lt;mailto:<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a><wbr>&gt;&gt;<span class="gmail-"><br>
     &gt;&gt; wrote:<br>
     &gt;&gt; &gt; On Wed, 22 Aug 2018, 20:02 Martin Jansa,<br></span><div><div class="gmail-h5">
    &lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a> &lt;mailto:<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a><wbr>&gt;&gt; wrote:<br>
     &gt;&gt; &gt;&gt;<br>
     &gt;&gt; &gt;&gt; Your 1st parameter is wrong, compare again with the example I<br>
    gave you<br>
     &gt;&gt; &gt;&gt; (don&#39;t include &quot;brcm/&quot; path in 1st param, because you want<br>
    the symlink<br>
     &gt;&gt; &gt;&gt; to<br>
     &gt;&gt; &gt;&gt; point to just brcmfmac43430-sdio.AP6212.txt like you did in<br>
    the version<br>
     &gt;&gt; &gt;&gt; after cd).<br>
     &gt;&gt; &gt;<br>
     &gt;&gt; &gt; That doesn&#39;t work either. I tried it with the same result, but<br>
    didn&#39;t<br>
     &gt;&gt; &gt; send a<br>
     &gt;&gt; &gt; log of it. That works for you?<br>
     &gt;&gt;<br>
     &gt;&gt; Martin&#39;s example is correct so maybe check your tests again for<br>
    typos.<br>
     &gt;&gt; It it still doesn&#39;t work then please do send a log.<br>
     &gt;&gt;<br>
     &gt;&gt; The link will point to whatever you define via the first<br>
    parameter, so<br>
     &gt;&gt; if you changed the first parameter it shouldn&#39;t be possible to get<br>
     &gt;&gt; &quot;the same result&quot;.<br>
     &gt;&gt;<br>
     &gt;&gt;   $ mkdir foo<br>
     &gt;&gt;   $ ln -sf test_target foo/test1<br>
     &gt;&gt;   $ ln -sf brcm/test_target foo/test2<br>
     &gt;&gt;   $ ls -l foo<br>
     &gt;&gt;<br>
     &gt;&gt;   lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -&gt; test_target<br>
     &gt;&gt;   lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -&gt; brcm/test_target<br>
     &gt;<br>
     &gt; Yes, that&#39;s essentially the same as what I&#39;m getting.<br>
     &gt;<br>
     &gt; Now try &quot;cat foo/test1&quot; and what happens?<br>
     &gt;<br>
     &gt; There is no file called test_target in the foo directory. And<br>
    neither is<br>
     &gt; there a file called brcm/test_target in the foo directory.<br>
<br>
    Correct. The above was just an example to show that you can * create<br>
    symlinks * in the foo directory without cd&#39;ing into the foo directory<br>
    first.<br>
<br>
    If you&#39;d like the symlinks in the example to point to valid targets<br>
    then you need to create the targets too, e.g.<br>
<br>
       $ mkdir -p foo/brcm<br>
       $ echo hello &gt; foo/test_target<br>
       $ echo hello2 &gt; foo/brcm/test_target<br>
<br>
    But note that the process of creating a symlink is always the same,<br>
    regardless of whether the symlink points to a valid target or not (so<br>
    you can run these extra commands to create the targets before or after<br>
    you create the symlinks).<br>
<br>
<br>
So that doesn&#39;t work for me how I expect it to work. I must be missing something fundamental here.<br>
<br>
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.<br>
<br>
So, to copy your example, but creating the file &quot;test_target&quot; from the start:<br>
<br>
$ mkdir -p /tmp/test<br>
$ cd /tmp/test<br>
$ mkdir foo<br>
$ echo 1 &gt; test_target<br>
$ ln -sf test_target foo/test1<br>
$ ln -sf brcm/test_target foo/test2<br>
$ ls -l foo<br>
total 0<br>
lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -&gt; test_target<br>
lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -&gt; brcm/test_target<br>
$ cat test_target<br>
1<br>
$ cat foo/test1<br>
cat: foo/test1: No such file or directory<br>
$ cat foo/test2<br>
cat: foo/test2: No such file or directory<br>
$ echo hello &gt; foo/test_target<br>
$ echo hello2 &gt; foo/brcm/test_target<br>
bash: foo/brcm/test_target: No such file or directory<br>
$ cat foo/test1<br>
hello<br>
$ cat foo/test2<br>
cat: foo/test2: No such file or directory<br>
$ cat test_target<br>
1<br>
$ tree<br>
.<br>
├── foo<br>
│   ├── test1 -&gt; test_target<br>
│   ├── test2 -&gt; brcm/test_target<br>
│   └── test_target<br>
└── test_target<br>
<br>
1 directory, 4 files<br>
<br>
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&#39;t exist.<br>
<br>
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.<br>
<br>
So, this will work:<br>
<br>
$cd /tmp/test<br>
$ ln -sf ../test_target foo/test3<br>
$ cat foo/test3<br>
1<br>
$ cat /tmp/test/foo/test3<br>
1<br>
<br>
But that is a strange way to create the soft link, IMO.<br>
<br>
AFAICT, for the recipe, to get rid of the &quot;cd&quot;, I&#39;d have to specify an absolute path to the original file:<br>
<br>
+do_install_append_bcm43430-nv<wbr>ram-mur1dx() {<br>
+       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1<wbr>DX.txt ${D}${nonarch_base_libdir}/fir<wbr>mware/brcm/brcmfmac43430-sdio.<wbr>txt)<br>
<br>
... assuming PWD is available to the recipe. There will be a proper Yocto variable I can use, of course, but I can&#39;t think of it right now.<br>
<br>
Either way, Martin&#39;s example doesn&#39;t work for me. And adding the absolute path of the original file doesn&#39;t seem any neater or clearer than following the TI example from the do_install a few lines up in the recipe. But I&#39;m happy to do it either way, so long as it works.<br>
<br>
</div></div></blockquote><span class="gmail-HOEnZb"><font color="#888888">
<br>
-- <br>
Kind regards,<br>
Martin Hundebøll<br>
Embedded Linux Consultant<br>
<br>
+45 61 65 54 61<br>
<a href="mailto:martin@geanix.com" target="_blank">martin@geanix.com</a><br>
<br>
Geanix IVS<br>
<a href="https://geanix.com" rel="noreferrer" target="_blank">https://geanix.com</a><br>
DK39600706<br>
</font></span></blockquote></div><br></div></div>
Ryan Harkin Aug. 23, 2018, 7:17 a.m. UTC | #16
On 23 August 2018 at 08:06, Andre McCurdy <armccurdy@gmail.com> wrote:
>

> On Wed, Aug 22, 2018 at 11:12 PM, Ryan Harkin <ryan.harkin@linaro.org>

wrote:
> > On 22 August 2018 at 23:55, Andre McCurdy <armccurdy@gmail.com> wrote:

> >> On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org>

> >> wrote:

> >> > On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com>

wrote:
> >> >> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin <ryan.harkin@linaro.org

>

> >> >> wrote:

> >> >> > On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com>

> >> >> > 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

>

> 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:

> 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)



>

>

> > $ 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.

>

> > $ 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.


Well, your example said:

>  $ 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.


>

> > $ 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

>

> No real mysteries here. Everything looks as expected given the

> comments above about how you creating the target files.

>

> > 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.

>

> > 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.

>

> > 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.

>

> > 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.

>

> > 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?

>

> > 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.

>

> That definitely doesn't look right...

>

> > 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.
<div dir="ltr"><br><br>On 23 August 2018 at 08:06, Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br>&gt;<br>&gt; On Wed, Aug 22, 2018 at 11:12 PM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt; wrote:<br>&gt; &gt; On 22 August 2018 at 23:55, Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br>&gt; &gt;&gt; On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt;<br>&gt; &gt;&gt; wrote:<br>&gt; &gt;&gt; &gt; On Wed, 22 Aug 2018, 21:42 Andre McCurdy, &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br>&gt; &gt;&gt; &gt;&gt; On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt;<br>&gt; &gt;&gt; &gt;&gt; wrote:<br>&gt; &gt;&gt; &gt;&gt; &gt; On Wed, 22 Aug 2018, 20:02 Martin Jansa, &lt;<a href="mailto:martin.jansa@gmail.com">martin.jansa@gmail.com</a>&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt; wrote:<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; Your 1st parameter is wrong, compare again with the example I gave<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; you<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; (don&#39;t include &quot;brcm/&quot; path in 1st param, because you want the<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; symlink<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; to<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; point to just brcmfmac43430-sdio.AP6212.txt like you did in the<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; version<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; after cd).<br>&gt; &gt;&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&gt; &gt; That doesn&#39;t work either. I tried it with the same result, but didn&#39;t<br>&gt; &gt;&gt; &gt;&gt; &gt; send a<br>&gt; &gt;&gt; &gt;&gt; &gt; log of it. That works for you?<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Martin&#39;s example is correct so maybe check your tests again for typos.<br>&gt; &gt;&gt; &gt;&gt; It it still doesn&#39;t work then please do send a log.<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; The link will point to whatever you define via the first parameter, so<br>&gt; &gt;&gt; &gt;&gt; if you changed the first parameter it shouldn&#39;t be possible to get<br>&gt; &gt;&gt; &gt;&gt; &quot;the same result&quot;.<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;   $ mkdir foo<br>&gt; &gt;&gt; &gt;&gt;   $ ln -sf test_target foo/test1<br>&gt; &gt;&gt; &gt;&gt;   $ ln -sf brcm/test_target foo/test2<br>&gt; &gt;&gt; &gt;&gt;   $ ls -l foo<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;   lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -&gt; test_target<br>&gt; &gt;&gt; &gt;&gt;   lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -&gt; brcm/test_target<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Yes, that&#39;s essentially the same as what I&#39;m getting.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Now try &quot;cat foo/test1&quot; and what happens?<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; There is no file called test_target in the foo directory. And neither is<br>&gt; &gt;&gt; &gt; there a file called brcm/test_target in the foo directory.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Correct. The above was just an example to show that you can * create<br>&gt; &gt;&gt; symlinks * in the foo directory without cd&#39;ing into the foo directory<br>&gt; &gt;&gt; first.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; If you&#39;d like the symlinks in the example to point to valid targets<br>&gt; &gt;&gt; then you need to create the targets too, e.g.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;   $ mkdir -p foo/brcm<br>&gt; &gt;&gt;   $ echo hello &gt; foo/test_target<br>&gt; &gt;&gt;   $ echo hello2 &gt; foo/brcm/test_target<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; But note that the process of creating a symlink is always the same,<br>&gt; &gt;&gt; regardless of whether the symlink points to a valid target or not (so<br>&gt; &gt;&gt; you can run these extra commands to create the targets before or after<br>&gt; &gt;&gt; you create the symlinks).<br>&gt; &gt;<br>&gt; &gt; So that doesn&#39;t work for me how I expect it to work. I must be missing<br>&gt; &gt; something fundamental here.<br>&gt; &gt;<br>&gt; &gt; The recipe is trying to create a soft link from a file in the current<br>&gt; &gt; directory to a file in the sub-directory. On my system, your example creates<br>&gt; &gt; links from a file in the sub-directory to the another file in the<br>&gt; &gt; sub-directory.<br>&gt; &gt;<br>&gt; &gt; So, to copy your example, but creating the file &quot;test_target&quot; from the<br>&gt; &gt; start:<br>&gt; &gt;<br>&gt; &gt; $ mkdir -p /tmp/test<br>&gt; &gt; $ cd /tmp/test<br>&gt; &gt; $ mkdir foo<br>&gt; &gt; $ echo 1 &gt; test_target<br>&gt;<br>&gt; Here you are creating &quot;test_target&quot; in the directory which contains<br>&gt; foo, not inside foo. So a symlink inside foo pointing to &quot;test_target&quot;<br>&gt; isn&#39;t going to work.<br><br>Exactly my point! Martin asked me to do this:<br><br>&gt; ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt<br><br>Which is in essence what I&#39;m doing above. It won&#39;t work. The file &quot;brcmfmac43430-sdio.AP6212.txt&quot; doesn&#39;t exist in the current directory. That&#39;s why there&#39;s a &quot;cd&quot; command in there.<br><br>I think, in hind sight, the problem is that there is no path specified for the original file. Hence, the email I&#39;ve just sent, suggests I could make this mod:<br><br>-       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>+      ( ln -sf ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)<br><br><br> <br>&gt;<br>&gt;<br>&gt; &gt; $ ln -sf test_target foo/test1<br>&gt; &gt; $ ln -sf brcm/test_target foo/test2<br>&gt; &gt; $ ls -l foo<br>&gt; &gt; total 0<br>&gt; &gt; lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -&gt; test_target<br>&gt; &gt; lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -&gt; brcm/test_target<br>&gt; &gt; $ cat test_target<br>&gt; &gt; 1<br>&gt; &gt; $ cat foo/test1<br>&gt; &gt; cat: foo/test1: No such file or directory<br>&gt; &gt; $ cat foo/test2<br>&gt; &gt; cat: foo/test2: No such file or directory<br>&gt;<br>&gt; All as expected given that none of the symlink targets exist yet.<br>&gt;<br>&gt; &gt; $ echo hello &gt; foo/test_target<br>&gt; &gt; $ echo hello2 &gt; foo/brcm/test_target<br>&gt; &gt; bash: foo/brcm/test_target: No such file or directory<br>&gt;<br>&gt; You can&#39;t create a file within the foo/brcm subdirectory without<br>&gt; creating that subdirectory first. You&#39;ve somehow missed that step -<br>&gt; although it was in my example.<br><br>Well, your example said:<br><br>&gt;  $ mkdir foo<br>&gt;  $ ln -sf test_target foo/test1<br>&gt;  $ ln -sf brcm/test_target foo/test2<br>&gt;  $ ls -l foo<br><br>... and I was trying to show that it doesn&#39;t work. Although in fairness, you did add the &quot;mkdir -p foo/brcm&quot; command<span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> in a later email. So I think we&#39;re both arguing the same point and neither of us is making ourselves very clear.</span><div><br></div><div>So I don&#39;t think we need to continue down this track. Martin&#39;s original suggestion won&#39;t work for the reasons we&#39;ve both just discussed. If I add the absolute paths to the source and target, it should be fine.<br><br><br>&gt;<br>&gt; &gt; $ cat foo/test1<br>&gt; &gt; hello<br>&gt; &gt; $ cat foo/test2<br>&gt; &gt; cat: foo/test2: No such file or directory<br>&gt; &gt; $ cat test_target<br>&gt; &gt; 1<br>&gt; &gt; $ tree<br>&gt; &gt; .<br>&gt; &gt; ├── foo<br>&gt; &gt; │   ├── test1 -&gt; test_target<br>&gt; &gt; │   ├── test2 -&gt; brcm/test_target<br>&gt; &gt; │   └── test_target<br>&gt; &gt; └── test_target<br>&gt; &gt;<br>&gt; &gt; 1 directory, 4 files<br>&gt;<br>&gt; No real mysteries here. Everything looks as expected given the<br>&gt; comments above about how you creating the target files.<br>&gt;<br>&gt; &gt; So, neither test1 nor test2 are linked to /tmp/test/test_target.<br>&gt;<br>&gt; As expected. For a symlink which is in the foo subdirectory, the<br>&gt; target would have to be &quot;../test_target&quot; to correctly point to your<br>&gt; /tmp/test/test_target file.<br>&gt;<br>&gt; &gt; test1 is<br>&gt; &gt; linked to /tmp/test/foo/test_target<br>&gt;<br>&gt; Not exactly. The test1 symlink in foo just points to &quot;test_target&quot;,<br>&gt; there&#39;s no absolute path.<br>&gt;<br>&gt; ie if you renamed the foo directory to something else then the test1<br>&gt; symlink would still point &quot;test_target&quot; and it would still be a valid<br>&gt; link.<br>&gt;<br>&gt; &gt; and test2 is linked to<br>&gt; &gt; /tmp/test/brcm/test_target, which doesn&#39;t exist.<br>&gt;<br>&gt; Again, test2 is a relative symlink, not absolute. The test2 symlink<br>&gt; points to a target which doesn&#39;t exist due to a missing &quot;mkdir -p<br>&gt; foo/brcm&quot; before you tried to create the target file.<br>&gt;<br>&gt; &gt; AFAIK, when creating a softlink, you have to give it either an absolute<br>&gt; &gt; path, or a path relative to the link being created. The path cannot be<br>&gt; &gt; relative to the original file that you want to link to.<br>&gt;<br>&gt; The only real restriction when creating a symlink is that the<br>&gt; directory which will contain the symlink must exist.<br>&gt;<br>&gt; If you want the symlink to point to something then it&#39;s up to you to<br>&gt; arrange that the target exists and the symlink points to it correctly<br>&gt; - but the symlink can still be created even if the target doesn&#39;t<br>&gt; point to anything valid.<br>&gt;<br>&gt; &gt; So, this will work:<br>&gt; &gt;<br>&gt; &gt; $cd /tmp/test<br>&gt; &gt; $ ln -sf ../test_target foo/test3<br>&gt; &gt; $ cat foo/test3<br>&gt; &gt; 1<br>&gt; &gt; $ cat /tmp/test/foo/test3<br>&gt; &gt; 1<br>&gt; &gt;<br>&gt; &gt; But that is a strange way to create the soft link, IMO.<br>&gt;<br>&gt; What&#39;s strange about it?<br>&gt;<br>&gt; &gt; AFAICT, for the recipe, to get rid of the &quot;cd&quot;, I&#39;d have to specify an<br>&gt; &gt; absolute path to the original file:<br>&gt; &gt;<br>&gt; &gt; +do_install_append_bcm43430-nvram-mur1dx() {<br>&gt; &gt; +       ( ln -sf ${PWD}/brcmfmac43430-sdio.MUR1DX.txt<br>&gt; &gt; ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt)<br>&gt; &gt;<br>&gt; &gt; ... assuming PWD is available to the recipe. There will be a proper Yocto<br>&gt; &gt; variable I can use, of course, but I can&#39;t think of it right now.<br>&gt;<br>&gt; That definitely doesn&#39;t look right...<br>&gt;<br>&gt; &gt; Either way, Martin&#39;s example doesn&#39;t work for me. And adding the absolute<br>&gt; &gt; path of the original file doesn&#39;t seem any neater or clearer than following<br>&gt; &gt; the TI example from the do_install a few lines up in the recipe. But I&#39;m<br>&gt; &gt; happy to do it either way, so long as it works.<br>&gt;<br>&gt; Martin&#39;s example is basically saying (correctly) that this sequence:<br>&gt;<br>&gt;   mkdir foo<br>&gt;   echo hello &gt; foo/target<br>&gt;   cd foo<br>&gt;   ln -sf target link<br>&gt;   cd ..<br>&gt;<br>&gt; is equivalent to this one:<br>&gt;<br>&gt;   mkdir foo<br>&gt;   echo hello &gt; foo/target<br>&gt;   ln -sf target foo/link<br>&gt;<br>&gt; Notice that the first parameter to ln (the thing you want the symlink<br>&gt; to point to) is the same in both cases. ie it isn&#39;t affected by which<br>&gt; directory you are in when you create the symlink.<br></div></div>
Andre McCurdy Aug. 23, 2018, 7:19 a.m. UTC | #17
On Thu, Aug 23, 2018 at 12:08 AM, Ryan Harkin <ryan.harkin@linaro.org> wrote:
> On 23 August 2018 at 07:39, Martin Hundebøll <martin@geanix.com> wrote:

>>

>> 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)


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.

> 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.

> 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.

>>

>> // Martin

>>

>> On 23/08/2018 08.12, Ryan Harkin wrote:

>>>

>>>

>>>

>>> On 22 August 2018 at 23:55, Andre McCurdy <armccurdy@gmail.com

>>> <mailto:armccurdy@gmail.com>> wrote:

>>>

>>>     On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org

>>>     <mailto:ryan.harkin@linaro.org>> wrote:

>>>      > On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com

>>>     <mailto:armccurdy@gmail.com>> wrote:

>>>      >> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin

>>>     <ryan.harkin@linaro.org <mailto:ryan.harkin@linaro.org>>

>>>      >> wrote:

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

>>>     <martin.jansa@gmail.com <mailto:martin.jansa@gmail.com>> 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.

>>>

>>

>> --

>> Kind regards,

>> Martin Hundebøll

>> Embedded Linux Consultant

>>

>> +45 61 65 54 61

>> martin@geanix.com

>>

>> Geanix IVS

>> https://geanix.com

>> DK39600706

>

>
Andre McCurdy Aug. 23, 2018, 7:34 a.m. UTC | #18
On Thu, Aug 23, 2018 at 12:17 AM, Ryan Harkin <ryan.harkin@linaro.org> wrote:
> On 23 August 2018 at 08:06, Andre McCurdy <armccurdy@gmail.com> wrote:

>> On Wed, Aug 22, 2018 at 11:12 PM, Ryan Harkin <ryan.harkin@linaro.org>

>> wrote:

>> > On 22 August 2018 at 23:55, Andre McCurdy <armccurdy@gmail.com> wrote:

>> >> On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org>

>> >> wrote:

>> >> > On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com>

>> >> > wrote:

>> >> >> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin

>> >> >> <ryan.harkin@linaro.org>

>> >> >> wrote:

>> >> >> > On Wed, 22 Aug 2018, 20:02 Martin Jansa, <martin.jansa@gmail.com>

>> >> >> > 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

>>

>> 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:

>

>> 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.

> 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)

>

>

>

>>

>>

>> > $ 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.

>>

>> > $ 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.

>

> Well, your example said:

>

>>  $ 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.


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.

>

>>

>> > $ 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

>>

>> No real mysteries here. Everything looks as expected given the

>> comments above about how you creating the target files.

>>

>> > 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.

>>

>> > 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.

>>

>> > 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.

>>

>> > 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.

>>

>> > 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?

>>

>> > 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.

>>

>> That definitely doesn't look right...

>>

>> > 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.
Ryan Harkin Aug. 23, 2018, 7:36 a.m. UTC | #19
On 23 August 2018 at 08:34, Andre McCurdy <armccurdy@gmail.com> wrote:

> On Thu, Aug 23, 2018 at 12:17 AM, Ryan Harkin <ryan.harkin@linaro.org>

> wrote:

> > On 23 August 2018 at 08:06, Andre McCurdy <armccurdy@gmail.com> wrote:

> >> On Wed, Aug 22, 2018 at 11:12 PM, Ryan Harkin <ryan.harkin@linaro.org>

> >> wrote:

> >> > On 22 August 2018 at 23:55, Andre McCurdy <armccurdy@gmail.com>

> wrote:

> >> >> On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org

> >

> >> >> wrote:

> >> >> > On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com>

> >> >> > wrote:

> >> >> >> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin

> >> >> >> <ryan.harkin@linaro.org>

> >> >> >> wrote:

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

> martin.jansa@gmail.com>

> >> >> >> > 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

> >>

> >> 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:

> >

> >> 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.

>

> > 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)

> >

> >

> >

> >>

> >>

> >> > $ 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.

> >>

> >> > $ 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.

> >

> > Well, your example said:

> >

> >>  $ 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.

>

> 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.



> >

> >>

> >> > $ 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

> >>

> >> No real mysteries here. Everything looks as expected given the

> >> comments above about how you creating the target files.

> >>

> >> > 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.

> >>

> >> > 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.

> >>

> >> > 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.

> >>

> >> > 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.

> >>

> >> > 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?

> >>

> >> > 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.

> >>

> >> That definitely doesn't look right...

> >>

> >> > 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.

>
<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 23 August 2018 at 08:34, Andre McCurdy <span dir="ltr">&lt;<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Aug 23, 2018 at 12:17 AM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt; wrote:<br>
&gt; On 23 August 2018 at 08:06, Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br>
&gt;&gt; On Wed, Aug 22, 2018 at 11:12 PM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; On 22 August 2018 at 23:55, Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; On Wed, 22 Aug 2018, 21:42 Andre McCurdy, &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt; On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin<br>
&gt;&gt; &gt;&gt; &gt;&gt; &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; On Wed, 22 Aug 2018, 20:02 Martin Jansa, &lt;<a href="mailto:martin.jansa@gmail.com">martin.jansa@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; Your 1st parameter is wrong, compare again with the example I<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; gave<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; you<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; (don&#39;t include &quot;brcm/&quot; path in 1st param, because you want the<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; symlink<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; point to just brcmfmac43430-sdio.AP6212.txt like you did in the<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; version<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; after cd).<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; That doesn&#39;t work either. I tried it with the same result, but<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; didn&#39;t<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; send a<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; log of it. That works for you?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Martin&#39;s example is correct so maybe check your tests again for<br>
&gt;&gt; &gt;&gt; &gt;&gt; typos.<br>
&gt;&gt; &gt;&gt; &gt;&gt; It it still doesn&#39;t work then please do send a log.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; The link will point to whatever you define via the first parameter,<br>
&gt;&gt; &gt;&gt; &gt;&gt; so<br>
&gt;&gt; &gt;&gt; &gt;&gt; if you changed the first parameter it shouldn&#39;t be possible to get<br>
&gt;&gt; &gt;&gt; &gt;&gt; &quot;the same result&quot;.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;   $ mkdir foo<br>
&gt;&gt; &gt;&gt; &gt;&gt;   $ ln -sf test_target foo/test1<br>
&gt;&gt; &gt;&gt; &gt;&gt;   $ ln -sf brcm/test_target foo/test2<br>
&gt;&gt; &gt;&gt; &gt;&gt;   $ ls -l foo<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;   lrwxrwxrwx 1 andre andre 11 Aug 22 13:35 test1 -&gt; test_target<br>
&gt;&gt; &gt;&gt; &gt;&gt;   lrwxrwxrwx 1 andre andre 16 Aug 22 13:35 test2 -&gt; brcm/test_target<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Yes, that&#39;s essentially the same as what I&#39;m getting.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Now try &quot;cat foo/test1&quot; and what happens?<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; There is no file called test_target in the foo directory. And neither<br>
&gt;&gt; &gt;&gt; &gt; is<br>
&gt;&gt; &gt;&gt; &gt; there a file called brcm/test_target in the foo directory.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Correct. The above was just an example to show that you can * create<br>
&gt;&gt; &gt;&gt; symlinks * in the foo directory without cd&#39;ing into the foo directory<br>
&gt;&gt; &gt;&gt; first.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; If you&#39;d like the symlinks in the example to point to valid targets<br>
&gt;&gt; &gt;&gt; then you need to create the targets too, e.g.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;   $ mkdir -p foo/brcm<br>
&gt;&gt; &gt;&gt;   $ echo hello &gt; foo/test_target<br>
&gt;&gt; &gt;&gt;   $ echo hello2 &gt; foo/brcm/test_target<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; But note that the process of creating a symlink is always the same,<br>
&gt;&gt; &gt;&gt; regardless of whether the symlink points to a valid target or not (so<br>
&gt;&gt; &gt;&gt; you can run these extra commands to create the targets before or after<br>
&gt;&gt; &gt;&gt; you create the symlinks).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; So that doesn&#39;t work for me how I expect it to work. I must be missing<br>
&gt;&gt; &gt; something fundamental here.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; The recipe is trying to create a soft link from a file in the current<br>
&gt;&gt; &gt; directory to a file in the sub-directory. On my system, your example<br>
&gt;&gt; &gt; creates<br>
&gt;&gt; &gt; links from a file in the sub-directory to the another file in the<br>
&gt;&gt; &gt; sub-directory.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; So, to copy your example, but creating the file &quot;test_target&quot; from the<br>
&gt;&gt; &gt; start:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; $ mkdir -p /tmp/test<br>
&gt;&gt; &gt; $ cd /tmp/test<br>
&gt;&gt; &gt; $ mkdir foo<br>
&gt;&gt; &gt; $ echo 1 &gt; test_target<br>
&gt;&gt;<br>
&gt;&gt; Here you are creating &quot;test_target&quot; in the directory which contains<br>
&gt;&gt; foo, not inside foo. So a symlink inside foo pointing to &quot;test_target&quot;<br>
&gt;&gt; isn&#39;t going to work.<br>
&gt;<br>
&gt; Exactly my point! Martin asked me to do this:<br>
&gt;<br>
&gt;&gt; ln -sf brcmfmac43430-sdio.AP6212.txt<br>
&gt;&gt; ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt<br>
&gt;<br>
&gt; Which is in essence what I&#39;m doing above. It won&#39;t work. The file<br>
&gt; &quot;brcmfmac43430-sdio.AP6212.<wbr>txt&quot; doesn&#39;t exist in the current directory.<br>
&gt; That&#39;s why there&#39;s a &quot;cd&quot; command in there.<br>
<br>
</div></div>I think you&#39;re really still quite confused about something here...<br>
<br>
You don&#39;t need to have any file existing in the current directory (or<br>
anywhere else) in order to create a symlink. The symlink exists on<br>
it&#39;s own. Creating the file that the symlink points to is an entirely<br>
separate step.<br>
<div><div class="h5"><br>
&gt; I think, in hind sight, the problem is that there is no path specified for<br>
&gt; the original file. Hence, the email I&#39;ve just sent, suggests I could make<br>
&gt; this mod:<br>
&gt;<br>
&gt; -       ( cd ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/ ; ln -sf<br>
&gt; brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>
&gt; +      ( ln -sf<br>
&gt; ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.MUR1DX.txt<br>
&gt; ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; $ ln -sf test_target foo/test1<br>
&gt;&gt; &gt; $ ln -sf brcm/test_target foo/test2<br>
&gt;&gt; &gt; $ ls -l foo<br>
&gt;&gt; &gt; total 0<br>
&gt;&gt; &gt; lrwxrwxrwx 1 ryan ryan 11 Aug 23 06:54 test1 -&gt; test_target<br>
&gt;&gt; &gt; lrwxrwxrwx 1 ryan ryan 16 Aug 23 06:54 test2 -&gt; brcm/test_target<br>
&gt;&gt; &gt; $ cat test_target<br>
&gt;&gt; &gt; 1<br>
&gt;&gt; &gt; $ cat foo/test1<br>
&gt;&gt; &gt; cat: foo/test1: No such file or directory<br>
&gt;&gt; &gt; $ cat foo/test2<br>
&gt;&gt; &gt; cat: foo/test2: No such file or directory<br>
&gt;&gt;<br>
&gt;&gt; All as expected given that none of the symlink targets exist yet.<br>
&gt;&gt;<br>
&gt;&gt; &gt; $ echo hello &gt; foo/test_target<br>
&gt;&gt; &gt; $ echo hello2 &gt; foo/brcm/test_target<br>
&gt;&gt; &gt; bash: foo/brcm/test_target: No such file or directory<br>
&gt;&gt;<br>
&gt;&gt; You can&#39;t create a file within the foo/brcm subdirectory without<br>
&gt;&gt; creating that subdirectory first. You&#39;ve somehow missed that step -<br>
&gt;&gt; although it was in my example.<br>
&gt;<br>
&gt; Well, your example said:<br>
&gt;<br>
&gt;&gt;  $ mkdir foo<br>
&gt;&gt;  $ ln -sf test_target foo/test1<br>
&gt;&gt;  $ ln -sf brcm/test_target foo/test2<br>
&gt;&gt;  $ ls -l foo<br>
&gt;<br>
&gt; ... and I was trying to show that it doesn&#39;t work. Although in fairness, you<br>
&gt; did add the &quot;mkdir -p foo/brcm&quot; command in a later email. So I think we&#39;re<br>
&gt; both arguing the same point and neither of us is making ourselves very<br>
&gt; clear.<br>
&gt;<br>
&gt; So I don&#39;t think we need to continue down this track. Martin&#39;s original<br>
&gt; suggestion won&#39;t work for the reasons we&#39;ve both just discussed. If I add<br>
&gt; the absolute paths to the source and target, it should be fine.<br>
<br>
</div></div>If you make it down as far as the end of the previous email you&#39;ll<br>
find a simplified example of Martin&#39;s suggestion. Please try it. It<br>
does work.<br></blockquote><div><br></div><div>I think you&#39;re right. As was Martin.</div><div><br></div><div>I was starting to respond to your previous email but I&#39;ll cut it short and just say that I apologise for the confusion and distraction and I&#39;ll make the mod Martin suggested and test it works.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; $ cat foo/test1<br>
&gt;&gt; &gt; hello<br>
&gt;&gt; &gt; $ cat foo/test2<br>
&gt;&gt; &gt; cat: foo/test2: No such file or directory<br>
&gt;&gt; &gt; $ cat test_target<br>
&gt;&gt; &gt; 1<br>
&gt;&gt; &gt; $ tree<br>
&gt;&gt; &gt; .<br>
&gt;&gt; &gt; ├── foo<br>
&gt;&gt; &gt; │   ├── test1 -&gt; test_target<br>
&gt;&gt; &gt; │   ├── test2 -&gt; brcm/test_target<br>
&gt;&gt; &gt; │   └── test_target<br>
&gt;&gt; &gt; └── test_target<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 1 directory, 4 files<br>
&gt;&gt;<br>
&gt;&gt; No real mysteries here. Everything looks as expected given the<br>
&gt;&gt; comments above about how you creating the target files.<br>
&gt;&gt;<br>
&gt;&gt; &gt; So, neither test1 nor test2 are linked to /tmp/test/test_target.<br>
&gt;&gt;<br>
&gt;&gt; As expected. For a symlink which is in the foo subdirectory, the<br>
&gt;&gt; target would have to be &quot;../test_target&quot; to correctly point to your<br>
&gt;&gt; /tmp/test/test_target file.<br>
&gt;&gt;<br>
&gt;&gt; &gt; test1 is<br>
&gt;&gt; &gt; linked to /tmp/test/foo/test_target<br>
&gt;&gt;<br>
&gt;&gt; Not exactly. The test1 symlink in foo just points to &quot;test_target&quot;,<br>
&gt;&gt; there&#39;s no absolute path.<br>
&gt;&gt;<br>
&gt;&gt; ie if you renamed the foo directory to something else then the test1<br>
&gt;&gt; symlink would still point &quot;test_target&quot; and it would still be a valid<br>
&gt;&gt; link.<br>
&gt;&gt;<br>
&gt;&gt; &gt; and test2 is linked to<br>
&gt;&gt; &gt; /tmp/test/brcm/test_target, which doesn&#39;t exist.<br>
&gt;&gt;<br>
&gt;&gt; Again, test2 is a relative symlink, not absolute. The test2 symlink<br>
&gt;&gt; points to a target which doesn&#39;t exist due to a missing &quot;mkdir -p<br>
&gt;&gt; foo/brcm&quot; before you tried to create the target file.<br>
&gt;&gt;<br>
&gt;&gt; &gt; AFAIK, when creating a softlink, you have to give it either an absolute<br>
&gt;&gt; &gt; path, or a path relative to the link being created. The path cannot be<br>
&gt;&gt; &gt; relative to the original file that you want to link to.<br>
&gt;&gt;<br>
&gt;&gt; The only real restriction when creating a symlink is that the<br>
&gt;&gt; directory which will contain the symlink must exist.<br>
&gt;&gt;<br>
&gt;&gt; If you want the symlink to point to something then it&#39;s up to you to<br>
&gt;&gt; arrange that the target exists and the symlink points to it correctly<br>
&gt;&gt; - but the symlink can still be created even if the target doesn&#39;t<br>
&gt;&gt; point to anything valid.<br>
&gt;&gt;<br>
&gt;&gt; &gt; So, this will work:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; $cd /tmp/test<br>
&gt;&gt; &gt; $ ln -sf ../test_target foo/test3<br>
&gt;&gt; &gt; $ cat foo/test3<br>
&gt;&gt; &gt; 1<br>
&gt;&gt; &gt; $ cat /tmp/test/foo/test3<br>
&gt;&gt; &gt; 1<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; But that is a strange way to create the soft link, IMO.<br>
&gt;&gt;<br>
&gt;&gt; What&#39;s strange about it?<br>
&gt;&gt;<br>
&gt;&gt; &gt; AFAICT, for the recipe, to get rid of the &quot;cd&quot;, I&#39;d have to specify an<br>
&gt;&gt; &gt; absolute path to the original file:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; +do_install_append_bcm43430-<wbr>nvram-mur1dx() {<br>
&gt;&gt; &gt; +       ( ln -sf ${PWD}/brcmfmac43430-sdio.<wbr>MUR1DX.txt<br>
&gt;&gt; &gt; ${D}${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ... assuming PWD is available to the recipe. There will be a proper<br>
&gt;&gt; &gt; Yocto<br>
&gt;&gt; &gt; variable I can use, of course, but I can&#39;t think of it right now.<br>
&gt;&gt;<br>
&gt;&gt; That definitely doesn&#39;t look right...<br>
&gt;&gt;<br>
&gt;&gt; &gt; Either way, Martin&#39;s example doesn&#39;t work for me. And adding the<br>
&gt;&gt; &gt; absolute<br>
&gt;&gt; &gt; path of the original file doesn&#39;t seem any neater or clearer than<br>
&gt;&gt; &gt; following<br>
&gt;&gt; &gt; the TI example from the do_install a few lines up in the recipe. But I&#39;m<br>
&gt;&gt; &gt; happy to do it either way, so long as it works.<br>
&gt;&gt;<br>
&gt;&gt; Martin&#39;s example is basically saying (correctly) that this sequence:<br>
&gt;&gt;<br>
&gt;&gt;   mkdir foo<br>
&gt;&gt;   echo hello &gt; foo/target<br>
&gt;&gt;   cd foo<br>
&gt;&gt;   ln -sf target link<br>
&gt;&gt;   cd ..<br>
&gt;&gt;<br>
&gt;&gt; is equivalent to this one:<br>
&gt;&gt;<br>
&gt;&gt;   mkdir foo<br>
&gt;&gt;   echo hello &gt; foo/target<br>
&gt;&gt;   ln -sf target foo/link<br>
&gt;&gt;<br>
&gt;&gt; Notice that the first parameter to ln (the thing you want the symlink<br>
&gt;&gt; to point to) is the same in both cases. ie it isn&#39;t affected by which<br>
&gt;&gt; directory you are in when you create the symlink.<br>
</div></div></blockquote></div><br></div></div>
Ryan Harkin Aug. 23, 2018, 8:15 a.m. UTC | #20
On 22 August 2018 at 17:41, Martin Jansa <martin.jansa@gmail.com> wrote:
>

> 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:

diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
index 8c54f28..70d4f6a 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -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?


>

>

> On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin <ryan.harkin@linaro.org>

wrote:
>>

>> 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.

>>

>> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>

>> ---

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

++++++++++++
>>  1 file changed, 12 insertions(+)

>>

>> diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
>> index 8c54f28..b647abc 100644

>> --- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb

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

>> @@ -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 \

>> --

>> 2.7.4

>>
<div dir="ltr"><br><br>On 22 August 2018 at 17:41, Martin Jansa &lt;<a href="mailto:martin.jansa@gmail.com">martin.jansa@gmail.com</a>&gt; wrote:<br>&gt;<br>&gt; The &quot;cd ${D}${nonarch_base_libdir}/firmware/brcm/&quot; doesn&#39;t seem to be needed, just include the path in 2nd ln parameter.<br><br>Thanks Martin, and sorry for being so dumb. I&#39;ll send another series at some point, but for now, the patch looks like this:<br><br>diff --git a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb">linux-firmware_git.bb</a> b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb">linux-firmware_git.bb</a><br>index 8c54f28..70d4f6a 100644<br>--- a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb">linux-firmware_git.bb</a><br>+++ b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb">linux-firmware_git.bb</a><br>@@ -226,6 +226,18 @@ do_install() {<br>        ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )<br> }<br> <br>+# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a<br>+# softlink for the module specific NVRAM file to the filename expected<br>+# by the Linux kernel<br>+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>+do_install_append_bcm43430-nvram-mur1dx() {<br>+       ln -sf brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt<br>+}<br>+FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = &quot;${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>+do_install_append_bcm43430-nvram-ap6212() {<br>+       ln -sf brcmfmac43430-sdio.AP6212.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt<br>+}<br>+<br><br>So now the ln issue is resolved, I&#39;m not convinced my MACHINEOVERRIDES is the correct approach. Does anyone have any feedback on how I can improve that?<br><br>As per my cover letter, I originally wanted to be able to provide a MACHINE_EXTRA_RRECOMMENDS, or similar, but I&#39;m not familiar with how to get an _append to apply based on that variable, unless I tested it incorrectly (again).<div><br></div><div>If I add, say, &quot;linux-firmware-bcm43430-nvram-mur1dx&quot; to <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">MACHINE_EXTRA_RRECOMMENDS, should this work:</span></div><div><br></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">+FILES_${PN}-bcm43430-nvram_append_${PN}-bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;</span><br style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">+do_install_append_${PN}-bcm43430-nvram-mur1dx() {</span><br style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">+       ln -sf brcmfmac43430-sdio.MUR1DX.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt</span><br style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">+}</span><br> </div><div>Or is there a better way of achieving this?</div><div><br></div><div><br>&gt;<br>&gt;<br>&gt; On Wed, Aug 22, 2018 at 6:30 PM Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; The Linux kernel currently expects a single NVRAM file for BCM43430<br>&gt;&gt; named brcmfmac43430-sdio.txt.<br>&gt;&gt;<br>&gt;&gt; Allow the machine to specify an override to link its module specific<br>&gt;&gt; NVRAM to the filename expected by the kernel.<br>&gt;&gt;<br>&gt;&gt; Signed-off-by: Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org">ryan.harkin@linaro.org</a>&gt;<br>&gt;&gt; ---<br>&gt;&gt;  meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb">linux-firmware_git.bb</a> | 12 ++++++++++++<br>&gt;&gt;  1 file changed, 12 insertions(+)<br>&gt;&gt;<br>&gt;&gt; diff --git a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb">linux-firmware_git.bb</a> b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb">linux-firmware_git.bb</a><br>&gt;&gt; index 8c54f28..b647abc 100644<br>&gt;&gt; --- a/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb">linux-firmware_git.bb</a><br>&gt;&gt; +++ b/meta/recipes-kernel/linux-firmware/<a href="http://linux-firmware_git.bb">linux-firmware_git.bb</a><br>&gt;&gt; @@ -226,6 +226,18 @@ do_install() {<br>&gt;&gt;         ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )<br>&gt;&gt;  }<br>&gt;&gt;<br>&gt;&gt; +# Adding bcm43430-nvram-{module type} to MACHINEOVERRIDES will create a<br>&gt;&gt; +# softlink for the module specific NVRAM file to the filename expected<br>&gt;&gt; +# by the Linux kernel<br>&gt;&gt; +FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-mur1dx = &quot; ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>&gt;&gt; +do_install_append_bcm43430-nvram-mur1dx() {<br>&gt;&gt; +       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.MUR1DX.txt brcmfmac43430-sdio.txt)<br>&gt;&gt; +}<br>&gt;&gt; +FILES_${PN}-bcm43430-nvram_append_bcm43430-nvram-ap6212 = &quot;${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt&quot;<br>&gt;&gt; +do_install_append_bcm43430-nvram-ap6212() {<br>&gt;&gt; +       ( cd ${D}${nonarch_base_libdir}/firmware/brcm/ ; ln -sf brcmfmac43430-sdio.AP6212.txt brcmfmac43430-sdio.txt)<br>&gt;&gt; +}<br>&gt;&gt; +<br>&gt;&gt;<br>&gt;&gt;  PACKAGES =+ &quot;${PN}-ralink-license ${PN}-ralink \<br>&gt;&gt;               ${PN}-mt7601u-license ${PN}-mt7601u \<br>&gt;&gt; --<br>&gt;&gt; 2.7.4<br>&gt;&gt;<br></div></div>
Khem Raj Aug. 23, 2018, 3:58 p.m. UTC | #21
On Wed, Aug 22, 2018 at 11:40 PM Martin Hundebøll <martin@geanix.com> wrote:
>

> 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

> // Martin

>

> On 23/08/2018 08.12, Ryan Harkin wrote:

> >

> >

> > On 22 August 2018 at 23:55, Andre McCurdy <armccurdy@gmail.com

> > <mailto:armccurdy@gmail.com>> wrote:

> >

> >     On Wed, Aug 22, 2018 at 2:56 PM, Ryan Harkin <ryan.harkin@linaro.org

> >     <mailto:ryan.harkin@linaro.org>> wrote:

> >      > On Wed, 22 Aug 2018, 21:42 Andre McCurdy, <armccurdy@gmail.com

> >     <mailto:armccurdy@gmail.com>> wrote:

> >      >> On Wed, Aug 22, 2018 at 1:10 PM, Ryan Harkin

> >     <ryan.harkin@linaro.org <mailto:ryan.harkin@linaro.org>>

> >      >> wrote:

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

> >     <martin.jansa@gmail.com <mailto:martin.jansa@gmail.com>> 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.

> >

>

> --

> Kind regards,

> Martin Hundebøll

> Embedded Linux Consultant

>

> +45 61 65 54 61

> martin@geanix.com

>

> Geanix IVS

> https://geanix.com

> DK39600706

> --

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Andre McCurdy Aug. 24, 2018, 2:53 a.m. UTC | #22
On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin <ryan.harkin@linaro.org> 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.
Martin Jansa Aug. 24, 2018, 9:04 a.m. UTC | #23
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 <armccurdy@gmail.com> wrote:

> On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin <ryan.harkin@linaro.org>

> 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.

>
<div dir="ltr">One way to keep it allarch would be to package<div>${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt<br>${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt<br></div><div>in 2 separate packages and handle</div><div>${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt<br></div><div>symlink with update-alternatives</div><div><br></div><div>most MACHINEs won&#39;t install either of these packages and those which need it will pull the right one (e.g. through MACHINE_EXTRA_RRECOMMENDS).</div><div><br></div><div>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).</div><div><br></div><div>Cheers,</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 24, 2018 at 4:53 AM Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt; wrote:<br>
&gt;<br>
&gt; So now the ln issue is resolved, I&#39;m not convinced my MACHINEOVERRIDES is<br>
&gt; the correct approach. Does anyone have any feedback on how I can improve<br>
&gt; that?<br>
<br>
If you want to make a configurable symlink then perhaps the more usual<br>
approach would be to just use a variable in the linux-firmware recipe<br>
to weakly define a default target for the symlink. Machine config<br>
files could then either do nothing (ie use the default) or provide<br>
their own value. For example, in the linux-firmware recipe:<br>
<br>
  BCM43430_NVRAM_SYMLINK ?= &quot;brcmfmac43430-sdio.AP6212.txt&quot;<br>
<br>
  FILES_${PN}-bcm43430-nvram = &quot; \<br>
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt \<br>
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.AP6212.txt \<br>
    ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.MUR1DX.txt \<br>
  &quot;<br>
<br>
  do_install() {<br>
    ...<br>
    ln -sf ${BCM43430_NVRAM_SYMLINK}<br>
${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.txt<br>
  }<br>
<br>
And then in the machine config files of machines which need the MUR1DX<br>
firmware instead of the default, add:<br>
<br>
  BCM43430_NVRAM_SYMLINK = &quot;brcmfmac43430-sdio.MUR1DX.txt&quot;<br>
<br>
However... note that currently the linux-firmware recipe is<br>
architecture independent (ie it won&#39;t be rebuilt if the target is<br>
changed). Adding a machine specific symlink is going to cause problems<br>
with that, so the above is still not a full solution.<br>
</blockquote></div>
Mike Looijmans Aug. 24, 2018, 10:43 a.m. UTC | #24
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).

On 24-08-18 11:04, Martin Jansa wrote:
> 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 <armccurdy@gmail.com 

> <mailto:armccurdy@gmail.com>> wrote:

> 

>     On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin <ryan.harkin@linaro.org

>     <mailto:ryan.harkin@linaro.org>> 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.

> 

> 

>
Ryan Harkin Aug. 24, 2018, 10:50 a.m. UTC | #25
Hi Martin,

On 24 August 2018 at 10:04, Martin Jansa <martin.jansa@gmail.com> wrote:

> 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).

>


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.


> Cheers,

>

> On Fri, Aug 24, 2018 at 4:53 AM Andre McCurdy <armccurdy@gmail.com> wrote:

>

>> On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin <ryan.harkin@linaro.org>

>> 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.

>>

>

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

Cheers,
Ryan.
<div dir="ltr">Hi Martin,<br><div class="gmail_extra"><br><div class="gmail_quote">On 24 August 2018 at 10:04, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">One way to keep it allarch would be to package<span class=""><div>${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.AP6212.txt<br>${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.MUR1DX.txt<br></div></span><div>in 2 separate packages and handle</div><div>${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt<br></div><div>symlink with update-alternatives</div><div><br></div><div>most MACHINEs won&#39;t install either of these packages and those which need it will pull the right one (e.g. through MACHINE_EXTRA_<wbr>RRECOMMENDS).</div><div><br></div><div>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).</div></div></blockquote><div><br></div>Thanks, this sounds like a good approach. I&#39;ll experiment with update-alternatives as I haven&#39;t used it before and see if I can come up with something sensible.<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Cheers,</div></div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 24, 2018 at 4:53 AM Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a>&gt; wrote:<br>
&gt;<br>
&gt; So now the ln issue is resolved, I&#39;m not convinced my MACHINEOVERRIDES is<br>
&gt; the correct approach. Does anyone have any feedback on how I can improve<br>
&gt; that?<br>
<br>
If you want to make a configurable symlink then perhaps the more usual<br>
approach would be to just use a variable in the linux-firmware recipe<br>
to weakly define a default target for the symlink. Machine config<br>
files could then either do nothing (ie use the default) or provide<br>
their own value. For example, in the linux-firmware recipe:<br>
<br>
  BCM43430_NVRAM_SYMLINK ?= &quot;brcmfmac43430-sdio.AP6212.<wbr>txt&quot;<br>
<br>
  FILES_${PN}-bcm43430-nvram = &quot; \<br>
    ${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt \<br>
    ${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.AP6212.txt \<br>
    ${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.MUR1DX.txt \<br>
  &quot;<br>
<br>
  do_install() {<br>
    ...<br>
    ln -sf ${BCM43430_NVRAM_SYMLINK}<br>
${D}${nonarch_base_libdir}/<wbr>firmware/brcm/brcmfmac43430-<wbr>sdio.txt<br>
  }<br>
<br>
And then in the machine config files of machines which need the MUR1DX<br>
firmware instead of the default, add:<br>
<br>
  BCM43430_NVRAM_SYMLINK = &quot;brcmfmac43430-sdio.MUR1DX.<wbr>txt&quot;<br>
<br>
However... note that currently the linux-firmware recipe is<br>
architecture independent (ie it won&#39;t be rebuilt if the target is<br>
changed). Adding a machine specific symlink is going to cause problems<br>
with that, so the above is still not a full solution.<br>
</blockquote></div>
</div></div></blockquote></div><br></div><div class="gmail_extra">Thanks Andre. It looks like it would work, but unless you see a problem, I&#39;ll look at Martin&#39;s idea first.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,</div><div class="gmail_extra">Ryan.</div><div class="gmail_extra"><br></div></div>
Ryan Harkin Aug. 28, 2018, 10:54 a.m. UTC | #26
On 24 August 2018 at 11:43, Mike Looijmans <mike.looijmans@topic.nl> wrote:

> 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.


>

> On 24-08-18 11:04, Martin Jansa wrote:

>

>> 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 <armccurdy@gmail.com

>> <mailto:armccurdy@gmail.com>> wrote:

>>

>>     On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin <ryan.harkin@linaro.org

>>     <mailto:ryan.harkin@linaro.org>> 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.

>>

>>

>>

>>

> --

> _______________________________________________

> Openembedded-core mailing list

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core

>
<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 24 August 2018 at 11:43, Mike Looijmans <span dir="ltr">&lt;<a href="mailto:mike.looijmans@topic.nl" target="_blank">mike.looijmans@topic.nl</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think this should be solved in the driver actually. It probably &quot;knows&quot; which variant is there (or could be taught using devicetree or so).</blockquote><div><br></div><div>I agree. That&#39;s a longer term change that will take quite some time to filter through, if at all.</div><div><br></div><div>The device doesn&#39;t know which variant it is, but I&#39;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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 24-08-18 11:04, Martin Jansa wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
One way to keep it allarch would be to package<br>
${nonarch_base_libdir}/firmwar<wbr>e/brcm/brcmfmac43430-sdio.<wbr>AP6212.txt<br>
${nonarch_base_libdir}/firmwar<wbr>e/brcm/brcmfmac43430-sdio.<wbr>MUR1DX.txt<br>
in 2 separate packages and handle<br>
${nonarch_base_libdir}/firmwar<wbr>e/brcm/brcmfmac43430-sdio.txt<br>
symlink with update-alternatives<br>
<br>
most MACHINEs won&#39;t install either of these packages and those which need it will pull the right one (e.g. through MACHINE_EXTRA_RRECOMME<wbr>NDS).<br>
<br>
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).<br>
<br>
Cheers,<br>
<br></span><span class="">
On Fri, Aug 24, 2018 at 4:53 AM Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a> &lt;mailto:<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>&gt;&gt; wrote:<br>
<br>
    On Thu, Aug 23, 2018 at 1:15 AM, Ryan Harkin &lt;<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a><br></span><div><div class="h5">
    &lt;mailto:<a href="mailto:ryan.harkin@linaro.org" target="_blank">ryan.harkin@linaro.org</a><wbr>&gt;&gt; wrote:<br>
     &gt;<br>
     &gt; So now the ln issue is resolved, I&#39;m not convinced my MACHINEOVERRIDES is<br>
     &gt; the correct approach. Does anyone have any feedback on how I can improve<br>
     &gt; that?<br>
<br>
    If you want to make a configurable symlink then perhaps the more usual<br>
    approach would be to just use a variable in the linux-firmware recipe<br>
    to weakly define a default target for the symlink. Machine config<br>
    files could then either do nothing (ie use the default) or provide<br>
    their own value. For example, in the linux-firmware recipe:<br>
<br>
       BCM43430_NVRAM_SYMLINK ?= &quot;brcmfmac43430-sdio.AP6212.txt<wbr>&quot;<br>
<br>
       FILES_${PN}-bcm43430-nvram = &quot; \<br>
         ${nonarch_base_libdir}/firmwar<wbr>e/brcm/brcmfmac43430-sdio.txt \<br>
         ${nonarch_base_libdir}/firmwar<wbr>e/brcm/brcmfmac43430-sdio.<wbr>AP6212.txt \<br>
         ${nonarch_base_libdir}/firmwar<wbr>e/brcm/brcmfmac43430-sdio.<wbr>MUR1DX.txt \<br>
       &quot;<br>
<br>
       do_install() {<br>
         ...<br>
         ln -sf ${BCM43430_NVRAM_SYMLINK}<br>
    ${D}${nonarch_base_libdir}/fir<wbr>mware/brcm/brcmfmac43430-sdio.<wbr>txt<br>
       }<br>
<br>
    And then in the machine config files of machines which need the MUR1DX<br>
    firmware instead of the default, add:<br>
<br>
       BCM43430_NVRAM_SYMLINK = &quot;brcmfmac43430-sdio.MUR1DX.txt<wbr>&quot;<br>
<br>
    However... note that currently the linux-firmware recipe is<br>
    architecture independent (ie it won&#39;t be rebuilt if the target is<br>
    changed). Adding a machine specific symlink is going to cause problems<br>
    with that, so the above is still not a full solution.<br>
<br>
<br>
<br>
</div></div></blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openem<wbr>bedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</div></div></blockquote></div><br></div></div>
diff mbox series

Patch

diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
index 8c54f28..b647abc 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -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 \