Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 100637 - sys-kernel/genkernel with install option give empty grub.conf
Summary: sys-kernel/genkernel with install option give empty grub.conf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
: 104450 117976 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-28 14:26 UTC by Tim Keitt
Modified: 2010-12-10 07:56 UTC (History)
6 users (show)

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


Attachments
AMD64 grub.conf (grub.conf.bak,3.05 KB, text/plain)
2005-09-01 00:52 UTC, hvjunk
Details
my grub.conf (grub.conf,926 bytes, application/octet-stream)
2005-09-16 10:12 UTC, Matthias R.
Details
grub.conf.bak (grub.conf.bak,1.09 KB, text/plain)
2005-09-25 19:19 UTC, Chan Min Wai
Details
another grub.conf.bak (grub.conf.bak,997 bytes, application/x-trash)
2005-10-22 11:26 UTC, Bruno Adele
Details
Replacement grup awk script that cares not about whitespace instead of = (gen_bootloader_grub.awk,1.64 KB, text/plain)
2005-11-13 22:15 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Keitt 2005-07-28 14:26:49 UTC
Running genkernel 3.3 with the BOOTLOADER=grub set in /etc/genkernel.conf leaves
/boot/grub/grub.conf empty.

Reproducible: Always
Steps to Reproduce:
1. uncomment the BOOTLOADER=grub line in /etc/genkernel.conf
2. run genkernel all
3. 

Actual Results:  
grub.conf is empty

Expected Results:  
grub.conf contains bootloader commands

I do not have a separate /boot partition on this machine. grub.conf.bak contains
your old grub.conf contents.
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2005-07-29 13:59:36 UTC
Please attach grub.conf.bak.
Comment 2 Tim Yamin (RETIRED) gentoo-dev 2005-08-09 07:40:16 UTC
Please attach grub.conf.bak.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-09-01 00:46:02 UTC
*** Bug 104450 has been marked as a duplicate of this bug. ***
Comment 4 hvjunk 2005-09-01 00:52:54 UTC
Created attachment 67393 [details]
AMD64 grub.conf
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2005-09-01 01:14:18 UTC
Reopen wrt the duplicate bug.
Comment 6 hvjunk 2005-09-01 01:25:22 UTC
Can genkernel perhaps include a "template"/initial grub.conf?

This would help with the creation during initial installation, and perhaps
easier/quicker to generate a "compliant" grub.conf. Especially when I'm
installing a new server/desktop/etc. I don't like to type in the whole grub.conf
file and have these type of problems :(

Thanx
HEndrik
Comment 7 Matthias R. 2005-09-16 10:12:35 UTC
Created attachment 68590 [details]
my grub.conf

I've got the same problem.
Using Genkernel 3.3.6
Comment 8 Chan Min Wai 2005-09-25 19:17:32 UTC
Same problem here...
once genkernel grub.conf is empty.
Comment 9 Chan Min Wai 2005-09-25 19:19:55 UTC
Created attachment 69244 [details]
grub.conf.bak

As requested.
Comment 10 Bruno Adele 2005-10-22 11:26:55 UTC
Created attachment 71210 [details]
another grub.conf.bak

Another grub.conf.bak

I have same probleme with genkernel 3.3.6
Comment 11 Bruno Adele 2005-10-24 11:57:37 UTC
If i add lines(bottom this message) in top of my grub.conf that run correctely, 
genkernel not clear grub.conf. 
 
i think juste replace  
"initrd (hd0,4)/initrd-genkernel-x86-2.6.13-gentoo-r3" by 
"initrd (hd0,4)/initramfs-genkernel-x86-2.6.13-gentoo-r3" 
 
genkernel rename "initrd-genkernel-x86-x.x.x" by 
"initramfs-genkernel-x86-x.x.x" ? 
 
PS: sorry for my bad english, i french. 
 
title Gentoo  2.6.13 
root (hd0,4) 
kernel (hd0,4)/kernel-genkernel-x86-2.6.13-gentoo-r3 root=/dev/ram0 
real_root=/dev/hda7 init=/linuxrc 
ramdisk=8192 video=vesafb:ywrap,mtrr vga=0x317 splash=silent udev gentoo=udev 
initrd (hd0,4)/initramfs-genkernel-x86-2.6.13-gentoo-r3 
 
Comment 12 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2005-11-13 21:52:36 UTC
A possible solution:

after reading throught teh Awk script that does all the work,  (and learning awk
lol ) it seems the problem lies in that it wants you to write

title=Gentoo     # way genkernel wants it

as opposed to

title Gentoo   # way you guys all have it

and it seems that  "title=Gentoo" method is quite commonly used.

http://www.linuxquestions.org/questions/history/376513 is an example of this.

so it appears theres one of 2 ways we can fix it, modify the script to support
the nonstandard "title Gentoo" method of doing it( but have the script secretly
move to the new system ) , or enlighten users as to what genkernel wants, and it
seems the latter of the two will more likey go unseen.

hope this is a bug fix for all of you :D


Solution:

Replace all instances of 
  title yourkenrnelName
with
  title=yourkernelName




Comment 13 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2005-11-13 22:15:31 UTC
Created attachment 72859 [details]
Replacement grup awk script that cares not about whitespace instead of =

Suggested replacement for /usr/share/genkernel/gen_bootloader_grub.awk

this permits existing grub configs to have 

"title gentoo" 


standard entries and still be able to use them, but will append new entries in
the new format to encourage users to switch without shocking thier nickers off.


( ie: genkernel, reboot.. "OMG gentoo sucks" syndrome which we really cant have
;) )


the script basically has 

( match($0, /^title=/) || match($0, /^title */) ) 

in the places where it would ordinarily only have

match($0, /^title=/)
Comment 14 Massimiliano Adamo 2005-11-14 12:50:59 UTC
As I can see this option works only when /boot/grub/grub.conf doesn't exist.
If it exists, it doesn't matter what it contains, it will be filled to zero.
Even if it is already zero size it will remain to zero size.
To get it working you must delete grub.conf. Only in this case it will works.
May I have some doubt about gentoo testing processes? ;) ;)
How is it possible that you don't see this bug and you release to production
such things?? ;)

I am using last version 3.3.6
Comment 15 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2005-11-17 06:08:09 UTC
(In reply to comment #14)
> As I can see this option works only when /boot/grub/grub.conf doesn't exist.
> If it exists, it doesn't matter what it contains, it will be filled to zero.
> Even if it is already zero size it will remain to zero size.
> To get it working you must delete grub.conf. Only in this case it will works.
> May I have some doubt about gentoo testing processes? ;) ;)
> How is it possible that you don't see this bug and you release to production
> such things?? ;)
> 
> I am using last version 3.3.6


very peculiar, the genkernel script should copy grub.conf to grub.conf.bak and
then use the awk script to process grub.conf.bak to inject a new entry to the
front of it which is output to grub.conf

You didnt say wether or not my suggested awk script did the job or not to fix
this error :) , it works for me, so i'd hope it worked for you too.

if it still doesnt work, well, id have to suspect theres something abnormal
about your grub.conf, as it appears that the genkernel script is quite picky on
such matters.

maybe theres more ghosts that ive not seen in the script ^^;
Comment 16 Chuck Wegrzyn 2005-12-02 06:36:47 UTC
This has been a consistent problem. I have never gotten it to work. Why not just
put the new entry at the end of grub.conf and scan the file for a 'default'
line. If it is present, change it to the last one (for instance just count
kernel lines - perhaps).

I am using 3.3.8 and it still isn't working...
Comment 17 Chan Min Wai 2005-12-06 08:19:13 UTC
This is still happening on the new stable version... :(
Comment 18 Tim Yamin (RETIRED) gentoo-dev 2005-12-16 12:10:37 UTC
Patch added to 3.3.9; if you still have issues with that please reopen this bug. Thanks!
Comment 19 Chris Gianelloni (RETIRED) gentoo-dev 2006-01-06 09:02:21 UTC
*** Bug 117976 has been marked as a duplicate of this bug. ***
Comment 20 Petteri Räty (RETIRED) gentoo-dev 2006-11-22 22:50:58 UTC
The problem is here again with genkernel-3.4.4:

* Adding kernel to /boot/grub/grub.conf...
*
* Kernel compiled successfully!
*
* Required Kernel Parameters:
*     real_root=/dev/$ROOT
*
*     Where $ROOT is the device node for your root partition as the
*     one specified in /etc/fstab
*
* If you require Genkernel's hardware detection features; you MUST
* tell your bootloader to use the provided INITRAMFS file. Otherwise;
* substitute the root argument for the real_root argument if you are
* not planning to use the initrd...

* WARNING... WARNING... WARNING...
* Additional kernel cmdline arguments that *may* be required to boot properly...
* add "dolvm2" for lvm2 support

* Do NOT report kernel bugs as genkernel bugs unless your bug
* is about the default genkernel configuration...
*
* Make sure you have the latest genkernel before reporting bugs.
pelimies / # cat /boot/grub/grub.conf
pelimies / # cat /boot/grub/grub.conf.bak
#
# Sample boot menu configuration file
#

# Boot automatically after 30 secs.
timeout 10

# By default, boot the first entry.
default 0

# Fallback to the second entry.
fallback 1
Comment 21 Chris Gianelloni (RETIRED) gentoo-dev 2007-09-17 20:12:13 UTC
Petteri, do you have a fix?  I don't use this functionality in genkernel, since I only use it for release-building, so I'm not very familiar with it.
Comment 22 Tobia Fasciati 2008-05-10 01:09:57 UTC
(In reply to comment #6)
> Can genkernel perhaps include a "template"/initial grub.conf?
> 
> This would help with the creation during initial installation, and perhaps
> easier/quicker to generate a "compliant" grub.conf. Especially when I'm
> installing a new server/desktop/etc. I don't like to type in the whole grub.conf
> file and have these type of problems :(

You just have to login via ssh and copy&past everything.
Comment 23 Andrew Gaffney (RETIRED) gentoo-dev 2008-12-15 01:53:08 UTC
The code that modified the grub.conf has been rewritten from the ground up and seems to work fine on your original attached grub.conf. Please try it out by emerging sys-kernel/genkernel-9999
Comment 24 Sebastian Pipping gentoo-dev 2010-12-10 07:56:37 UTC
Due to the date of the last comment on this bug I assume that feature to be included in 3.4.10.907 or an earlier release of genkernel.

Closing, please re-open as needed.