]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - mkosi.build
user-util: indentation fix
[thirdparty/systemd.git] / mkosi.build
index 114e617c8586e57d8a200d7a0f7ab63584af8c71..4a13f1075eb47987528b85997653dc7151a0e5b5 100755 (executable)
@@ -42,6 +42,14 @@ fi
 if [ ! -f "$BUILDDIR"/build.ninja ] ; then
         sysvinit_path=`realpath /etc/init.d`
 
+        init_path=`realpath /sbin/init 2>/dev/null`
+        if [ -z "$init_path" ] ; then
+            rootprefix=""
+        else
+            rootprefix=${init_path%/lib/systemd/systemd}
+            rootprefix=/${rootprefix#/}
+        fi
+
         nobody_user=`id -u -n 65534 2> /dev/null`
         if [ "$nobody_user" != "" ] ; then
                 # Validate that we can translate forth and back
@@ -76,11 +84,17 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then
                 fi
         fi
 
-        meson "$BUILDDIR" -D "sysvinit-path=$sysvinit_path" -D default-hierarchy=unified -D man=false -D "nobody-user=$nobody_user" -D "nobody-group=$nobody_group"
+        meson "$BUILDDIR" -D "sysvinit-path=$sysvinit_path" -D "rootprefix=$rootprefix" -D default-hierarchy=unified -D man=false -D "nobody-user=$nobody_user" -D "nobody-group=$nobody_group"
 fi
 
 ninja -C "$BUILDDIR" all
-[ "$WITH_TESTS" = 0 ] || ninja -C "$BUILDDIR" test
+if [ "$WITH_TESTS" = 1 ] ; then
+        for id in 1 2 3; do
+                groupadd -g $id testgroup$id || :
+        done
+
+        ninja -C "$BUILDDIR" test
+fi
 ninja -C "$BUILDDIR" install
 
 mkdir -p "$DESTDIR"/etc
@@ -95,3 +109,7 @@ EOF
 mkdir -p "$DESTDIR"/boot/efi/EFI/systemd "$DESTDIR"/boot/efi/EFI/BOOT
 cp "$DESTDIR"/usr/lib/systemd/boot/efi/systemd-bootx64.efi "$DESTDIR"/boot/efi/EFI/systemd/systemd-bootx64.efi
 cp "$DESTDIR"/usr/lib/systemd/boot/efi/systemd-bootx64.efi "$DESTDIR"/boot/efi/EFI/BOOT/bootx64.efi
+
+mkdir -p "$DESTDIR"/efi/EFI/systemd "$DESTDIR"/efi/EFI/BOOT
+cp "$DESTDIR"/usr/lib/systemd/boot/efi/systemd-bootx64.efi "$DESTDIR"/efi/EFI/systemd/systemd-bootx64.efi
+cp "$DESTDIR"/usr/lib/systemd/boot/efi/systemd-bootx64.efi "$DESTDIR"/efi/EFI/BOOT/bootx64.efi