package/linux-firmware: fix special cases of symlinks
authorAntoine Tenart <antoine.tenart@bootlin.com>
Wed, 4 Mar 2020 16:55:32 +0000 (17:55 +0100)
committerYann E. MORIN <yann.morin.1998@free.fr>
Thu, 5 Mar 2020 17:22:05 +0000 (18:22 +0100)
commit7f24e92751448a0aa715aca9746fcacc106b07a8
treea1f8443aacccf7dd7af8989abf6faabf1d3b7e43
parentfccdc6bd0b587b1b60565d957fe963fa4396f120
package/linux-firmware: fix special cases of symlinks

Some symlinks were not created correctly when installing the
Linux-firmware package. This patch fixes the support for all symlinks of
the form:

  a/foo -> bar
  a/foo -> b/bar
  a/foo -> ../b/bar

With this patch all forms of symlinks described in the WHENCE file
should be supported, whether they are in nested directories, or in
non-existing ones.

As some symlinks could be in directories that do not exist, we must
maje sure to canonicalize the path before testing the linked-to file.

We compared the symlinks installed pre-20200122 to what we have now, and
it seems we're handling all of them with this patch.

Fixes: 55df4059d24b ("package/linux-firmware: fix symlink support")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
[yann.morin.1998@free.fr:
  - use readlink in canonicalize-missing mode, to avoid
    creating-then-removing directories
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Antoine Tenart <antoine.tenart@bootlin.com>
Reviewed-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/linux-firmware/linux-firmware.mk