]> git.proxmox.com Git - mirror_linux-firmware.git/commit - copy-firmware.sh
copy-firmware: Fix linking directories when using compression
authorBenjamin Drung <benjamin.drung@canonical.com>
Tue, 18 Jul 2023 18:23:40 +0000 (20:23 +0200)
committerJosh Boyer <jwboyer@kernel.org>
Tue, 25 Jul 2023 10:53:30 +0000 (06:53 -0400)
commitb6ea35ff6b9869470a0c68813f1668acb3d356a8
tree4005837d2eb5418dbe5a871e3c9529ed45482677
parent0a51959c6fd4248b454f7250997fd4f13500fb8a
copy-firmware: Fix linking directories when using compression

When `copy-firmware` is called with `--xz` or `--zstd` it will create
broken symlinks for directories:

```
$ ./copy-firmware -v --zstd $dir
[...]
creating link qcom/LENOVO/21BX.zst -> ../sc8280xp/LENOVO/21BX.zst
```

The original target `../sc8280xp/LENOVO/21BX` is a directory. Adding the
compression extension to the directory name breaks the link. The
directory `qcom/sc8280xp/LENOVO/21BX` exists but
`qcom/sc8280xp/LENOVO/21BX.zst` does not exist.

The relative symlink needs to be resolved. If it points to a directory,
create the symlink without the compression extension.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Signed-off-by: Josh Boyer <jwboyer@kernel.org>
copy-firmware.sh