diff options
author | Luca Boccassi <bluca@debian.org> | 2022-02-18 22:56:56 +0000 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2022-02-19 14:01:17 +0000 |
commit | 21838f36a64e71dd6439692e57d629f27e4954ea (patch) | |
tree | 5c0f66faab22c7cefff94140c16b47641d006ffa /.github | |
parent | a59e5c625da5a6e0c46e493d55f2f4212e9457ca (diff) | |
download | systemd-21838f36a64e71dd6439692e57d629f27e4954ea.tar.gz |
mkosi CI: mask isc-dhcp-server units
The packages are installed to provide the dhcpd binary, used by
test/test-network/systemd-networkd-tests.py, but we don't need the units
to run, and in fact in some cases the image fails to boot because of
them:
Spawning container image on /home/runner/work/systemd/systemd/image.raw.
Press ^] three times within 1s to kill container.
● isc-dhcp-server.service loaded failed failed ISC DHCP IPv4 server
● isc-dhcp-server6.service loaded failed failed ISC DHCP IPv6 server
Container image failed with error code 1.
Error: Process completed with exit code 1.
Mask the units with an --extra-tree.
Diffstat (limited to '.github')
-rwxr-xr-x | .github/workflows/run_mkosi.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/.github/workflows/run_mkosi.sh b/.github/workflows/run_mkosi.sh index 980fa1a96c..153ebe3d37 100755 --- a/.github/workflows/run_mkosi.sh +++ b/.github/workflows/run_mkosi.sh @@ -7,11 +7,20 @@ set -o pipefail EC=0 TEMPFILE="$(mktemp)" -trap "rm -f '$TEMPFILE'" EXIT +TEMP_EXTRA_TREE="$(mktemp --directory)" +trap "rm -rf '$TEMPFILE' '$TEMP_EXTRA_TREE'" EXIT + +# We need isc-dhcp-server to be installed for the networkd unit tests, but we don't want to +# run it by default. mktemp creates the directory as 700, so change it, otherwise it will +# affect the image's root folder permissions. +chmod 755 "$TEMP_EXTRA_TREE" +mkdir -p "$TEMP_EXTRA_TREE/etc/systemd/system/" +ln -s /dev/null "$TEMP_EXTRA_TREE/etc/systemd/system/isc-dhcp-server.service" +ln -s /dev/null "$TEMP_EXTRA_TREE/etc/systemd/system/isc-dhcp-server6.service" for ((i = 0; i < 5; i++)); do EC=0 - (sudo python3 -m mkosi "$@") |& tee "$TEMPFILE" || EC=$? + (sudo python3 -m mkosi --extra-tree="$TEMP_EXTRA_TREE" "$@") |& tee "$TEMPFILE" || EC=$? if [[ $EC -eq 0 ]]; then # The command passed — let's return immediately break |