summaryrefslogtreecommitdiffstats
path: root/mkosi.conf.d
diff options
context:
space:
mode:
Diffstat (limited to 'mkosi.conf.d')
-rwxr-xr-xmkosi.conf.d/10-arch/mkosi.prepare8
-rwxr-xr-xmkosi.conf.d/10-centos-fedora/mkosi.prepare6
-rw-r--r--mkosi.conf.d/10-debian-ubuntu/mkosi.conf5
-rwxr-xr-xmkosi.conf.d/10-debian-ubuntu/mkosi.prepare26
-rw-r--r--mkosi.conf.d/10-fedora/mkosi.conf.d/rawhide.conf7
-rwxr-xr-xmkosi.conf.d/10-opensuse/mkosi.prepare8
-rw-r--r--mkosi.conf.d/10-ubuntu/mkosi.conf3
7 files changed, 44 insertions, 19 deletions
diff --git a/mkosi.conf.d/10-arch/mkosi.prepare b/mkosi.conf.d/10-arch/mkosi.prepare
index aac7b3d..76f67c1 100755
--- a/mkosi.conf.d/10-arch/mkosi.prepare
+++ b/mkosi.conf.d/10-arch/mkosi.prepare
@@ -6,9 +6,11 @@ if [[ "$1" == "build" ]]; then
exit 0
fi
+mapfile -t PACKAGES < <(jq --raw-output .VolatilePackages[] <"$MKOSI_CONFIG")
+
DEPS=""
-while read -r PACKAGE; do
+for PACKAGE in "${PACKAGES[@]}"; do
DEPS="$DEPS $(
pacman --sync --info "$PACKAGE" |
sed '1,/^$/d' | # Only keep result from first repository (delete everything after first blank line).
@@ -23,11 +25,11 @@ while read -r PACKAGE; do
sed 's/ *\(.*\):.*/\1/' | # Drop descriptions (everything after first colon for all lines).
tr '\n' ' ' # Transform newlines to whitespace.
)"
-done < <(jq --raw-output .VolatilePackages[] <"$MKOSI_CONFIG")
+done
echo "$DEPS" |
xargs | # Remove extra whitespace.
tr ' ' '\n' |
- grep --invert-match --regexp systemd --regexp None | # systemd packages will be installed later on.
+ grep --extended-regexp --invert-match --regexp "$(IFS=\| ; echo "${PACKAGES[*]}")" --regexp None | # systemd packages will be installed later on.
sort --unique |
xargs --delimiter '\n' --no-run-if-empty mkosi-install
diff --git a/mkosi.conf.d/10-centos-fedora/mkosi.prepare b/mkosi.conf.d/10-centos-fedora/mkosi.prepare
index 2a890bc..9aca009 100755
--- a/mkosi.conf.d/10-centos-fedora/mkosi.prepare
+++ b/mkosi.conf.d/10-centos-fedora/mkosi.prepare
@@ -11,9 +11,9 @@ mapfile -t PACKAGES < <(jq --raw-output .VolatilePackages[] <"$MKOSI_CONFIG")
for DEPS in --requires --recommends --suggests; do
# We need --latest-limit=1 to only consider the newest version of the packages.
# --latest-limit=1 is per <name>.<arch> so we have to pass --arch= explicitly to make sure i686 packages
- # are not considerd on x86-64.
- dnf repoquery --arch="$DISTRIBUTION_ARCHITECTURE" --latest-limit=1 --quiet "$DEPS" "${PACKAGES[@]}" |
- grep --invert-match --regexp systemd --regexp udev --regexp /bin/sh --regexp grubby --regexp sdubby --regexp libcurl-minimal |
+ # are not considered on x86-64.
+ dnf repoquery --arch="$DISTRIBUTION_ARCHITECTURE,noarch" --latest-limit=1 --quiet "$DEPS" "${PACKAGES[@]}" |
+ grep --extended-regexp --invert-match --regexp "$(IFS=\| ; echo "${PACKAGES[*]}")" --regexp /bin/sh --regexp grubby --regexp sdubby --regexp libcurl-minimal |
sort --unique |
xargs --delimiter '\n' --no-run-if-empty mkosi-install
done
diff --git a/mkosi.conf.d/10-debian-ubuntu/mkosi.conf b/mkosi.conf.d/10-debian-ubuntu/mkosi.conf
index d14746f..472064e 100644
--- a/mkosi.conf.d/10-debian-ubuntu/mkosi.conf
+++ b/mkosi.conf.d/10-debian-ubuntu/mkosi.conf
@@ -8,10 +8,6 @@ Distribution=|ubuntu
PackageManagerTrees=mkosi-pinning.pref:/etc/apt/preferences.d/mkosi-pinning.pref
[Content]
-# Debian ships /usr/bin/login from shadow instead of util-linux which doesn't support credentials so we
-# enable autologin the old-fashioned way.
-Autologin=yes
-
VolatilePackages=
libnss-myhostname
libnss-mymachines
@@ -58,6 +54,7 @@ Packages=
knot
libcap-ng-utils
locales
+ login
man-db
multipath-tools
ncat
diff --git a/mkosi.conf.d/10-debian-ubuntu/mkosi.prepare b/mkosi.conf.d/10-debian-ubuntu/mkosi.prepare
index acab113..bf2c5eb 100755
--- a/mkosi.conf.d/10-debian-ubuntu/mkosi.prepare
+++ b/mkosi.conf.d/10-debian-ubuntu/mkosi.prepare
@@ -8,9 +8,23 @@ fi
mapfile -t PACKAGES < <(jq --raw-output .VolatilePackages[] <"$MKOSI_CONFIG")
-apt-cache depends "${PACKAGES[@]}" |
- grep --invert-match --regexp "<" --regexp "|" --regexp systemd | # Remove e.g. <python3:any> and |dbus-broker like results
- grep --extended-regexp "Depends|Suggests|Recommends" |
- sed --quiet 's/.*: //p' | # Get every line with ": " in it and strip it at the same time.
- sort --unique |
- xargs --delimiter '\n' --no-run-if-empty mkosi-install
+PATTERNS=()
+
+# The ?reverse-depends() pattern for some weird reason lists all the packages providing systemd-sysusers
+# instead of just excluding it, so we add another pattern to filter out anything that conflicts with
+# any other systemd packages so we filter out both opensysusers and systemd-sysusers-standalone. We also
+# exclude packages that belong to the systemd source package as we'll install these later. Finally, we
+# exclude virtual packages as trying to install these makes apt fail with an error saying we need to install
+# a specific implementation even if one is already installed.
+COMMON="?not(?virtual), ?not(?reverse-conflicts(?source-package(^systemd$))), ?not(?reverse-breaks(?source-package(^systemd$))), ?not(?source-package(^systemd$))"
+
+for PACKAGE in "${PACKAGES[@]}"; do
+ # Get all the dependencies of the systemd packages including recommended and suggested dependencies.
+ PATTERNS+=(
+ "?and(?reverse-depends(?exact-name($PACKAGE)), $COMMON)"
+ "?and(?reverse-recommends(?exact-name($PACKAGE)), $COMMON)"
+ "?and(?reverse-suggests(?exact-name($PACKAGE)), $COMMON)"
+ )
+done
+
+mkosi-install "${PATTERNS[@]}"
diff --git a/mkosi.conf.d/10-fedora/mkosi.conf.d/rawhide.conf b/mkosi.conf.d/10-fedora/mkosi.conf.d/rawhide.conf
new file mode 100644
index 0000000..f657b3d
--- /dev/null
+++ b/mkosi.conf.d/10-fedora/mkosi.conf.d/rawhide.conf
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[Match]
+Release=rawhide
+
+[Content]
+Packages=util-linux-script
diff --git a/mkosi.conf.d/10-opensuse/mkosi.prepare b/mkosi.conf.d/10-opensuse/mkosi.prepare
index 6ee0af2..728b502 100755
--- a/mkosi.conf.d/10-opensuse/mkosi.prepare
+++ b/mkosi.conf.d/10-opensuse/mkosi.prepare
@@ -6,18 +6,20 @@ if [[ "$1" == "build" ]]; then
exit 0
fi
+mapfile -t PACKAGES < <(jq --raw-output .VolatilePackages[] <"$MKOSI_CONFIG")
+
DEPS=""
-while read -r PACKAGE; do
+for PACKAGE in "${PACKAGES[@]}"; do
# zypper's output is not machine readable so we make do with sed instead.
DEPS="$DEPS\n$(
zypper info --requires --recommends --suggests "$PACKAGE" |
sed '/Requires/,$!d' | # Remove everything before Requires line
sed --quiet 's/^ //p' # All indented lines have dependencies
)"
-done < <(jq --raw-output .VolatilePackages[] <"$MKOSI_CONFIG")
+done
echo -e "$DEPS" |
- grep --invert-match --regexp systemd --regexp udev --regexp qemu |
+ grep --extended-regexp --invert-match --regexp "$(IFS=\| ; echo "${PACKAGES[*]}")" --regexp qemu |
sort --unique |
xargs --delimiter '\n' --no-run-if-empty mkosi-install
diff --git a/mkosi.conf.d/10-ubuntu/mkosi.conf b/mkosi.conf.d/10-ubuntu/mkosi.conf
index 1ffa3ab..73faafe 100644
--- a/mkosi.conf.d/10-ubuntu/mkosi.conf
+++ b/mkosi.conf.d/10-ubuntu/mkosi.conf
@@ -8,6 +8,9 @@ Release=noble
Repositories=universe
[Content]
+# Ubuntu ships /usr/bin/login from shadow instead of util-linux which doesn't support credentials so we
+# enable autologin the old-fashioned way.
+Autologin=yes
Packages=
linux-image-generic
linux-tools-common