From: "Martin Hundebøll" <martin@geanix.com>
To: Ryan Harkin <ryan.harkin@linaro.org>,
Andre McCurdy <armccurdy@gmail.com>
Cc: daiane.angolini@nxp.com, Patch Tracking <patches@linaro.org>,
Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM
Date: Thu, 23 Aug 2018 08:39:55 +0200 [thread overview]
Message-ID: <ef756a97-310a-63a9-1a3b-be0bb6634769@geanix.com> (raw)
In-Reply-To: <CAD0U-h+yMkaadysGDcmhZHSPY8tgbw_O8jquynJduChJjgypxA@mail.gmail.com>
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
next prev parent reply other threads:[~2018-08-23 6:39 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-22 16:30 [RFC 0/3] Adding BCM43430 NVRAM files Ryan Harkin
2018-08-22 16:30 ` [RFC 1/3] linux-firmware: upgrade to 1d17c18 revision Ryan Harkin
2018-08-22 16:30 ` [RFC 2/3] linux-firmware: add BCM43430 nvram files Ryan Harkin
2018-08-22 16:30 ` [RFC 3/3] linux-firmware: MACHINEOVERRIDES for BCM43430 NVRAM Ryan Harkin
2018-08-22 16:41 ` Martin Jansa
2018-08-22 16:47 ` Ryan Harkin
2018-08-22 16:56 ` Martin Jansa
2018-08-22 17:11 ` Ryan Harkin
2018-08-22 19:02 ` Martin Jansa
2018-08-22 20:10 ` Ryan Harkin
2018-08-22 20:36 ` Khem Raj
2018-08-22 21:52 ` Ryan Harkin
2018-08-22 20:42 ` Andre McCurdy
2018-08-22 21:56 ` Ryan Harkin
2018-08-22 22:55 ` Andre McCurdy
2018-08-23 6:12 ` Ryan Harkin
2018-08-23 6:39 ` Martin Hundebøll [this message]
2018-08-23 7:08 ` Ryan Harkin
2018-08-23 7:19 ` Andre McCurdy
2018-08-23 15:58 ` Khem Raj
2018-08-23 7:06 ` Andre McCurdy
2018-08-23 7:17 ` Ryan Harkin
2018-08-23 7:34 ` Andre McCurdy
2018-08-23 7:36 ` Ryan Harkin
2018-08-23 8:15 ` Ryan Harkin
2018-08-24 2:53 ` Andre McCurdy
2018-08-24 9:04 ` Martin Jansa
2018-08-24 10:43 ` Mike Looijmans
2018-08-28 10:54 ` Ryan Harkin
2018-08-24 10:50 ` Ryan Harkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ef756a97-310a-63a9-1a3b-be0bb6634769@geanix.com \
--to=martin@geanix.com \
--cc=armccurdy@gmail.com \
--cc=daiane.angolini@nxp.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=patches@linaro.org \
--cc=ryan.harkin@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox