]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Use authselect local profile if it exists
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 22 Jan 2024 11:04:45 +0000 (12:04 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 22 Jan 2024 11:42:52 +0000 (11:42 +0000)
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.

mkosi.images/system/mkosi.postinst.chroot

index 0fec067ebb2a6c8d80c8f7d01d95b7c0c236e63a..692242da38fb370355d4cbdaea00446b3fe59be4 100755 (executable)
@@ -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