| 1 | = Building Grub = |
| 2 | |
| 3 | |
| 4 | The following instructions built the image and were run on a Fedora Core 5 Linux host. |
| 5 | |
| 6 | Download the latest release of version 2 the [http://grub.enbug.org/FrontPage Grub boot loader] from ftp://alpha.gnu.org/gnu/grub/. Build the package with the following configure command: |
| 7 | |
| 8 | $ ../grub-1.94/configure --prefix=/tmp/g2/build |
| 9 | $ make all install |
| 10 | |
| 11 | where the prefix can be anything suitable for your machine. If configure fails with a missing LZO library check you have the lzo-devel package installed. |
| 12 | |
| 13 | To make the floppy image follow the instructions in the Grub Wiki at http://grub.enbug.org/TestingOnX86. This script is adapted from the instructions: |
| 14 | |
| 15 | #! /bin/sh -x |
| 16 | grub=/tmp/g2/build |
| 17 | workspace=/tmp/g2 |
| 18 | mnt=$workspace/mnt/loop |
| 19 | file=$workspace/rtems-boot.img |
| 20 | export PATH=$grub/bin:$grub/sbin:$PATH |
| 21 | mkdir -p $workspace |
| 22 | cd $workspace |
| 23 | grub-mkimage -o core.img _chain ls pc multiboot gpt fat boot reboot configfile cat help |
| 24 | dd if=/dev/zero of=$file bs=512 count=2880 |
| 25 | /sbin/mkdosfs $file |
| 26 | mkdir -p $mnt |
| 27 | mount -o loop -t vfat $file $mnt |
| 28 | mkdir -p $mnt/boot/grub |
| 29 | cp $grub/lib/grub/i386-pc/boot.img core.img $grub/lib/grub/i386-pc/*.mod $mnt/boot/grub |
| 30 | echo "configfile (hd0,0)/rtems-grub.cfg" > $mnt/boot/grub/grub.cfg |
| 31 | echo '(fd0)' $file > tmp_device.map |
| 32 | grub-setup -d $mnt/boot/grub -r '(fd0)' -m tmp_device.map '(fd0)' |
| 33 | rm -f tmp_device.map |
| 34 | umount $mnt |