]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - mkosi.build
generators: be more careful when writing unit settings that support specifier expansion
[thirdparty/systemd.git] / mkosi.build
index 6bbe8f3942af6c9f7e0a06feb24e74cbbca2260c..7a72b63b94b73142b0581fbd7e63f08af110d761 100755 (executable)
 # This is a build script for OS image generation using mkosi (https://github.com/systemd/mkosi).
 # Simply invoke "mkosi" in the project directory to build an OS image.
 
-meson build
-ninja -C build all
-ninja -C build test
-ninja -C build install
+# If mkosi.builddir/ exists mkosi will set $BUILDDIR to it, let's then use it
+# as out-of-tree build dir. Otherwise, let's make up our own builddir.
+[ -z "$BUILDDIR" ] && BUILDDIR=build
 
-mkdir -p $DESTDIR/etc
+export LC_CTYPE=en_US.UTF-8
 
-cat > $DESTDIR/etc/issue <<EOF
+sysvinit_path=`realpath /etc/init.d`
+
+[ -f "$BUILDDIR"/build.ninja ] || meson "$BUILDDIR" -D "sysvinit-path=$sysvinit_path" -D "default-hierarchy=unified"
+ninja -C "$BUILDDIR" all
+[ "$WITH_TESTS" = 0 ] || ninja -C "$BUILDDIR" test || ( RET="$?" ; cat "$BUILDDIR"/meson-logs/testlog.txt ; exit "$RET" )
+ninja -C "$BUILDDIR" install
+
+mkdir -p "$DESTDIR"/etc
+
+cat > "$DESTDIR"/etc/issue <<EOF
 \S (built from systemd tree)
 Kernel \r on an \m (\l)