From f2bb8857cd093eb9bd5e1dad6fb996a0a4463556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Fri, 12 Feb 2021 18:11:18 +0100 Subject: [PATCH 1/6] mkosi: openSUSE update --bootable=no dependencies Since we can build --bootable=no images without dracut->systemd, we need to add systemd runtime dependencies explicitely. --- .mkosi/mkosi.opensuse | 1 + 1 file changed, 1 insertion(+) diff --git a/.mkosi/mkosi.opensuse b/.mkosi/mkosi.opensuse index b468433f34..fdbbdeb1f8 100644 --- a/.mkosi/mkosi.opensuse +++ b/.mkosi/mkosi.opensuse @@ -60,6 +60,7 @@ Packages= libapparmor1 libcrypt1 libcryptsetup12 + libgcrypt20 libkmod2 liblz4-1 libmount1 From ed802c44da7918ba1c14944b711a20b14d9e0fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Thu, 10 Jun 2021 14:39:13 +0200 Subject: [PATCH 2/6] mkosi: Fix openSUSE Jinja2 package name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dare to be different ¯\_(ツ)_/¯ --- .mkosi/mkosi.opensuse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mkosi/mkosi.opensuse b/.mkosi/mkosi.opensuse index fdbbdeb1f8..7eb7b857ca 100644 --- a/.mkosi/mkosi.opensuse +++ b/.mkosi/mkosi.opensuse @@ -36,7 +36,7 @@ BuildPackages= pcre-devel python3 python3-lxml - python3-jinja2 + python3-Jinja2 qrencode-devel system-user-nobody systemd-sysvinit From 7c87fb219e74baf5890bea1bbd964d131071eee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Fri, 12 Feb 2021 18:19:06 +0100 Subject: [PATCH 3/6] ci: Bump mkosi version to v10 Use mkosi GH action that includes fixes for openSUSE builds. This enables testing openSUSE builds in CI. --- .github/workflows/mkosi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index babdf7ae6e..9b4121f608 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: systemd/mkosi@v9 + - uses: systemd/mkosi@v10 - name: Install run: sudo apt-get update && sudo apt-get install --no-install-recommends python3-pexpect python3-jinja2 From 2e9055ab6a9967880ed12586650970368f7b8640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Fri, 12 Feb 2021 18:13:59 +0100 Subject: [PATCH 4/6] ci: Do not require network in test images The current boot test relies on terminal login, therefore network setup inside image is unnecessary. This opens up possibility to test images that don't support the network setup via veth devices. --- .github/workflows/mkosi.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 9b4121f608..09c1a0b805 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -46,13 +46,13 @@ jobs: systemd-nspawn --version - name: Build ${{ matrix.distro }} - run: sudo python3 -m mkosi --password= --qemu-headless build + run: sudo python3 -m mkosi --password= --network-veth=no --qemu-headless build - name: Show ${{ matrix.distro }} image summary run: sudo python3 -m mkosi --password= --qemu-headless summary - name: Boot ${{ matrix.distro }} systemd-nspawn - run: sudo ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --password= --qemu-headless boot + run: sudo ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --password= --network-veth=no --qemu-headless boot - name: Boot ${{ matrix.distro }} QEMU - run: sudo ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --password= --qemu-headless qemu + run: sudo ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --password= --network-veth=no --qemu-headless qemu From 7e5e6043937055acd7040e8e7011c22e2164adc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Mon, 21 Jun 2021 17:18:54 +0200 Subject: [PATCH 5/6] ci: Detect shell prompt with higher specificity The current pattern '#' triggers on the openSUSE kernel version that is printed early during boot when no actual prompt is ready > [ 0.000000] Linux version 5.12.10-1-default (geeko@buildhost) (gcc (SUSE Linux) 11.1.1 20210510 [revision 23855a176609fe8dda6abaf2b21846b4517966eb], GNU ld (GNU Binutils; openSUSE Tumbleweed) 2.36.1.20210326-4) #1 SMP Fri Jun 11 05:05:06 UTC 2021 (b92eaf7) Instead wait for pattern that: a) should have fewer false positives, b) still be with working on distro shells: openSUSE (red color) ^[[1m^[[31mimage:~ #^[[m^O arch [root@image ~]# debian root@image:~# ubuntu root@image:~# fedora [root@image ~]# --- .github/workflows/test_mkosi_boot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_mkosi_boot.py b/.github/workflows/test_mkosi_boot.py index 3418fd3a51..3ea769a69f 100755 --- a/.github/workflows/test_mkosi_boot.py +++ b/.github/workflows/test_mkosi_boot.py @@ -2,13 +2,15 @@ # SPDX-License-Identifier: LGPL-2.1-or-later import pexpect +import re import sys def run() -> None: p = pexpect.spawnu(" ".join(sys.argv[1:]), logfile=sys.stdout, timeout=300) - p.expect("#") + # distro-independent root prompt + p.expect(re.compile("~[^#]{0,3}#")) p.sendline("systemctl poweroff") p.expect(pexpect.EOF) From 3ec4fccb3798d61ac4e445670f90623ba9df147d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= Date: Fri, 12 Feb 2021 18:17:01 +0100 Subject: [PATCH 6/6] ci: Add openSUSE Tumbleweed among tested distros --- .github/workflows/mkosi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 09c1a0b805..75aa948aa9 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -21,6 +21,7 @@ jobs: - debian - ubuntu - fedora + - opensuse steps: - uses: actions/checkout@v2