Using USB Storage in Kickstart

21 12 2009

Recently I’ve been going through several kickstart build scripts – mainly to setup the correct packages and settings.  I thought it would be convenient if I was able to use the same kickstart DVD for all machines but read in the appropriate settings from a USB stick.  To do this, I put the following in my kickstart postscript…

# Check for USB storage and profile definition
if [ -d /proc/scsi/usb-storage ]; then
DEVICENUM=$(ls /proc/scsi/usb-storage/)
DEVICELETTER=$(<<<$DEVICENUM tr ‘[1-9]’ ‘[a-i]’)
echoOut “USB storage found at sd”$DEVICELETTER
mkdir -p /mnt/usb
mount /dev/sd${DEVICELETTER}1 /mnt/usb
if [ -f /mnt/usb/network-settings-*.bash ]; then
source /mnt/usb/network-settings-*.bash
cp /mnt/usb/network-settings-*.bash /root/
echoOut “Loaded profile found on USB storage”
echoOut “Unable to find profile settings on USB storage”
echoOut “No USB storage present…”

The echoOut function is just an echo function I wrote to do an ordinary echo, log to a file and tee it to tty3 (for use the kickstart installation).  I could go further with this script and perhaps use a menu in the case of several available files, but a single file on the USB is fine for me.




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: