Bug 192332 - Before running %post scripts, CD should be remounted
Before running %post scripts, CD should be remounted
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Anaconda Maintenance Team
Depends On:
  Show dependency treegraph
Reported: 2006-05-18 18:05 EDT by Philip Prindeville
Modified: 2010-12-20 15:19 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-05-22 13:27:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Proposed fix (doesn't detect failure) (742 bytes, patch)
2006-05-30 11:19 EDT, Philip Prindeville
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Bugzilla 191819 None None None Never

  None (edit)
Description Philip Prindeville 2006-05-18 18:05:11 EDT
Description of problem:

When %post scripts are about to be run (especially if they chroot'd), they won't
see /mnt/source (even with the patch for bug #191819 applied).

Version-Release number of selected component (if applicable):

How reproducible:

Run an install with the ks.cfg file containing "mount" in the "%post" section.

Steps to Reproduce:
1. Build a DVD install disque with a ks.cfg file, and put "mount" (with no
arguments) and "ls -l /mnt/source" into the "%post" section.
2. Do an install.
3. From the logs, you'll be able to see that the DVD media was mounted, but the
directory it was mounted on isn't visible.
Actual results:

The directory /mnt/source isn't accessible from the chroot'd environment.

Expected results:

The DVD media should be mounted in such a way that both chroot'd and not
%post-scripts can see it.

A symlink from /mnt/source to /mnt/sysimage/mnt/source might be required so that
non-chroot'd scripts can run symmetrically.

This is a short-hand, but isn't strictly necessary.

Additional info:
Comment 1 Philip Prindeville 2006-05-19 18:51:56 EDT
I ran the following two script fragments with some success:

mount | awk '/ on \/mnt\/source type iso9660/ { print $1}' > /tmp/dvd_device

%post --nochroot

# this is set up via the %pre script... though it's always /tmp/cdrom
# for the block device from what I can tell.
dvd="`cat /tmp/dvd_device`"

# this should be done by the PostInstall method for us in Anaconda.
mkdir /mnt/sysimage/mnt/source
umount /mnt/source
rmdir /mnt/source
mount -t iso9660 -o ro $dvd /mnt/sysimage/mnt/source
ln -s /mnt/sysimage/mnt/source /mnt/source

So this should be viable when done directly by Anaconda.
Comment 2 Jeremy Katz 2006-05-22 13:27:59 EDT
Doing this breaks expectations of people -- /mnt/source isn't going to exist on
the real system.  Also, it's not going to work with non-CD install methods.
Comment 3 Philip Prindeville 2006-05-22 14:43:44 EDT
I'm not sure I get this...

Lots of things happen during the install portion, including your modprobe.conf
file living in /tmp.  Everyone already has the explicit understanding that the
install environment is different.

What "real system" are you talking about?

And if the filesystem is linked as /mnt/source pointing to
/mnt/sysimage/mnt/source then previous scripts that expected it on /mnt/source
(in the non-chrooted scripts) will continue to see it there.

This will also work with NFS .iso mounts.
Comment 4 James Olin Oden 2006-05-24 13:25:01 EDT
Though his example was flawed, his idea I think is reasonable, and that is 
wherever the media came from make its mount available in the chroot 
environment.  Symlinks of course wouldn't work, but bind mounts would.
Comment 5 Mike McLean 2006-05-26 14:51:05 EDT
Philip, please keep comments related to this bugzilla in the bugzilla and not in
personal emails. If you want your comments to be heard, I suggest you repost
them here or on an appropriate email list.
Comment 6 Philip Prindeville 2006-05-26 15:03:17 EDT
Umm... that's w(In reply to comment #5)
> Philip, please keep comments related to this bugzilla in the bugzilla and not in
> personal emails. If you want your comments to be heard, I suggest you repost
> them here or on an appropriate email list.

That's what I did in comment #3, which was never answered.
Comment 7 Philip Prindeville 2006-05-30 11:19:30 EDT
Created attachment 130239 [details]
Proposed fix (doesn't detect failure)

As John suggested.
Comment 8 Philip Prindeville 2006-05-30 16:54:21 EDT
On second thoughts, there might be a cleaner place to put this that only
involved .iso images (i.e. CD, DVD, or NFS mounted .iso images).

Comment 9 Philip Prindeville 2010-12-20 01:48:55 EST
How did this get closed and marked won't fix without any annotation or commentary?
Comment 10 David Cantrell 2010-12-20 15:19:19 EST
This was closed in 2006 by someone who is no longer working on anaconda, and I have no idea what the reason was.  Are you still seeing the same behavior on the current release of Fedora?  If so, update your patch and we can discuss things again.

Note You need to log in before you can comment on or make changes to this bug.