From 64b420111efff95dae4353c5a13cbca286cec44a Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 22 Aug 2017 12:12:45 +1200 Subject: [PATCH] move instructions from script to README --- README.md | 40 +++++++++++++++++++++++++++++++-- scripts/inject-subquity-snap.sh | 20 +---------------- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7966544e..9ab7fdd5 100644 --- a/README.md +++ b/README.md @@ -31,5 +31,41 @@ Machine profiles are generated from the probert tool. To collect a machine prof # Testing changes in KVM -To try out your changes for real, it is necessary to install them into an -image. See the comments in scripts/inject-subiquity-snap.sh for how to do this. +To try out your changes for real, it is necessary to install them into +an ISO. Rather than building one from scratch, it's much easier to +install your version of subiquity into the daily image. Here's how to +do this: + +1. Build your change into a snap: + + ``` + $ snapcraft snap --output subiquity_test.snap + ``` + +2. Grab the current version of the installer: + + ``` + $ urlbase=http://cdimage.ubuntu.com/ubuntu-server/daily-live/current + $ isoname=$(distro-info -d)-live-$(dpkg --print-architecture).iso + $ zsync ${urlbase}/${isoname}.zsync + ``` + +3. Run the provided script to make a copy of the downloaded installer + that has your version of subiquity: + + ``` + $ sudo ./scripts/inject-subquity-snap.sh ${isoname} subquity_test.snap custom.iso + ``` + +4. Boot the new iso in KVM: + + ``` + $ qemu-img create -f raw target.img 10G + $ kvm -m 1024 -cdrom custom.iso -hda target.img -serial stdio + ``` + +5. Finally, boot the installed image: + + ``` + $ kvm -m 1024 -hda target.img -serial stdio + ``` diff --git a/scripts/inject-subquity-snap.sh b/scripts/inject-subquity-snap.sh index 35bc8937..ff2764c3 100755 --- a/scripts/inject-subquity-snap.sh +++ b/scripts/inject-subquity-snap.sh @@ -2,25 +2,7 @@ set -eux -# So you want to test a change you're making to subiquity in a real -# ISO rather than dry-run mode. Easy! -# -# 1. Build your change into a snap: -# -# $ snapcraft snap -# -# 2. Grab the current version of the installer: -# -# $ urlbase=http://cdimage.ubuntu.com/ubuntu-server/daily-live/current -# $ isoname=$(distro-info -d)-live-$(dpkg --print-architecture).iso -# $ zsync ${urlbase}/${isoname}.zsync -# -# 3. Run this script to replace the subiquity in the downloaded image with your -# fresh one: -# -# $ sudo ./scripts/inject-subquity-snap.sh ${isoname} subquity_*.snap custom.iso -# -# 4. Profit!! (Or, more likely, boot custom.iso in kvm) +# inject-subquity-snap.sh $old_iso $subiquity_snap $new_iso OLD_ISO=$(readlink -f $1) SUBIQUITY_SNAP_PATH=$(readlink -f $2)