Recently I decided to play a little with Fedora’s Grub2 to see how it works. Fedora Grub2 package does not replace Grub1 and adds itself to its menu, so it is safe to install.
It is clear that Fedora is not ready to switch to Grub2 currently (while it is not much work to do so), since the grub2 menu of it is not polished at all: a simple black background, and Fedora menu entries appear as “GNU/Linux, with Linux VERSION”. Well, both are just a very simple polish work, one of them is tracked here.
I was surprised to see that other installed operating systems, like my Windows and the other installed Fedora was not added to Grub2’s menu. It is generally the task of grub2’s /etc/grub.d/30_os-prober script. I was surprised to find out that this script depends on os-prober for detecting other operating systems, which is a tool developed for Debian installer and is not available in Fedora. Therefore, I decided to package it and it is up for review here, waiting for someone to approve it! 😉 Also, it is clear that grub2 package should depend on it, so a bug report is created for it too.
But there is nothing in os-prober to make it useful only for grub2. Fedora is currently using grub1 and there is no clear plans for migrating to grub2 currently, and there are people who are frustrated when find out that Fedora is unable to automatically detect and add other installed Linux distributions to its Grub menu, which is also reported here. So, I decided to modify grub2’s os_prober script to generate menu entries for Grub1, and the result is available here. If you’ve installed os-prober, you can run this script and it should generate grub1 menu entries for other operating systems installed on your system (Windows and other distribution installations). However, I’m not sure if it generates correct entries for all systems, specially as it currently depends on /boot/grub/device.map to convert Linux device names to grub names. The script outputs the results to standard output and doesn’t modify your grub.conf directly, so you can try it safely.
An example output of this script is like this:
title Windows Recovery Environment (loader) (on /dev/sda1)
title Windows Vista (loader) (on /dev/sda2)
title Parsidora (18.104.22.168-83.fc14.x86_64) (on /dev/mapper/VolGroupLaptop-lvroot2)
kernel /vmlinuz-22.214.171.124-83.fc14.x86_64 ro root=/dev/mapper/VolGroupLaptop-lvroot rd_LVM_LV=VolGroupLaptop/lvroot rd_LVM_LV=VolGroupLaptop/lvswap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
title Fedora 15 tmp Installer (on /dev/mapper/VolGroupLaptop-lvroot2)
kernel /vmlinuz askmethod
title Fedora (2.6.38-0.rc5.git1.1.fc15.x86_64) (on /dev/mapper/VolGroupLaptop-lvroot2)
kernel /vmlinuz-2.6.38-0.rc5.git1.1.fc15.x86_64 ro root=/dev/mapper/VolGroupLaptop-lvroot2 rd_LVM_LV=VolGroupLaptop/lvroot2 rd_LVM_LV=VolGroupLaptop/lvswap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
title GNU GRUB 2, (1.98) (on /dev/mapper/VolGroupLaptop-lvroot2)