mkdir DOS-image mount -o loop DOS-4Mb-floppy.img DOS-image cp AFUDOS.exe SMCMOS.exe MYBIOS.IMG MYBIOS.SIM DOS-image pushd DOS-image echo "rem Sample DOS batch file to boot Linux." >autoexec.bet echo "rem afudos BIOS.IMG /P /REBOOT" >>autoexec.bet echo "smcmos -w BIOS.sim" >>autoexec.bat echo "re-boot 2" >>autoexec.bat popd umount DOS-image cp DOS-4Mb-floppy.img /boot
After running those commands, you should have the two files /boot/memdisk and /boot/DOS-4Mb-boot.img, which only need a proper entry in /boot/grub/grub.conf to make it possible to flash your BIOS or configure it with your settings.
To update BIOS settings on a node:
yum -y remove grub tar xvzpf /ldcg_admin/Flash-BIOS/RIP-grub-0.97-X.tar.gz tar xvzpf /ldcg_admin/Flash-BIOS/bootkit-NN-NN-NNNN.tar.gz --directory / cp -r RIP-grub-0.97-X/usr / grub-install /dev/sda grub-set-default 7 reboot
Your /boot/grub/grub.conf file needs to be modified to make this work:
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda2
# initrd /initrd-version.img
#boot=/dev/sda
default=saved
timeout=5
serial --unit=1 --speed=19200
terminal --timeout=5 serial console
title Fedora Core (2.6.20.20-CIT)
root (hd0,0)
kernel /vmlinuz-2.6.20.20-CIT ro root=/dev/sda2 elevator=deadline console=tty0 console=ttyS1,19200n8
initrd /initrd-2.6.20.20-CIT.img
savedefault
title Fedora Core (2.6.20.14-CIT)
root (hd0,0)
kernel /vmlinuz-2.6.20.14-CIT ro root=/dev/sda2 elevator=deadline console=tty0 console=ttyS1,19200n8 iommu=off
initrd /initrd-2.6.20.14-CIT.img
savedefault 0
title Memtest86+ (1.55.1)
root (hd0,0)
kernel /memtest86+-1.55.1 ro root=/dev/sda2
savedefault 0
title DOS For BIOS Flashing
root (hd0,0)
kernel /memdisk bigraw floppy c=4 s=32 h=64
initrd /DOS-4Mb-boot.img
savedefault 0
boot
All the lines highlighted in red are part of new functionality introduced in grub-0.96 to support the command grub-set-default (part of the grub distribution beginning with 0.96), which allows you to reboot to an alternate target ONCE, with a subsequent reboot returning to the default target.
In the example grub.conf above, the 0th target has the keyword savedefault with no added argument. All other targets have the added argument 0, which means that if they are run as alternate targets via the grub-set-default script, the default after they are selected will revert to the 0th target. The necessary state is preserved in the file /boot/grub/default, which is a plain text file consisting mostly of rubbish that gives it a known checksum for a given declared default target value.