X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mkosi.build;h=4a13f1075eb47987528b85997653dc7151a0e5b5;hb=d910f4c2b2542544d7b187a09605da7a0f220837;hp=131eb9fd906093fcec701944884b499364bde12d;hpb=4279c82075dbd457fc2f15db68a40bca769bd0f0;p=thirdparty%2Fsystemd.git
diff --git a/mkosi.build b/mkosi.build
index 131eb9fd906..4a13f1075eb 100755
--- a/mkosi.build
+++ b/mkosi.build
@@ -1,23 +1,6 @@
#!/bin/sh
set -ex
-# This file is part of systemd.
-#
-# Copyright 2016 Lennart Poettering
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# systemd is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with systemd; If not, see .
-
# 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.
@@ -59,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
@@ -93,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
@@ -107,3 +104,12 @@ cat > "$DESTDIR"/etc/issue <