From 976ceafe1b260ac435b27682d43c7a3e4feb5427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 10 Nov 2022 15:00:53 +0100 Subject: [PATCH 1/3] ci: skip running on docs-only changes https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths > If you define a path with the ! character, you must also define at least one > path without the ! character. If you only want to exclude paths, use > paths-ignore instead. > > The order that you define patterns matters: > A matching negative pattern (prefixed with !) after a positive match will > exclude the path. > A matching positive pattern after a negative match will include the path > again. Even if some of the exluded paths *could* impact the build, generally it's a waste of time to do mkosi builds on them. Let's skip to releave the builders a bit. --- .github/workflows/mkosi.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index dbdae760c29..f544881b344 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -9,10 +9,37 @@ on: branches: - main - v[0-9]+-stable + paths: + - '**' + - '!README*' + - '!LICENSE*' + - '!LICENSES/**' + - '!TODO' + - '!docs/**' + - '!man/**' + - '!catalog/**' + - '!shell-completion/**' + - '!po/**' + - '!.**' + - '.github/**' + pull_request: branches: - main - v[0-9]+-stable + paths: + - '**' + - '!README*' + - '!LICENSE*' + - '!LICENSES/**' + - '!TODO' + - '!docs/**' + - '!man/**' + - '!catalog/**' + - '!shell-completion/**' + - '!po/**' + - '!.**' + - '.github/**' permissions: contents: read From e642816b65498637b69287009e884032933a2c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 10 Nov 2022 15:10:08 +0100 Subject: [PATCH 2/3] ci: use mkosi executable directly --- .github/workflows/mkosi.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index f544881b344..e8f3bae01a3 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -99,19 +99,19 @@ jobs: EOF - name: Build ${{ matrix.distro }} - run: sudo python3 -m mkosi build + run: sudo mkosi build - name: Show ${{ matrix.distro }} image summary - run: sudo python3 -m mkosi summary + run: sudo mkosi summary - name: Boot ${{ matrix.distro }} systemd-nspawn - run: sudo python3 -m mkosi boot ${{ env.KERNEL_CMDLINE }} + run: sudo mkosi boot ${{ env.KERNEL_CMDLINE }} - name: Check ${{ matrix.distro }} systemd-nspawn - run: sudo python3 -m mkosi shell bash -c "[[ -e /testok ]] || { cat /failed-services; exit 1; }" + run: sudo mkosi shell bash -c "[[ -e /testok ]] || { cat /failed-services; exit 1; }" - name: Boot ${{ matrix.distro }} QEMU - run: sudo timeout -k 30 10m python3 -m mkosi qemu + run: sudo timeout -k 30 10m mkosi qemu - name: Check ${{ matrix.distro }} QEMU - run: sudo python3 -m mkosi shell bash -c "[[ -e /testok ]] || { cat /failed-services; exit 1; }" + run: sudo mkosi shell bash -c "[[ -e /testok ]] || { cat /failed-services; exit 1; }" From f7ad96506e29c0cffadb200fe3ddb75ba0111ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 10 Nov 2022 15:12:33 +0100 Subject: [PATCH 3/3] mkosi: drop spaces after shell redirection operator --- mkosi.build | 12 ++++++------ mkosi.postinst | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mkosi.build b/mkosi.build index cbf82811cf2..dbfd5e38304 100755 --- a/mkosi.build +++ b/mkosi.build @@ -61,7 +61,7 @@ done # version 5.6.0 to satisfy meson which makes bpf work on CentOS Stream 8 as well. if [ "$(grep '^ID=' /etc/os-release)" = "ID=\"centos\"" ] && [ "$(grep '^VERSION=' /etc/os-release)" = "VERSION=\"8\"" ]; then cp /usr/sbin/bpftool /usr/sbin/bpftool.real - cat > /usr/sbin/bpftool </usr/sbin/bpftool <"/tmp/os-release.tmp" - cat /tmp/os-release.tmp > "$DESTDIR"/usr/lib/os-release + cat /tmp/os-release.tmp >"$DESTDIR"/usr/lib/os-release rm /tmp/os-release.tmp fi @@ -238,7 +238,7 @@ if [ -n "$SANITIZERS" ]; then mkdir -p "$DESTDIR/etc/systemd/system.conf.d" - cat > "$DESTDIR/etc/systemd/system.conf.d/10-asan.conf" <"$DESTDIR/etc/systemd/system.conf.d/10-asan.conf" < "$DESTDIR/etc/systemd/system/systemd-journald.service.d/10-stdout-tty.conf" <"$DESTDIR/etc/systemd/system/systemd-journald.service.d/10-stdout-tty.conf" < "$DESTDIR/etc/systemd/system/console-getty.service.d/10-no-vhangup.conf" <"$DESTDIR/etc/systemd/system/console-getty.service.d/10-no-vhangup.conf" < "$DESTDIR/etc/systemd/system-preset/99-mkosi.preset" +echo "disable *" >"$DESTDIR/etc/systemd/system-preset/99-mkosi.preset" if [ -d mkosi.kernel/ ]; then cd "$SRCDIR/mkosi.kernel" diff --git a/mkosi.postinst b/mkosi.postinst index fb59d311152..cebbf29250d 100755 --- a/mkosi.postinst +++ b/mkosi.postinst @@ -2,11 +2,11 @@ # SPDX-License-Identifier: LGPL-2.1-or-later if [ "$1" = "final" ]; then - if command -v bootctl > /dev/null && [ -d "/efi" ]; then + if command -v bootctl >/dev/null && [ -d "/efi" ]; then bootctl install fi - cat >> /root/.gdbinit <>/root/.gdbinit <