X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mkosi.build;h=4a13f1075eb47987528b85997653dc7151a0e5b5;hb=448e7440c2d6e682d55032d15076b840521ab120;hp=ee9f7d95ad41cf626a530d71c6553461c82b5db6;hpb=7a9a0c05d45a9a8cdd43a0dfabded7a9495a1fbc;p=thirdparty%2Fsystemd.git diff --git a/mkosi.build b/mkosi.build index ee9f7d95ad4..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 +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 <