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