HP Scripting Toolkit 9.50 for Linux User Guide

echo ""
echo "Rerun hardware discovery to find boot device"
./hpdiscovery -f ${HPDISCOVERY_FILE}
## use hwquery to fetch the boot dev node from hardware discovery file.
if [ -z ${BOOTDEVNODE} ]; then
export `./hwquery ${HPDISCOVERY_FILE} allboards.xml BOOTDEVNODE=DevNode`
fi
echo "Boot Device=${BOOTDEVNODE}"
if [ -z ${BOOTDEVNODE} ]; then
echo "MISSING boot device dev node. Check that the drivers are loaded."
exec /bin/bash
fi
ls -al ${BOOTDEVNODE}*
ln -s ${BOOTDEVNODE} /dev/sssd
echo "### Linux Unattended Install using Kickstart ###"
echo "clearing mbr and a few more sectors"
dd if=/dev/zero of=/dev/sssd bs=512 count=32
echo "forcing kernel to re-read partition table"
sfdisk --re-read /dev/sssd
sleep 5
echo "landing mbr"
dd if=${NFS_MAIN}/linux_unattend/generic.mbr of=/dev/sssd bs=512 count=1
echo "create new 256M FAT16 partition using sfdisk"
echo "0,256,6,*" | sfdisk -uM -D /dev/sssd
echo "forcing kernel to re-read partition table"
sfdisk --re-read /dev/sssd
sleep 5
## make symlink for first partition, usually sda1 or c0d0p1
if test -e ${BOOTDEVNODE}1 ; then
ln -s ${BOOTDEVNODE}1 /dev/sssd1
elif test -e ${BOOTDEVNODE}p1 ; then
ln -s ${BOOTDEVNODE}p1 /dev/sssd1
else
echo "Partition 1 missing, check that partition creation succeeded"
exec /bin/bash
fi
ls -al /dev/sssd1
cd ${NFS_MAIN}/linux_unattend/rhel4/
echo "landing diskboot.img from RHEL4-disc1/images/"
dd if=diskboot.img of=/dev/sssd1
## mount disk
echo "mounting to /mnt/dos"
mount -t vfat /dev/sssd1 /mnt/dos
##### MAKE SURE YOU MODIFY syslinux-rh.cfg FOR YOUR ENVIRONMENT #######
cp -a syslinux-rh.cfg /mnt/dos/syslinux.cfg
cd ${TOOLKIT}
## unmount disk
18 Booting and OS installation