@@ -51,10 +51,10 @@ function seeed_recomputer_install_from_apt() {
5151 -- no- install- recommends install " $@"
5252}
5353
54- # Install Seeed common packages (USB gadget, Morse tools)
55- # Note: fcs960k-aic-bluez is NOT installed here — it conflicts with bluez,
56- # which gets pulled in later by desktop packages. It's installed in
57- # post_repo_customize_image instead, after all desktop/extension packages.
54+ # Install Seeed common packages (USB gadget, Morse tools).
55+ # fcs960k-aic-bluez is NOT installed here — it conflicts with bluez,
56+ # which is pulled in by desktop packages. It is installed in a separate
57+ # post_repo_customize_image hook after all desktop/extension packages.
5858function pre_install_distribution_specific__recomputer_install_seeed_packages () {
5959 display_alert " Installing Seeed packages from APT repo" " seeed-apt" " info"
6060
@@ -69,11 +69,44 @@ function pre_install_distribution_specific__recomputer_install_seeed_packages()
6969
7070# Install fcs960k-aic-bluez AFTER all desktop/extension packages.
7171# This package conflicts with bluez; desktop pulls in bluez during
72- # install_distribution_agnostic, so we must install fcs960k last to replace it.
72+ # install_distribution_agnostic, so we install fcs960k last to replace it.
73+ # apt's conflict resolution removes packages that depend on bluez
74+ # (e.g. gnome-session, gnome-control-center, gdm3).
75+ # We perform snapshot and diff entirely inside chroot to avoid
76+ # pipe/process-substitution issues with dpkg-query across chroot boundary.
7377function post_repo_customize_image__recomputer_install_fcs960k_bluez () {
7478 display_alert " Installing fcs960k-aic-bluez (replacing bluez)" " seeed-apt" " info"
7579
80+ # Snapshot installed packages (only "ii" status, excluding rc/unpacked)
81+ # dpkg-query -W lists ALL packages including rc-status (removed, config-files),
82+ # which would make comm diff miss packages that were removed but left config files.
83+ local snapshot_before snapshot_after
84+ snapshot_before= $(mktemp -- tmpdir= " ${SDCARD}/tmp" pkg- before.XXXXXX)
85+ snapshot_after= $(mktemp -- tmpdir= " ${SDCARD}/tmp" pkg- after.XXXXXX)
86+ chroot_sdcard_with_stdout dpkg- query - W - f ' ${db:Status-Abbrev} ${Package}\n ' \
87+ | grep " ^ii " | awk ' {print $2}' | sort > " ${snapshot_before}"
88+
7689 seeed_recomputer_install_from_apt fcs960k- aic- bluez
90+
91+ # Diff to detect removed packages
92+ chroot_sdcard_with_stdout dpkg- query - W - f ' ${db:Status-Abbrev} ${Package}\n ' \
93+ | grep " ^ii " | awk ' {print $2}' | sort > " ${snapshot_after}"
94+ local removed_pkgs
95+ removed_pkgs= $(comm - 23 " ${snapshot_before}" " ${snapshot_after}" )
96+ rm - f " ${snapshot_before}" " ${snapshot_after}"
97+
98+ if [[ - n " ${removed_pkgs}" ]]; then
99+ display_alert " Reinstalling packages removed by bluez conflict" " ${removed_pkgs}" " warn"
100+ chroot_sdcard_apt_get_install ${removed_pkgs}
101+ fi
102+
103+ # Re-disable display managers: reinstalling gdm3 triggers its postinst
104+ # which re-enables display-manager.service, undoing desktop_postinstall()'s
105+ # disable. Without this the system boots into GDM instead of console,
106+ # skipping armbian-firstlogin's user/password setup prompt.
107+ disable_systemd_service_sdcard gdm3.service
108+ disable_systemd_service_sdcard lightdm.service
109+ disable_systemd_service_sdcard sddm.service
77110}
78111
79112# AIC8800 wireless tweaks (BSP-level)
@@ -283,6 +316,16 @@ function post_family_tweaks__recomputer_add_sbin_to_path() {
283316 chmod + x $SDCARD/ etc/ profile.d/ custom- path.sh
284317}
285318
319+ # Patch armbian-firstlogin: disable GDM auto-login.
320+ # Upstream sets AutomaticLoginEnable=true and relies on a background
321+ # (sleep 20; sed) to disable it, which is unreliable and gets killed.
322+ # Force AutomaticLoginEnable=false so GDM always prompts for password.
323+ function post_family_tweaks__recomputer_disable_gdm_autologin () {
324+ display_alert " $BOARD" " Disabling GDM auto-login in armbian-firstlogin" " info"
325+ sed - i ' s/AutomaticLoginEnable = true/AutomaticLoginEnable = false/' \
326+ " ${SDCARD}/usr/lib/armbian/armbian-firstlogin"
327+ }
328+
286329# Clone/pull Seeed RK extension at top-level before enable_extension
287330if [[ " ${ENABLE_SEEED_RK_EXTENSION}" == " yes" ]]; then
288331 if [[ ! - d " ${SRC}/extensions/seeed_armbian_extension" ]]; then
0 commit comments