FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

LinkBack Thread Tools
Old 04-05-2012, 10:56 PM
Will Woods
Default 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.
dracut/anaconda-diskroot | 8 +++++++-
dracut/anaconda-lib.sh | 9 +++++++++
2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/dracut/anaconda-diskroot b/dracut/anaconda-diskroot
index 612a131..eb4e838 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
+ anaconda_live_root_dir $repodir $path
diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh
index c469555..1ec80db 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"; }
+ # 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


Anaconda-devel-list mailing list

Thread Tools

All times are GMT. The time now is 04:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org