Changes between Initial Version and Version 1 of bootloaders/grub


Ignore:
Timestamp:
Jan 2, 2010, 5:52:29 AM (14 years ago)
Author:
Jonathan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • bootloaders/grub

    v1 v1  
     1= Grub Legacy for CLFS Builds =
     2
     3== Needed Files ==
     4
     5Grub Legacy [[ftp://alpha.gnu.org/gnu/grub/grub-0.97.tar.gz]][[BR]]
     6
     7256-byte inode Patch [[http://patches.cross-lfs.org/dev/grub-0.97-256byte_inode-1.patch]][[BR]]
     8EXT4 Patch [[http://patches.cross-lfs.org/dev/grub-0.97-ext4-1.patch]][[BR]]
     9Fixes Patch [[http://patches.cross-lfs.org/dev/grub-0.97-fixes-1.patch]][[BR]]
     10x86_64 Fixes Patch [[http://patches.cross-lfs.org/dev/grub-0.97-use_mmap-1.patch]]
     11
     12== Apply the patches ==
     13
     14These patches are required for both the boot method and the Final-System sections of the book.
     15
     16{{{
     17patch -Np1 -i ../grub-0.97-use_mmap-1.patch
     18patch -Np1 -i ../grub-0.97-fixes-1.patch
     19patch -Np1 -i ../grub-0.97-256byte_inode-1.patch
     20patch -Np1 -i ../grub-0.97-ext4-1.patch
     21}}}
     22
     23
     24== Changes for Cross-Tools Section ==
     25
     26This build is only required if you're using the Boot Method of the build.
     27
     28=== Build Grub Legancy ===
     29
     30{{{
     31
     32./configure --prefix=/usr \
     33   --build=${CLFS_HOST} --host=${CLFS_TARGET}
     34make
     35make DESTDIR=${CLFS} install
     36mkdir -v ${CLFS}/boot/grub
     37cp -v ${CLFS}/usr/lib/grub/*/stage{1,2} ${CLFS}/boot/grub
     38}}}
     39
     40== Changes to Final-Sysyem section ==
     41
     42Thid build is only required for the final-system section of the book.
     43
     44=== Build Grub Legancy ===
     45
     46The 'make check' is optional.
     47
     48{{{
     49./configure --prefix=/usr
     50make
     51make check
     52make install
     53mkdir -pv /boot/grub
     54cp -v /usr/lib/grub/*/stage{1,2} /boot/grub
     55}}}
     56
     57
     58The FHS stipulates that the bootloader's configuration file should be symlinked to /etc/{Bootloader Name}. The bootloader's configuration file is created in the following section. To satisfy this requirement for GRUB, issue the following command:
     59{{{
     60mkdir -v /etc/grub &&
     61ln -sv /boot/grub/menu.lst /etc/grub
     62}}}
     63
     64
     65== Installing Grub ==
     66GRUB 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).
     67
     68Using the above information, determine the appropriate designator for the root partition (or boot partition, if a separate one is used). For the following example, it is assumed that the root (or separate boot) partition is hda4.
     69
     70After running the 'grub' command. tell GRUB where to search for its stage{1,2} files. The Tab key can be used everywhere to make GRUB show the alternatives. Install grub to the MBR and then quit.
     71
     72{{{
     73grub
     74root (hd0,3)
     75setup (hd0)
     76quit
     77}}}
     78
     79=== Creating the Boot Menu ===
     80
     81Create a "Boot Menu" for grub by defining the boot menu, ${CLFS} is only required if you are using the boot method.
     82
     83{{{
     84cat > ${CLFS}/boot/grub/menu.lst << "EOF"
     85# Begin /boot/grub/menu.lst
     86
     87# By default boot the first menu entry.
     88default 0
     89
     90# Allow 30 seconds before booting the default.
     91timeout 30
     92
     93# Use prettier colors.
     94color green/black light-green/black
     95
     96# The first entry is for CLFS.
     97title CLFS SVN-20100101
     98root (hd0,3)
     99kernel /boot/clfskernel-2.6.30.5 root=/dev/hda4
     100EOF
     101}}}
     102
     103Add an entry for the host distribution if desired. It might look like this:
     104{{{
     105cat >> ${CLFS}/boot/grub/menu.lst << "EOF"
     106title Red Hat
     107root (hd0,2)
     108kernel /boot/kernel-2.6.5 root=/dev/hda3
     109initrd /boot/initrd-2.6.5
     110EOF
     111}}}
     112
     113
     114If dual-booting Windows, the following entry will allow booting it:
     115{{{
     116cat >> ${CLFS}/boot/grub/menu.lst << "EOF"
     117title Windows
     118rootnoverify (hd0,0)
     119chainloader +1
     120EOF
     121}}}