Bug 192332 - Before running %post scripts, CD should be remounted
Summary: Before running %post scripts, CD should be remounted
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 5
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2006-05-18 22:05 UTC by Philip Prindeville
Modified: 2010-12-20 20:19 UTC (History)
0 users

Clone Of:
Last Closed: 2006-05-22 17:27:59 UTC

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

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

Description Philip Prindeville 2006-05-18 22:05:11 UTC
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 22:51:56 UTC
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 17:27:59 UTC
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 18:43:44 UTC
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 17:25:01 UTC
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 18:51:05 UTC
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 19:03:17 UTC
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 15:19:30 UTC
Created attachment 130239 [details]
Proposed fix (doesn't detect failure)

As John suggested.

Comment 8 Philip Prindeville 2006-05-30 20:54:21 UTC
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 06:48:55 UTC
How did this get closed and marked won't fix without any annotation or commentary?

Comment 10 David Cantrell 2010-12-20 20:19:19 UTC
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.