mounting non-install cd in %post cd
Wehner, Robert
Robert.Wehner at McKesson.com
Thu Apr 29 18:04:15 UTC 2004
Using some of the tips mentioned on this list, I've been experimenting
with something like this in the %post section. It doesn't eject the RH
install CD (I don't believe it is mounted once you hit %post). The user
just needs to pull the CD out. Hope this helps.
================
# use pid to get FDs, not "self"
myPid=$$
# TTY we'll use for user input
tty_num=8
user_tty=/dev/tty$tty_num
# Store original file descriptors
stdin=$(ls -l /proc/$myPid/fd/0 | awk '/^l/ {print $11}')
stdout=$(ls -l /proc/$myPid/fd/1 | awk '/^l/ {print $11}')
# change to new virtual terminal and set FDs there
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."
# handle the please try again part
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
#change back the FDs
exec < $stdin > $stdout
echo "Done with CD file transfers"
Robert
-----Original Message-----
From: Kristen Smith [mailto:kjsmith at nortelnetworks.com]
Sent: Thursday, April 29, 2004 11:56 AM
To: 'kickstart-list at redhat.com'
Subject: mounting non-install cd in %post cd
Been 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20040429/462403f1/attachment.htm>
More information about the Kickstart-list
mailing list