summaryrefslogtreecommitdiffstats
path: root/mkosi.images/system
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-01-22 12:04:45 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2024-01-22 12:42:52 +0100
commit166bcaf95fbdd036f99705d2204138c36eb95836 (patch)
tree68accf1a9a66501239e325273baa103a8e1c0495 /mkosi.images/system
parenttree-wide: link to docs.kernel.org for kernel documentation (diff)
downloadsystemd-166bcaf95fbdd036f99705d2204138c36eb95836.tar.xz
systemd-166bcaf95fbdd036f99705d2204138c36eb95836.zip
mkosi: Use authselect local profile if it exists
authselect 1.5.0 removed the "minimal" profile and added the "local" profile instead. Let's modify our post-installation script to take these changes into account.
Diffstat (limited to 'mkosi.images/system')
-rwxr-xr-xmkosi.images/system/mkosi.postinst.chroot12
1 files changed, 10 insertions, 2 deletions
diff --git a/mkosi.images/system/mkosi.postinst.chroot b/mkosi.images/system/mkosi.postinst.chroot
index 0fec067ebb..692242da38 100755
--- a/mkosi.images/system/mkosi.postinst.chroot
+++ b/mkosi.images/system/mkosi.postinst.chroot
@@ -65,9 +65,17 @@ if [ -n "$IMAGE_VERSION" ] ; then
fi
if command -v authselect >/dev/null; then
- authselect select minimal
+ # authselect 1.5.0 renamed the minimal profile to the local profile without keeping backwards compat so
+ # let's use the new name if it exists.
+ if [ -d /usr/share/authselect/default/local ]; then
+ PROFILE=local
+ else
+ PROFILE=minimal
+ fi
+
+ authselect select "$PROFILE"
- if authselect list-features minimal | grep -q "with-homed"; then
+ if authselect list-features "$PROFILE" | grep -q "with-homed"; then
authselect enable-feature with-homed
fi
fi