From 24acd4064ebeca7ccdda12512ffdf8aefe600862 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 8 Dec 2021 19:31:25 +0100 Subject: ci: check for failed services after boot This should, hopefully, catch issues like systemd/systemd#21671 automagically. --- mkosi.build | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mkosi.build') diff --git a/mkosi.build b/mkosi.build index fe3688d6ae..5855868acc 100755 --- a/mkosi.build +++ b/mkosi.build @@ -110,3 +110,12 @@ if [ -n "$IMAGE_VERSION" ] ; then cat /tmp/os-release.tmp > "$DESTDIR"/usr/lib/os-release rm /tmp/os-release.tmp fi + +# If $CI_BUILD is set, copy over the CI service which executes a service check +# after boot and then shuts down the machine +if [ -n "$CI_BUILD" ]; then + mkdir -p "$DESTDIR/usr/lib/systemd/system" + cp -v "$SRCDIR/test/mkosi-check-and-shutdown.service" "$DESTDIR/usr/lib/systemd/system/mkosi-check-and-shutdown.service" + cp -v "$SRCDIR/test/mkosi-check-and-shutdown.sh" "$DESTDIR/usr/lib/systemd/mkosi-check-and-shutdown.sh" + chmod +x "$DESTDIR/usr/lib/systemd/mkosi-check-and-shutdown.sh" +fi -- cgit v1.2.1