Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 795057 - kernel-2.eclass (commit aa4f1706fe35d8e49c69f3cd1c1caf66f3a0714d) USE="symlink" does not set symlink
Summary: kernel-2.eclass (commit aa4f1706fe35d8e49c69f3cd1c1caf66f3a0714d) USE="symlin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: https://github.com/gentoo/gentoo/pull...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-09 07:31 UTC by Till Schäfer
Modified: 2021-06-09 11:54 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Till Schäfer 2021-06-09 07:31:42 UTC
After emerging sys-kernel/gentoo-sources-5.12.9 with USE="symlink" (previous kernel was sys-kernel/gentoo-sources-5.12.7) the symlink was not set to the new kernel. 

# l /usr/src/
total 28K
drwxr-xr-x  7 root root 4.0K  9. Jun 07:27 .
drwxr-xr-x 18 root root 4.0K  8. Mai 01:56 ..
-rw-r--r--  1 root root    0 17. Apr 2007  .keep
lrwxrwxrwx  1 root root   19 28. Mai 19:35 linux -> linux-5.12.7-gentoo
drwxr-xr-x 21 root root 4.0K 19. Mai 09:12 linux-5.11.20-gentoo
drwxr-xr-x 21 root root 4.0K 21. Mai 10:38 linux-5.11.21-gentoo
drwxr-xr-x 21 root root 4.0K 28. Mai 22:13 linux-5.12.5-gentoo
drwxr-xr-x 21 root root 4.0K  9. Jun 09:23 linux-5.12.7-gentoo
drwxr-xr-x 25 root root 4.0K  9. Jun 09:23 linux-5.12.9-gentoo

is this an EAPI issue? 

# diff gentoo-sources-5.12.[79].ebuild 
4c4
< EAPI="6"
---
> EAPI="7"
7c7
< K_GENPATCHES_VER="8"
---
> K_GENPATCHES_VER="10"

Reproducible: Always




# emerge --info gentoo-sources
Portage 3.0.18 (python 3.9.4-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-10.3.0, glibc-2.33, 5.12.7-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.12.7-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-glibc2.33
KiB Mem:    32276804 total,  12737056 free
KiB Swap:   16801788 total,  16801788 free
Timestamp of repository gentoo: Wed, 09 Jun 2021 07:20:23 +0000
Head commit of repository gentoo: bf9bc675d9ee75b27ff98ca10e95b808793fce71

sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          2.7.18_p9::gentoo, 3.8.9_p2::gentoo, 3.9.4_p1::gentoo
dev-lang/rust:            1.51.0-r2::gentoo
dev-util/cmake:           3.18.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.3.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: true

shared_overlay
    location: /opt/conf/common/var/db/repos/shared_overlay
    masters: gentoo
    priority: 100

local_overlay
    location: /var/db/repos/local_overlay
    masters: gentoo
    priority: 200

Installed sets: @system
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -ftree-vectorize -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.8/conf /var/lib/hsqldb"
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/portage/package.accept_keywords/99-autounmask /etc/portage/package.unmask/99-autounmask /etc/portage/package.use/99-autounmask /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 -ftree-vectorize -ggdb"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --autounmask=y --autounmask-write --autounmask-continue --jobs=2 --load-average=8 --backtrack=100"
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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
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"
RUSTFLAGS="-C target-cpu=native -O -g"
USE="X a52 aac acl acpi activities aes alsa amd64 apng avx bash-completion berkdb bluetooth branding brotli bzip2 cairo cdaudio cdda cddb cdparanoia cdr chm cli crypt cups dbus declarative djvu dnssec dri dts dvd dvdr elogind emboss encode eps epub evdev exif f16c ffmpeg flac fortran gdbm gif glib gpg gpm gstreamer gtk gui gzip iconv icu id3tag idn imagemagick inotify ipv6 irc jpeg jpeg2k kde kipi kwallet lame latex lcms libglvnd libnotify libsamplerate libtirpc lvm lzma mad matroska mmx mmxext mng mp3 mp4 mpeg mplayer mtp multilib musicbrainz ncurses nls nptl ntp ogg opengl openmp opus otr pam pango pclmul pcre pdf phonon plasma png policykit popcnt ppds pulseaudio qml qt5 quicktime rar rdrand readline real rss sdl seccomp semantic-desktop spell spice split-usr sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg syslog taglib tcpd theora threads thumbnail tiff truetype twolame udev udisks uefi unicode upower usb v4l v4l2 vaapi vcd vim-syntax visualization vorbis vpx wavpack webp widgets wma wmf wxwidgets x264 x265 xattr xcb xinerama xml xv xvid xvidv xvmc xz zlib zstd" ABI_X86="64" 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 f16c 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" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

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

sys-kernel/gentoo-sources-5.12.9::gentoo was built with the following:
USE="symlink -build -experimental" ABI_X86="(64)"
Comment 1 Till Schäfer 2021-06-09 08:10:19 UTC
postinst is executed: 

>>> Messages generated by process 176711 on 2021-06-09 09:29:30 CEST for package sys-kernel/gentoo-sources-5.12.9:

LOG: setup
>>> Preparing to unpack ...
LOG: install
>>> Copying sources ...
LOG: postinst
If you are upgrading from a previous kernel, you may be interested
in the following document:
  - General upgrade guide: https://wiki.gentoo.org/wiki/Kernel/Upgrade
Comment 3 Till Schäfer 2021-06-09 08:46:43 UTC
re-adding the explicit symlink removal to kernel-2.eclass fixes the problem: 

[[ -h ${EROOT%/}/usr/src/linux ]] && { rm "${EROOT%/}"/usr/src/linux || die; }


but why does the ln --force fail?
Comment 4 Till Schäfer 2021-06-09 09:00:13 UTC
BTW: should the use of EROOT not always be surrounded by quotes?
Comment 5 Till Schäfer 2021-06-09 09:28:04 UTC
I think the problem is that linux is a folder. Thus, the call of ln should add the --no-dereference option to correctly update existing symlinks.
Comment 6 Till Schäfer 2021-06-09 10:05:11 UTC
(In reply to Till Schäfer from comment #5)
> I think the problem is that linux is a folder. Thus, the call of ln should
> add the --no-dereference option to correctly update existing symlinks.

Just to note: currently this leads to a symlink created inside /usr/src/linux/

Example: 
$ file /usr/src/linux-5.12.7-gentoo/linux-5.12.9-gentoo 
/usr/src/linux-5.12.7-gentoo/linux-5.12.9-gentoo: broken symbolic link to linux-5.12.9-gentoo
Comment 7 Michael 'veremitz' Everitt 2021-06-09 10:43:08 UTC
(In reply to Till Schäfer from comment #5)
> I think the problem is that linux is a folder. Thus, the call of ln should
> add the --no-dereference option to correctly update existing symlinks.

You are indeed correct. Not sure why this wasn't picked up in testing.. (!!)

Thanks for the PR.

pp. kernel@
Comment 8 Larry the Git Cow gentoo-dev 2021-06-09 11:54:45 UTC
The bug has been closed via the following commit(s):

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

commit b4a816d5c143c0a79c9853221860918484cdcab4
Author:     Till Schäfer <till2.schaefer@uni-dortmund.de>
AuthorDate: 2021-06-09 09:39:31 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2021-06-09 11:54:33 +0000

    eclass/kernel-2: fix USE=symlink
    
    the symlink to /usr/src/linux is longer removed bofore linking
    (see 7446cb850c5e0412e4d88b3aa5d207751241fb02). the latter ln -sf
    does not replace existing symlinks, since destination is a
    directory.
    
    Closes: https://bugs.gentoo.org/795057
    Signed-off-by: Till Schäfer <till2.schaefer@uni-dortmund.de>
    Closes: https://bugs.gentoo.org/795057
    Closes: https://github.com/gentoo/gentoo/pull/21171
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 eclass/kernel-2.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

commit b4a816d5c143c0a79c9853221860918484cdcab4
Author:     Till Schäfer <till2.schaefer@uni-dortmund.de>
AuthorDate: 2021-06-09 09:39:31 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2021-06-09 11:54:33 +0000

    eclass/kernel-2: fix USE=symlink
    
    the symlink to /usr/src/linux is longer removed bofore linking
    (see 7446cb850c5e0412e4d88b3aa5d207751241fb02). the latter ln -sf
    does not replace existing symlinks, since destination is a
    directory.
    
    Closes: https://bugs.gentoo.org/795057
    Signed-off-by: Till Schäfer <till2.schaefer@uni-dortmund.de>
    Closes: https://bugs.gentoo.org/795057
    Closes: https://github.com/gentoo/gentoo/pull/21171
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 eclass/kernel-2.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)