#!/bin/bash export PATH=/bin:/sbin:/usr/bin:/usr/sbin echo "Welcome to Bruce and Warren's Beowulf Magic Boot Disk!" echo sleep 2 route add default dev eth0 echo "Removing stale mount tables" rm -f /etc/mtab rm -f /etc/fstab touch /etc/mtab cp /etc/fstab.CLONE /etc/fstab echo Mounting /proc and looking around. mount /proc ps wuxa sleep 1 echo OK. sleep 2 echo Asking bootp server who we are. cd /tmp echo "output from bootp starting!" bootpc > tmpfile echo "Good! The BOOTP server found us." sleep 1 cat tmpfile eval `cat tmpfile` echo I will be the node named $HOSTNAME with address $IPADDR when this is over. sleep 3 echo "Testing rsh -- and Setting the date from node 1" date `rsh n001.beowulf date +%m%d%H%M%Y.%S` echo Copying partition table. dd if=/boot/ptable.161Mbyte-swap of=/dev/sda echo "Finishing writing partition table to disk, and alerting kernel" /sbin/reread echo "w" | fdisk sleep 5 sync echo Making ms-dos boot filesystem /dev/sda2. mkdosfs /dev/sda2 sync echo Making a root filesystem on /dev/sda3. mke2fs /dev/sda3 echo Creating swap space from /dev/sda1 mkswap /dev/sda1 echo Turning on swapping on /dev/sda1 swapon /dev/sda1 cd /mnt/root rm -rf * cd /mnt echo Mounting root filesystem /dev/sda3 on /mnt/root echo "*********************************************************************************" echo "The install process may require two passes -- if the sytem halts here this" echo "is OK. Just restart the linuxNFS install process again, and don't worry!" echo "Please press the reset button now, then select LinuxNFS as the boot option" echo "*********************************************************************************" # mount -o errors=panic /dev/sda3 || exit mount -o errors=panic /dev/sda3 || /sbin shutdown -r now sync sync sync cd /mnt/root mkdir dos echo Mounting DOS partition disk mount /dev/sda2 || exit sync sync sync echo Copy ALL filesystems! cd /mnt/root tar -X /etc/node-exclude.tar -C / -cf - . | tar xvvfp - echo Done copying ALL files. echo Making some needed directories mkdir proc chmod 1777 /mnt/root/tmp echo Done. echo Syncing disks. sync echo Creating a proper fstab and init cd /etc rm /mnt/root/etc/mtab touch /mnt/root/etc/mtab rm /mnt/root/etc/fstab cp fstab.SAVE /mnt/root/etc/fstab cd /sbin cp init.normal /mnt/root/sbin/init echo "Setting up the correct networking files..." source /tmp/tmpfile rm -f /etc/HOSTNAME echo "$HOSTNAME" > /etc/HOSTNAME rm -f /tmp/net cd /mnt/root/etc/sysconfig grep -v HOSTNAME network.SAVE > /tmp/net echo "HOSTNAME=$HOSTNAME" >> /tmp/net rm -f network mv /tmp/net network echo "Setting up the ethernet interface file." cd network-scripts grep -v IPADDR SAVE.ifcfg-eth0 > /tmp/net echo "IPADDR=$IPADDR" >> /tmp/net rm -f ifcfg-eth0 mv /tmp/net ifcfg-eth0 echo Unmounting partitions. sync cd / sync sync sync umount /mnt/root/dos umount /mnt/root # echo "Starting interactive shell ... when you exit machine will halt" # bash -i echo "*********************************************************************************" echo "Congratulations! The operating system installation appears to have terminated" echo "sucessfully! You now need to give the system a soft boot, configure the firmware" echo "with another operating system selection choice (Linux, boot from disk)" echo "make that the primary power-up boot selection, and restart the system!" echo "If you are installing a collection of machines, don't forget to move the floppy" echo "boot disk to the next machine before restarting" echo "*********************************************************************************" halt