On Fri, Feb 22, 2013 at 06:26:30PM -0500, Will Woods wrote:
So it turns out that having the device that contains the runtime
image
mounted *underneath* the runtime image means we have a mount loop, e.g.:
The DVD can't be unmounted because it holds the image for /
/ can't be unmounted because the DVD is mounted underneath it
To fix this, we move the repo mount(s) back out from under the runtime
image during dracut's pre-shutdown hook (new in dracut 025).
---
anaconda.spec.in | 2 +-
dracut/Makefile.am | 3 ++-
dracut/anaconda-pre-shutdown.sh | 20 ++++++++++++++++++++
dracut/module-setup.sh | 1 +
4 files changed, 24 insertions(+), 2 deletions(-)
create mode 100644 dracut/anaconda-pre-shutdown.sh
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 85585f0..57a4c7c 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -34,7 +34,7 @@ Source0: %{name}-%{version}.tar.bz2
%define firewalldver 0.2.9-1
%define pythonurlgrabberver 3.9.1-5
%define utillinuxver 2.15.1
-%define dracutver 024-16
+%define dracutver 025
BuildRequires: audit-libs-devel
BuildRequires: gettext >= %{gettextver}
diff --git a/dracut/Makefile.am b/dracut/Makefile.am
index 7646e23..53a30cb 100644
--- a/dracut/Makefile.am
+++ b/dracut/Makefile.am
@@ -39,7 +39,8 @@ dist_dracut_SCRIPTS = module-setup.sh \
fetch-updates-disk \
parse-kickstart \
anaconda-modprobe.sh \
- save-initramfs.sh
+ save-initramfs.sh \
+ anaconda-pre-shutdown.sh
MAINTAINERCLEANFILES = Makefile.in
diff --git a/dracut/anaconda-pre-shutdown.sh b/dracut/anaconda-pre-shutdown.sh
new file mode 100644
index 0000000..78f9f06
--- /dev/null
+++ b/dracut/anaconda-pre-shutdown.sh
@@ -0,0 +1,20 @@
+# Fix mount loops that prevent unmount/eject.
+#
+# During startup, we mount our repo (e.g. the DVD) at $repodir or $isodir.
+# We then mount the runtime image from that repo at /newroot and switch into it.
+# Switching moves $repodir to /newroot/$repodir, which creates a mount loop:
+#
+# -> You can't unmount the runtime image because the DVD is mounted under it
+# -> You can't unmount the DVD because it holds the mounted runtime image
+#
+# And now you can't unmount or eject the DVD!
+#
+# We fix this by moving the repo mounts back out from under the runtime image
+# during shutdown. Then everything can be unmounted like normal.
Maybe make a note here that dracut mounts the old system on /oldroot
before this script is called.
Ack otherwise.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)