move instructions from script to README

This commit is contained in:
Michael Hudson-Doyle 2017-08-22 12:12:45 +12:00
parent 6b97bdcb61
commit 64b420111e
2 changed files with 39 additions and 21 deletions

View File

@ -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
```

View File

@ -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)