Summary: | genkernel: doesn't support relative paths | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | j.habenicht |
Component: | genkernel | Assignee: | Gentoo Genkernel Maintainers <genkernel> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=412321 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
/etc/genkernel.conf
old reliable kernel config new kernel config file genkernel log, build ok genkernel log, build failed log of failed genkernel-4 run linux-4.19.72 kernel config after genkernel-4 build |
Description
j.habenicht
2019-10-29 07:48:39 UTC
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! |