diff options
author | Brian C. Lane <bcl@redhat.com> | 2012-09-06 10:28:36 -0700 |
---|---|---|
committer | Brian C. Lane <bcl@redhat.com> | 2012-09-06 16:25:31 -0700 |
commit | 0c4ed2c2c4e03f0b753d13bddb90994498481ed7 (patch) | |
tree | 0600e8c223e9373d4a43d73e0ac15baf7eb11126 /pyanaconda/packaging/livepayload.py | |
parent | f71f9237e7d94f33bb11bf6e4b32a190bc4be418 (diff) | |
download | anaconda-0c4ed2c2c4e03f0b753d13bddb90994498481ed7.tar.gz anaconda-0c4ed2c2c4e03f0b753d13bddb90994498481ed7.tar.xz anaconda-0c4ed2c2c4e03f0b753d13bddb90994498481ed7.zip |
fixup live install (#853988, #854962)
liveinst:
use /dev/mapper/live-osimg-min as the install source. This is the original
filesystem before changes made by the live boot scripts.
updates overwrite unconditionally
anaconda:
handle livecd: method, set method to 'livecd' and partition to the path.
packaging:
Move new-kernel-pkg creation into a helper method, _recreateInitrds
Add a flag to prevent running new-kernel-pkg more than once
livepayload:
mount the install source on INSTALL_TREE and rsync it to the ROOT_PATH
Don't use verbose with rsync, results in huge program.log and slows
down install. Error will be logged.
Ignore rsync errors. It has problems with selinux xattrs. Log the
return value, but continue.
Call _recreateInitrds to create the initrd (#853988)
Diffstat (limited to 'pyanaconda/packaging/livepayload.py')
-rw-r--r-- | pyanaconda/packaging/livepayload.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py index 501acef0c..78ff9e9a5 100644 --- a/pyanaconda/packaging/livepayload.py +++ b/pyanaconda/packaging/livepayload.py @@ -31,6 +31,7 @@ """ import os import stat +from pyanaconda import isys from . import * @@ -52,10 +53,13 @@ _ = lambda x: gettext.ldgettext("anaconda", x) class LiveImagePayload(ImagePayload): """ A LivePayload copies the source image onto the target system. """ def setup(self, storage): - if not os.path.ismount("/run/initramfs/live"): - exn = PayloadSetupError("live image is not mounted") + # Mount the live device and copy from it instead of the overlay at / + osimg = storage.devicetree.getDeviceByPath(self.data.method.partition) + if not stat.S_ISBLK(os.stat(osimg.path)[stat.ST_MODE]): + exn = PayloadSetupError("%s is not a valid block device" % (self.data.method.partition,)) if errorHandler.cb(exn) == ERROR_RAISE: raise exn + isys.mount(osimg.path, INSTALL_TREE, fstype="auto", readOnly=True) def preInstall(self, packages=None, groups=None): """ Perform pre-installation tasks. """ @@ -68,8 +72,8 @@ class LiveImagePayload(ImagePayload): # preserve: permissions, owners, groups, ACL's, xattrs, times, # symlinks, hardlinks # go recursively, include devices and special files, don't cross - # file system boundaries, print processed files - args = ["-pogAXtlHrDxv", "/", ROOT_PATH] + # file system boundaries + args = ["-pogAXtlHrDx", INSTALL_TREE+"/", ROOT_PATH] try: rc = iutil.execWithRedirect(cmd, args, stderr="/dev/tty5", stdout="/dev/tty5") @@ -78,13 +82,20 @@ class LiveImagePayload(ImagePayload): else: err = None if rc != 0: - err = "%s exited with code %d" % (cmd, rc) + log.info("%s exited with code %d" % (cmd, rc)) if err: exn = PayloadInstallError(err) if errorHandler.cb(exn) == ERROR_RAISE: raise exn + def postInstall(self): + """ Perform post-installation tasks. """ + isys.umount(INSTALL_TREE, removeDir=True) + + super(LiveImagePayload, self).postInstall() + self._recreateInitrds() + @property def spaceRequired(self): return Size(bytes=iutil.getDirSize("/")*1024) |