aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--docs/HACKING.md11
-rwxr-xr-xmkosi.build52
-rw-r--r--mkosi.default.d/arch/mkosi.arch (renamed from .mkosi/mkosi.arch)0
-rw-r--r--mkosi.default.d/debian/mkosi.debian (renamed from .mkosi/mkosi.debian)0
-rw-r--r--mkosi.default.d/fedora/mkosi.fedora (renamed from .mkosi/mkosi.fedora)0
-rw-r--r--mkosi.default.d/opensuse/mkosi.opensuse (renamed from .mkosi/mkosi.opensuse)0
-rw-r--r--mkosi.default.d/ubuntu/mkosi.ubuntu (renamed from .mkosi/mkosi.ubuntu)0
8 files changed, 14 insertions, 53 deletions
diff --git a/.gitignore b/.gitignore
index d6f6caca55..cc7d3aa41e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,6 @@ __pycache__/
/mkosi.builddir/
/mkosi.output/
/mkosi.default
-mkosi.default.d/*
-!mkosi.default.d/10-systemd.conf
+# Ignore any mkosi config files with "local" in the name
+/mkosi.default.d/*local*.conf
/tags
diff --git a/docs/HACKING.md b/docs/HACKING.md
index 7982be34d0..3131597c22 100644
--- a/docs/HACKING.md
+++ b/docs/HACKING.md
@@ -34,13 +34,10 @@ possible, however. In order to simplify testing for cases like this we provide
a set of `mkosi` build files directly in the source tree. `mkosi` is a tool for
building clean OS images from an upstream distribution in combination with a
fresh build of the project in the local working directory. To make use of this,
-please acquire `mkosi` from https://github.com/systemd/mkosi first, unless your
-distribution has packaged it already and you can get it from there. After the
-tool is installed, symlink the settings file for your distribution of choice
-from .mkosi/ to mkosi.default in the project root directory (note that the
-package manager for this distro needs to be installed on your host system).
-After doing that, it is sufficient to type `mkosi` in the systemd project
-directory to generate a disk image `image.raw` you can boot either in
+please install the `mkosi` package (if not packaged for your distro, it can be
+downloaded from https://github.com/systemd/mkosi). `mkosi` will build an image
+for the host distro by default. It is sufficient to type `mkosi` in the systemd
+project directory to generate a disk image `image.raw` you can boot either in
`systemd-nspawn` or in an UEFI-capable VM:
```
diff --git a/mkosi.build b/mkosi.build
index 201b1888d5..e73cf554ca 100755
--- a/mkosi.build
+++ b/mkosi.build
@@ -20,7 +20,7 @@ fi
# that /usr/bin/ld is a symlink that points to a non-existing file in
# /etc/alternative/ in this mode. Let's work around this for now by manually
# redirect "ld" to "ld.bfd", i.e. circumventing the /usr/bin/ld symlink.
-if [ ! -x /usr/bin/ld -a -x /usr/bin/ld.bfd ] ; then
+if [ ! -x /usr/bin/ld ] && [ -x /usr/bin/ld.bfd ]; then
mkdir -p "$HOME"/bin
ln -s /usr/bin/ld.bfd "$HOME"/bin/ld
PATH="$HOME/bin:$PATH"
@@ -35,7 +35,7 @@ fi
# So let's ensure we're running under UTF-8.
#
# If our current locale already is UTF-8, then we don't need to do anything:
-if [ "$(locale charmap 2> /dev/null)" != "UTF-8" ] ; then
+if [ "$(locale charmap 2>/dev/null)" != "UTF-8" ] ; then
# Try using C.UTF-8 locale, if available. This locale is not shipped
# by upstream glibc, so it's not available in all distros.
# (In particular, it's not available in Arch Linux.)
@@ -54,9 +54,9 @@ if [ "$(locale charmap 2> /dev/null)" != "UTF-8" ] ; then
fi
if [ ! -f "$BUILDDIR"/build.ninja ] ; then
- sysvinit_path=`realpath /etc/init.d`
+ sysvinit_path=$(realpath /etc/init.d)
- init_path=`realpath /sbin/init 2>/dev/null`
+ init_path=$(realpath /sbin/init 2>/dev/null)
if [ -z "$init_path" ] ; then
rootprefix=""
else
@@ -64,46 +64,10 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then
rootprefix=/${rootprefix#/}
fi
- nobody_user=`id -u -n 65534 2> /dev/null`
- if [ "$nobody_user" != "" ] ; then
- # Validate that we can translate forth and back
- if [ "`id -u $nobody_user`" != 65534 ] ; then
- nobody_user=""
- fi
- fi
- if [ "$nobody_user" = "" ] ; then
- if id -u nobody 2> /dev/null ; then
- # The "nobody" user is defined already for something else, pick the Fedora name
- nobody_user=nfsnobody
- else
- # The "nobody" user name is free, use it
- nobody_user=nobody
- fi
- fi
-
- nobody_group=`id -g -n 65534 2> /dev/null`
- if [ "$nobody_group" != "" ] ; then
- # Validate that we can translate forth and back
- if [ "`id -g $nobody_group`" != 65534 ] ; then
- nobody_group=""
- fi
- fi
- if [ "$nobody_group" = "" ] ; then
- if id -u nobody 2> /dev/null ; then
- # The "nobody" group is defined already for something else, pick the Fedora name
- nobody_group=nfsnobody
- else
- # The "nobody" group name is free, use it
- nobody_group=nobody
- fi
- fi
-
meson "$BUILDDIR" \
-D "sysvinit-path=$sysvinit_path" \
-D "rootprefix=$rootprefix" \
-D man=false \
- -D "nobody-user=$nobody_user" \
- -D "nobody-group=$nobody_group" \
-D translations=false \
-D version-tag="${VERSION_TAG}"
fi
@@ -112,7 +76,7 @@ cd "$BUILDDIR"
ninja "$@"
if [ "$WITH_TESTS" = 1 ] ; then
for id in 1 2 3; do
- getent group $id > /dev/null || groupadd -g $id testgroup$id
+ getent group $id >/dev/null || groupadd -g $id testgroup$id
done
ninja test
@@ -128,7 +92,7 @@ fi
mkdir -p "$DESTDIR"/etc
-cat > "$DESTDIR"/etc/issue <<EOF
+cat >"$DESTDIR"/etc/issue <<EOF
\S (built from systemd tree)
Kernel \r on an \m (\l)
@@ -138,7 +102,7 @@ if [ -n "$IMAGE_ID" ] ; then
mkdir -p "$DESTDIR"/usr/lib
sed -n \
-e '/^IMAGE_ID=/!p' \
- -e '$aIMAGE_ID='$IMAGE_ID < /usr/lib/os-release > "$DESTDIR"/usr/lib/os-release
+ -e "\$aIMAGE_ID=$IMAGE_ID" <"/usr/lib/os-release" >"${DESTDIR}/usr/lib/os-release"
OSRELEASEFILE="$DESTDIR"/usr/lib/os-release
else
@@ -150,7 +114,7 @@ if [ -n "$IMAGE_VERSION" ] ; then
mkdir -p "$DESTDIR"/usr/lib
sed -n \
-e '/^IMAGE_VERSION=/!p' \
- -e '$aIMAGE_VERSION='$IMAGE_VERSION < $OSRELEASEFILE > /tmp/os-release.tmp
+ -e "\$aIMAGE_VERSION=$IMAGE_VERSION" <$OSRELEASEFILE >"/tmp/os-release.tmp"
cat /tmp/os-release.tmp > "$DESTDIR"/usr/lib/os-release
rm /tmp/os-release.tmp
diff --git a/.mkosi/mkosi.arch b/mkosi.default.d/arch/mkosi.arch
index f584d2d126..f584d2d126 100644
--- a/.mkosi/mkosi.arch
+++ b/mkosi.default.d/arch/mkosi.arch
diff --git a/.mkosi/mkosi.debian b/mkosi.default.d/debian/mkosi.debian
index 9bd504bf57..9bd504bf57 100644
--- a/.mkosi/mkosi.debian
+++ b/mkosi.default.d/debian/mkosi.debian
diff --git a/.mkosi/mkosi.fedora b/mkosi.default.d/fedora/mkosi.fedora
index cc3a5a2d1a..cc3a5a2d1a 100644
--- a/.mkosi/mkosi.fedora
+++ b/mkosi.default.d/fedora/mkosi.fedora
diff --git a/.mkosi/mkosi.opensuse b/mkosi.default.d/opensuse/mkosi.opensuse
index 7eb7b857ca..7eb7b857ca 100644
--- a/.mkosi/mkosi.opensuse
+++ b/mkosi.default.d/opensuse/mkosi.opensuse
diff --git a/.mkosi/mkosi.ubuntu b/mkosi.default.d/ubuntu/mkosi.ubuntu
index c9c473e7ba..c9c473e7ba 100644
--- a/.mkosi/mkosi.ubuntu
+++ b/mkosi.default.d/ubuntu/mkosi.ubuntu