From 3bf1940a695151b9e3b72e3c23eab9ff066c9331 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 27 Sep 2026 21:21:19 +0000 Subject: [PATCH 1/2] Do not block SDDM autologin on pam_gnome_keyring Co-authored-by: AnPod --- install/login/sddm.sh | 17 +++++-- migrations/1790544001.sh | 18 +++++++ test/shell.d/sddm-keyring-pam-test.sh | 67 +++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 3 deletions(-) create mode 100755 migrations/1790544001.sh create mode 100755 test/shell.d/sddm-keyring-pam-test.sh diff --git a/install/login/sddm.sh b/install/login/sddm.sh index 250ce80e1f7e..e5b9b5597acd 100644 --- a/install/login/sddm.sh +++ b/install/login/sddm.sh @@ -1,7 +1,18 @@ # Prevent password-based SDDM logins from creating an encrypted login keyring # that conflicts with Omarchy's passwordless default keyring behavior. The ISO # owns autologin/session state because it knows whether the target is encrypted. -if [[ -f /etc/pam.d/sddm ]]; then - sed -i '/-auth.*pam_gnome_keyring\.so/d' /etc/pam.d/sddm - sed -i '/-password.*pam_gnome_keyring\.so/d' /etc/pam.d/sddm +sddm_pam="${OMARCHY_SDDM_PAM:-/etc/pam.d/sddm}" +sddm_autologin_pam="${OMARCHY_SDDM_AUTOLOGIN_PAM:-/etc/pam.d/sddm-autologin}" + +if [[ -f $sddm_pam ]]; then + sed -i '/-auth.*pam_gnome_keyring\.so/d' "$sddm_pam" + sed -i '/-password.*pam_gnome_keyring\.so/d' "$sddm_pam" +fi + +# Autologin has no password for pam_gnome_keyring to unlock with. Its session +# auto_start can still block sddm-helper for ~30s after Plymouth quits, leaving +# a black screen before the Wayland session starts (#13414). Omarchy seeds a +# passwordless Default keyring from install/user/default-keyring.sh instead. +if [[ -f $sddm_autologin_pam ]]; then + sed -i '/pam_gnome_keyring\.so/d' "$sddm_autologin_pam" fi diff --git a/migrations/1790544001.sh b/migrations/1790544001.sh new file mode 100755 index 000000000000..e73da17972c5 --- /dev/null +++ b/migrations/1790544001.sh @@ -0,0 +1,18 @@ +echo "Stop pam_gnome_keyring from blocking SDDM autologin" + +# sddm-autologin ships `-session optional pam_gnome_keyring.so auto_start`. With +# no password available that step can stall ~30s after Plymouth, leaving a black +# screen before Hyprland starts (#13414). Fresh installs drop the line from +# install/login/sddm.sh; existing machines need the same edit once. + +autologin_pam="${OMARCHY_SDDM_AUTOLOGIN_PAM:-/etc/pam.d/sddm-autologin}" + +[[ -f $autologin_pam ]] || exit 0 +grep -q 'pam_gnome_keyring\.so' "$autologin_pam" || exit 0 + +# Migrations run as the desktop user; /etc/pam.d is root-owned. +if [[ -w $autologin_pam ]]; then + sed -i '/pam_gnome_keyring\.so/d' "$autologin_pam" +else + sudo sed -i '/pam_gnome_keyring\.so/d' "$autologin_pam" +fi diff --git a/test/shell.d/sddm-keyring-pam-test.sh b/test/shell.d/sddm-keyring-pam-test.sh new file mode 100755 index 000000000000..0059b67ba473 --- /dev/null +++ b/test/shell.d/sddm-keyring-pam-test.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +set -euo pipefail + +source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" + +sddm_install="$ROOT/install/login/sddm.sh" +migration="$ROOT/migrations/1790544001.sh" + +rg -q 'OMARCHY_SDDM_AUTOLOGIN_PAM' "$sddm_install" || + fail "SDDM install script can target a test autologin PAM path" +rg -q "sed -i '/pam_gnome_keyring\\\\.so/d'" "$sddm_install" || + fail "SDDM install script strips gnome-keyring from autologin PAM" +pass "SDDM install script strips gnome-keyring from autologin PAM" + +tmp_dir=$(mktemp -d) +trap 'rm -rf "$tmp_dir"' EXIT + +cat >"$tmp_dir/sddm" <<'EOF' +#%PAM-1.0 +auth include system-login +-auth optional pam_gnome_keyring.so +-password optional pam_gnome_keyring.so use_authtok +session include system-login +EOF + +cat >"$tmp_dir/sddm-autologin" <<'EOF' +#%PAM-1.0 +auth required pam_permit.so +auth required pam_faillock.so authsucc +auth required pam_shells.so +auth required pam_nologin.so +auth required pam_env.so +session required pam_loginuid.so +session optional pam_keyinit.so force revoke +session required pam_limits.so +session required pam_unix.so +-session optional pam_gnome_keyring.so auto_start +session optional pam_umask.so +session optional pam_systemd.so +EOF + +OMARCHY_SDDM_PAM="$tmp_dir/sddm" OMARCHY_SDDM_AUTOLOGIN_PAM="$tmp_dir/sddm-autologin" \ + bash -c 'source '"$sddm_install" + +grep -q 'pam_gnome_keyring\.so' "$tmp_dir/sddm" && + fail "password SDDM PAM still references gnome-keyring auth/password" "$(cat "$tmp_dir/sddm")" +grep -q 'pam_gnome_keyring\.so' "$tmp_dir/sddm-autologin" && + fail "autologin PAM still starts gnome-keyring" "$(cat "$tmp_dir/sddm-autologin")" +pass "sourced SDDM install script clears gnome-keyring from both PAM files" + +# Migration must clear an existing autologin line without touching other session modules. +cat >"$tmp_dir/sddm-autologin" <<'EOF' +session required pam_unix.so +-session optional pam_gnome_keyring.so auto_start +session optional pam_systemd.so +EOF + +OMARCHY_SDDM_AUTOLOGIN_PAM="$tmp_dir/sddm-autologin" bash "$migration" + +grep -q 'pam_gnome_keyring\.so' "$tmp_dir/sddm-autologin" && + fail "migration left gnome-keyring on autologin PAM" "$(cat "$tmp_dir/sddm-autologin")" +grep -qx 'session required pam_unix.so' "$tmp_dir/sddm-autologin" || + fail "migration preserved unrelated PAM lines" +grep -qx 'session optional pam_systemd.so' "$tmp_dir/sddm-autologin" || + fail "migration preserved systemd PAM line" +pass "autologin keyring migration drops only gnome-keyring" From f0de6fce4800aae8286869abd46a7088396eeed4 Mon Sep 17 00:00:00 2001 From: Omarchybot <317366263+omarchybot@users.noreply.github.com> Date: Sat, 3 Oct 2026 10:12:34 +0200 Subject: [PATCH 2/2] Make the autologin keyring migration 0644 Migrations run through `bash -euo pipefail`, not their executable bit, and agents/skills/migrations.md requires 0644; this was the only 0755 file in migrations/. Co-Authored-By: Claude Opus 5.5 --- migrations/1790544001.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 migrations/1790544001.sh diff --git a/migrations/1790544001.sh b/migrations/1790544001.sh old mode 100755 new mode 100644