Skip to content

Commit 6883578

Browse files
committed
armbian: fix fcs960k-aic-bluez conflict with desktop bluez
Remove bluetooth and bluez-tools from PACKAGE_LIST_BOARD on both reComputer boards to prevent pulling standard bluez as a dependency. Improve the snapshot-diff-reinstall logic in common.inc: - Perform snapshot and diff entirely inside chroot to avoid pipe/process-substitution issues across chroot boundary - Only count packages with "ii" status to exclude rc/unpacked entries - Re-disable display managers after reinstalling gdm3 (its postinst re-enables display-manager.service, breaking first-login prompt) - Disable GDM auto-login in armbian-firstlogin (upstream's background sleep+sed approach is unreliable and gets killed)
1 parent e3c0167 commit 6883578

3 files changed

Lines changed: 50 additions & 7 deletions

File tree

config/boards/recomputer-rk3576-devkit.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ IMAGE_PARTITION_TABLE="gpt"
1818
OTA_ENABLE="yes"
1919
SERIALCON="ttyFIQ0,ttyGS0"
2020
BT_UART="/dev/ttyS4"
21-
PACKAGE_LIST_BOARD="net-tools rfkill bluetooth bluez-tools pulseaudio-module-bluetooth fail2ban"
21+
PACKAGE_LIST_BOARD="net-tools rfkill pulseaudio-module-bluetooth fail2ban"
2222
AIC8800_TYPE="sdio"
2323
enable_extension "radxa-aic8800"
2424

config/boards/recomputer-rk3588-devkit.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ IMAGE_PARTITION_TABLE="gpt"
1818
OTA_ENABLE="yes"
1919
SERIALCON="ttyFIQ0,ttyGS0"
2020
BT_UART="/dev/ttyS6"
21-
PACKAGE_LIST_BOARD="net-tools rfkill bluetooth bluez-tools pulseaudio-module-bluetooth fail2ban"
21+
PACKAGE_LIST_BOARD="net-tools rfkill pulseaudio-module-bluetooth fail2ban"
2222
AIC8800_TYPE="sdio"
2323
enable_extension "radxa-aic8800"
2424

config/sources/vendors/seeed-studio/recomputer-rk35xx-common.inc

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
5858
function 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.
7377
function 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
287330
if [[ "${ENABLE_SEEED_RK_EXTENSION}" == "yes" ]]; then
288331
if [[ ! -d "${SRC}/extensions/seeed_armbian_extension" ]]; then

0 commit comments

Comments
 (0)