Changes between Initial Version and Version 1 of bootloaders/grub2


Ignore:
Timestamp:
Jan 2, 2010, 6:54:17 AM (15 years ago)
Author:
Jonathan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • bootloaders/grub2

    v1 v1  
     1= Grub2 =
     2
     3=== Needed Files ===
     4Grub2 [[ftp://alpha.gnu.org/gnu/grub/grub-1.97.1.tar.gz]]
     5
     6== Changed to boot method ==
     7These changes apply if you are using the boot method.
     8
     9=== Builing Grub2 ===
     10
     11{{{
     12./configure --prefix=/usr \
     13   --build=${CLFS_HOST} --host=${CLFS_TARGET}
     14make
     15make DESTDIR=${CLFS} install
     16}}}
     17
     18== Changes to Final-System ==
     19These changes apply to the final-system section of the book.
     20
     21=== Building Grub2 ===
     22The 'make check' is optional.
     23{{{
     24./configure --prefix=/usr
     25make
     26make check
     27make install
     28}}}
     29
     30
     31== Installing Grub2 ==
     32To install Grub2 onto the MBR you need to run the following command. Rember to substitute 'sda' for your boot hard drive.
     33{{{
     34grub-install /dev/sda
     35}}}
     36
     37== Creating the Boot Menu ==
     38GRUB uses its own naming structure for drives and partitions in the form of (hdn,m), where n is the hard drive number and m is the partition number, both starting from zero. For example, partition hda1 is (hd0,0) to GRUB and hdb3 is (hd1,2). In contrast to Linux, GRUB does not consider CD-ROM drives to be hard drives. For example, if using a CD on hdb and a second hard drive on hdc, that second hard drive would still be (hd1).
     39
     40Create a "Boot Menu" for grub by defining the boot menu, ${CLFS} is only required if you are using the boot method. The menu below uses the second partition on the first hard drive, (hd0,1), remember to substitute this for your hard drive and parition.
     41{{{
     42cat > ${CLFS}/boot/grub/grub.cfg << "EOF"
     43# Begin /boot/grub/grub.cfg
     44
     45set default=0
     46set timeout=5
     47
     48set root=(hd0,1)
     49menuentry "Linux 2.6.31.5" {
     50  linux /kernel-2.6.31.5 root=/dev/sda2
     51}
     52
     53EOF
     54}}}
     55
     56
     57
     58If dual-booting with Windows, then following entry will allow booting it:
     59{{{
     60cat >> ${CLFS}/boot/grub/grub.cfg << "EOF"
     61menuentry "Microsoft Windows" {
     62        set root=(hd1,1)
     63        devicemap -s hd0 hd1
     64        chainloader +1
     65}
     66EOF
     67}}}
     68
     69=== References ===
     70Gentoo Wiki [[http://en.gentoo-wiki.com/wiki/Grub2]]