Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 370207 - sys-apps/kexec-tools - kexec init script does not detect kernel image and initrd properly
Summary: sys-apps/kexec-tools - kexec init script does not detect kernel image and ini...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Miscellaneous
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-05 23:03 UTC by Łukasz Stelmach
Modified: 2012-03-18 07:46 UTC (History)
2 users (show)

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


Attachments
Detect kernels and initrds created with genkernel. (kexec.init.diff,1.22 KB, patch)
2011-06-05 23:05 UTC, Łukasz Stelmach
Details | Diff
genkernel compat and automatic initrd (kexec.init-2.patch,1.90 KB, patch)
2012-01-16 00:57 UTC, Dennis Schridde
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Łukasz Stelmach 2011-06-05 23:03:33 UTC
The kexec init script from kexec-tools-2.0.0-r1 can't load kernels and initrds created with genkernel and named: kernel-genkernel-ARCH-VERSION and initramfs-genkernel-ARCH-VERSION, respectively.

Reproducible: Always
Comment 1 Łukasz Stelmach 2011-06-05 23:05:26 UTC
Created attachment 275957 [details, diff]
Detect kernels and initrds created with genkernel.
Comment 2 Claudio Roberto França Pereira 2011-09-11 02:01:43 UTC
Why doesn't the init script just rely on the path found on /etc/conf.d/kexec?
Comment 3 Łukasz Stelmach 2011-09-11 21:48:45 UTC
I guess that's because hardly anyone likes to remember to alter some "unrelated" configuration files every time they upgrade their kernel.
Comment 4 Claudio Roberto França Pereira 2011-09-12 13:30:20 UTC
That's why gentoo-sources' (maybe vanilla also) make install script, by default, install symlinks: vmlinuz and vmlinuz.old, as fallback. GRUB also has an interactive interface while booting to solve this kind of issue.
Anyways, everytime you change kernels you have to reload kexec anyways, I don't see how bad configuring /etc/conf.d/kexec could be.

We should delete it altogether or, at least, use the guessing algorithm only as fallback.

In a related note, why doesn't the init script load the kernel on the STOP phase, so that we don't need to restart /etc/init.d/kexec after upgrading kernels?
Comment 5 Dennis Schridde 2012-01-16 00:57:32 UTC
Created attachment 299047 [details, diff]
genkernel compat and automatic initrd

(In reply to comment #4)
> That's why gentoo-sources' (maybe vanilla also) make install script, by
> default, install symlinks: vmlinuz and vmlinuz.old, as fallback.
That is sys-apps/debianutils' /sbin/installkernel doing it, not?
 
> In a related note, why doesn't the init script load the kernel on the STOP
> phase, so that we don't need to restart /etc/init.d/kexec after upgrading
> kernels?
It does. Set LOAD_DURING_SHUTDOWN to "yes" (the default).

(In reply to comment #1)
> Created attachment 275957 [details, diff] [details, diff]
> Detect kernels and initrds created with genkernel.
I created a similar patch (attached), unknowing of yours, by copying parts from /etc/grub.d/10_linux.
I just merged your parts related to genkernel and karch into it.
One difference: I do not check for the existence of the initrd before creating initrdopt, since initrd_path() did that already.
Comment 6 Dennis Schridde 2012-01-16 01:01:30 UTC
Btw: It's been 6 months now.

And the bug also affects users of sys-kernel/dracut, which does not create /boot/initrd symlinks or update /etc/conf.d/kexec. For valid reasons: The modules included in the initrd would not be compatible to any but the corresponding kernel - so neither way would be safe.
Comment 7 Justin Lecher (RETIRED) gentoo-dev 2012-03-18 07:46:06 UTC
+*kexec-tools-2.0.3-r1 (18 Mar 2012)
+
+  18 Mar 2012; Justin Lecher <jlec@gentoo.org> +files/kexec.conf-2.0.3,
+  +files/kexec.init-2.0.3, +kexec-tools-2.0.3-r1.ebuild, +files/README.Gentoo:
+  Use $RC_REBOOT instead of /sbin/runlevel, #401231 thanks William Hubbs for
+  the patch; usability enhancements including better detection of the kernel
+  image, additional option parsing, better descriptions in the config file,
+  #392229, thanks teika for those things; better detection of genkernel,
+  #370207, thanks Łukasz Stelmach & Dennis Schridde for their contributions
+