[neon/neon/calamares-settings/Neon/release-lts] /: move oem-config sddm conf to subdir

Harald Sitter null at kde.org
Mon Mar 15 15:00:06 GMT 2021


Git commit 0afc7b1567e47dd5f6723c1dee83683246b1c72d by Harald Sitter.
Committed on 15/03/2021 at 14:59.
Pushed by sitter into branch 'Neon/release-lts'.

move oem-config sddm conf to subdir

the previous way of doing things was fairly dated and actually broke
autologin as cala in oem-config mode would adjust sddm.conf to login the
final user but then we'd remove that config in undo.
instead oem-prepare now creates a fiel in sddm.conf.d and we'll remove
it in undo. sddm.conf from the oem session meanwhile is removed
completely meaning oem-config will generate a new config if autologin is
selected (this new config is then left alone)

for convenience we'll leave the sddm.conf.d directory around in case
sddm ever pre-generates one, means we don't have to fuss over removing a
dir that is expected to be there. for the same reason our mkdir is
rescued ||true. should mkdir actually fail and not produce a dir we'll
see the prepare script fail on the cat anyway.

M  +1    -1    oem-config/calamares/oem-config/modules/oem-undo.conf
M  +12   -3    oem-prepare/calamares/oem-prepare/prepare-system/calamares-oem-prepare-root

https://invent.kde.org/neon/neon/calamares-settings/commit/0afc7b1567e47dd5f6723c1dee83683246b1c72d

diff --git a/oem-config/calamares/oem-config/modules/oem-undo.conf b/oem-config/calamares/oem-config/modules/oem-undo.conf
index 33dbbe7..1cfaf0a 100644
--- a/oem-config/calamares/oem-config/modules/oem-undo.conf
+++ b/oem-config/calamares/oem-config/modules/oem-undo.conf
@@ -12,7 +12,7 @@
 ---
 timeout: 1800
 script:
-    - rm /etc/sddm.conf
+    - rm /etc/sddm.conf.d/01-calamares-oem-config.conf
     - rm /etc/xdg/kdeglobals
     - systemctl disable calamares-sddm.service
     - rm /lib/systemd/system/calamares-sddm.service
diff --git a/oem-prepare/calamares/oem-prepare/prepare-system/calamares-oem-prepare-root b/oem-prepare/calamares/oem-prepare/prepare-system/calamares-oem-prepare-root
index f7fb46a..7444cd4 100755
--- a/oem-prepare/calamares/oem-prepare/prepare-system/calamares-oem-prepare-root
+++ b/oem-prepare/calamares/oem-prepare/prepare-system/calamares-oem-prepare-root
@@ -28,9 +28,18 @@ EOT
 
 # Make sure autologin and relogin on logout is enabled so we always get back
 # into the session.
-kwriteconfig5 --file /etc/sddm.conf --group Autologin --key Relogin --type bool true
-kwriteconfig5 --file /etc/sddm.conf --group Autologin --key User oem
-kwriteconfig5 --file /etc/sddm.conf --group Autologin --key Session plasma.desktop
+# Use the configure directory so as to not step on calamares' toes in case
+# it wants to set up autologin during oem-config.
+SDDM_CONF=/etc/sddm.conf.d/01-calamares-oem-config.conf
+mkdir -p --mode=0755 $(dirname $SDDM_CONF) || true # same mode as when kcm_sddm creates it
+cat << EOT >>$SDDM_CONF
+[Autologin]
+Relogin=true
+User=oem
+Session=plasma.desktop
+EOT
+chmod 0644 $SDDM_CONF
+rm -f /etc/sddm.conf # remove the oem's file, it serves no purpose after oem-config
 
 cp -a oem-cleanup /usr/bin/
 cp -a oem-cleanup.service /lib/systemd/system


More information about the Neon-commits mailing list