Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 704266 - current stable sys-kernel/genkernel-4.0.1 messes up the old naming convention and addionally installs (IMHO useless) *.old versions in /boot
Summary: current stable sys-kernel/genkernel-4.0.1 messes up the old naming convention...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-30 12:35 UTC by Thomas Beutin
Modified: 2020-01-07 21:33 UTC (History)
1 user (show)

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


Attachments
log of two consecutive genkernel v.3.5.3.3 runs (genkernel-v3.5.3.3.log,9.73 KB, text/plain)
2020-01-03 14:20 UTC, Thomas Beutin
Details
gzipped log of two consecutive genkernel v.3.5.3.3 runs w/ --loglevel=5 (genkernel-v3.5.3.3.log.gz,269.76 KB, application/gzip)
2020-01-07 15:11 UTC, Thomas Beutin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Beutin 2019-12-30 12:35:38 UTC
after updating to sys-kernel/genkernel-4.0.1 the files
- /etc/kernels/kernel-config-*
- /boot/(initramfs|kernel|System.map)-*
are messed up.

Is there any script available to fix this? Or - better - a configuration to keep it the same as it used to be?

The main reason why i'm asking is the place of the new kernel in the boot menu: it's named vmlinuz an it's placed at the end in my grub2 config file. And since grub-mkconfig ignores the *.old files i don't need them anyway.

Maybe i missed some after-installation-message of the package...!?

Reproducible: Always




# emerge --info sys-kernel/genkernel
Portage 2.3.79 (python 2.7.17-final-0, default/linux/amd64/17.0, gcc-9.2.0, glibc-2.29-r7, 5.4.6-gentoo-x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.4.6-gentoo-x86_64-x86_64-Intel_Xeon_E312xx_-Sandy_Bridge-with-gentoo-2.6
KiB Mem:    49353524 total,  48647076 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Mon, 30 Dec 2019 01:15:01 +0000
Head commit of repository gentoo: 2ac9af45a2d1647df08c37f9eab1ec2d88730e4a
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.32 p2) 2.32.0
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17::gentoo, 3.6.9::gentoo, 3.7.5-r1::gentoo
dev-util/cmake:           3.14.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r7::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://192.168.45.107/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

barzog-overlay
    location: /var/lib/layman/barzog-overlay
    masters: gentoo
    priority: 50

java
    location: /var/lib/layman/java
    masters: gentoo
    priority: 50

python
    location: /var/lib/layman/python
    masters: gentoo
    priority: 50

rion
    location: /var/lib/layman/rion
    masters: gentoo
    priority: 50

science
    location: /var/lib/layman/science
    masters: gentoo
    priority: 50

seden
    location: /var/lib/layman/seden
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=sandybridge -fomit-frame-pointer -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/fax /usr/share/gnupg/qualified.txt /var/spool/fax/etc /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.2/ext-active/ /etc/php/apache2-php7.3/ext-active/ /etc/php
/cgi-php5.6/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/php/cli-php7.3/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 /var/spool/fax/etc/xferfaxlog"
CXXFLAGS="-march=sandybridge -fomit-frame-pointer -O2 -pipe"
DISTDIR="/mnt/gentoo/distfiles/"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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 buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-li
bs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/lib/systemd/"
LANG="en_IE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB en en_US de_DE de"
MAKEOPTS="-j28"
PKGDIR="/mnt/gentoo/packages"
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=/.gi
t"
PORTAGE_TMPDIR="/mnt/gentoo/tmp"
USE="R X X509 a52 aac aalib accounting acl acpi adns aim aio alsa amd64 amr ansi ao aot apache2 apng applet archive asm ass audio audiofile automount avahi avx awt bacula-console bash-completion bazaar bcmath berkdb bidi bind-mysql bittor
rent blas bluetooth bluray bonobo boost bzip2 cacert cairo caja calendar caps ccache cdb cdda cddb cdio cdparanoia cdr cgi chipcard chroot clang colord command-args corefonts cpudetection cpulimit cracklib cramfs crypt cscope css csv ctyp
e cue cups curl curlwrappers customlog cvs cvsgraph cxx cyrus dba dbi dbm dbus dbx devhelp device-mapper devmap dga dhcp dirac directfb djvu dlna dlopen dnsdb dri dri3 drm dts dv dvb dvd dvda dvdr dvi ecc egl elogind enchant encode eselec
t-ldso excel exif expat faad fam fastcgi fat fdk ffmpeg fftw fits flac flash flatfile fltk fontconfig fonts fpx ftp fuse fusefs gallium gd gdal gdbm gdu gegl geoclue geoip geos ggi gif gimp ginac git glib glpk glut gmp gnome-keyring gnupl
ot gpg gphoto2 graphviz gs gsf gsl gsm gssapi gstreamer gtk gtk2 gtk3 gudev gzip h323 hardened hardenedphp hddtemp hdf5 hdri highlight hpn html http hunspell hwdb iconv icq icu idea idled idn imagemagick imap imlib imlib2 inifile innodb i
nt64 introspection ios ipalias ipc ipod ipv6 iso jabber jack java javascript jbig jingle jit jpeg jpeg2k json kdrive kerberos keymap kmod kpathsea lame lapack latex lcms ldap lensfun less libass libcaca libcerf libcxx libnotify libsampler
ate libv4l libv4l2 libwww live llvm lm_sensors lmtp logrotate logwatch lua lz4 lzma lzo mad magic mathml matplotlib matroska mbox mcal md5sum memlimit mercurial metis mgetty mhash midi milter mime mimencode ming mmap mms mmx mmxext mng mp
3 mp4 mpeg mpir mplayer msn mtp multilib mumps musepack musicbrainz mysql mysqli nagios-dns nagios-game nagios-ntp nagios-ping nagios-ssh natspec ncurses net netboot netcdf netlink network network-uri networkmanager nfs nis nls nntp nptl 
nsplugin nss ntfs ntp oav ocaml ocamlopt ocatve ocr octave odbc offensive ogg openal opencl openexr opengl openh264 openmp openrc openssh openssl opus orc ortp osc oscar pam pam_chroot pam_console pam_timestamp pango parse-clocks pcf pci 
pcntl pcre pda pdf pdfkit pdflib perl pgo php pic plotutils png policykit portaudio posix postfix postgis postgres postproc postscript ppds procmail ps pulseaudio pwdb python qdbm qt5 quotas quvi radius raw rdesktop rdp readline recode re
iserfs rpc rrdtool rss rtmp ruby samba sample sasl scanner schroedinger scotch screen sendfile sensord session sftp sftplogging shaper shared sharedext shorten shout sieve simplexml slang slp smartcard smime smp sms smtp sna sndfile snmp 
snortsam soap sockets socks5 sound sox spamassassin sparse spatialite speex spell spice spl split-usr sql sqlite sqlite3 sse sse2 sse3 sse4 sse4_1 ssh ssl ssse3 stream subversion svg sysfs syslog sysvipc szip t1lib taglib tcpd telepathy t
est-programs theora threads tidy tiff timidity tokenizer tools transparent-proxy truetype truetype-fonts tslib twolame type1-fonts udev udisks unicode upnp upnp-av upower usb userlocales utf8 uuid v4l vaapi vala vcd vdpau vhosts video vim
-syntax virtual-users virus-scan vnc vorbis vpx vte wavpack wayland wddx weather webdav webkit webm webp wifi win32codecs withsamplescripts wmf x264 x265 xattr xcb xcomposite xetex xface xfs xft xinerama xinetd xml xml2 xmlrpc xmp xmpp xo
rg xosd xpdf-headers xpm xps xrandr xscreensaver xsl xslt xv xvfb xvid xvmc xz yahoo yaml yaz zeromq zlib zstd zvbi" ABI_X86="32 64" APACHE2_MODULES="access auth auth_basic auth_digest authn_default authn_core authn_file authn_dbm authn_d
bd authn_alias authn_anon authz_core authz_groupfile authz_host authz_user authz_dbd authz_dbm authz_owner authz_default dbd ident imagemap alias echo charset_lite cache file_cache disk_cache mem_cache ext_filter case_filter case-filter-i
n deflate filter mime_magic cern_meta proxy proxy_connect proxy_ftp http2 proxy_html proxy_http proxy_ajp proxy_balancer proxy_fcgi proxy_wstunnel expires headers usertrack info include cgi cgid dav dav_lock dav_fs vhost_alias speling rew
rite log_config logio env setenvif mime status substitute autoindex asis negotiation dir imap actions userdir so unique_id version dumpio log_forensic reqtimeout socache_shmcb unixd slotmem_shm ratelimit remoteip lbmethod_bybusyness lbmet
hod_byrequests lbmethod_bytraffic lbmethod_heartbeat xml2enc brotli watchdog" APACHE2_MPMS="worker" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" FFTOOLS="cws2fws ffhash pktdu
mper sidxindex qt-faststart aviocat ismindex" GPSD_PROTOCOLS="aivdm sirf mtk3301 gpsclock superstar2 timing nmea" GRUB_PLATFORMS="pc multiboot efi coreboot efi-64" INPUT_DEVICES="keyboard mouse evdev wacom synaptics" KERNEL="linux" L10N="
en_GB en en_US de_DE de" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer nlpsolver pdfimport wiki-publisher scripting-beanshell" LLVM_TARGETS="X86 NVPTX" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGR
ES_TARGETS="postgres11 postgres12" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby24 ruby25" SANE_BACKENDS="net hp" USERLAND="GNU"
 VIDEO_CARDS="vga intel i915 i965 fbdev vesa" XFCE_PLUGINS="clock multiload-nandhp power trash"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

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

sys-kernel/genkernel-4.0.1::gentoo was built with the following:
USE="firmware (-ibm)" ABI_X86="(64)"
Comment 1 Ben Kohler gentoo-dev 2019-12-30 12:54:38 UTC
Yes: https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-kernel/genkernel/genkernel-4.0.1.ebuild#n237

There is also a news item going out soon so that even less people will be surprised by this change: https://archives.gentoo.org/gentoo-dev/message/91f09183b737f0c8533ca5138da45215

With those 2 things, are you ok with this bug being closed?
Comment 2 Thomas Beutin 2019-12-30 13:16:35 UTC
(In reply to Ben Kohler from comment #1)
> Yes:
> https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-kernel/genkernel/
> genkernel-4.0.1.ebuild#n237

Is there any place for help? At least an information how to get rid of the *.old files (or better don't even create them) would be helpful - since they are ignored by grub's mkconfig they just steal precious space in /boot :(

On the other hand a tool that walks into /boot and /etc/kernels and renames the files to the new scheme shouln't be too difficult.



> There is also a news item going out soon so that even less people will be
> surprised by this change:
> https://archives.gentoo.org/gentoo-dev/message/
> 91f09183b737f0c8533ca5138da45215

I expected this when i run into this last week, but couldn't find it.


> With those 2 things, are you ok with this bug being closed?

Well, do i have an option? ;)

Thanks anyway!
Comment 3 Ben Kohler gentoo-dev 2019-12-30 13:18:33 UTC
The .old files ARE picked up by grub-mkconfig, and a lot of people find them quite handy.  You can still pick your own naming scheme, see the new options & comments in genkernel.conf
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2019-12-30 15:23:01 UTC
Just for the records: Since 2006-11-13 (commit 12b8ba5e27675a0391cdf22e6f6fa3a14a7b8b4d) we are preserving ".old" for symlinks and since 2007-03-09 (commit 89c7fbdde588c97a343a04e48f4e06d15dde08d9) we are preserving previous build kernel/initramfs. That feature isn't new in v4.
Comment 5 Thomas Beutin 2019-12-30 15:50:01 UTC
(In reply to Thomas Deutschmann from comment #4)
> Just for the records: Since 2006-11-13 (commit
> 12b8ba5e27675a0391cdf22e6f6fa3a14a7b8b4d) we are preserving ".old" for
> symlinks and since 2007-03-09 (commit
> 89c7fbdde588c97a343a04e48f4e06d15dde08d9) we are preserving previous build
> kernel/initramfs. That feature isn't new in v4.

Is this optional or configurable?
I use genernel almost right after starting w/ gentoo, and i use it on all of my systems. I checked at least 80% of them w/o finding any *.old files in /boot. What am i doing wrong here?
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2019-12-30 16:25:05 UTC
No, this is not configurable. I guess you never compiled a kernel for same version twice in the past or manually removed previous image/initramfs before re-running genkernel.
Comment 7 Thomas Beutin 2020-01-03 14:19:06 UTC
(In reply to Thomas Deutschmann from comment #6)
> No, this is not configurable. I guess you never compiled a kernel for same
> version twice in the past or manually removed previous image/initramfs
> before re-running genkernel.

Sorry to come back on this, but i just verified/ tested it by using genkernel-v3.5.3.3, and no /boot/*old* appears (see attached log file). Do you have an idea how to get this behaviour back by using genkernel-v4.x?
Comment 8 Thomas Beutin 2020-01-03 14:20:13 UTC
Created attachment 602408 [details]
log of two consecutive genkernel v.3.5.3.3 runs
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2020-01-03 15:08:58 UTC
This log doesn't help, for <genkernel-4 you need to run with --loglevel=5.

But please compare https://github.com/gentoo/genkernel/blob/v3.5.3.3/gen_funcs.sh#L352-L384 with https://github.com/gentoo/genkernel/blob/v4.0.1/gen_funcs.sh#L669-L699

You will see that there was no change in logic between v3 and v4.
Comment 10 Thomas Beutin 2020-01-07 15:10:30 UTC
(In reply to Thomas Deutschmann from comment #9)
> This log doesn't help, for <genkernel-4 you need to run with --loglevel=5.

i did it and attach the compressed logfile soon.



> But please compare
> https://github.com/gentoo/genkernel/blob/v3.5.3.3/gen_funcs.sh#L352-L384
> with https://github.com/gentoo/genkernel/blob/v4.0.1/gen_funcs.sh#L669-L699
> 
> You will see that there was no change in logic between v3 and v4.

I did it, and i cannot see a difference. But still i don't understand why i've never ever had an old file here :-/
Comment 11 Thomas Beutin 2020-01-07 15:11:34 UTC
Created attachment 602754 [details]
gzipped log of two consecutive genkernel v.3.5.3.3 runs w/ --loglevel=5
Comment 12 Thomas Deutschmann (RETIRED) gentoo-dev 2020-01-07 17:22:45 UTC
I spent some time finding the difference:

Variable "currDestImageExists" in copy_image_with_preserve() will be initialized with "0".

This value will be set to "1" when

  if [ -e "${BOOTDIR}/${currDestImage}" ]

will be true.

However, this code (line 314) will only run when <genkernel-4 was started with --symlink option set (default is --no-symlink).

Now, because $currDestImageExists is still set to "0" in you case, the code to preserve existing kernel image will never run.

Of course this is a bug in v3: The check for the existence of $currDestImage should *not* depend on whether you are running with --symlink or --no-symlink option.

This got fixed in genkernel-4.

That's why *you* are *now* seeing genkernel preserving previous kernels (people using --symlink option got this right before).
Comment 13 Thomas Beutin 2020-01-07 21:33:10 UTC
(In reply to Thomas Deutschmann from comment #12)
> I spent some time finding the difference:

i really appreciate this!

[...]
> Of course this is a bug in v3: The check for the existence of $currDestImage
> should *not* depend on whether you are running with --symlink or
> --no-symlink option.

Well, i'd call it a feature ;)


> That's why *you* are *now* seeing genkernel preserving previous kernels
> (people using --symlink option got this right before).

Ok, so it seems i've no excuse anymore to write a wrapper around genkernel by myself to "clean" this (from my side) unwanted behavior :)
Anyway, thanks a lot for your time in writing genkernel and digging into the code to clarify this issue.
Best from Berlin!