]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: make sysvinit path inference consistent 30464/head
authorRichard Maw <richard.maw@codethink.co.uk>
Fri, 8 Dec 2023 18:47:04 +0000 (18:47 +0000)
committerRichard Maw <richard.maw@codethink.co.uk>
Thu, 14 Dec 2023 16:26:23 +0000 (16:26 +0000)
The integration tests use /etc/rc.d/init.d if it exists
or falls back to /etc/init.d,
while the mkosi.build.chroot script dereferenced /etc/init.d.

This produces inconsistent results, as sometimes an image can be made
that has systemd built to expect /etc/init.d but /etc/rc.d/init.d
also exists.

mkosi.images/base/mkosi.build.chroot

index f26098cedf5c7835c1329f842b9fbd7374235392..b60ed8d73129c4be9b371fcd1aeed549433462be 100755 (executable)
@@ -44,7 +44,7 @@ EOF
 fi
 
 if [ ! -f "$BUILDDIR"/build.ninja ]; then
-    sysvinit_path=$(realpath /etc/init.d)
+    [[ -d /etc/rc.d/init.d ]] && sysvinit_path="/etc/rc.d/init.d" || sysvinit_path="/etc/init.d"
 
     if [ "$ID" = "centos" ] && [ "$VERSION" = "8" ]; then
         UKIFY="disabled"