2016-07-19 13:30:34 +03:00
#!/bin/sh -ex
2016-07-16 03:00:44 +03:00
# 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 <http://www.gnu.org/licenses/>.
# 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.
2017-07-12 20:58:53 +03:00
# 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
2017-11-07 19:17:40 +03:00
export LC_CTYPE=en_US.UTF-8
2017-07-18 11:30:52 +03:00
2017-10-25 21:42:38 +03:00
sysvinit_path=`realpath /etc/init.d`
2017-10-31 11:44:00 +03:00
[ -f "$BUILDDIR"/build.ninja ] || meson "$BUILDDIR" -D "sysvinit-path=$sysvinit_path" -D default-hierarchy=unified -D man=false
2017-07-12 20:58:53 +03:00
ninja -C "$BUILDDIR" all
2017-09-05 13:19:28 +03:00
[ "$WITH_TESTS" = 0 ] || ninja -C "$BUILDDIR" test || ( RET="$?" ; cat "$BUILDDIR"/meson-logs/testlog.txt ; exit "$RET" )
2017-07-12 20:58:53 +03:00
ninja -C "$BUILDDIR" install
2016-12-07 01:17:57 +03:00
2017-07-12 20:58:53 +03:00
mkdir -p "$DESTDIR"/etc
2016-12-07 01:17:57 +03:00
2017-07-12 20:58:53 +03:00
cat > "$DESTDIR"/etc/issue <<EOF
2016-12-07 01:17:57 +03:00
\S (built from systemd tree)
Kernel \r on an \m (\l)
EOF