Features/Grub2

From FedoraProject

< Features(Difference between revisions)
Jump to: navigation, search
(moved to FeatureAcceptedF16 - feature was approved at 2011-07-11 meeting.)
m (From a DVD with Anaconda: changing dvd chroot instructions to SOP compliant mountpoint)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{autolang|base=yes}}
 
= Feature Name =
 
= Feature Name =
 
GRUB2
 
GRUB2
Line 14: Line 15:
 
== Current status ==
 
== Current status ==
 
* Targeted release: 16
 
* Targeted release: 16
* Last updated: 05/24/2011
+
* Last updated: 8/10/2011
* Percentage of completion: 10%
+
* Percentage of completion: 85%
  
 
http://koji.fedoraproject.org/koji/buildinfo?buildID=242356
 
http://koji.fedoraproject.org/koji/buildinfo?buildID=242356
Line 29: Line 30:
  
 
***---***
 
***---***
Grub (legacy) is no longer supported. Patches are not accepted. Grub2 is also nearing a stable release (20-Apr-2011 GRUB 1.99~rc2) which is something that Grub (legacy) never reached.
+
Grub (legacy) is no longer supported. Patches are not accepted. Grub2 is also nearing a stable release (14-May-2011 GRUB 1.99) which is something that Grub (legacy) never reached.
  
 
== Scope ==
 
== Scope ==
Line 92: Line 93:
  
 
=== From a DVD with Anaconda ===
 
=== From a DVD with Anaconda ===
TBD as things get fleshed out more
+
An install DVD can be used to install or repair grub, after setting up a working chroot of your filesystems. From a root console:
 +
#make a directory to work in:
 +
<code><nowiki>mkdir /mnt/sysimage</nowiki></code>
 +
#mount your filesystems (device nodes are examples, be sure to fill in your own!):
 +
<code><nowiki>mount /dev/sda2 /mnt/sysimage</nowiki></code>
  
 +
<code><nowiki>mount /dev/sda1 /mnt/sysimage/boot</nowiki></code>
 +
 +
#bind mount your system filesystems:
 +
<code><nowiki>mount --bind /dev /mnt/sysimage/dev</nowiki></code>
 +
 +
<code><nowiki>mount --bind /proc /mnt/sysimage/proc</nowiki></code>
 +
 +
<code><nowiki>mount --bind /sys /mnt/sysimage/sys</nowiki></code>
 +
 +
#enter your chroot
 +
 +
<code><nowiki>chroot /mnt/sysimage/</nowiki></code>
 +
 +
You should now be able to install grub2 to your device without interference from the temporary system.
 
<!-- This does not need to be a full-fledged document.  Describe the dimensions of tests that this  
 
<!-- This does not need to be a full-fledged document.  Describe the dimensions of tests that this  
 
feature is expected to pass when it is done.  If it needs to be tested with different hardware or software configurations, indicate them.  The more specific you can be, the better the community testing can be.  
 
feature is expected to pass when it is done.  If it needs to be tested with different hardware or software configurations, indicate them.  The more specific you can be, the better the community testing can be.  
Line 131: Line 150:
 
== Comments and Discussion ==
 
== Comments and Discussion ==
 
* See [[Talk:Features/Grub2]]  <!-- This adds a link to the "discussion" tab associated with your page.  This provides the ability to have ongoing comments or conversation without bogging down the main feature page -->
 
* See [[Talk:Features/Grub2]]  <!-- This adds a link to the "discussion" tab associated with your page.  This provides the ability to have ongoing comments or conversation without bogging down the main feature page -->
 +
 +
* [http://en.gentoo-wiki.com/wiki/Grub2 http://en.gentoo-wiki.com/wiki/Grub2]
 +
* [https://help.ubuntu.com/community/Grub2 https://help.ubuntu.com/community/Grub2]
 +
* [http://wiki.debian.org/Grub http://wiki.debian.org/Grub]
 +
* [http://en.opensuse.org/GRUB http://en.opensuse.org/GRUB]
 +
* [https://wiki.archlinux.org/index.php/GRUB2 https://wiki.archlinux.org/index.php/GRUB2]
 +
* [http://www.dedoimedo.com/computers/grub-2.html GRUB 2 bootloader-Full tutorial]
 +
* [http://en.wikipedia.org/wiki/GNU_GRUB wikipedia-GRUB]
  
  

Latest revision as of 00:04, 7 March 2012

Contents

[edit] Feature Name

GRUB2

[edit] Summary

THIS IS VERY VERY EARLY STAGE

This is very early stage, but I'm trying to document the progress here rather than just locally

Switch to using grub2 instead of grub legacy for boot loading an installed x86 system

[edit] Owner

[edit] Current status

  • Targeted release: 16
  • Last updated: 8/10/2011
  • Percentage of completion: 85%

http://koji.fedoraproject.org/koji/buildinfo?buildID=242356 At least probably 10% of this feature is creating and updating the packages to reflect changes in http://ftp.gnu.org/gnu/grub/.

[edit] Detailed Description

We currently use what is essentially a fork of GRUB 0.9x in Fedora for a variety of historical reasons. It would be nice to get back to the upstream developed version, even though it is in many ways an entirely new project.

GRUB2 has reached version 1.99 (equivalent to r.c. 3). The upstream wiki can be found at http://grub.enbug.org/ (This was down for me so http://www.gnu.org/software/grub/.)

[edit] Benefit to Fedora

There could be new functionality, but that's currently less of the driver.

      • ---***

Grub (legacy) is no longer supported. Patches are not accepted. Grub2 is also nearing a stable release (14-May-2011 GRUB 1.99) which is something that Grub (legacy) never reached.

[edit] Scope

The changes are somewhat localized, but there's a lot to be done. The current status based on the testing I've done so far.

[edit] What Currently Works

  • MBR Bios booting as chainloaded from grub1 works
  • Booting from the MBR works
  • Graphics mode works
    • You have to have freetype2-devel installed and build with --enable-mkfont
    • Also had to grab the unifont from http://unifoundry.com/unifont.html
    • Simple hacked up module to load a background image is okay. Could certainly be made better
  • Creating /usr/local/etc/defaults/grub (would be /etc, but prefix=/usr/local) allowed me to set the following
    • default timeout, default distro name, default to graphics mode
    • some of this is lame and should get auto-detected (eg, parse /etc/system-release)

[edit] Things that still have to be tested/worked on

  • EFI mode
  • passwords -- Debian and Ubuntu are working on this upstream as of 8 July
  • hidden menu support that we use for flicker-less boot
  • serial terminal support (with the timeouts)
  • bootonce
  • Always adding single user entry is not so good -- set GRUB_DISABLE_LINUX_RECOVERY in /etc/default/grub
  • Chainloading various versions of Windows
  • Auto-detection of Windows and adding it to the config file
  • Can we ship the unifont ?
  • support for multiple initrds
    • Also, as I had it "built", the font wasn't quite right
  • Ensuring all the other features we have and care about are present (if someone wants to make a list of these, it would be helpful)
  • Documentation, documentation, documentation...

[edit] External things that would need work

  • anaconda needs to be able to create the new file. Or at least run grub-mkconf
  • grubby to update. Or phase out for grub-updconf?


[edit] How To Test

It is very easy to test from Grub Legacy type environment, but we will also need to test from Anaconda/Firstinstall.

[edit] From an Installed System with Grub Legacy

This was adapted from http://en.gentoo-wiki.com/wiki/Grub2

The following will automatically generate a GRUB2 configuration file including kernels images within your /boot folder, using the auto configuration scripts in /etc/grub.d, the -o specifices an output file, here the default, /boot/grub2/grub.cfg:

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

[edit] Testing With Chain Loading

GRUB2 includes a boot image that's loadable from GRUB Legacy, so you can try it out without wiping out your existing, working MBR. To set up GRUB2 without actually writing to the MBR, run

grub2-install --grub-setup=/bin/true /dev/sda

[edit] Writing to the MBR

If that works, you can go on testing to writing to your MBR. Same steps as above, but don't tell grub to run the dummy setup program /bin/true

grub2-install /dev/sda

Congratulations! You've reached the point of no return! If you can't boot now you will need to run a rescue CD

[edit] From a DVD with Anaconda

An install DVD can be used to install or repair grub, after setting up a working chroot of your filesystems. From a root console:

  1. make a directory to work in:

mkdir /mnt/sysimage

  1. mount your filesystems (device nodes are examples, be sure to fill in your own!):

mount /dev/sda2 /mnt/sysimage

mount /dev/sda1 /mnt/sysimage/boot

  1. bind mount your system filesystems:

mount --bind /dev /mnt/sysimage/dev

mount --bind /proc /mnt/sysimage/proc

mount --bind /sys /mnt/sysimage/sys

  1. enter your chroot

chroot /mnt/sysimage/

You should now be able to install grub2 to your device without interference from the temporary system.

Test matrix here: https://fedoraproject.org/wiki/User:Pjones/Grub2TestMatrix

[edit] User Experience

Ultimately, the main thing a user could change is the different config file (grub.cfg vs grub.conf) and the different syntax in the config file. During the normal boot process, the idea should be that it's not that noticeable

[edit] Dependencies

We'll have to be sure to update anaconda for the new config file format and also deal with things like grubby (which updates boot loader configs)

[edit] Contingency Plan

Keep using GRUB legacy

[edit] Documentation

  • The only docs right now are at the upstream site, but they're slim at best.

[edit] Release Notes

Fedora switched from grub legacy to grub2 in Fedora 16. Grub 2 allows better configuration options, better support for non x86 architectures, scripting and localization support. Grub 2 has new configuration format and and files. Please consult the grub manual for more information.

[edit] Comments and Discussion