Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57576 - patch - genkernel adds automatically new kernel definition to grub configuration file.
Summary: patch - genkernel adds automatically new kernel definition to grub configurat...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-07-19 06:57 UTC by Mathias Gug
Modified: 2004-09-19 05:27 UTC (History)
0 users

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


Attachments
patch to add automatic grub configuration update. (genkernel-addBootLoader.patch,3.97 KB, patch)
2004-07-19 06:58 UTC, Mathias Gug
Details | Diff
Add --bootloader=grub option to first patch. (genkernel-bootloader.patch,4.64 KB, patch)
2004-07-20 12:35 UTC, Mathias Gug
Details | Diff
Patch : put the new kernel definition as the first entry in grub.conf (genkernel-3.0.2e-bootloader.patch,2.91 KB, patch)
2004-08-17 13:03 UTC, Mathias Gug
Details | Diff
update to patch 37625 to remove section comments (genkernel-3.0.2e-bootloader.patch,1.58 KB, patch)
2004-08-18 13:37 UTC, Mathias Gug
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathias Gug 2004-07-19 06:57:00 UTC
When genkernel generates a new kernel/initrd, it updates grub configuration file with a new entry for the new kernel.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




This patch creates a new file gen_bootloader.sh and uses a new variable in
/etc/genkernel.conf : BOOTLOADER.

If BOOTLOADER is defined and equal to "grub", genkernel updates grub.conf with a
definition for the new kernel.
If grub.conf has already kernel definitions, it just copies the first definition
and updates the kernel and initrd version.
If not, it generates a default kernel definition in grub.conf

If BOOTLOADER is not set, nothing happens.
Comment 1 Mathias Gug 2004-07-19 06:58:22 UTC
Created attachment 35739 [details, diff]
patch to add automatic grub configuration update.

The patch to add support for automatic grub configuration update.
Comment 2 Tim Yamin (RETIRED) gentoo-dev 2004-07-20 11:40:38 UTC
Could we have a --bootloader=grub option as well please?
Comment 3 Mathias Gug 2004-07-20 12:35:53 UTC
Created attachment 35831 [details, diff]
Add --bootloader=grub option to first patch.

Add --bootloader option.
Comment 4 Tim Yamin (RETIRED) gentoo-dev 2004-07-21 07:04:42 UTC
Now in source CVS; I'll roll a new release with this patch and a few others soon. Thanks a lot!
Comment 5 Tim Yamin (RETIRED) gentoo-dev 2004-07-28 04:03:59 UTC
The patch should be in Portage with genkernel-3.0.2e; please reopen this bug if you have any issues with it. Thanks!
Comment 6 Mathias Gug 2004-08-17 13:03:42 UTC
Created attachment 37625 [details, diff]
Patch : put the new kernel definition as the first entry in grub.conf

Here is an updated version of the patch (against 3.0.2e)

Now, the new kernel entry is added at the first position in grub.conf, so that
the new kernel will be the default one on the next reboot.

I've also included some comments at the begining of the grub.conf file to
explain what structure genkernel expects to find.
Comment 7 Mathias Gug 2004-08-17 13:04:30 UTC
New patch.
Comment 8 Tim Yamin (RETIRED) gentoo-dev 2004-08-17 18:06:57 UTC
A few ideas... Firstly, I see no reason for having a date in the file; genkernel logs as well as the mtime of the file would serve that purpose. Also, the configuration file seems very bulky and I do not see why the format should be documented in the configuration file since the GRUB documentation deals with it.

I think the best solution would be to simply keep the feature for the new entry to be at the start of the list, and maybe add a comment such as: "# Genkernel generated entry, see GRUB documentation for details" above the entries that are added? And instead of quoting that the topmost entry is used, maybe genkernel could just print the entry name from which the new one is generated when it configures the bootloader?
Comment 9 Mathias Gug 2004-08-18 13:37:03 UTC
Created attachment 37691 [details, diff]
update to patch 37625 to remove section comments

This is a new version of the patch to put new kernel definition as the first
entry in grub.conf.

It removes all the comments and the date in the auto-generated grub.conf.
Comment 10 Robert Moss (RETIRED) gentoo-dev 2004-08-23 14:58:25 UTC
Closing. jhuebel assures me that your problem can be solved by doing "modprobe ide-disk" instead of the mknod stuff. Hopefully, this should be fixed for the 2004.3 release.
Comment 11 Tim Yamin (RETIRED) gentoo-dev 2004-08-23 17:12:31 UTC
...? Um, wrong bug? Reopening.
Comment 12 Robert Moss (RETIRED) gentoo-dev 2004-08-27 19:14:38 UTC
Oh yeah, how strange! Sorry about that.

Tim, grub-0.95.20040823 has a new "savedefault" option. Whether you can hook into this or not I don't know - it would be more reliable than manually editing the configuration file if you can, though, as this is guaranteed to follow any changes that the grub developers make to the configuration file.
Comment 13 Robert Moss (RETIRED) gentoo-dev 2004-09-05 13:33:42 UTC
Tim - actually, the thing in question is "/sbin/grub-set-default".
Comment 14 Tim Yamin (RETIRED) gentoo-dev 2004-09-19 05:27:20 UTC
New patch (attachment #37691 [details, diff]) in genkernel-3.0.2g; please reopen this bug if you have any problems. Thanks!