Skip to content

Commit b16f3a9

Browse files
committed
Merge remote-tracking branch 'ArrayBolt3/arraybolt3/trixie'
2 parents cae3d45 + a864d7e commit b16f3a9

2 files changed

Lines changed: 38 additions & 14 deletions

File tree

usr/sbin/autologinchange

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -462,16 +462,21 @@ fi
462462
## safely manage those
463463
## TODO: consider cases with leading spaces
464464
## TODO: ignore comments
465-
if grep --quiet --recursive --ignore-case -- '^\[Seat:[^*]' /etc/lightdm; then
466-
printf '%s\n' "ERROR: Multi-seat lightdm configuration detected, cannot proceed!" >&2
467-
exit 1
465+
if [ -d /etc/lightdm ]; then
466+
if grep --quiet --recursive --ignore-case -- '^\[Seat:[^*]' /etc/lightdm; then
467+
printf '%s\n' "ERROR: Multi-seat lightdm configuration detected, cannot proceed!" >&2
468+
exit 1
469+
fi
468470
fi
469471

470-
readarray -t autologin_users_lightdm < <(
471-
grep --recursive --ignore-case -- '^autologin-user=' /etc/lightdm \
472-
| filter_out_sysmaint_maybe \
473-
| awk -F'=' '{ print $NF }' || true
474-
) || true
472+
autologin_users_lightdm=()
473+
if [ -d /etc/lightdm ]; then
474+
readarray -t autologin_users_lightdm < <(
475+
grep --recursive --ignore-case -- '^autologin-user=' /etc/lightdm \
476+
| filter_out_sysmaint_maybe \
477+
| awk -F'=' '{ print $NF }' || true
478+
) || true
479+
fi
475480
true "INFO: Collected list of users with lightdm autologin enabled."
476481

477482
readarray -t autologin_users_sddm < <(
@@ -487,11 +492,23 @@ readarray -t autologin_users_sddm < <(
487492
) || true
488493
true "INFO: Collected list of users with sddm autologin enabled."
489494

495+
readarray -t autologin_users_greetd < <(
496+
for file_name in /etc/greetd/config.toml.d/*; do
497+
if ! [ -f "${file_name}" ]; then
498+
continue
499+
fi
500+
get_config_section "${file_name}" 'initial_session' \
501+
| grep -- '^user\s*=\s*"[^"]*"$' \
502+
| filter_out_sysmaint_maybe \
503+
| sed 's/^.*"\([^"]*\)"$/\1/' || true
504+
done
505+
) || true
506+
490507
readarray -t autologin_users < <(
491-
IFS=$'\n'
492-
printf '%s\n%s\n' \
493-
"${autologin_users_lightdm[*]}" \
494-
"${autologin_users_sddm[*]}" \
508+
printf '%s\n' \
509+
"${autologin_users_lightdm[@]}" \
510+
"${autologin_users_sddm[@]}" \
511+
"${autologin_users_greetd[@]}" \
495512
| sed '/^$/d' \
496513
| sort -u
497514
)

usr/sbin/rebuild-dkms-modules

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ source /usr/libexec/helper-scripts/as_root.sh
2020
source /usr/libexec/helper-scripts/has.sh
2121

2222
rebuild_dkms_modules() {
23-
local dkms_mod_status_item dkms_mod_name dkms_mod_kernel dkms_mod_status
23+
local dkms_mod_status_item dkms_mod_name dkms_mod_kernel dkms_mod_status \
24+
dkms_build_count
2425

2526
as_root
2627

@@ -32,6 +33,7 @@ rebuild_dkms_modules() {
3233

3334
log notice 'Rebuilding DKMS modules...'
3435

36+
dkms_build_count='0'
3537
while IFS= read -r dkms_mod_status_item; do
3638
if ! [[ "${dkms_mod_status_item}" \
3739
=~ ^([^,]*),\ ([^,]*),\ [^:]*:\ (.*)$ ]]; then
@@ -57,9 +59,14 @@ rebuild_dkms_modules() {
5759
continue
5860
fi
5961
log notice "Successfully rebuilt DKMS module '${dkms_mod_name}' for kernel '${dkms_mod_kernel}'."
62+
(( dkms_build_count++ )) || true
6063
done < <(dkms status)
6164

62-
log notice 'Done rebuilding DKMS modules.'
65+
if [ "${dkms_build_count}" = '0' ]; then
66+
log notice 'No DKMS modules to rebuild, ok.'
67+
else
68+
log notice 'Done rebuilding DKMS modules.'
69+
fi
6370
}
6471

6572
rebuild_dkms_modules

0 commit comments

Comments
 (0)