Add: support for caching and unpacking the rootfs

This speeds up iterative development of a vmdb specification file: the
output of qemu-debootstrap and the apt installation additinal packages
are cached. They take up most of the time of a full run. If modifying
other parts of raspi3.yaml, this means an iteration drops from about
20 minutes to 16 seconds on my laptop.

If making changes to the cached parts, the cache tarball needs to be
deleted between runs.

The --rootfs-tarball options MUST now be used on all invocations.
This commit is contained in:
Lars Wirzenius 2019-01-02 10:40:34 +02:00
parent 92f08cce01
commit 5e2dc9c569
1 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,8 @@ steps:
dirname: '/boot/firmware'
fs-tag: boot-fs
- unpack-rootfs: root-fs
# We need to use Debian buster (currently testing) instead of Debian stretch
# (currently stable) for:
#
@ -58,6 +60,7 @@ steps:
- main
- contrib
- non-free
unless: rootfs_unpacked
# TODO(https://bugs.debian.org/877855): remove this workaround once
# debootstrap is fixed
@ -65,6 +68,7 @@ steps:
shell: |
echo 'deb http://deb.debian.org/debian buster main contrib non-free' > /etc/apt/sources.list
apt-get update
unless: rootfs_unpacked
- apt: install
packages:
@ -78,6 +82,10 @@ steps:
- raspi3-firmware
- linux-image-arm64
fs-tag: root-fs
unless: rootfs_unpacked
- cache-rootfs: root-fs
unless: rootfs_unpacked
- shell: |
echo "rpi3" > "${ROOT?}/etc/hostname"
@ -122,6 +130,7 @@ steps:
# the partition labeled raspiroot instead of forcing it to mmcblk0p2
- chroot: root-fs
shell: |
ls -aR /boot
sed -i 's/.dev.mmcblk0p2/LABEL=RASPIROOT/' /boot/firmware/cmdline.txt
# TODO(https://github.com/larswirzenius/vmdb2/issues/24): remove once vmdb