Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 703666 - sys-kernel/genkernel-4.0.1 mucks with my kernel config
Summary: sys-kernel/genkernel-4.0.1 mucks with my kernel config
Status: RESOLVED WONTFIX
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:
: 708550 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-12-24 16:32 UTC by Christopher Head
Modified: 2020-02-07 09:49 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 Christopher Head 2019-12-24 16:32:24 UTC
Back in the Genkernel 3 era, I used to set up my /usr/src/linux/.config as desired and then run “genkernel all” to compile the kernel, install it in /boot, build the initramfs, and install that in /boot. Now with Genkernel 4, that still works, except that Genkernel 4 doesn’t totally respect my .config. It mostly uses it, but seems to turn on a few options I had left turned off. For example, I set LUKS=yes (because I use LUKS), and Genkernel decided to edit my .config to turn on CONFIG_CRYPTO_AES_NI_INTEL, even though the CPU on this particular machine doesn’t support AES-NI and I set it to NO on purpose. These genkernel.conf options used to mean just including the appropriate userspace tools in the initramfs, but now they seem to mean that plus also mucking about with my kernel config.

I don’t see anything in the genkernel.conf or the man page about how to make Genkernel stop doing this.

Reproducible: Always

Steps to Reproduce:
1. Start with a /usr/src/linux/.config that has AES-NI turned off.
2. Start with a /etc/genkernel.conf that has MRPROPER=no LUKS=yes.
3. Run “genkernel all”
Actual Results:  
/usr/src/linux/.config has AES-NI turned on.

Expected Results:  
/usr/src/linux/.config has AES-NI turned off.

Portage 2.3.79 (python 3.6.9-final-0, default/linux/amd64/17.1, gcc-9.2.0, glibc-2.29-r7, 4.19.86-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.86-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_Q_720_@_1.60GHz-with-gentoo-2.6
KiB Mem:     6024728 total,   2189640 free
KiB Swap:    8388604 total,   8349948 free
Head commit of repository steam-overlay: 20d913e2977b8f51b8b3481769cb7eaf5d975295

Timestamp of repository gentoo: Tue, 24 Dec 2019 01:06:07 +0000
Head commit of repository hawk777: 6ecbc4eaf842039a92d4bedb2a9101f3f4f72ae0

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-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17::gentoo, 3.6.9::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.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: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r7::gentoo
Repositories:

steam-overlay
    location: /var/cache/repos/steam
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 1

gentoo
    location: /var/cache/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://amdahl.home.chead.ca/gentoo-portage
    priority: 3
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

hawk777
    location: /var/cache/repos/hawk777
    sync-type: git
    sync-uri: https://git.chead.ca/portage
    masters: gentoo
    priority: 4

Installed sets: @admin, @desktop, @fonts, @games, @media, @net, @office, @vim, @web, @xfce
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE AdobeFlash-11.x freedist"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 8 --with-bdeps y --complete-graph y -1"
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 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 sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.gossamerhost.com/ ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles http://gentoo.osuosl.org/"
INSTALL_MASK="grub-mkconfig"
LANG="en_CA.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_CA"
MAKEOPTS="--jobs 4 --load-average 8"
PKGDIR="/var/cache/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=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl alsa amd64 bzip2 cairo caps cli cxx dbus dri ffmpeg flac fontconfig fortran gtk iconv icu idn ipv6 joystick libnotify libsamplerate libtirpc multilib ncurses nls nptl ogg opengl openmp opus pam pcre readline seccomp split-usr ssl startup-notification svg theora threads truetype udev unicode v4l vaapi vdpau vim-syntax vorbis xattr xinerama xscreensaver xv xvmc zlib" 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="mmx mmxext popcnt 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="pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-CA" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="nvidia" XFCE_PLUGINS="logout menu" 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, 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 Thomas Deutschmann (RETIRED) gentoo-dev 2019-12-26 15:50:45 UTC
You are right about things like AES_NI_INTEL but we cannot know if you are going to run on Intel processor, capable of AES-NI or not. Adding another option would make things very complicated. These are the limitations when you want to offer a simple switch (--luks) to get a good/working configuration for most users.

The only solution I can think of is adding an option like --do-not-adjust-kernel-configuration but I don't think it's worth to add:

- Keep in mind that these kernel options do not really hurt or cause problems. And you can always mask modules to prevent kernel from using them.

- Where do you stop? You can control initramfs compression through genkernel options. What should we do when you set option to something not supported by your kernel but you also set "--do-not-adjust..."?
Comment 2 Christopher Head 2019-12-26 18:37:25 UTC
I understand the rationale for enabling the option. It’s just that it was, as far as I can tell, a change in behaviour from v3 to v4 that was not mentioned anywhere (in e.g. a news item or postinst message, though it did say that “nearly everything” has changed)—v3 didn’t muck with kernel config *at all* as far as I know (if I set my kernel config by hand, it just used it without question and just built the kernel I as I told it to), whereas v4 overrides my decisions, sometimes, for certain options.

I can work around it by only running “genkernel initramfs” and building the kernel outside initramfs. It’s not an ideal workaround because “genkernel all” used to be a nice way to just build and install everything, but if you don’t want to provide a “yes, I have configured my kernel already, stop poking it, just do what I told you” option, I guess that’s what I’ll have to do from now on.
Comment 3 Christopher Head 2019-12-26 18:38:06 UTC
building the kernel outside *genkernel*, I meant, of course.
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2019-12-26 19:06:49 UTC
Well, strict speaking, this behavior isn't new: See https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_configkernel.sh?h=v3.5.3.3#n148 -- genkernel always adjusted kernel configuration. This was only extended and modernized in v4.

Now that I explained that this behavior is *not* new and *wanted*, what do you want us to do with this bug?

Is this really a problem for you? Please explain and help us to understand the problem. Maybe we can find a solution. For example, would it help you if we would add an option which would just fail but never touch your config (such an option would be in spirit of I_KNOW_WHAT_I_AM_DOING -- no crying allowed if something would break; Keep in mind that in rare cases this could even result in unbootable kernels/initramfs)?

Or should we just close the bug because there's not much we can do?
Comment 5 Christopher Head 2019-12-26 19:20:07 UTC
I didn’t know v3 did it too; I never saw it happen so I didn’t realize that (I guess I always had the options it asks for turned on anyway). In that case, I can keep using my workaround. Personally I always saw genkernel as “a tool to make an initramfs (which happens to be able to run a kernel compile as well, for convenience)”, not “a tool to configure everything for me”; I started out building kernels by hand and then only started using genkernel when use of an initramfs became mandatory. So this can be closed as… something… maybe WONTFIX? Or it could be a feature request for a don’t-change-my-kernel-config option, as you suggest. I would be OK with either.
Comment 6 Jack 2020-01-02 23:36:54 UTC
I have a similar problem (let me know if it should be a separate bug.)  I've only tried it once, so have not yet built up adequate documentation - but I have all the config parameters to genkernel turned off (I'll post genkernel.conf if of any use) and could not find a way to prevent genkernel from changing CONFIG_LOCALVERSION.  If I'm going to edit .config myself (generally with "make xconfig") I don't want to have to change the localversion in a different config file every time I build a new kernel.  I really wonder if --dont-mess-with-my-.config isn't a possible option, even it it's somehow "hidden" behind some sort of "I really know what I'm doing" protection.  On the other hand, if making genkernel not mess with _LOCALVERSION is possisble, I couldn't find it in the docs.
Comment 7 Thomas Deutschmann (RETIRED) gentoo-dev 2020-01-03 00:01:18 UTC
No, this is a different thing. You want --kernel-localversion='UNSET'.
Comment 8 Jack 2020-01-10 03:04:50 UTC
Unless you mean the command line option "--kernel-localversion='UNSET'" is different from 'KERNEL_LOCALVERSION="UNSET"' in /etc/genkernel.conf, it seems that unsets the "01" I have in .config for CONFIG_LOCALVERSION.  I want genkernel to leave CONFIG_LOCALVERSION as I have it set in .config.  Is that not possible?
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2020-01-14 02:05:06 UTC
No, it's not possible: Using CONFIG_LOCALVERSION is the only way to alter $KV without patching sources and also the only way to extract this information later in a reliable way.

But this shouldn't be a problem in practice: If you want to set CONFIG_LOCALVERSION, all you have to do is setting this value *through* genkernel:  Just use new --kernel-append-localversion= parameter to set (append) your value.


Regarding this bug, closing as WONTFIX per comment #5.
Comment 10 Thomas Deutschmann (RETIRED) gentoo-dev 2020-02-07 09:49:46 UTC
*** Bug 708550 has been marked as a duplicate of this bug. ***