I installed an image server and a golden client, pulled an image using
'getimage', built an NBI using the 'kernel' and 'initrd.img' from the
floppy image generated by 'mkautoinstalldiskette', then booted the
autoinstall client. After autoinstalling and rebooting, Grub fails with
Error 15. I looked at the autoinstall script (attached), and it seems that
it is not configuring the boot loader at all. I am using SystemImager
3.2.3.
Youssef Eldakar
Bibliotheca Alexandrina
#!/bin/sh
#
# "SystemImager"
#
# Copyright (C) 1999-2001 Brian Elliott Finley <[EMAIL PROTECTED]>
# Copyright (C) 2002-2003 Bald Guy Software <[EMAIL PROTECTED]>
#
# This master autoinstall script was created with SystemImager v3.2.3
# Load functions and other variables
. /etc/init.d/functions
get_arch
if [ -z $NO_LISTING ]; then
VERBOSE_OPT="v"
else
VERBOSE_OPT=""
fi
# Pull in variables left behind by the linuxrc script.
# This information is passed from the linuxrc script on the autoinstall media
# via /tmp/variables.txt. Apparently the shell we use in BOEL is not
# intelligent enough to take a "set -a" parameter.
#
. /tmp/variables.txt || shellout
[ -z $IMAGENAME ] && IMAGENAME=ia.060503
[ -z $OVERRIDES ] && OVERRIDES="ia.060503"
### BEGIN Check to be sure this not run from a working machine ###
# Test for mounted SCSI or IDE disks
mount | grep [hs]d[a-z][1-9] > /dev/null 2>&1
[ $? -eq 0 ] && echo Sorry. Must not run on a working machine... && shellout
# Test for mounted software RAID devices
mount | grep md[0-9] > /dev/null 2>&1
[ $? -eq 0 ] && echo Sorry. Must not run on a working machine... && shellout
# Test for mounted hardware RAID disks
mount | grep c[0-9]+d[0-9]+p > /dev/null 2>&1
[ $? -eq 0 ] && echo Sorry. Must not run on a working machine... && shellout
### END Check to be sure this not run from a working machine ###
################################################################################
#
# Stop RAID devices before partitioning begins
#
# Q1) Why did they get started in the first place?
# A1) So we can pull a local.cfg file off a root mounted software RAID system.
# They may not be started on your system -- they would only be started if
# you did the stuff in Q3 below.
#
# Q2) Why didn't my local.cfg on my root mounted software RAID work for me
# with the standard kernel flavour?
# A2) The standard kernel flavour uses modules for the software RAID drivers --
# therefore, software RAID is not available at the point in the boot process
# where BOEL needs to read the local.cfg file. They are only pulled over
# when this script is run, which is, of course, only runnable if it was
# pulled over the network using the settings that you would have wanted it
# to get from the local.cfg file, which it couldn't. Right?
#
# Q3) Whatever. So how do I make it work with a local.cfg file on my root
# mounted software RAID?
# A3) Compile an autoinstall kernel with software RAID, and any other drivers
# you might need built in (filesystem, SCSI drivers, etc.).
#
if [ -f /proc/mdstat ]; then
RAID_DEVICES=` cat /proc/mdstat | grep ^md | sed 's/ .*$//g' `
# raidstop will not run unless a raidtab file exists
echo "" >> /etc/raidtab || shellout
# turn dem pesky raid devices off!
for RAID_DEVICE in ${RAID_DEVICES}
do
DEV="/dev/${RAID_DEVICE}"
# we don't do a shellout here because, well I forgot why, but we don't.
echo "raidstop ${DEV}" && raidstop ${DEV}
done
fi
#
################################################################################
### BEGIN partition /dev/hda ###
echo "Partitioning /dev/hda..."
echo "Old partition table for /dev/hda:"
parted -s -- /dev/hda print
# Create disk label. This ensures that all remnants of the old label, whatever
# type it was, are removed and that we're starting with a clean label.
echo "parted -s -- /dev/hda mklabel msdos || shellout"
parted -s -- /dev/hda mklabel msdos || shellout
# Get the size of the destination disk so that we can make the partitions fit
properly.
DISK_SIZE=`parted -s /dev/hda print | grep 'Disk geometry for' | sed
's/^.*-//g' | sed 's/\..*$//' `
[ -z $DISK_SIZE ] && shellout
if [ "$ARCH" = "alpha" ]; then
END_OF_LAST_PRIMARY=1
else
END_OF_LAST_PRIMARY=0
fi
echo "Creating partition /dev/hda1."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(echo "scale=3; ($START_MB + 267025)" | bc)
echo "parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB || shellout"
parted -s -- /dev/hda mkpart primary ext2 $START_MB $END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
echo "Creating partition /dev/hda2."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(( $DISK_SIZE - 0 ))
echo "parted -s -- /dev/hda mkpart extended $START_MB $END_MB || shellout"
parted -s -- /dev/hda mkpart extended $START_MB $END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
END_OF_LAST_LOGICAL=$START_MB
echo "Creating partition /dev/hda5."
START_MB=$END_OF_LAST_LOGICAL
END_MB=$(echo "scale=3; ($START_MB + 957)" | bc)
echo "parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout"
parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout
END_OF_LAST_LOGICAL=$END_MB
echo "Creating partition /dev/hda6."
START_MB=$END_OF_LAST_LOGICAL
END_MB=$(echo "scale=3; ($START_MB + 1906)" | bc)
echo "parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout"
parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout
END_OF_LAST_LOGICAL=$END_MB
echo "Creating partition /dev/hda7."
START_MB=$END_OF_LAST_LOGICAL
END_MB=$(echo "scale=3; ($START_MB + 5719)" | bc)
echo "parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout"
parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout
END_OF_LAST_LOGICAL=$END_MB
echo "Creating partition /dev/hda8."
START_MB=$END_OF_LAST_LOGICAL
END_MB=$(echo "scale=3; ($START_MB + 957)" | bc)
echo "parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout"
parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout
END_OF_LAST_LOGICAL=$END_MB
echo "Creating partition /dev/hda9."
START_MB=$END_OF_LAST_LOGICAL
END_MB=$(( $DISK_SIZE - 0 ))
echo "parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout"
parted -s -- /dev/hda mkpart logical ext2 $START_MB $END_MB || shellout
END_OF_LAST_LOGICAL=$END_MB
echo "New partition table for /dev/hda:"
echo "parted -s -- /dev/hda print"
parted -s -- /dev/hda print
### END partition /dev/hda ###
### BEGIN partition /dev/hdb ###
echo "Partitioning /dev/hdb..."
echo "Old partition table for /dev/hdb:"
parted -s -- /dev/hdb print
# Create disk label. This ensures that all remnants of the old label, whatever
# type it was, are removed and that we're starting with a clean label.
echo "parted -s -- /dev/hdb mklabel msdos || shellout"
parted -s -- /dev/hdb mklabel msdos || shellout
# Get the size of the destination disk so that we can make the partitions fit
properly.
DISK_SIZE=`parted -s /dev/hdb print | grep 'Disk geometry for' | sed
's/^.*-//g' | sed 's/\..*$//' `
[ -z $DISK_SIZE ] && shellout
if [ "$ARCH" = "alpha" ]; then
END_OF_LAST_PRIMARY=1
else
END_OF_LAST_PRIMARY=0
fi
echo "Creating partition /dev/hdb1."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(( $DISK_SIZE - 0 ))
echo "parted -s -- /dev/hdb mkpart primary ext2 $START_MB $END_MB || shellout"
parted -s -- /dev/hdb mkpart primary ext2 $START_MB $END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
echo "New partition table for /dev/hdb:"
echo "parted -s -- /dev/hdb print"
parted -s -- /dev/hdb print
### END partition /dev/hdb ###
### BEGIN partition /dev/hdc ###
echo "Partitioning /dev/hdc..."
echo "Old partition table for /dev/hdc:"
parted -s -- /dev/hdc print
# Create disk label. This ensures that all remnants of the old label, whatever
# type it was, are removed and that we're starting with a clean label.
echo "parted -s -- /dev/hdc mklabel msdos || shellout"
parted -s -- /dev/hdc mklabel msdos || shellout
# Get the size of the destination disk so that we can make the partitions fit
properly.
DISK_SIZE=`parted -s /dev/hdc print | grep 'Disk geometry for' | sed
's/^.*-//g' | sed 's/\..*$//' `
[ -z $DISK_SIZE ] && shellout
if [ "$ARCH" = "alpha" ]; then
END_OF_LAST_PRIMARY=1
else
END_OF_LAST_PRIMARY=0
fi
echo "Creating partition /dev/hdc1."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(( $DISK_SIZE - 0 ))
echo "parted -s -- /dev/hdc mkpart primary ext2 $START_MB $END_MB || shellout"
parted -s -- /dev/hdc mkpart primary ext2 $START_MB $END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
echo "New partition table for /dev/hdc:"
echo "parted -s -- /dev/hdc print"
parted -s -- /dev/hdc print
### END partition /dev/hdc ###
### BEGIN partition /dev/hdd ###
echo "Partitioning /dev/hdd..."
echo "Old partition table for /dev/hdd:"
parted -s -- /dev/hdd print
# Create disk label. This ensures that all remnants of the old label, whatever
# type it was, are removed and that we're starting with a clean label.
echo "parted -s -- /dev/hdd mklabel msdos || shellout"
parted -s -- /dev/hdd mklabel msdos || shellout
# Get the size of the destination disk so that we can make the partitions fit
properly.
DISK_SIZE=`parted -s /dev/hdd print | grep 'Disk geometry for' | sed
's/^.*-//g' | sed 's/\..*$//' `
[ -z $DISK_SIZE ] && shellout
if [ "$ARCH" = "alpha" ]; then
END_OF_LAST_PRIMARY=1
else
END_OF_LAST_PRIMARY=0
fi
echo "Creating partition /dev/hdd1."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(( $DISK_SIZE - 0 ))
echo "parted -s -- /dev/hdd mkpart primary ext2 $START_MB $END_MB || shellout"
parted -s -- /dev/hdd mkpart primary ext2 $START_MB $END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
echo "New partition table for /dev/hdd:"
echo "parted -s -- /dev/hdd print"
parted -s -- /dev/hdd print
### END partition /dev/hdd ###
echo "Load additional filesystem drivers."
modprobe reiserfs
modprobe ext2
modprobe ext3
modprobe jfs
modprobe xfs
### BEGIN swap and filesystem creation commands ###
echo "mke2fs -j /dev/hda5 || shellout"
mke2fs -j /dev/hda5 || shellout
echo "mkdir -p /a/ || shellout"
mkdir -p /a/ || shellout
echo "mount /dev/hda5 /a/ -t ext3 -o defaults || shellout"
mount /dev/hda5 /a/ -t ext3 -o defaults || shellout
echo "mke2fs -j /dev/hda1 || shellout"
mke2fs -j /dev/hda1 || shellout
echo "mkdir -p /a/0 || shellout"
mkdir -p /a/0 || shellout
echo "mount /dev/hda1 /a/0 -t ext3 -o defaults || shellout"
mount /dev/hda1 /a/0 -t ext3 -o defaults || shellout
echo "mke2fs -j /dev/hdb1 || shellout"
mke2fs -j /dev/hdb1 || shellout
echo "mkdir -p /a/1 || shellout"
mkdir -p /a/1 || shellout
echo "mount /dev/hdb1 /a/1 -t ext3 -o defaults || shellout"
mount /dev/hdb1 /a/1 -t ext3 -o defaults || shellout
echo "mke2fs -j /dev/hdc1 || shellout"
mke2fs -j /dev/hdc1 || shellout
echo "mkdir -p /a/2 || shellout"
mkdir -p /a/2 || shellout
echo "mount /dev/hdc1 /a/2 -t ext3 -o defaults || shellout"
mount /dev/hdc1 /a/2 -t ext3 -o defaults || shellout
echo "mke2fs -j /dev/hdd1 || shellout"
mke2fs -j /dev/hdd1 || shellout
echo "mkdir -p /a/3 || shellout"
mkdir -p /a/3 || shellout
echo "mount /dev/hdd1 /a/3 -t ext3 -o defaults || shellout"
mount /dev/hdd1 /a/3 -t ext3 -o defaults || shellout
echo "mke2fs -j /dev/hda9 || shellout"
mke2fs -j /dev/hda9 || shellout
echo "mkdir -p /a/tmp || shellout"
mkdir -p /a/tmp || shellout
echo "mount /dev/hda9 /a/tmp -t ext3 -o defaults || shellout"
mount /dev/hda9 /a/tmp -t ext3 -o defaults || shellout
echo "mke2fs -j /dev/hda7 || shellout"
mke2fs -j /dev/hda7 || shellout
echo "mkdir -p /a/usr || shellout"
mkdir -p /a/usr || shellout
echo "mount /dev/hda7 /a/usr -t ext3 -o defaults || shellout"
mount /dev/hda7 /a/usr -t ext3 -o defaults || shellout
echo "mke2fs -j /dev/hda8 || shellout"
mke2fs -j /dev/hda8 || shellout
echo "mkdir -p /a/var || shellout"
mkdir -p /a/var || shellout
echo "mount /dev/hda8 /a/var -t ext3 -o defaults || shellout"
mount /dev/hda8 /a/var -t ext3 -o defaults || shellout
echo "mkswap -v1 /dev/hda6 || shellout"
mkswap -v1 /dev/hda6 || shellout
echo "swapon /dev/hda6 || shellout"
swapon /dev/hda6 || shellout
### END swap and filesystem creation commands ###
### BEGIN mount proc in image for tools like System Configurator ###
echo "mkdir -p /a/proc || shellout"
mkdir -p /a/proc || shellout
echo "mount proc /a/proc -t proc -o defaults || shellout"
mount proc /a/proc -t proc -o defaults || shellout
### END mount proc in image for tools like System Configurator ###
################################################################################
#
# Lay the image down on the freshly formatted disk(s)
#
if [ ! -z $FLAMETHROWER_DIRECTORY_PORTBASE ]; then
# Use multicast
MODULE_NAME="${IMAGENAME}"
DIR=/a
RETRY=7
flamethrower_client
else
# Use rsync
if [ $NO_LISTING ]; then
echo "Quietly installing image... "
start_spinner
fi
if [ "${TMPFS_STAGING}" = "yes" ]; then
# Deposit image into tmpfs
DIR=/tmp/tmpfs_staging
echo
echo "TMPFS_STAGING=${TMPFS_STAGING} -- Staging in ${DIR}"
mkdir -p ${DIR}
echo "rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ --numeric-ids
${IMAGESERVER}::${IMAGENAME}/ ${DIR}/"
rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ --numeric-ids
${IMAGESERVER}::${IMAGENAME}/ ${DIR}/ || shellout
# Move from staging in tmpfs to disk
rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ --numeric-ids ${DIR}/ /a/
else
echo "rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ --numeric-ids
${IMAGESERVER}::${IMAGENAME}/ /a/"
rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ --numeric-ids
${IMAGESERVER}::${IMAGENAME}/ /a/ || shellout
fi
fi
beep
#
################################################################################
if [ $NO_LISTING ]; then
stop_spinner
fi
# Leave notice of which image is installed on the client
echo $IMAGENAME > /a/etc/systemimager/IMAGE_LAST_SYNCED_TO || shellout
### BEGIN generate new fstab file from autoinstallscript.conf ###
cat <<'EOF' > /a/etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda5 / ext3 defaults,errors=remount-ro 0 1
/dev/hda1 /0 ext3 defaults 0 2
/dev/hdb1 /1 ext3 defaults 0 2
/dev/hdc1 /2 ext3 defaults 0 2
/dev/hdd1 /3 ext3 defaults 0 2
/dev/hda9 /tmp ext3 defaults 0 2
/dev/hda7 /usr ext3 defaults 0 2
/dev/hda8 /var ext3 defaults 0 2
/dev/hda6 none swap sw 0 0
/dev/scd0 /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
EOF
### END generate new fstab file from autoinstallscript.conf ###
################################################################################
#
# Process override directories
#
for OVERRIDE in $OVERRIDES
do
if [ ! -z $FLAMETHROWER_DIRECTORY_PORTBASE ]; then
# Use multicast
MODULE_NAME="override_${OVERRIDE}"
DIR=/a
RETRY=7
flamethrower_client
else
# Use rsync
echo "rsync -av --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ /a/"
rsync -av --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ /a/ || echo
"Override directory $OVERRIDE doesn't seem to exist, but that may be OK."
fi
done
beep
#
################################################################################
##################################################################
#
# Uncomment the line below to leave your hostname blank.
# Certain distributions use this as an indication to take on the
# hostname provided by a DHCP server. The default is to have
# SystemConfigurator assign your clients the hostname that
# corresponds to the IP address the use during the install.
# (If you used to use the static_dhcp option, this is your man.)
#
#HOSTNAME=""
################################################################################
#
# mount /dev /a/dev -o bind if needed
#
#not needed for this image
#
################################################################################
################################################################################
#
# System Configurator
#
# Configure the client's hardware, network interface, and boot loader.
#
chroot /a/ systemconfigurator
--excludesto=/etc/systemimager/systemconfig.local.exclude --configsi --stdin <<
EOL || shellout
[NETWORK]
HOSTNAME = $HOSTNAME
DOMAINNAME = $DOMAINNAME
[INTERFACE0]
DEVICE = eth0
TYPE = dhcp
EOL
#
################################################################################
################################################################################
#
# Unmount filesystems
#
echo "umount /a/var || shellout"
umount /a/var || shellout
echo "umount /a/usr || shellout"
umount /a/usr || shellout
echo "umount /a/tmp || shellout"
umount /a/tmp || shellout
echo "umount /a/proc || shellout"
umount /a/proc || shellout
echo "umount /a/3 || shellout"
umount /a/3 || shellout
echo "umount /a/2 || shellout"
umount /a/2 || shellout
echo "umount /a/1 || shellout"
umount /a/1 || shellout
echo "umount /a/0 || shellout"
umount /a/0 || shellout
echo "umount /a/ || shellout"
umount /a/ || shellout
#
################################################################################
################################################################################
#
# Tell the image server we're done
#
rsync $IMAGESERVER::scripts/imaging_complete > /dev/null 2>&1
#
################################################################################
# Take network interface down
ifconfig eth0 down || shellout
# Announce completion (even for non beep-incessantly --post-install options)
beep 3
beep_incessantly