Grub -> grub2?

Adam Williamson awilliam at redhat.com
Mon Oct 17 06:17:35 UTC 2011


On Sun, 2011-10-16 at 21:21 +0100, Martin Airs wrote:
> On Sunday 16 Oct 2011 08:06:32 David wrote:
> > 
> > To what line did you add 'vga=0x305'?
> > 
> > - --
> > 
> >   David
> 
> I don't actually know the correct/official way to do this, but here's the first menu entry in my grub.cfg
> 
> menuentry 'Linux, with Linux 3.1.0-0.rc9.git0.0.fc16.x86_64' --class gnu-linux --class gnu --class os {
>         load_video
>         set gfxpayload=keep
>         insmod gzio
>         insmod part_msdos
>         insmod ext2
>         set root='(hd0,msdos1)'
>         search --no-floppy --fs-uuid --set=root 0bc0fbf7-86a3-482c-abf3-ad29d0b39c6c
>         echo    'Loading Linux 3.1.0-0.rc9.git0.0.fc16.x86_64 ...'
>         linux   /vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root ro quiet LANG=en_GB.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=uk vga=0x305 nouveau.modeset=0 rdblacklist=nouveau 
>         echo    'Loading initial ramdisk ...'
>         initrd  /initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
> }
> 
> sorry I'v just turned wordwrap off on this, not sure how it will show to everyone else

To be entirely sure custom entries will always be present you should add
them to /etc/default/grub and then re-run 'grub2-mkconfig
-o /boot/grub/menu.lst' - this is the current "recommended procedure".

The background is that when you install kernels, grub.cfg is updated via
grubby, but if you want to manually re-generate the config, you use
grub2-mkconfig . grubby simply works by taking a copy of the first entry
in grub.cfg and adjusting it for the new kernel; grub2-mkconfig
re-writes the config from scratch based on the kernels it finds and the
other OSes it finds on your system. grub2-mkconfig reads 'extra'
parameters from /etc/default/grub , while grubby will simply 'inherit'
whichever others are currently present in entry #0 in grub.cfg .

So if you add them to /etc/default/grub and re-run grub2-mkconfig then
you'll know they're there on grub2-mkconfig runs, and because they're
now present in all grub.cfg entries, you know grubby will 'inherit' them
too.

/etc/default/grub is not currently packaged as a config file so changes
to it get overwritten when grub2 is updated; this has been reported as a
bug and should be fixed soon.
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | identi.ca: adamwfedora
http://www.happyassassin.net



More information about the test mailing list