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

Bug 941786

Summary: sys-kernel/linux-firmware-20241017[savedconfig]: ./copy-firmware.sh "${FW_OPTIONS[@]}" || die;
Product: Gentoo Linux Reporter: Perfect Gentleman <perfect007gentleman>
Component: Current packagesAssignee: Chí-Thanh Christopher Nguyễn <chithanh>
Status: RESOLVED FIXED    
Severity: normal CC: aidanamarks, creideiki+gentoo-bugzilla, gentoo, holger, kernel, mpagano, perfect007gentleman, vovan, zerochaos
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
emerge --info
build.log leaving dangling nvidia symlinks behind

Description Perfect Gentleman 2024-10-18 23:13:18 UTC
* ERROR: sys-kernel/linux-firmware-20241017::gentoo failed (install phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 136:  Called src_install
 *   environment, line 3205:  Called die
 * The specific snippet of code:
 *       ./copy-firmware.sh "${FW_OPTIONS[@]}" || die;


Reproducible: Always
Comment 1 Perfect Gentleman 2024-10-18 23:13:55 UTC
Created attachment 906326 [details]
build.log
Comment 2 Matt Whitlock 2024-10-18 23:28:42 UTC
I have the same failure, except whereas Perfect Gentleman has…

> ERROR: Broken symlinks found:\n/tmp/portage/sys-kernel/linux-firmware-20241017/image/lib/firmware/brcm/BCM-0a5c-6410.hcd.zst

…I have…

> ERROR: Broken symlinks found:\n/var/tmp/portage/sys-kernel/linux-firmware-20241017/image/lib/firmware/mediatek/mt7988_wo_0.bin

…in the same spot in the build log ­— i.e., right after all the lines beginning "creating link".

# emerge -pqvO sys-kernel/linux-firmware
[ebuild     U ] sys-kernel/linux-firmware-20241017 [20240909-r1] USE="redistributable savedconfig -bindist -compress-xz -compress-zstd -deduplicate -dist-kernel -initramfs (-unknown-license)" 

# cat /etc/portage/savedconfig/sys-kernel/linux-firmware
# Remove files that shall not be installed from this list.
amdgpu/bonaire_ce.bin
amdgpu/bonaire_k_smc.bin
amdgpu/bonaire_mc.bin
amdgpu/bonaire_me.bin
amdgpu/bonaire_mec.bin
amdgpu/bonaire_pfp.bin
amdgpu/bonaire_rlc.bin
amdgpu/bonaire_sdma.bin
amdgpu/bonaire_sdma1.bin
amdgpu/bonaire_smc.bin
amdgpu/bonaire_uvd.bin
amdgpu/bonaire_vce.bin
ath9k_htc/htc_9271-1.4.0.fw
htc_9271.fw
mediatek/mt7662.bin
mediatek/mt7662_rom_patch.bin
mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin
mediatek/WIFI_RAM_CODE_MT7961_1.bin
mt7662.bin
mt7662_rom_patch.bin
rtl_nic/rtl8168e-3.fw
Comment 3 Vlad 2024-10-19 05:03:44 UTC
The package failed to build here as well, but the error is different:
> ERROR: Broken symlinks found:\n/mnt/portage/tmp/portage/sys-kernel/linux-firmware-20241017/image/lib/firmware/i915/skl_dmc_ver1.bin
Comment 4 Greg Kubaryk 2024-10-19 05:46:04 UTC
emerge --info as a comment please
Comment 5 Vlad 2024-10-19 06:44:53 UTC
(In reply to Greg Kubaryk from comment #4)
> emerge --info as a comment please

Got "Comments cannot be longer than 16384 characters.", so posted as an attachment.
Comment 6 Vlad 2024-10-19 06:45:42 UTC
Created attachment 906329 [details]
emerge --info
Comment 7 Mike Pagano gentoo-dev 2024-10-19 12:01:05 UTC
(In reply to Perfect Gentleman from comment #1)
> Created attachment 906326 [details]
> build.log

Attach /etc/portage/savedconfig/sys-kernel/linux-firmware-20241017, please
Comment 8 Mike Pagano gentoo-dev 2024-10-19 12:32:12 UTC
It looks like it's failing in copy-firmware.sh when using "savedconfig" here:

# Verify no broken symlinks
if test "$(find "$destdir" -xtype l | wc -l)" -ne 0 ; then
    err "Broken symlinks found:\\n$(find "$destdir" -xtype l)"
fi

exit 0
Comment 9 Larry the Git Cow gentoo-dev 2024-10-19 13:29:56 UTC
The bug has been referenced in the following commit(s):

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

commit 44b358c2437431ba2addd455a6f1c6627d5a37e2
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2024-10-19 13:29:10 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2024-10-19 13:29:10 +0000

    sys-kernel/linux-firmware: Don't check for broken links with savedconfig
    
    Bug: https://bugs.gentoo.org/941786
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 .../files/linux-firmware-copy-firmware-r6.patch    |  47 +++
 .../linux-firmware-20241017-r1.ebuild              | 403 +++++++++++++++++++++
 2 files changed, 450 insertions(+)
Comment 10 Mike Pagano gentoo-dev 2024-10-19 13:30:29 UTC
Can you folks test with linux-firmware-20241017-r1, please?
Comment 11 Perfect Gentleman 2024-10-19 14:34:02 UTC
cat /etc/portage/savedconfig/sys-kernel/linux-firmware-20241017 
# Remove files that shall not be installed from this list.
amd-ucode/microcode_amd.bin
tigon/tg357766.bin
tigon/tg3_tso5.bin
tigon/tg3_tso.bin
tigon/tg3.bin
Comment 12 Perfect Gentleman 2024-10-19 14:35:01 UTC
Portage 3.0.66.1 (python 3.13.0-final-0, default/linux/amd64/23.0/no-multilib, gcc-14, glibc-2.40-r5, 6.11.4-gentoo x86_64)
=================================================================
System uname: Linux-6.11.4-gentoo-x86_64-AMD_Turion-tm-_II_Neo_N54L_Dual-Core_Processor-with-glibc2.40
KiB Mem:     8128340 total,   6684000 free
KiB Swap:    7340028 total,   6692604 free
Timestamp of repository gentoo: Sat, 19 Oct 2024 14:18:29 +0000
Head commit of repository gentoo: b7bc5d3a0390e4a1ec1911c3718e346e92867209

Head commit of repository qt: 5bb4bfb222c72dcecc60b734db952c9870dde84e

Head commit of repository pg_overlay: bf71586208c72c962d214116aa5484d81d47dd1c

sh bash 5.2_p37
ld GNU ld (Gentoo 2.43 p2) 2.43.1
ccache version 4.10.2 [disabled]
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.17-r1::gentoo
dev-build/cmake:           3.30.5::gentoo
dev-build/libtool:         2.5.3::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.5.2::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.13.0::pg_overlay
dev-util/ccache:           4.10.2-r1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.55.1::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.43-r1::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             14.2.1_p20240921::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-kernel/linux-headers:  6.11::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r5::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: 1
    eclass-overrides: gentoo qt pg_overlay
    volatile: False
    sync-git-clone-extra-opts: --single-branch --branch master

qt
    location: /var/db/repos/qt
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/qt.git
    masters: gentoo
    priority: 1
    eclass-overrides: gentoo qt pg_overlay
    volatile: False

pg_overlay
    location: /var/db/repos/pg_overlay
    sync-type: git
    sync-uri: https://gitlab.com/Perfect_Gentleman/PG_Overlay.git
    masters: gentoo
    priority: 7
    eclass-overrides: gentoo qt pg_overlay
    volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
AR="gcc-ar"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O3 -pipe -fdevirtualize-at-ltrans -fgraphite -fgraphite-identity -fipa-pta -flto=3 -flto-compression-level=19 -floop-nest-optimize -floop-parallelize-all -fomit-frame-pointer -fsched-pressure -ftree-vectorize -fuse-linker-plugin -fuse-ld=bfd -fno-asynchronous-unwind-tables -fno-fat-lto-objects -fno-plt -fno-semantic-interposition -fno-stack-protector -s -g0 -w"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.3/ext-active/ /etc/php/cgi-php8.3/ext-active/ /etc/php/cli-php8.3/ext-active/ /etc/php/fpm-php8.3/ext-active/ /etc/php/phpdbg-php8.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-march=native -mtune=native -O3 -pipe -fdevirtualize-at-ltrans -fgraphite -fgraphite-identity -fipa-pta -flto=3 -flto-compression-level=19 -floop-nest-optimize -floop-parallelize-all -fomit-frame-pointer -fsched-pressure -ftree-vectorize -fuse-linker-plugin -fuse-ld=bfd -fno-asynchronous-unwind-tables -fno-fat-lto-objects -fno-plt -fno-semantic-interposition -fno-stack-protector -s -g0 -w"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -mtune=native -O3 -pipe -fdevirtualize-at-ltrans -fgraphite -fgraphite-identity -fipa-pta -flto=3 -flto-compression-level=19 -floop-nest-optimize -floop-parallelize-all -fomit-frame-pointer -fsched-pressure -ftree-vectorize -fuse-linker-plugin -fuse-ld=bfd -fno-asynchronous-unwind-tables -fno-fat-lto-objects -fno-plt -fno-semantic-interposition -fno-stack-protector -s -g0 -w"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait metadata-transfer multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -mtune=native -O3 -pipe -fdevirtualize-at-ltrans -fgraphite -fgraphite-identity -fipa-pta -flto=3 -flto-compression-level=19 -floop-nest-optimize -floop-parallelize-all -fomit-frame-pointer -fsched-pressure -ftree-vectorize -fuse-linker-plugin -fuse-ld=bfd -fno-asynchronous-unwind-tables -fno-fat-lto-objects -fno-plt -fno-semantic-interposition -fno-stack-protector -s -g0 -w"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/share/zsh /usr/share/fish"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--relax -Wl,--gc-sections -Wl,--sort-common -Wl,-z,norelro -march=native -mtune=native -O3 -pipe -fdevirtualize-at-ltrans -fgraphite -fgraphite-identity -fipa-pta -flto=3 -flto-compression-level=19 -floop-nest-optimize -floop-parallelize-all -fomit-frame-pointer -fsched-pressure -ftree-vectorize -fuse-linker-plugin -fuse-ld=bfd -fno-asynchronous-unwind-tables -fno-fat-lto-objects -fno-plt -fno-semantic-interposition -fno-stack-protector -s -g0 -w"
LEX="flex"
LIBTOOL="rlibtool"
LINGUAS="en en_US ru ru_RU"
MAKE="make LIBTOOL=rlibtool"
MAKEFLAGS="LIBTOOL=rlibtool"
MAKEOPTS="-j3"
NM="gcc-nm"
PKGDIR="/var/cache/binpkgs"
PORTAGE_COMPRESS_FLAGS="-9"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/tmp"
RANLIB="gcc-ranlib"
SHELL="/bin/bash"
USE="acl amd64 bash-completion bzip2 cet crypt custom-cflags cxx fastcgi ffmpeg gmp gzip iconv ipv6 jit libtirpc lto lzma lzo ncurses nls ogg openmp pam pch pcre readline seccomp smp ssl symlink szip test-rust threads udev unicode xattr zip zlib zstd" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="pc" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en_US ru ru_RU" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PERL_FEATURES="ithreads" PHP_TARGETS="php8-3" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_13" PYTHON_TARGETS="python3_13" RUBY_TARGETS="ruby32" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LFLAGS, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 13 Perfect Gentleman 2024-10-19 14:36:37 UTC
Seems fixed to me.
Comment 14 Karl-Johan Karlsson 2024-10-19 14:39:42 UTC
(In reply to Mike Pagano from comment #10)
> Can you folks test with linux-firmware-20241017-r1, please?

linux-firmware-20241017-r1 installs for me, but leaves a couple of superfluous nvidia symlinks behind (on a system which has never contained any nvidia hardware):


# tree /etc/portage/savedconfig/sys-kernel/
/etc/portage/savedconfig/sys-kernel/
└── linux-firmware

1 directory, 1 file


# cat /etc/portage/savedconfig/sys-kernel/linux-firmware 
# Remove files that shall not be installed from this list.
amdgpu/navy_flounder_ce.bin
amdgpu/navy_flounder_dmcub.bin
amdgpu/navy_flounder_me.bin
amdgpu/navy_flounder_mec.bin
amdgpu/navy_flounder_mec2.bin
amdgpu/navy_flounder_pfp.bin
amdgpu/navy_flounder_rlc.bin
amdgpu/navy_flounder_sdma.bin
amdgpu/navy_flounder_smc.bin
amdgpu/navy_flounder_sos.bin
amdgpu/navy_flounder_ta.bin
amdgpu/navy_flounder_vcn.bin
rtl_nic/rtl8168g-2.fw


# grep QA /var/tmp/portage/sys-kernel/linux-firmware-20241017-r1/temp/build.log
 * QA Notice: Symbolic link /lib/firmware/nvidia/ad107/gsp points to /lib/firmware/nvidia/ad102/gsp which does not exist.
 * QA Notice: Symbolic link /lib/firmware/nvidia/ad106/gsp points to /lib/firmware/nvidia/ad102/gsp which does not exist.
 * QA Notice: Symbolic link /lib/firmware/nvidia/ad104/gsp points to /lib/firmware/nvidia/ad102/gsp which does not exist.
 * QA Notice: Symbolic link /lib/firmware/nvidia/ad103/gsp points to /lib/firmware/nvidia/ad102/gsp which does not exist.
 * QA Notice: Symbolic link /lib/firmware/nvidia/tu117/gsp points to /lib/firmware/nvidia/tu116/gsp which does not exist.


# tree /lib/firmware/nvidia/
/lib/firmware/nvidia/
├── ad103
│   └── gsp -> ../ad102/gsp
├── ad104
│   └── gsp -> ../ad102/gsp
├── ad106
│   └── gsp -> ../ad102/gsp
├── ad107
│   └── gsp -> ../ad102/gsp
└── tu117
    └── gsp -> ../tu116/gsp

6 directories, 5 files


# tree -d /lib/firmware
/lib/firmware
├── amdgpu
├── intel-ucode
├── nvidia
│   ├── ad103
│   ├── ad104
│   ├── ad106
│   ├── ad107
│   └── tu117
└── rtl_nic

10 directories
Comment 15 Karl-Johan Karlsson 2024-10-19 14:42:05 UTC
Created attachment 906366 [details]
build.log leaving dangling nvidia symlinks behind
Comment 16 Mike Pagano gentoo-dev 2024-10-19 15:33:34 UTC
(In reply to Karl-Johan Karlsson from comment #15)
> Created attachment 906366 [details]
> build.log leaving dangling nvidia symlinks behind

Thanks, I think I see the issue, -r2 coming out in a bit.
Comment 17 Larry the Git Cow gentoo-dev 2024-10-19 16:07:16 UTC
The bug has been referenced in the following commit(s):

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

commit 24162b6c5051a442f906da62df70e590ee36a2b7
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2024-10-19 16:06:31 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2024-10-19 16:06:31 +0000

    sys-kernel/linux-firmware: Fix bug with savedconfig and symlinks
    
    Bug: https://bugs.gentoo.org/941786
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 .../files/linux-firmware-copy-firmware-r6.patch    |   2 +-
 .../linux-firmware-20241017-r2.ebuild              | 403 +++++++++++++++++++++
 2 files changed, 404 insertions(+), 1 deletion(-)
Comment 18 Mike Pagano gentoo-dev 2024-10-19 16:07:57 UTC
(In reply to Larry the Git Cow from comment #17)
> The bug has been referenced in the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=24162b6c5051a442f906da62df70e590ee36a2b7
> 
> commit 24162b6c5051a442f906da62df70e590ee36a2b7
> Author:     Mike Pagano <mpagano@gentoo.org>
> AuthorDate: 2024-10-19 16:06:31 +0000
> Commit:     Mike Pagano <mpagano@gentoo.org>
> CommitDate: 2024-10-19 16:06:31 +0000
> 
>     sys-kernel/linux-firmware: Fix bug with savedconfig and symlinks
>     
>     Bug: https://bugs.gentoo.org/941786
>     Signed-off-by: Mike Pagano <mpagano@gentoo.org>
> 
>  .../files/linux-firmware-copy-firmware-r6.patch    |   2 +-
>  .../linux-firmware-20241017-r2.ebuild              | 403
> +++++++++++++++++++++
>  2 files changed, 404 insertions(+), 1 deletion(-)

Karl, can you test linux-firmware-20241017-r2 ?
Comment 19 Karl-Johan Karlsson 2024-10-19 16:22:02 UTC
(In reply to Mike Pagano from comment #18)
> Karl, can you test linux-firmware-20241017-r2 ?

Thanks, -r2 works for me.
Comment 20 Mike Pagano gentoo-dev 2024-10-19 20:06:34 UTC
(In reply to Karl-Johan Karlsson from comment #19)
> (In reply to Mike Pagano from comment #18)
> > Karl, can you test linux-firmware-20241017-r2 ?
> 
> Thanks, -r2 works for me.

Thanks for testing