LWN.net Logo

GRUB 2.00 released

GRUB 2.00 released

Posted Jun 29, 2012 7:51 UTC (Fri) by idupree (subscriber, #71169)
In reply to: GRUB 2.00 released by alspnost
Parent article: GRUB 2.00 released

I know Debian's done crazy things with their GRUB configuration, but my manual GRUB2 installation is dirt simple:

grub.cfg:

#timeout in seconds:
set timeout=3

#default counts menuentries in order from 0, i.e.
#this references "Arch-no-nouveau-pushed".
set default=1

menuentry "Arch-force-nouveau" {
  linux /archboot/vmlinuz-linux cryptdevice=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:files root=/dev/mapper/files gpt nouveau modeset=1 printk.time=1
  initrd /archboot/initramfs-linux.img
}
menuentry "Arch-no-nouveau-pushed" {
  linux /archboot/vmlinuz-linux cryptdevice=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:files root=/dev/mapper/files gpt printk.time=1
  initrd /archboot/initramfs-linux.img
}
menuentry "Arch-lts-fallback-3.0kernel" {
  linux /archboot/vmlinuz-linux-lts cryptdevice=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:files root=/dev/mapper/files gpt nouveau modeset=1 printk.time=1
  initrd /archboot/initramfs-linux-lts-fallback.img
}
menuentry "Rescue iso (sysresccd 2.7.0, kernel rescue64 3.2.x)" {
  loopback loop /systemrescuecd-x86-2.7.0.iso
  linux (loop)/isolinux/rescue64 docache isoloop=systemrescuecd-x86-2.7.0.iso
  initrd (loop)/isolinux/initram.igz
}
menuentry "Arch memtest86+" {
  linux16 /archboot/memtest86+/memtest.bin
}

(context - I have a dedicated bootloader partition. I mount its /archboot onto my Arch Linux /boot partition (using fstab). grub2-install takes care of what happens before this partition [I install grub using SysRescCD]. My distro's initramfs takes care of what happens after.)


(Log in to post comments)

GRUB 2.00 released

Posted Jun 29, 2012 8:06 UTC (Fri) by HelloWorld (guest, #56129) [Link]

It should also be mentioned that entries like these can be put in /boot/grub/custom.cfg where they won't be overwritten the next time grub.cfg is regenerated.

GRUB 2.00 released

Posted Jun 29, 2012 15:48 UTC (Fri) by Aliasundercover (subscriber, #69009) [Link]

All the layers get tiresome. A configuration file for a script to write a configuration file which gets interpreted like a script...

Some honor this as the "Unix" way but it feels like pushing on a string to me.

GRUB 2.00 released

Posted Jun 29, 2012 16:54 UTC (Fri) by HelloWorld (guest, #56129) [Link]

If you don't want to use grub-mkconfig, nothing stops you from writing grub.cfg by hand, so what's the problem? I'm not saying everything is perfect with Grub2's configuration handling, it's just that I completely fail to see how Grub1 is any better.

GRUB 2.00 released

Posted Jun 29, 2012 21:08 UTC (Fri) by Aliasundercover (subscriber, #69009) [Link]

Right, then we get back to grub.cfg getting trashed by the automatic tools. Pick your poison, complicated script to generate a script vs. care to backup and fix a less complicated hand written config file every time the automatic stuff gets loose with it.

GRUB 2.00 released

Posted Jun 29, 2012 23:41 UTC (Fri) by HelloWorld (guest, #56129) [Link]

Entries in /boot/grub/custom.cfg won't be overwritten.

GRUB 2.00 released

Posted Jul 8, 2012 16:21 UTC (Sun) by hodoscek (subscriber, #5290) [Link]

What about /etc/grub.d/40_custom file. This is official place to put your stuff that you want to boot. After changing the file just run

grub2-mkconfig -o /boot/grub2/grub.cfg

I use it all the times with Gentoo. But Ubuntu can do it too. So I still compile my own kernels and extend the 40_custom file, similar to grub1 or lilo in the ancient times. Not much changed :-)

Even simpler

Posted Jul 12, 2012 12:35 UTC (Thu) by alex (subscriber, #1355) [Link]

I just have /boot/kernel-stable, /boot/kernel-linus and /boot/kernel-ajb and take care not to update all of them at once. I believe I also have the Gentoo default installed kernel just in case I hose all of my custom kernels but I've never needed to go that far.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds