RE: mounting non-install cd in %post cd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Title: Message
Thanks for the script - however, I still have the same problem. I looks like the cd is not being unmounted in the %post section - I am using RedHat AS 2.1 if that makes a difference.
 
In the case of your script below, I am unable to eject the CD manually. During a post section, I change into vt2 and in the shell, do a mount and I see that the cdrom is mounted on /mnt/source. I can't umount from the shell - I get a device or resource busy. I tried putting a umount of /mnt/source in the kickstart.py file right before the %post scripts run, but same thing - "device or resource busy". It must be possible to change disks since kickstart can do it during the rpm install - guess I will have to dig around in the kickstart code a bit more.
 
Thanks again for the help.
-----Original Message-----
From: Wehner, Robert [mailto:Robert.Wehner@xxxxxxxxxxxx]
Sent: Thursday, April 29, 2004 1:04 PM
To: 'Discussion list about Kickstart'
Subject: RE: mounting non-install cd in %post cd

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@xxxxxxxxxxxxxxxxxx]
Sent: Thursday, April 29, 2004 11:56 AM
To: 'kickstart-list@xxxxxxxxxx'
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


[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux