From 83607e3d7243f831f28e4d12ece68ad057fb9f9c Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 5 Nov 2014 10:24:07 +0000 Subject: Use the default symlink when creating the orig subvolume. This patch solves the issue caused by upgrading a system without a factory version. Currently we are only using the factory version to snapshot its orig subvolume to make faster the transfer of the new content (rsync won't have to send everything). The default symlink may not be present, but it can't be deleted easily using system-version-manager. This is a quick fix, but in the future we may want to not harcode the path from where we snapshot the orig subvolume. Or improve system-version-manager to make sure that the default symlink is always present. --- morphlib/exts/rawdisk.write | 2 +- morphlib/exts/ssh-rsync.write | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/morphlib/exts/rawdisk.write b/morphlib/exts/rawdisk.write index 1c2c5a84..12db4398 100755 --- a/morphlib/exts/rawdisk.write +++ b/morphlib/exts/rawdisk.write @@ -68,7 +68,7 @@ class RawDiskWriteExtension(morphlib.writeexts.WriteExtension): version_root = os.path.join(mp, 'systems', version_label) os.mkdir(version_root) - old_orig = os.path.join(mp, 'systems', 'factory', 'orig') + old_orig = os.path.join(mp, 'systems', 'default', 'orig') new_orig = os.path.join(version_root, 'orig') cliapp.runcmd( ['btrfs', 'subvolume', 'snapshot', old_orig, new_orig]) diff --git a/morphlib/exts/ssh-rsync.write b/morphlib/exts/ssh-rsync.write index 0ce89c7f..2d7258ba 100755 --- a/morphlib/exts/ssh-rsync.write +++ b/morphlib/exts/ssh-rsync.write @@ -92,8 +92,8 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): def get_old_orig(self, location, remote_mnt): '''Identify which subvolume to snapshot from''' - # rawdisk upgrades use 'factory' - return os.path.join(remote_mnt, 'systems', 'factory', 'orig') + # rawdisk upgrades use 'default' + return os.path.join(remote_mnt, 'systems', 'default', 'orig') @contextlib.contextmanager def _created_orig_subvolume(self, location, remote_mnt, version_root): -- cgit v1.2.1