genkernel exits with an error about no compression method configured in the kernel config file. note: If I start the genkernel build a second time, it completes successfully Using =sys-kernel/genkernel-3.5.3.3 Reproducible: Always Steps to Reproduce: To compile a new kernel I 1) emerge -u gentoo-sources, 2) copy an old reliable .config file from previous build to the new linux source directory, 3) genkernel --kerneldir=. all with no cleanup, no menuconfig, no .. Actual Results: genkernel errors with this: ...compiling ok * initramfs: >> Initializing... * >> Appending devices cpio data... * >> Appending base_layout cpio data... * >> Appending auxilary cpio data... * >> Copying keymaps * >> Appending busybox cpio data... * >> Appending modules cpio data... * >> Appending blkid cpio data... * >> Appending modprobed cpio data... * >> Appending linker cpio data... * >> Deduping cpio... * ERROR: None of the initramfs compression methods we tried are supported by your kernel (config file "/usr/share/genkernel/arch/x86_64/generated-config"), strange!? * * -- Grepping log... -- * * CC [M] drivers/net/phy/micrel.o * CC [M] drivers/usb/host/ehci-pci.o * LD [M] net/bridge/bridge.o * LD [M] net/bridge/br_netfilter.o * CC [M] drivers/net/phy/national.o * CC [M] net/core/failover.o *-- * CC [M] net/ipv4/netfilter/iptable_filter.o * CC [M] drivers/usb/host/xhci-ring.o * CC [M] net/ipv4/netfilter/iptable_mangle.o * CC [M] net/ipv4/netfilter/iptable_nat.o * CC [M] drivers/usb/host/xhci-hub.o * CC [M] drivers/net/net_failover.o *-- * CC drivers/net/ethernet/realtek/8139cp.mod.o * CC drivers/net/ethernet/realtek/8139too.mod.o * CC drivers/net/ethernet/realtek/r8169.mod.o * CC drivers/net/mdio.mod.o * CC drivers/net/mii.mod.o * CC drivers/net/net_failover.mod.o *-- * CC net/bridge/netfilter/ebt_vlan.mod.o * CC net/bridge/netfilter/ebtable_broute.mod.o * CC net/bridge/netfilter/ebtable_filter.mod.o * CC net/bridge/netfilter/ebtable_nat.mod.o * CC net/bridge/netfilter/ebtables.mod.o * CC net/core/failover.mod.o *-- * LD [M] drivers/net/ethernet/realtek/8139cp.ko * LD [M] drivers/net/ethernet/realtek/8139too.ko * LD [M] drivers/net/ethernet/realtek/r8169.ko * LD [M] drivers/net/mdio.ko * LD [M] drivers/net/mii.ko * LD [M] drivers/net/net_failover.ko *-- * LD [M] net/bridge/netfilter/ebt_vlan.ko * LD [M] net/bridge/netfilter/ebtable_broute.ko * LD [M] net/bridge/netfilter/ebtable_filter.ko * LD [M] net/bridge/netfilter/ebtable_nat.ko * LD [M] net/bridge/netfilter/ebtables.ko * LD [M] net/core/failover.ko *-- * INSTALL drivers/net/ethernet/realtek/8139cp.ko * INSTALL drivers/net/ethernet/realtek/8139too.ko * INSTALL drivers/net/ethernet/realtek/r8169.ko * INSTALL drivers/net/mdio.ko * INSTALL drivers/net/mii.ko * INSTALL drivers/net/net_failover.ko *-- * INSTALL net/bridge/netfilter/ebt_vlan.ko * INSTALL net/bridge/netfilter/ebtable_broute.ko * INSTALL net/bridge/netfilter/ebtable_filter.ko * INSTALL net/bridge/netfilter/ebtable_nat.ko * INSTALL net/bridge/netfilter/ebtables.ko * INSTALL net/core/failover.ko *-- * Running with options: --kerneldir=. all * Using genkernel.conf from /etc/genkernel.conf * Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh .. * Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load .. * * ERROR: None of the initramfs compression methods we tried are supported by your kernel (config file "/usr/share/genkernel/arch/x86_64/generated-config"), strange!? * * -- End log... -- Expected Results: The build should run flawlessly on the first run. # eix genkernel [I] sys-kernel/genkernel Available versions: 3.4.52.3 ~3.4.52.4-r1 3.4.52.4-r2 3.4.52.4-r3 ~3.5.1.1 ~3.5.2.0-r1 ~3.5.2.1 ~3.5.2.2 ~3.5.2.3 ~3.5.2.4 ~3.5.2.5 ~3.5.3.2 3.5.3.3 ~4.0.0_beta20 **9999*l {cryptsetup +firmware ibm selinux} Installed versions: 3.5.3.3(10:24:12 18/06/18)(firmware -cryptsetup -ibm -selinux) Homepage: https://www.gentoo.org Description: Gentoo automatic kernel building scripts # emerge --info Portage 2.3.76 (python 3.6.9-final-0, default/linux/amd64/17.0, gcc-8.3.0, glibc-2.29-r2, 4.19.27-gentoo-r1 x86_64) ================================================================= System uname: Linux-4.19.27-gentoo-r1-x86_64-Intel-R-_Celeron-R-_CPU_J1800_@_2.41GHz-with-gentoo-2.6 KiB Mem: 3753900 total, 623800 free KiB Swap: 2104508 total, 1389256 free Timestamp of repository gentoo: Tue, 29 Oct 2019 02:15:01 +0000 Head commit of repository gentoo: fb7c020a6779d020cc781eeb159ab9e60791c9a4 sh bash 4.4_p23-r1 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1 distcc 3.3.3 x86_64-pc-linux-gnu [disabled] ccache version 3.7.4 [disabled] app-shells/bash: 4.4_p23-r1::gentoo dev-lang/perl: 5.28.2-r1::gentoo dev-lang/python: 2.7.16::gentoo, 3.6.9::gentoo dev-util/ccache: 3.7.4::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.14.1::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo sys-devel/binutils: 2.25.1-r1::gentoo, 2.26.1::gentoo, 2.28.1::gentoo, 2.29.1-r1::gentoo, 2.30-r4::gentoo, 2.31.1-r6::gentoo, 2.32-r1::gentoo sys-devel/gcc: 8.3.0-r1::gentoo sys-devel/gcc-config: 2.0::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-r2::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-metamanifest: yes sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 sync-rsync-extra-opts: x-portage location: /usr/local/portage masters: gentoo priority: 0 LAN-spezifische-ebuild-erweiterungen location: /usr/local/portage-domain-overlay masters: gentoo priority: 1 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=native -pipe" 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/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" CXXFLAGS="-O2 -march=native -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--color=y --nospinner" 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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_GB.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j3" PKGDIR="/usr/local/portage/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/portage" USE="acl amd64 avahi bash-completion berkdb bzip2 caps clamav cli crypt cxx dri fam fortran gdbm iconv ipv6 kmod libclamav libtirpc logrotate mmx mmxext multilib mysql ncurses nls nptl oav openmp pam pcre popcnt ppds readline seccomp split-usr sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 tcpd udev unicode x265 xattr 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="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_connect proxy_http rewrite setenvif so 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" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" 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" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="arm armeb" RUBY_TARGETS="ruby24 ruby25" SANE_BACKENDS="hp5590" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 594338 [details] /etc/genkernel.conf current config file
sorry, have to correct myself. I missed the preparation of the config file in the source directory. Steps to Reproduce: To compile a new kernel I 1) emerge -u gentoo-sources, 2) copy an old reliable .config file from previous build to the new linux source directory, 3) cd to the new linux source directory 4) make olddefconfig 5) genkernel --kerneldir=. all
Please share your kernel .config file with us.
Created attachment 594724 [details] old reliable kernel config This is the config file which has been copied from to the new linux source directory
Created attachment 594726 [details] new kernel config file This config file is the result of the old config file plus a 'make olddefconfig' run.
I am unable to reproduce: In a clean stage3. I emerged genkernel-3.5.3.3 and gentoo-sources-4.19.72. I changed /etc/genkernel.conf to match your attached config (i.e. I disabled mkproper, clean...). In that chroot I changed directory to /usr/src/linux. I copied your kernel config to /usr/src/linux/.config. I run `genkernel --kerneldir=. --no-install all`: > # genkernel --kerneldir=. --no-install all > * Gentoo Linux Genkernel; Version 3.5.3.3 > * Running with options: --kerneldir=. --no-install all > > * Using genkernel.conf from /etc/genkernel.conf > * Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh .. > * Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load .. > * Linux Kernel 4.19.72-gentoo for x86_64... > * .. with config file /etc/kernels/kernel-config-x86_64-4.19.72-gentoo > * kernel: Using config from ./.config > * kernel: --mrproper is disabled; not running 'make mrproper'. > * >> Running oldconfig... > * kernel: --clean is disabled; not running 'make clean'. > * >> Compiling 4.19.72-gentoo bzImage... > [...] Like you can see genkernel is picking up kernel config from cwd. Back to you: The error message > * ERROR: None of the initramfs compression methods we tried are supported by your kernel (config file "/usr/share/genkernel/arch/x86_64/generated-config") indicates that you did something not the way you described: genkernel used default config for some reason, not the one you provided. If you care please try to reproduce using latest genkernel-4 ebuild. If you are able to reproduce, please tell us exactly what you did and share created genkernel.log which will have all necessary information to reproduce.
Created attachment 594834 [details] genkernel log, build ok
Created attachment 594836 [details] genkernel log, build failed A log of the failed build. Here genkernel takes the generated config file from /usr/share/genkernel/arch/x86_64/generated-config
I think I found it: At first I did a build with the current setting. The genkernel log of the successful build takes the kernel config from /etc/kernels/kernel-config-x86_64-4.19.72-gentoo . Then I removed /etc/kernels/kernel-config-x86_64-4.19.72-gentoo and again did a build, which failed. The failed build takes the kernel config from /usr/share/genkernel/arch/x86_64/generated-config . $ diff genkernel.ok.log genkernel.not-ok.log [...] 9c8 < * .. with config file /etc/kernels/kernel-config-x86_64-4.19.72-gentoo --- > * .. with config file /usr/share/genkernel/arch/x86_64/generated-config There we evaluate the generated config file for compression methods: * ERROR: None of the initramfs compression methods we tried are supported by your kernel (config file "/usr/share/genkernel/arch/x86_64/generated-config"), strange!? In /etc/kernels/kernel-config-x86_64-4.19.72-gentoo the compression methods are correctly defined. During the failed build genkernel stores the current config into /etc/kernels/kernel-config-x86_64-4.19.72-gentoo (is is like this?). And on the second and later runs we got this config file /etc/kernels/kernel-config-x86_64-4.19.72-gentoo as source with the correct compression methods defined. How about this solution: I think genkernel should source .config file instead of /usr/share/genkernel/arch/* or /etc/kernels/* if it is available?
> I think genkernel should source .config file instead of /usr/share/genkernel/arch/* or /etc/kernels/* if it is available? It's not that easy and complicated: In case user provides a kernel config, we will always use whatever user told us to use. If no config was specified and when we are unable to find kernel config, we will fall back to our default config (https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_configkernel.sh?h=v3.5.3.3#n5). Settings like mrproper are causing a special handling, see https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_configkernel.sh?h=v3.5.3.3#n39 Anyways, genkernel-3 is dead. genkernel-4 (4.0.0_beta20 at the moment) will be stabilized this month. Code in genkernel-4 has changed a lot. I won't spend more time in debugging genkernel-3. Like said I tried to reproduce but was unable to do so. Please try genkernel-4 which will tell us exactly why a kernel config was chosen/ignored. In case there's really a bug which is still present in genkernel-4, this would help us to find it. At best this bug is already fixed/gone in latest version.
Well, it seems to be the same in genkernel-4. It takes /usr/share/genkernel/arch/x86_64/generated-config instead of .config and errors on the missing compression config. Is this behavior (taking the generated config instead of the local config) intended? Note: The following build after this runs without errors # ACCEPT_KEYWORDS="~amd64" emerge -a1 =sys-kernel/genkernel-4.0.0_beta20 [...] [ebuild U ] sys-kernel/genkernel-4.0.0_beta20 [3.5.3.3] # cd /usr/src/linux-4.19.72-gentoo # cmp /etc/kernels/kernel-config-x86_64-4.19.72-gentoo .config; echo $? 0 # rm /etc/kernels/kernel-config-x86_64-4.19.72-gentoo # genkernel --kerneldir=. --no-install all * Gentoo Linux Genkernel; Version 4.0.0_beta20 * Using genkernel configuration from '/etc/genkernel.conf' ... * Running with options: --kerneldir=. --no-install all * Working with Linux kernel 4.19.72-gentoo for x86_64 * Using kernel config file '/usr/share/genkernel/arch/x86_64/generated-config' ... * * Note: The version above is subject to change (depends on config and status of kernel sources). * kernel: >> Initializing ... * >> --no-clean is set; Skipping 'make clean' ... * >> --no-mrproper is set; Skipping 'make mrproper' ... * >> Running 'make oldconfig' ... * >> Re-running 'make oldconfig' due to changed kernel options ... * >> Kernel version has changed (probably due to config change) since genkernel start: * We are now building Linux kernel 4.19.72-gentoo-x86_64 for x86_64 ... * >> Compiling 4.19.72-gentoo-x86_64 bzImage ... * >> Compiling 4.19.72-gentoo-x86_64 modules ... * >> Installing 4.19.72-gentoo-x86_64 modules (and stripping) ... * >> Generating module dependency data ... * >> Saving config of successful build to '/etc/kernels/kernel-config-4.19.72-gentoo-x86_64' ... * initramfs: >> Initializing ... * >> Appending devices cpio data ... * >> Appending base_layout cpio data ... * >> Appending auxilary cpio data ... * >> Appending blkid cpio data ... * >> Appending busybox cpio data ... * >> Appending modprobed cpio data ... * >> Appending modules cpio data ... * >> Appending linker cpio data ... * >> Deduping cpio ... * >> Pre-generating initramfs' /etc/ld.so.cache ... * ERROR: None of the initramfs compression methods we tried are supported by your kernel (config file "/usr/share/genkernel/arch/x86_64/generated-config"), strange!? * Please consult '/var/log/genkernel.log' for more information and any * errors that were reported above. * * Report any genkernel bugs to bugs.gentoo.org and * assign your bug to genkernel@gentoo.org. Please include * as much information as you can in your bug report; attaching * '/var/log/genkernel.log' so that your issue can be dealt with effectively. * * Please do *not* report kernel compilation failures as genkernel bugs! *
Thanks for trying genkernel-4. Now please attach genkernel.log from that genkernel-4 run which ended up in the shown error. Please also attach .config (kernel config) from that failing run.
Created attachment 594848 [details] log of failed genkernel-4 run
Created attachment 594862 [details] linux-4.19.72 kernel config after genkernel-4 build This kernel config is from the genkernel-4 build. It only differs in one line from the kernel config from the genkernel-3 build: $ diff ~/Downloads/config-4.19.72 config 22c22 < CONFIG_LOCALVERSION="" --- > CONFIG_LOCALVERSION="-x86_64"
Thanks, I am now able to reproduce and will look into it.
The problem is that you expect that genkernel allows for relative paths like other user expected that genkernel will support shell expansion (bug 412321). It's currently failing because "--kerneldir=." will set KERNEL_DIR variable to "." -- we don't resolve/expand this value. In several places we will use $KERNEL_DIR... but in most cases we haven't changed directory. But in create_initramfs() function where you see the failure we changed current working dir to $TMPDIR just before we use $KERNEL_DIR (see https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_initramfs.sh?h=v4.0.0_beta20#n1792) i.e. > if [[ -f "${KERNEL_DIR}/.config" ]] becomes > if [[ -f "./.config" ]] aka > if [[ -f "/var/tmp/genkernel/gk.KF2Dujgt/.config" ]] which fails with the result that we will check for compression support in default kernel configuration and not in the kernel configuration actually used. For now, just avoid using a relative path.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=370dde2816bd28f75dbf6111fac571ed9d34791f commit 370dde2816bd28f75dbf6111fac571ed9d34791f Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-11-20 01:54:58 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-11-24 19:59:16 +0000 kernel-generic-config: Enable support for bzip2, gzip and xz compressed initramfs Bug: https://bugs.gentoo.org/698828 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> defaults/kernel-generic-config | 3 +++ 1 file changed, 3 insertions(+) https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=4344d6de2451e163bc922df9700b5729b46d6517 commit 4344d6de2451e163bc922df9700b5729b46d6517 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-11-18 02:40:48 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-11-19 16:47:53 +0000 gen_determineargs.sh: determine_real_args(): Initialize $KERNEL_OUTPUTDIR after $KERNEL_DIR Bug: https://bugs.gentoo.org/698828 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> gen_determineargs.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 7 deletions(-)
Released with >=sys-kernel/genkernel-4.0.0_rc1! Thanks for the report!