summaryrefslogtreecommitdiffstats
path: root/dracut
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2012-04-05 18:43:07 -0400
committerWill Woods <wwoods@redhat.com>2012-04-05 18:56:14 -0400
commit99854685688efd9ee5d582953c790e264919dcc8 (patch)
treee13f132885c7140dc6eee60527558afedab45399 /dracut
parent700e985082b03abcbd3009de81885b8fbf72818b (diff)
downloadanaconda-99854685688efd9ee5d582953c790e264919dcc8.tar.gz
anaconda-99854685688efd9ee5d582953c790e264919dcc8.tar.xz
anaconda-99854685688efd9ee5d582953c790e264919dcc8.zip
copy installer image to RAM during upgrades (#810391)
When installing from a hard drive, loader used to copy install.img to tmpfs and unmount the partition afterward. We're avoiding that (to save RAM) and it works fine in most cases. However: for preupgrade, stage2 is stored in /boot. When anaconda tries to mount /boot for upgrading, it finds that it's already mounted, pops up a "Fatal error" dialog, and exits. So, a hack: if "preupgrade" or "upgrade" or "inst.upgrade" is in the boot args, and we're getting the installer image from a disk, copy the install image into tmpfs and unmount the disk before proceeding.
Diffstat (limited to 'dracut')
-rwxr-xr-xdracut/anaconda-diskroot8
-rwxr-xr-xdracut/anaconda-lib.sh9
2 files changed, 16 insertions, 1 deletions
diff --git a/dracut/anaconda-diskroot b/dracut/anaconda-diskroot
index 612a1313b..eb4e83843 100755
--- a/dracut/anaconda-diskroot
+++ b/dracut/anaconda-diskroot
@@ -13,4 +13,10 @@ path="$2" # optional, could be empty
info "anaconda using disk root at $dev"
mount $dev $repodir || warn "Couldn't mount $dev"
-anaconda_live_root_dir $repodir $path
+# HACK: umount $dev on upgrades so anaconda doesn't crash.
+# FIXME: make anaconda handle this cleanly (mount --rbind/--move)
+if getargbool 0 preupgrade upgrade inst.upgrade; then
+ anaconda_live_root_dir $repodir $path --copy-to-ram
+else
+ anaconda_live_root_dir $repodir $path
+fi
diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh
index c46955596..1ec80dbc1 100755
--- a/dracut/anaconda-lib.sh
+++ b/dracut/anaconda-lib.sh
@@ -66,6 +66,15 @@ anaconda_live_root_dir() {
mount -o loop,ro $iso $repodir
img=$(find_runtime $repodir) || { warn "$iso has no suitable runtime"; }
fi
+ # FIXME: make rd.live.ram clever enough to do this for us
+ if [ "$1" = "--copy-to-ram" ]; then
+ echo "Copying installer image to RAM..."
+ echo "(this may take a few minutes)"
+ cp $img /run/install/install.img
+ img=/run/install/install.img
+ umount $repodir
+ [ -n "$iso" ] && umount $isodir
+ fi
[ -e "$img" ] && /sbin/dmsquash-live-root $img
}