From 5e2dc9c56977942a96c1ce5d2bb7bd03b861540a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 2 Jan 2019 10:40:34 +0200 Subject: [PATCH] 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. --- raspi3.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/raspi3.yaml b/raspi3.yaml index 328fb91..df03ba1 100644 --- a/raspi3.yaml +++ b/raspi3.yaml @@ -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