[Buildroot] [PATCH] package/linux-firmware: fix symlink support
Antoine Tenart
antoine.tenart at bootlin.com
Tue Mar 3 21:30:18 UTC 2020
Yann,
On Tue, Mar 03, 2020 at 10:15:52PM +0100, Yann E. MORIN wrote:
> On 2020-03-03 19:47 +0100, Antoine Tenart spake thusly:
> > On Tue, Mar 03, 2020 at 05:43:02PM +0100, Yann E. MORIN wrote:
> > > On 2020-03-03 14:33 +0100, Antoine Tenart spake thusly:
> > > > +# Some firmware are distributed as a symlink, for drivers to load them using a
> > > > +# defined name other than the real one. Since 9cfefbd7fbda ("Remove duplicate
> > > > +# symlinks") those symlink aren't distributed in linux-firmware but are created
> > > > +# automatically by its copy-firmware.sh script during the installation, which
> > > > +# parses the WHENCE file where symlinks are described. We follow the same logic
> > > > +# here, adding symlink only for firmwares installed in the target directory.
> > > > +# The grep/sed parsing is taken from the script mentioned before.
> > > > +define LINUX_FIRMWARE_CREATE_SYMLINKS
> > > > + grep -E '^Link:' $(@D)/WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; do \
> > >
> > > You can combine the grep and sed into a single sed call:
> > >
> > > sed -r -e '/^Link: (.+) -> (.+)$$/!d; s//\1 \2/' $(@D)/WHENCE
> >
> > The reasoning here was to reuse with as little change as possible the
> > code used in Linux-firmware's copy-firmware.sh script, to be easily
> > maintainable should they decide to update the link definition format.
>
> I see, and that's a good reason. Yet, I've looked at the copy-firmware
> script, and I am not impressed... I find the above to be more readable.
That is the least we can say, not impressed :-)
> > I'm not pushing for either solution, I can change this for v2 if you
> > believe the two command should still be combined.
>
> no need for a v2: the major road-block (the globs above) is not. I can
> fix the sed and hook stuff locally (I already did it).
Thanks!
Antoine
--
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the buildroot
mailing list