From f7c70f77d0d7fdc973e6bd88caf644aa35b6f46f Mon Sep 17 00:00:00 2001 From: HuijingHei Date: Wed, 8 May 2024 19:36:31 +0800 Subject: [PATCH] ci: add `bootc install to-disk` test in c9s-bootc-e2e --- .github/workflows/ci.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc6eb6b24..0e6111914 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,23 @@ jobs: tags: localhost/bootupd:latest - name: Copy to podman run: sudo skopeo copy docker-daemon:localhost/bootupd:latest containers-storage:localhost/bootupd:latest - - name: bootc install + - name: bootc install to disk + run: | + set -xeuo pipefail + sudo truncate -s 10G myimage.raw + sudo podman run --rm -ti --privileged -v .:/target --pid=host --security-opt label=disable \ + -v /var/lib/containers:/var/lib/containers \ + -v /dev:/dev \ + localhost/bootupd:latest bootc install to-disk --skip-fetch-check \ + --disable-selinux --generic-image --via-loopback /target/myimage.raw + # Verify we installed grub.cfg and shim on the disk + sudo losetup -P -f myimage.raw + device=$(losetup --list --noheadings --output NAME,BACK-FILE | grep myimage.raw | awk '{print $1}') + sudo mount "${device}p2" /mnt/ + sudo ls /mnt/EFI/centos/{grub.cfg,shimx64.efi} + sudo losetup -D "${device}" + sudo rm -f myimage.raw + - name: bootc install to filesystem run: | set -xeuo pipefail sudo podman run --rm -ti --privileged -v /:/target --pid=host --security-opt label=disable \