X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mkosi.build;h=4a13f1075eb47987528b85997653dc7151a0e5b5;hb=864a25d99bb523e7a5c166771e3ddbf39baffd33;hp=093a586b8362bc759349d1cfffba2208b685ad7b;hpb=b667d50d3443be7fd861d319b5acd525aa15329c;p=thirdparty%2Fsystemd.git diff --git a/mkosi.build b/mkosi.build index 093a586b836..4a13f1075eb 100755 --- a/mkosi.build +++ b/mkosi.build @@ -1,10 +1,6 @@ #!/bin/sh set -ex -# This file is part of systemd. -# -# Copyright 2016 Lennart Poettering - # 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. @@ -46,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 @@ -80,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 || ( RET="$?" ; cat "$BUILDDIR"/meson-logs/testlog.txt ; exit "$RET" ) +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 @@ -94,3 +104,12 @@ cat > "$DESTDIR"/etc/issue <