From 9e0f11c02e4c7fa717e86a1e5a037992ca782d92 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 21 Jul 2021 10:42:25 +1200 Subject: [PATCH] update quick-test-this-branch.sh too --- scripts/quick-test-this-branch.sh | 45 ++++++++----------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/scripts/quick-test-this-branch.sh b/scripts/quick-test-this-branch.sh index aef69d46..13ec0d13 100755 --- a/scripts/quick-test-this-branch.sh +++ b/scripts/quick-test-this-branch.sh @@ -2,46 +2,23 @@ set -eux + src="$(dirname "$(dirname "$(readlink -f "${0}")")")" + +LIVEFS_EDITOR="${LIVEFS_EDITOR-$src/livefs-editor}" +[ -d $LIVEFS_EDITOR ] || git clone https://github.com/mwhudson/livefs-editor $LIVEFS_EDITOR + +LIVEFS_EDITOR=$(readlink -f $LIVEFS_EDITOR) + old_iso="$(readlink -f "${1}")" new_iso="$(readlink -f "${2}")" tmpdir="$(mktemp -d)" cd "${tmpdir}" -_MOUNTS=() +PYTHONPATH=$LIVEFS_EDITOR python3 -m livefs_edit $old_iso /dev/null --setup-rootfs \ + --shell 'cp rootfs//var/lib/snapd/seed/snaps/subiquity_*.snap '$tmpdir'/old.snap' -do_mount_existing () { - local mountpoint="${!#}" - mount "$@" - _MOUNTS=("${mountpoint}" "${_MOUNTS[@]+"${_MOUNTS[@]}"}") -} +$src/scripts/slimy-update-snap.sh old.snap subiquity_new.snap -do_mount () { - local mountpoint="${!#}" - mkdir "${mountpoint}" - do_mount_existing "$@" -} - -clean_mounts () { - for m in "${_MOUNTS[@]+"${_MOUNTS[@]}"}"; do - umount "${m}" - done - _MOUNTS=() -} - -cleanup () { - clean_mounts - rm -rf "${tmpdir}" -} - -trap cleanup EXIT - -do_mount $old_iso old_iso -do_mount old_iso/casper/installer.squashfs installer - -$src/scripts/slimy-update-snap.sh installer/var/lib/snapd/seed/snaps/subiquity_*.snap subiquity_new.snap - -clean_mounts - -$src/scripts/inject-subiquity-snap.sh $old_iso subiquity_new.snap $new_iso +PYTHONPATH=$LIVEFS_EDITOR python3 -m livefs_edit $old_iso $new_iso --inject-snap subiquity_new.snap