diff options
-rwxr-xr-x | morphlib/exts/ssh-rsync.write | 7 | ||||
-rw-r--r-- | morphlib/util.py | 15 | ||||
-rwxr-xr-x | morphlib/xfer-hole | 10 |
3 files changed, 26 insertions, 6 deletions
diff --git a/morphlib/exts/ssh-rsync.write b/morphlib/exts/ssh-rsync.write index c139b6c0..468e5a1f 100755 --- a/morphlib/exts/ssh-rsync.write +++ b/morphlib/exts/ssh-rsync.write @@ -54,9 +54,12 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): self.upgrade_remote_system(location, temp_root) def upgrade_remote_system(self, location, temp_root): - self.complete_fstab_for_btrfs_layout(temp_root) - root_disk = self.find_root_disk(location) + uuid = cliapp.ssh_runcmd(location, ['blkid', '-s', 'UUID', '-o', + 'value', root_disk]).strip() + + self.complete_fstab_for_btrfs_layout(temp_root, uuid) + version_label = os.environ.get('VERSION_LABEL') autostart = self.get_environment_boolean('AUTOSTART') diff --git a/morphlib/util.py b/morphlib/util.py index dc3dd474..cc8ce88d 100644 --- a/morphlib/util.py +++ b/morphlib/util.py @@ -142,7 +142,18 @@ def new_artifact_caches(settings): # pragma: no cover def combine_aliases(app): # pragma: no cover - '''Create a full repo-alias set from the app's settings.''' + '''Create a full repo-alias set from the app's settings. + + The standard 'baserock:' and 'upstream:' keyed URLs use whatever trove was + set as 'trove-host'. + + Every trove listed in 'trove-ids' has its own repo-alias created in + addition to the defaults. We assume these require authenticated access, so + the keyed URL expansions for these troves are ssh:// URLs for both read and + write access. This can be overridden by the user if they calculate the full + repo-alias string and set it in their config manually. + + ''' trove_host = app.settings['trove-host'] trove_ids = app.settings['trove-id'] repo_aliases = app.settings['repo-alias'] @@ -173,7 +184,7 @@ def combine_aliases(app): # pragma: no cover m.group('prefix'), _expand(m.group('pull'), m.group('path')), _expand(m.group('push'), m.group('path'))) - elif '=' not in trove_id: + elif '=' not in trove_id and trove_id not in alias_map: alias_map[trove_id] = "%s=%s#%s" % ( trove_id, _expand('ssh', trove_id), diff --git a/morphlib/xfer-hole b/morphlib/xfer-hole index 0d4cee7a..22ee06bf 100755 --- a/morphlib/xfer-hole +++ b/morphlib/xfer-hole @@ -120,8 +120,14 @@ def make_xfer_instructions(fd): def copy_slice_from_file(to, fd, start, end): safe_lseek(fd, start, os.SEEK_SET) - data = os.read(fd, end - start) - to.write(data) + nbytes = end - start + max_at_a_time = 1024**2 + while nbytes > 0: + data = os.read(fd, min(nbytes, max_at_a_time)) + if not data: + break + to.write(data) + nbytes -= len(data) for kind, start, end in make_xfer_instructions(fd): |