Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 388437 - [patch] Support for grub2 in sys-kernel/genkernel
Summary: [patch] Support for grub2 in sys-kernel/genkernel
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2011-10-25 12:24 UTC by Mike Auty (RETIRED)
Modified: 2012-04-08 22:19 UTC (History)
0 users

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


Attachments
Patch for genkernel to support BOOTLOADER="grub2" (genkernel-grub2.patch,873 bytes, patch)
2011-10-25 12:24 UTC, Mike Auty (RETIRED)
Details | Diff
Little modification of previous grub2 patch (genkernel-3.4.22.1-grub2.patch,1.11 KB, patch)
2012-01-11 04:39 UTC, Tomasz Wasiak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Auty (RETIRED) gentoo-dev 2011-10-25 12:24:22 UTC
Created attachment 290789 [details, diff]
Patch for genkernel to support BOOTLOADER="grub2"

Hi there,

Here's a quick patch for adding grub2 support to genkernel.  It's very simple because grub2-mkconfig does most of the hard work that we used to in the old gen_bootloader.sh.  It currently fails if there is no existing grub2 config file present, but it could be made to always create grub.cfg if necessary.  This applies to the current git HEAD and 3.4.18...

This is activated by adding grub2 to the BOOTLOADER configuration variable.

Please let me know if there's any additional features required, or bugs found, etc...
Comment 1 Xake 2011-10-25 15:41:19 UTC
not to be picky, but a message in the style of "to customize bootparameters for grub2, please see /etc/defaults/grub" could be nice.
Comment 2 Tomasz Wasiak 2012-01-11 04:39:14 UTC
Created attachment 298597 [details, diff]
Little modification of previous grub2 patch

This patch add supports for different grub installation directories.
I am using live (-9999) of grub on some of my machines built using customized ebuild so this patch can work badly for stock sys-boot/grub:2 installations...
Comment 3 Mike Auty (RETIRED) gentoo-dev 2012-01-16 17:29:57 UTC
Several new versions of genkernel have come out since this patch was posted.  Has any progress been made on this?  Is there a particular stopping point or problem with this, or anything we can do help this get included?
Comment 4 Sebastian Pipping gentoo-dev 2012-01-16 19:05:04 UTC
(In reply to comment #3)
> Several new versions of genkernel have come out since this patch was posted. 
> Has any progress been made on this?  Is there a particular stopping point or
> problem with this, or anything we can do help this get included?

You may not like this, but this an honest answer:
I haven't dared touching this yet, not sure if I will.  Afaik Grub 1 integration is broken, I use a handmade menu.lst here with Grub 1 here and I have no personal motivation to move to Grub 2, yet.
Comment 5 Mike Auty (RETIRED) gentoo-dev 2012-01-18 15:40:06 UTC
Fair enough.

I worked on the grub1 integration a while ago, and as far as I'm aware it's very basic but should still work (it greps to find the previous copy of the kernel and then duplicates the necessary line for it).

The nice thing about grub2 is it's even easier, because you don't make any changes to the configuration yourself, you just rerun grub2-mkconfig, and it'll generate it for you (with new kernels included).  The patch is therefore just a convenience to running grub2-mkconfig afterwards, but given how simple it is, it seemed like it would be easy to add in (particularly since I think there's a push in the main tree to have people start testing/using grub2).

Let me know if there's anything else I can do to help get it in the tree, otherwise I guess it'll languish here for a while longer...

Thanks for the honest answer!  5:)
Comment 6 Mike Auty (RETIRED) gentoo-dev 2012-04-08 09:45:17 UTC
Hiya Sebastian, have you had a chance to investigate this yet?

It's really just a ten line patch, but there have been several new genkernel versions since then, and every time it requires a local bump just to apply this one patch (which has no effect on any existing code).

Please, when you get just 5 minutes, could you give this a look and let me know if it's ok to go in the next version?
Comment 7 Sebastian Pipping gentoo-dev 2012-04-08 19:46:31 UTC
Commited in [1] and refactored in [2].

Please give branch bug-388437 a try

  # git clone git://git.overlays.gentoo.org/proj/genkernel.git
  # cd genkernel
  # git checkout -t origin/bug-388437
  # GK_SHARE="$PWD" ./genkernel initramfs --no-install --no-postclear

and report back so I can merge it into master.


[1] http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=fd1f01f299b6e4e5d6963d61a72ad09578cd4e77
[2] http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=4971b9540af101b62f0a9f102d3be3d876d1868f
Comment 8 Mike Auty (RETIRED) gentoo-dev 2012-04-08 20:49:10 UTC
There seems to have been a typo in Tomasz's version.  Testing with grub-2.00_beta2-r1 in the main portage tree this fails because the program names are transformed from grub-mkconfig to grub2-mkconfig, whilst Tomasz's patch calls grub-mkconfig (which doesn't exist).  Other than that typo, this appears to work fine, thanks for putting the time in Sebastian, it's much appreciated!  5:)
Comment 9 Sebastian Pipping gentoo-dev 2012-04-08 22:19:39 UTC
(In reply to comment #8)
> There seems to have been a typo in Tomasz's version.  Testing with
> grub-2.00_beta2-r1 in the main portage tree this fails because the program
> names are transformed from grub-mkconfig to grub2-mkconfig, whilst Tomasz's
> patch calls grub-mkconfig (which doesn't exist).

Good catch, fixed:

http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=89ec359dbc21be79f03067c9cfa54cdad9db416d



>  Other than that typo, this
> appears to work fine, thanks for putting the time in Sebastian, it's much
> appreciated!  5:)

Thanks for the review.


+*genkernel-3.4.29 (08 Apr 2012)
+
+  08 Apr 2012; Sebastian Pipping <sping@gentoo.org> +genkernel-3.4.29.ebuild:
+  Bump to 3.4.29
+