myPid=$$
tty_num=8
user_tty=/dev/tty$tty_num
stdin=$(ls -l /proc/$myPid/fd/0 | awk '/^l/ {print $11}')
stdout=$(ls -l /proc/$myPid/fd/1 | awk '/^l/ {print $11}')
exec < $user_tty > $user_tty
chvt $tty_num
echo -n "Insert the next CD and then press 'Enter'. "
read ans
echo "Mounting CD..."
updfstab
if (mount /mnt/cdrom); then
#check that cd is correct; error if not
disc_label=$(head -1 /mnt/cdrom/.discinfo)
if [ $disc_label = "uniqueString" ]; then
# unpack CD contents.
else
echo "This isn't the right CD. Please try again."
fi
cd /
umount /mnt/cdrom
eject
else
# Error out. CD wouldn't mount, try again
echo "Error out. CD wouldn't mount, try again"
eject
fi
exec < $stdin > $stdout
Robert
-----Original Message-----
From: Kristen Smith [mailto:kjsmith@xxxxxxxxxxxxxxxxxx]
Sent: Thursday, April 29, 2004 11:56 AM
To: 'kickstart-list@xxxxxxxxxx'
Subject: mounting non-install cd in %post cdBeen digging around for a while now and can't seem to figure this out. Is there anyway to eject the install cd in a %post section and then mount a newly inserted cd? I have tried various methods of using mount/eject/umount in the %post sections, but can't seem to get it to work.
Has anyone had any success doing this? I have multiple CDs with data that need to be installed after the kickstart rpms are installed (unfortunately, I can't make the contents of the CDs rpms and I have to use multiple CDs for this part). I would like to keep from doing the kickstart, rebooting the system and then prompting for the new cds - instead would like to reboot only after everything has been installed - after I have done the kickstart and installed the data from the other CDs.
Thanks for the help,
Kristen Smith
Nortel Networks