Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 927022

Summary: sys-kernel/linux-firmware savedconfig non-functional for symlinks
Product: Gentoo Linux Reporter: email
Component: Current packagesAssignee: Chí-Thanh Christopher Nguyễn <chithanh>
Status: UNCONFIRMED ---    
Severity: normal CC: alexander, kernel, kfm, mpagano, zerochaos
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description email 2024-03-14 13:52:18 UTC
I have installed 
```
sys-kernel/linux-firmware-20240312::gentoo  USE="compress-zstd initramfs redistributable -bindist -compress-xz -deduplicate -savedconfig (-unknown-license)"
```

savedconfig is
```
voyager /etc/portage/savedconfig/sys-kernel # cat linux-firmware-20240312 
amdgpu/navy_flounder_sos.bin
amdgpu/navy_flounder_ta.bin
amdgpu/navy_flounder_smc.bin
amdgpu/navy_flounder_dmcub.bin
amdgpu/navy_flounder_pfp.bin
amdgpu/navy_flounder_me.bin
amdgpu/navy_flounder_ce.bin
amdgpu/navy_flounder_rlc.bin
amdgpu/navy_flounder_mec.bin
amdgpu/navy_flounder_mec2.bin
amdgpu/navy_flounder_sdma.bin
amdgpu/navy_flounder_vcn.bin
amdgpu/yellow_carp_toc.bin
amdgpu/yellow_carp_ta.bin
amdgpu/yellow_carp_dmcub.bin
amdgpu/yellow_carp_pfp.bin
amdgpu/yellow_carp_me.bin
amdgpu/yellow_carp_ce.bin
amdgpu/yellow_carp_rlc.bin
amdgpu/yellow_carp_mec.bin
amdgpu/yellow_carp_mec2.bin
amdgpu/yellow_carp_sdma.bin
amdgpu/yellow_carp_vcn.bin
regulatory.db
regulatory.db.p7s
ath11k/WCN6855/hw2.1/firmware-2.bin
ath11k/WCN6855/hw2.1/amss.bin
ath11k/WCN6855/hw2.1/board-2.bin
ath11k/WCN6855/hw2.1/m3.bin
qca/rampatch_usb_00130201.bin

```


files exist (compressed), but some are symlinks.
```
voyager /etc/portage/savedconfig/sys-kernel # file /usr/lib/firmware/ath11k/WCN6855/hw2.1/board-2.bin.zst 
/usr/lib/firmware/ath11k/WCN6855/hw2.1/board-2.bin.zst: symbolic link to ../hw2.0/board-2.bin.zst
```

re-emerging with USE="savedconfig" breaks the symbolic links, which are then later cleaned up.


```
>>> Install sys-kernel/linux-firmware-20240312 into /var/tmp/portage/sys-kernel/linux-firmware-20240312/image
copying/compressing file amdgpu/navy_flounder_ce.bin
copying/compressing file amdgpu/navy_flounder_dmcub.bin
copying/compressing file amdgpu/navy_flounder_me.bin
copying/compressing file amdgpu/navy_flounder_mec.bin
copying/compressing file amdgpu/navy_flounder_mec2.bin
copying/compressing file amdgpu/navy_flounder_pfp.bin
copying/compressing file amdgpu/navy_flounder_rlc.bin
copying/compressing file amdgpu/navy_flounder_sdma.bin
copying/compressing file amdgpu/navy_flounder_smc.bin
copying/compressing file amdgpu/navy_flounder_sos.bin
copying/compressing file amdgpu/navy_flounder_ta.bin
copying/compressing file amdgpu/navy_flounder_vcn.bin
copying/compressing file amdgpu/yellow_carp_ce.bin
copying/compressing file amdgpu/yellow_carp_dmcub.bin
copying/compressing file amdgpu/yellow_carp_me.bin
copying/compressing file amdgpu/yellow_carp_mec.bin
copying/compressing file amdgpu/yellow_carp_mec2.bin
copying/compressing file amdgpu/yellow_carp_pfp.bin
copying/compressing file amdgpu/yellow_carp_rlc.bin
copying/compressing file amdgpu/yellow_carp_sdma.bin
copying/compressing file amdgpu/yellow_carp_ta.bin
copying/compressing file amdgpu/yellow_carp_toc.bin
copying/compressing file amdgpu/yellow_carp_vcn.bin
copying/compressing file qca/rampatch_usb_00130201.bin
creating link ath11k/WCN6855/hw2.1/board-2.bin -> ../hw2.0/board-2.bin
creating link ath11k/WCN6855/hw2.1/amss.bin -> ../hw2.0/amss.bin
creating link ath11k/WCN6855/hw2.1/m3.bin -> ../hw2.0/m3.bin
 * Removing broken symlinks ...
ath11k/WCN6855/hw2.1/board-2.bin
ath11k/WCN6855/hw2.1/amss.bin
ath11k/WCN6855/hw2.1/m3.bin
```

To work-around, one needs to also list the symlink targets in the saved config, but this is tedious.

Perhaps this could be mentioned in the linux-firmware wiki?

I dont know what the ideal solution is...?

A) dont use symlinks when savedconfig is enabled?
B) use hardlinks instead of symlinks ?
C) try to be clever, and also preserve link targets?