mkosi: Use distro-invariant rootprefix
Distributions may be build with various configs, e.g. customized rootprefix. It'd be unmaintanable to have specific mkosi.build for each supported distro. Hence, make the build script flexible yet distro oblivious.
This commit is contained in:
+9
-1
@@ -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,7 +84,7 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user