Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917324 - sys-kernel/linux-firmware-20231111 installs non-existing symlinks, lacks files
Summary: sys-kernel/linux-firmware-20231111 installs non-existing symlinks, lacks files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-11-14 08:54 UTC by Klaus Kusche
Modified: 2023-11-29 04:14 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
complete emerge log (build.log,401.48 KB, text/x-log)
2023-11-14 09:05 UTC, Kostadin Shishmanov
Details
sys-kernel/linux-firmware: update live to work after upstream changes (0001-sys-kernel-linux-firmware-update-live-to-work-after-.patch,1.52 KB, patch)
2023-11-29 01:55 UTC, Eli Schwartz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Kusche 2023-11-14 08:54:47 UTC
I've a savedconfig file which lists several polaris12... files 
for my amd graphics card (and nothing else!).

sys-kernel/linux-firmware-20231111 seems to detect that four of these polaris12... files are identical to the correspondig polaris10... files.

Hence, for these polaris12... files, 
linux-firmware does not install the actual files, 
but installs just symlinks to the correspondig polaris10... files.

However, these polaris10... files are *not* installed,
because they are not listed in my savedconfig.
Hence, the polaris12... symlinks are broken, 
and building my kernel fails 
(I include the firmware directly in vmlinux).

linux-firmware should not check *all* firmware files for duplicates.
It should just check the *installed* files (i.e. those listed in savedconfig)
for duplicates!

Hence, it should install just symlinks only if the symlink target
is also installed.
Comment 1 Kostadin Shishmanov 2023-11-14 09:05:35 UTC
Created attachment 874723 [details]
complete emerge log

I think im running into the same thing? but with broken symlinks from sienna_cichlid files to beige_goby ones.

 * QA Notice: Symbolic link /lib/firmware/amdgpu/sienna_cichlid_vcn.bin.zst points to /lib/firmware/amdgpu/beige_goby_vcn.bin.zst which does not exist.
>>> /lib/firmware/amdgpu/sienna_cichlid_vcn.bin.zst -> beige_goby_vcn.bin.zst
 * QA Notice: Symbolic link /lib/firmware/amdgpu/sienna_cichlid_dmcub.bin.zst points to /lib/firmware/amdgpu/beige_goby_dmcub.bin.zst which does not exist.
>>> /lib/firmware/amdgpu/sienna_cichlid_dmcub.bin.zst -> beige_goby_dmcub.bin.zst

Contents of /etc/portage/savedconfig/sys-kernel/linux-firmware:

amdgpu/sienna_cichlid_ce.bin
amdgpu/sienna_cichlid_dmcub.bin
amdgpu/sienna_cichlid_me.bin
amdgpu/sienna_cichlid_mec.bin
amdgpu/sienna_cichlid_mec2.bin
amdgpu/sienna_cichlid_pfp.bin
amdgpu/sienna_cichlid_rlc.bin
amdgpu/sienna_cichlid_sdma.bin
amdgpu/sienna_cichlid_smc.bin
amdgpu/sienna_cichlid_sos.bin
amdgpu/sienna_cichlid_ta.bin
amdgpu/sienna_cichlid_vcn.bin
rtl_nic/rtl8125a-3.fw
rtl_nic/rtl8125b-1.fw
rtl_nic/rtl8125b-2.fw
Comment 2 Yuki N. 2023-11-14 09:52:02 UTC
Same here:

/etc/portage/savedconfig/sys-kernel/linux-firmware-20231111
amdgpu/sienna_cichlid_ce.bin
amdgpu/sienna_cichlid_dmcub.bin
amdgpu/sienna_cichlid_me.bin
amdgpu/sienna_cichlid_mec.bin
amdgpu/sienna_cichlid_mec2.bin
amdgpu/sienna_cichlid_pfp.bin
amdgpu/sienna_cichlid_rlc.bin
amdgpu/sienna_cichlid_sdma.bin
amdgpu/sienna_cichlid_smc.bin
amdgpu/sienna_cichlid_sos.bin
amdgpu/sienna_cichlid_ta.bin
amdgpu/sienna_cichlid_vcn.bin
rtl_nic/rtl8168h-2.fw

ls -l /lib/firmware/amdgpu | grep "\->"
sienna_cichlid_dmcub.bin -> beige_goby_dmcub.bin
sienna_cichlid_mec2.bin -> sienna_cichlid_mec.bin
sienna_cichlid_vcn.bin -> beige_goby_vcn.bin
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-14 16:32:10 UTC
This will end up surely being caused by the upstream dedupe stuff they added..
Comment 4 Holger Hoffstätte 2023-11-14 23:56:49 UTC
Confirmed - just suffered the same problem on two machines with amdgpu and radeon drivers, both were suddenly broken due to dangling symlinks and required additional entries in the savedconfig file. Definitely not a fluke.
E.g. renoir_dmcub.bin is suddenly symlinked to green_sardine_dmcub.bin, which was missing.
Comment 5 Larry the Git Cow gentoo-dev 2023-11-26 15:13:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7898633e0c2811881fc0fdde6b93e26f2277e8d

commit c7898633e0c2811881fc0fdde6b93e26f2277e8d
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2023-11-26 15:12:29 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2023-11-26 15:12:29 +0000

    sys-kernel/linux-firmware: upd EAPI 7 -> 8, add dedup optional logic
    
    Move upstream's deduplication part of their script,
    which requires rdfind, behind a new use flag: deduplicate
    
    Patch will remove the deduplication part of the script based on
    use flag.
    
    Add info on deduplicate use flag
    
    Thanks to Sam for the review
    
    Bug: https://bugs.gentoo.org/917324
    Closes: https://github.com/gentoo/gentoo/pull/33988
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 .../linux-firmware-remove-rdfind-dep-and-use.patch |  34 ++
 .../linux-firmware-20231111-r1.ebuild              | 408 +++++++++++++++++++++
 sys-kernel/linux-firmware/metadata.xml             |   1 +
 3 files changed, 443 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2023-11-26 15:23:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8f9d290054a758eaad85194c40ff7ccfce71d85

commit d8f9d290054a758eaad85194c40ff7ccfce71d85
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2023-11-26 15:22:16 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2023-11-26 15:22:16 +0000

    sys-kernel/linux-firmware: upd EAPI 7->8, add dedup optional logic
    
    Move upstream's deduplication part of their script,
    which requires rdfind, behind a new use flag: deduplicate
    
    Patch will remove the deduplication part of the script based on
    use flag.
    
    Thanks to Sam for the review
    
    Closes: https://bugs.gentoo.org/917324
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 sys-kernel/linux-firmware/linux-firmware-99999999.ebuild | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
Comment 7 Eli Schwartz 2023-11-29 01:03:26 UTC
Upstream has made the Makefile support skipping rdfind: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=4124f8f928d51a1437e2fd2636b20d540edc2836
Comment 8 Eli Schwartz 2023-11-29 01:55:07 UTC
Created attachment 875910 [details, diff]
sys-kernel/linux-firmware: update live to work after upstream changes
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-29 04:14:22 UTC
(In reply to Eli Schwartz from comment #8)
> Created attachment 875910 [details, diff] [details, diff]
> sys-kernel/linux-firmware: update live to work after upstream changes

commit 9b9521345f302df2a469d138bd041d87cf9b6a80 (HEAD -> master, origin/master, origin/HEAD)
Author: Eli Schwartz <eschwartz93@gmail.com>
Date:   Tue Nov 28 20:52:10 2023 -0500

    sys-kernel/linux-firmware: update live to work after upstream changes

    The USE=deduplicate patch is already invalidated by upstream commits.
    The good news is those upstream commits implement the same feature but
    without needing a patch.

    Start using the official upstream option instead.

    Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>