After installing the system, take a snapshot of the root device and reconfigure the system to use the snapshot as the root device.
This is only supported with thinp and btrfs autopart.
Resolves: rhbz#1113207
Related to rhinstaller/blivet/pull/166 and rhinstaller/pykickstart/pull/29
Added label: rhel7-branch.
From: David Lehman dlehman@redhat.com
After installing the system, take a snapshot of the root device and reconfigure the system to use the snapshot as the root device.
This is only supported with thinp and btrfs autopart.
Resolves: rhbz#1113207 --- pyanaconda/install.py | 17 +++++++++++++++-- pyanaconda/kickstart.py | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/install.py b/pyanaconda/install.py index 2b6b8aa..102d6c8 100644 --- a/pyanaconda/install.py +++ b/pyanaconda/install.py @@ -60,6 +60,7 @@ def _writeKS(ksdata): def doConfiguration(storage, payload, ksdata, instClass): willWriteNetwork = not flags.flags.imageInstall and not flags.flags.dirInstall willRunRealmd = ksdata.realm.discovered + willSnapShotRoot = ksdata.autopart.autopart and ksdata.autopart.snapshot
# configure base, create users, configure addons, initramfs, post-install step_count = 5 @@ -106,8 +107,9 @@ def doConfiguration(storage, payload, ksdata, instClass): with progress_report(_("Configuring addons")): ksdata.addons.execute(storage, ksdata, instClass, u)
- with progress_report(_("Generating initramfs")): - payload.recreateInitrds() + if not willSnapShotRoot: + with progress_report(_("Generating initramfs")): + payload.recreateInitrds()
# Work around rhbz#1200539, grubby doesn't handle grub2 missing initrd with /boot on btrfs # So rerun writing the bootloader if this is live and /boot is on btrfs @@ -131,6 +133,17 @@ def doConfiguration(storage, payload, ksdata, instClass): # kickstart file over if one exists). _writeKS(ksdata)
+ if willSnapShotRoot: + with progress_report(_("Configuring root snapshot")): + blivet.autopart.setUpRootSnapShot(storage) + + with progress_report(_("Generating initramfs")): + payload.recreateInitrds() + + if not ksdata.bootloader.disabled and ksdata.bootloader != "none": + with progress_report(_("Installing bootloader")): + writeBootLoader(storage, payload, instClass, ksdata) + progress_complete()
def doInstall(storage, payload, ksdata, instClass): diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 804f729..1d747ac 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -299,9 +299,9 @@ def execute(self, *args): except RuntimeError as msg: log.error("Error running %s %s: %s", cmd, args, msg)
-class AutoPart(commands.autopart.F21_AutoPart): +class AutoPart(commands.autopart.F23_AutoPart): def parse(self, args): - retval = commands.autopart.F21_AutoPart.parse(self, args) + retval = commands.autopart.F23_AutoPart.parse(self, args)
if self.fstype: fmt = blivet.formats.getFormat(self.fstype)
Added label: master.
Added label: ACK.
Looks good to me, although I think it's about time to look at install.py and rethink how we're doing things. It's getting pretty tangled up with the various install types.
@@ -60,6 +60,7 @@ def _writeKS(ksdata): def doConfiguration(storage, payload, ksdata, instClass): willWriteNetwork = not flags.flags.imageInstall and not flags.flags.dirInstall willRunRealmd = ksdata.realm.discovered
- willSnapShotRoot = ksdata.autopart.autopart and ksdata.autopart.snapshot
This needs to increment the number of progress steps just like the other two checks do below.
@@ -131,6 +133,17 @@ def doConfiguration(storage, payload, ksdata, instClass): # kickstart file over if one exists). _writeKS(ksdata)
- if willSnapShotRoot:
with progress_report(_("Configuring root snapshot")):blivet.autopart.setUpRootSnapShot(storage)with progress_report(_("Generating initramfs")):payload.recreateInitrds()if not ksdata.bootloader.disabled and ksdata.bootloader != "none":with progress_report(_("Installing bootloader")):writeBootLoader(storage, payload, instClass, ksdata)
This should be without a separate progress report step (just like in case of the liveCD+BtrfsBoot combination above) unless you want to move the check somewhere above and reflect it in the total number of steps.
This is going on the shelf.
Closed.
anaconda-patches@lists.fedorahosted.org