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