Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 754960 - sys-kernel/linux-firmware-20201022-r2 failed to emerge with USE=savedconfig
Summary: sys-kernel/linux-firmware-20201022-r2 failed to emerge with USE=savedconfig
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-16 19:05 UTC by Leonid Kopylov
Modified: 2020-11-19 18:26 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,94.42 KB, text/plain)
2020-11-16 19:06 UTC, Leonid Kopylov
Details
linux-firmware-20201022-r2 (linux-firmware-20201022-r2,56.33 KB, application/octet-stream)
2020-11-17 06:29 UTC, Leonid Kopylov
Details
linux-firmware.conf (linux-firmware.conf,56.33 KB, text/plain)
2020-11-19 10:34 UTC, Leonid Kopylov
Details
files_to_keep.lst (files_to_keep.lst,56.27 KB, text/plain)
2020-11-19 10:35 UTC, Leonid Kopylov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leonid Kopylov 2020-11-16 19:05:09 UTC
# emerge -pqv '=sys-kernel/linux-firmware-20201022-r2::gentoo'
[ebuild   R   ] sys-kernel/linux-firmware-20201022-r2  USE="redistributable savedconfig* -initramfs (-unknown-license)"

# emerge --info '=sys-kernel/linux-firmware-20201022-r2::gentoo'
Portage 3.0.9 (python 3.7.9-final-0, default/linux/amd64/17.1/systemd, gcc-10.2.0, glibc-2.32-r3, 5.9.8-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.9.8-gentoo-x86_64-Intel-R-_Core-TM-_i7-8559U_CPU_@_2.70GHz-with-gentoo-2.7
KiB Mem:    32753240 total,  16895840 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Mon, 16 Nov 2020 08:30:01 +0000
Head commit of repository gentoo: a96e73bcc512a2902dba6fb5e89f166b0e3711bd
sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.1 p1) 2.35.1
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo, 3.10.0_alpha1::gentoo
dev-util/cmake:           3.18.4::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2::gentoo
sys-devel/binutils:       2.35.1::gentoo
sys-devel/gcc:            10.2.0-r3::gentoo
sys-devel/gcc-config:     2.3.2::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox 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 -O2 -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="http://mirror.isoc.org.il/pub/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/var/cache/binpkgs"
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="/var/tmp"
USE="X accessibility acl addc ads alsa amd64 audit berkdb bluetooth bzip2 cgroup-hybrid cli crypt cryptsetup curl dbus device-mapper doc dot dri efi examples experimental fontconfig fortran fuse gd gdbm geoip go gpg gpm html http http2 iconv icu idn ipv6 iscsi iscsi-direct iso jadetex java jpeg json kerberos ldap libglvnd libssh libtirpc lkrn logrotate lvm lxc math mbox mdadm mount mpx multilib multipath ncurses networkmanager nfs nls nptl nscd offensive opengl openmp openntpd pam parted pcap pcre pcre32 perl plugins png policykit pulseaudio python qrcode readline samba sasl savedconfig script sdl sdl-image seccomp slp smi spice split-usr sqlite ssh sshdump ssl symlink sync-plugin-portage systemd tcpd tfshark threads tools truetype udev undi unicode usb usbredir vboxwebsrv vhost-net vhost-user-fs virtualbox vmware vnc wifi winbind wininst wireshark-plugins xattr xetex xfs xml yaml zfs zlib zstd" ABI_X86="64 32" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache 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="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en en-US he ru" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver scripting-beanshell wiki-publisher scripting-javascript" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25 ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="intel i965 iris" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sys-kernel/linux-firmware-20201022-r2::gentoo was built with the following:
USE="redistributable -initramfs -savedconfig (-unknown-license)" ABI_X86="(64)"
Comment 1 Leonid Kopylov 2020-11-16 19:06:11 UTC
Created attachment 671671 [details]
build.log
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2020-11-17 01:49:16 UTC
Please attach "/etc/portage/savedconfig/sys-kernel/linux-firmware-20201022-r2".
Comment 3 Leonid Kopylov 2020-11-17 06:29:30 UTC
Created attachment 671713 [details]
linux-firmware-20201022-r2
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2020-11-18 23:04:59 UTC
I cannot reproduce your failure.

Maybe make the following change to ebuild and show us debug output:

> @@ -270,6 +270,7 @@
>         find * -xtype l -print -delete || die
> 
>         if use savedconfig; then
> +               set -x
>                 if [[ -s "${S}/${PN}.conf" ]]; then
>                         local files_to_keep="${T}/files_to_keep.lst"
>                         grep -v '^#' "${S}/${PN}.conf" 2>/dev/null > "${files_to_keep}" || die
>
Comment 5 Leonid Kopylov 2020-11-19 08:47:16 UTC
creating link intel/ice/ddp/ice.pkg -> ice-1.3.16.0.pkg
 * Removing broken symlinks ...
+ [[ -s /var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/work/linux-firmware-20201022/linux-firmware.conf ]]
+ local files_to_keep=/var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/temp/files_to_keep.lst
+ grep -v '^#' /var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/work/linux-firmware-20201022/linux-firmware.conf
+ [[ -s /var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/temp/files_to_keep.lst ]]
+ einfo 'Applying USE=savedconfig; Removing all files not listed in config ...'
+ __elog_base INFO 'Applying USE=savedconfig; Removing all files not listed in config ...'
+ local messagetype
+ '[' -z INFO -o -z /var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/temp -o '!' -d /var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/temp/logging ']'
+ case "${1}" in
+ messagetype=INFO
+ shift
+ echo -e 'Applying USE=savedconfig; Removing all files not listed in config ...'
+ read -r
+ echo 'INFO Applying USE=savedconfig; Removing all files not listed in config ...'
+ read -r
+ return 0
+ [[ yes != \y\e\s ]]
+ echo -e 'Applying USE=savedconfig; Removing all files not listed in config ...'
+ read -r
+ echo ' * Applying USE=savedconfig; Removing all files not listed in config ...'
 * Applying USE=savedconfig; Removing all files not listed in config ...
+ read -r
+ LAST_E_CMD=einfo
+ return 0
+ set -o pipefail
+ find '!' -type d -printf '%P\n'
+ grep -Fvx -f /var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/temp/files_to_keep.lst
+ xargs -d '\n' --no-run-if-empty rm -v
+ [[ 1 -ne 0 ]]
+ die 'Failed to remove files not listed in config'
+ [[ -n '' ]]
+ set +x
 * ERROR: sys-kernel/linux-firmware-20201022-r2::gentoo failed (install phase):
 *   Failed to remove files not listed in config
 *
 * Call stack:
 *     ebuild.sh, line 125:  Called src_install
 *   environment, line 754:  Called die
 * The specific snippet of code:
 *               [[ ${?} -ne 0 ]] && die "Failed to remove files not listed in config";
 *
 * If you need support, post the output of `emerge --info '=sys-kernel/linux-firmware-20201022-r2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-kernel/linux-firmware-20201022-r2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/image/lib/firmware'
 * S: '/var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/work/linux-firmware-20201022'
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2020-11-19 10:27:04 UTC
Please attach

/var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/work/linux-firmware-20201022/linux-firmware.conf
/var/tmp/portage/sys-kernel/linux-firmware-20201022-r2/temp/files_to_keep.lst

once the package failed.
Comment 7 Leonid Kopylov 2020-11-19 10:34:41 UTC
Created attachment 672886 [details]
linux-firmware.conf
Comment 8 Leonid Kopylov 2020-11-19 10:35:09 UTC
Created attachment 672889 [details]
files_to_keep.lst
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2020-11-19 13:13:38 UTC
linux-firmware.conf looks fine and is the same in /etc and package.

But files_to_keep.lst doesn't match.

Yours is 50506 bytes larger.

With your generated files_to_keep.lst I can reproduce the failure but I don't know how to reproduce this file.

Please show us `emerge -p $(which grep)`.
Comment 10 Leonid Kopylov 2020-11-19 13:17:33 UTC
# emerge -p $(which grep)

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-apps/grep-3.6
Comment 11 Thomas Deutschmann (RETIRED) gentoo-dev 2020-11-19 16:53:54 UTC
OK, I now understand the problem:

To reproduce the problem you need to install the package twice with USE=savedconfig without altering saved config.

On second run you will run into the failure because grep command in

> find ! -type d -printf "%P\n" \
> 	| grep -Fvx -f "${files_to_keep}" \
> 	| xargs -d '\n' --no-run-if-empty rm -v

will eliminate all files previously returned by find command, thus grep is not selecting any lines which cause grep to exit with exit status 1 which will trigger our error handling.
Comment 12 Larry the Git Cow gentoo-dev 2020-11-19 18:26:16 UTC
The bug has been closed via the following commit(s):

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

commit 57616accfd55b736e3b402ead96637e23792772a
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-11-19 18:24:44 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-11-19 18:26:05 +0000

    sys-kernel/linux-firmware: check each command in pipeline manually
    
    We cannot use Bash's pipefail option because grep can return exit status 1
    to indicate that no line was selected which isn't an error.
    
    Fixes: 9bf0896d9 ("sys-kernel/linux-firmware: use copy-firmware.sh to install firmwares")
    Closes: https://bugs.gentoo.org/754960
    Package-Manager: Portage-3.0.9, Repoman-3.0.2
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild | 11 +++++++++--
 sys-kernel/linux-firmware/linux-firmware-99999999.ebuild    | 11 +++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)