Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 92 additions & 2 deletions tools/json/config.system.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,39 @@
},
{
"id": "BIAN01",
"description": "Install Bianbu [CSC]",
"description": "Install Bianbu (minimal) [CSC]",
"short": "Bianbu [CSC]",
"command": [
"module_desktops install de=bianbu tier=minimal"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "! module_desktops installed && module_desktop_supported bianbu",
"help": "Install Bianbu — SpacemiT K1 RISC-V desktop (minimal tier: bare DE + K1 hardware enablement: img-gpu-powervr, k1x-vpu-firmware, spacemit-uart-bt, kernel modules, Mesa stack pinned to SpacemiT's archive for PVR DRI). riscv64 on noble/resolute only. [community-supported, best-effort]."
},
{
"id": "BIAN05",
"description": "Install Bianbu (mid) [CSC]",
"short": "Bianbu mid [CSC]",
"command": [
"module_desktops install de=bianbu tier=mid"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "! module_desktops installed && module_desktop_supported bianbu",
"help": "Install Bianbu — SpacemiT K1 RISC-V desktop (mid tier: full DE + standard utilities + K1 camera stack). riscv64 on noble/resolute only; uses SpacemiT's pinned archive (priority >1000 to override distro for K1-specific packages). [community-supported, best-effort]."
"help": "Install Bianbu (mid tier): minimal + full Bianbu desktop apps + standard utilities + K1 camera stack (k1x-cam). riscv64 on noble/resolute only. [community-supported, best-effort]."
},
{
"id": "BIAN06",
"description": "Install Bianbu (full) [CSC]",
"short": "Bianbu full [CSC]",
"command": [
"module_desktops install de=bianbu tier=full"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "! module_desktops installed && module_desktop_supported bianbu",
"help": "Install Bianbu (full tier): mid + Chinese locale (bianbu-desktop-zh) + development tooling (bianbu-development). riscv64 on noble/resolute only. [community-supported, best-effort]."
},
{
"id": "XFCE01",
Expand Down Expand Up @@ -408,6 +432,17 @@
"condition": "module_desktops status de=gnome",
"help": "Uninstall the GNOME desktop environment"
},
{
"id": "BIAN02",
"description": "Uninstall Bianbu",
"command": [
"module_desktops remove de=bianbu"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "module_desktops status de=bianbu",
"help": "Uninstall the Bianbu desktop environment"
},
{
"id": "MATE02",
"description": "Uninstall MATE",
Expand Down Expand Up @@ -518,6 +553,17 @@
"condition": "module_desktops status de=gnome && ! module_desktops login de=gnome",
"help": "Enable automatic desktop login for GNOME"
},
{
"id": "BIAN03",
"description": "Enable autologin (Bianbu)",
"command": [
"module_desktops auto de=bianbu"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "module_desktops status de=bianbu && ! module_desktops login de=bianbu",
"help": "Enable automatic desktop login for Bianbu"
},
{
"id": "MATE03",
"description": "Enable autologin (MATE)",
Expand Down Expand Up @@ -628,6 +674,17 @@
"condition": "module_desktops status de=gnome && module_desktops login de=gnome",
"help": "Disable automatic desktop login for GNOME"
},
{
"id": "BIAN04",
"description": "Disable autologin (Bianbu)",
"command": [
"module_desktops manual de=bianbu"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "module_desktops status de=bianbu && module_desktops login de=bianbu",
"help": "Disable automatic desktop login for Bianbu"
},
{
"id": "MATE04",
"description": "Disable autologin (MATE)",
Expand Down Expand Up @@ -760,6 +817,17 @@
"condition": "module_desktops status de=gnome && ! module_desktops at-tier de=gnome tier=minimal",
"help": "Downgrade GNOME to the minimal tier"
},
{
"id": "BIAN07",
"description": "Change Bianbu to minimal",
"command": [
"module_desktops set-tier de=bianbu tier=minimal"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "module_desktops status de=bianbu && ! module_desktops at-tier de=bianbu tier=minimal",
"help": "Downgrade Bianbu to the minimal tier (bare DE + K1 hardware enablement)"
},
{
"id": "GNME08",
"description": "Change GNOME to mid",
Expand All @@ -771,6 +839,17 @@
"condition": "module_desktops status de=gnome && ! module_desktops at-tier de=gnome tier=mid",
"help": "Move GNOME to the mid tier"
},
{
"id": "BIAN08",
"description": "Change Bianbu to mid",
"command": [
"module_desktops set-tier de=bianbu tier=mid"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "module_desktops status de=bianbu && ! module_desktops at-tier de=bianbu tier=mid",
"help": "Move Bianbu to the mid tier (full DE + standard utilities + K1 camera stack)"
},
{
"id": "GNME09",
"description": "Change GNOME to full",
Expand All @@ -782,6 +861,17 @@
"condition": "module_desktops status de=gnome && ! module_desktops at-tier de=gnome tier=full",
"help": "Upgrade GNOME to the full tier"
},
{
"id": "BIAN09",
"description": "Change Bianbu to full",
"command": [
"module_desktops set-tier de=bianbu tier=full"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "module_desktops status de=bianbu && ! module_desktops at-tier de=bianbu tier=full",
"help": "Upgrade Bianbu to the full tier (adds zh locale and development tooling)"
},
{
"id": "MATE07",
"description": "Change MATE to minimal",
Expand Down
30 changes: 25 additions & 5 deletions tools/modules/desktops/module_desktop_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,38 @@ function module_desktop_repo() {
return 1
fi

local origin_host_var pkgs_var origin_host pkgs
for (( i=0; i < DESKTOP_REPO_PREFS_COUNT; i++ )); do
origin_var="DESKTOP_REPO_PREFS_${i}_ORIGIN"
suite_var="DESKTOP_REPO_PREFS_${i}_SUITE"
origin_host_var="DESKTOP_REPO_PREFS_${i}_ORIGIN_HOST"
pkgs_var="DESKTOP_REPO_PREFS_${i}_PACKAGES"
prio_var="DESKTOP_REPO_PREFS_${i}_PRIORITY"
origin="${!origin_var}"
suite="${!suite_var}"
origin_host="${!origin_host_var}"
pkgs="${!pkgs_var}"
prio="${!prio_var}"
if ! printf 'Package: *\nPin: release o=%s, n=%s\nPin-Priority: %s\n\n' \
"$origin" "$suite" "$prio" >> "$pref_tmp"; then
echo "Error: failed to write preferences for ${de}" >&2
rm -f "$pref_tmp"
return 1
# Empty packages list means "every package": apt's
# Package: line wants a glob, never blank.
[[ -z "$pkgs" ]] && pkgs="*"
# The parser guarantees exactly one pin style is set,
# so origin_host non-empty selects the host form,
# everything else falls back to release o=,n=.
if [[ -n "$origin_host" ]]; then
if ! printf 'Package: %s\nPin: origin %s\nPin-Priority: %s\n\n' \
"$pkgs" "$origin_host" "$prio" >> "$pref_tmp"; then
echo "Error: failed to write preferences for ${de}" >&2
rm -f "$pref_tmp"
return 1
fi
else
if ! printf 'Package: %s\nPin: release o=%s, n=%s\nPin-Priority: %s\n\n' \
"$pkgs" "$origin" "$suite" "$prio" >> "$pref_tmp"; then
echo "Error: failed to write preferences for ${de}" >&2
rm -f "$pref_tmp"
return 1
fi
fi
done

Expand Down
48 changes: 41 additions & 7 deletions tools/modules/desktops/module_desktops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,44 @@ function _module_desktops_configure_networking() {
return 0
}

#
# Detect whether desktop $de is installed. Returns 0 if so, 1 otherwise.
# Layered to avoid the dpkg-only check misfiring when DEs share
# packages (e.g. Bianbu's bianbu-desktop-minimal-en depends on
# gnome-session, so a naive dpkg check would mark gnome as installed
# on a Bianbu-only system and surface a "Uninstall GNOME" entry that
# would actually nuke Bianbu's display stack).
#
# 1. /etc/armbian/desktop/<de>.tier exists → installed. The marker
# is written by `install` and removed by `remove`, so it tracks
# exactly what configng put on the system. Authoritative.
#
# 2. A different DE has its marker present → not installed. The
# other DE's marker is the tiebreaker against the dpkg fallback.
#
# 3. No markers anywhere AND dpkg shows DESKTOP_PRIMARY_PKG
# installed → legacy installs that pre-date the marker
# convention or were done with apt directly. Caller must have
# populated DESKTOP_PRIMARY_PKG via module_desktop_yamlparse.
#
function _module_desktops_is_installed() {
local de="$1"
[[ -n "$de" ]] || return 1
# Layer 1
if [[ -f "/etc/armbian/desktop/${de}.tier" ]]; then
return 0
fi
# Layer 2 — any other DE's marker means dpkg is unsafe
local m
for m in /etc/armbian/desktop/*.tier; do
[[ -f "$m" ]] || continue
return 1
done
# Layer 3 — legacy dpkg fallback
[[ -n "${DESKTOP_PRIMARY_PKG:-}" ]] || return 1
dpkg -l "$DESKTOP_PRIMARY_PKG" 2>/dev/null | grep -q "^ii"
}

#
# Module to install and manage desktop environments (YAML-driven)
#
Expand Down Expand Up @@ -875,10 +913,7 @@ function module_desktops() {
return 1
fi
module_desktop_yamlparse "$de" || return 1
if [[ -n "$DESKTOP_PRIMARY_PKG" ]] && dpkg -l "$DESKTOP_PRIMARY_PKG" 2>/dev/null | grep -q "^ii"; then
return 0
fi
return 1
_module_desktops_is_installed "$de"
;;

"${commands[5]}")
Expand Down Expand Up @@ -1107,7 +1142,7 @@ function module_desktops() {
return 1
fi
module_desktop_yamlparse "$de" || return 1
if [[ -n "$DESKTOP_PRIMARY_PKG" ]] && dpkg -l "$DESKTOP_PRIMARY_PKG" 2>/dev/null | grep -q "^ii"; then
if _module_desktops_is_installed "$de"; then
if [[ -f "/etc/armbian/desktop/${de}.tier" ]]; then
cat "/etc/armbian/desktop/${de}.tier"
else
Expand All @@ -1131,8 +1166,7 @@ function module_desktops() {
return 1
fi
module_desktop_yamlparse "$de" || return 1
[[ -n "$DESKTOP_PRIMARY_PKG" ]] || return 1
dpkg -l "$DESKTOP_PRIMARY_PKG" 2>/dev/null | grep -q "^ii" || return 1
_module_desktops_is_installed "$de" || return 1
local current="minimal"
[[ -f "/etc/armbian/desktop/${de}.tier" ]] && current=$(< "/etc/armbian/desktop/${de}.tier")
[[ "$current" == "$tier" ]]
Expand Down
42 changes: 42 additions & 0 deletions tools/modules/desktops/postinst/bianbu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
set +e
# Bianbu is a GNOME variant (gdm3 / GNOME Shell). Branding is much
# narrower than the stock GNOME postinst — Bianbu ships its own
# opinionated favorites, theme, and panel config from SpacemiT, and
# we want to leave those alone. The only piece we override is the
# wallpaper, so an installed image actually looks like Armbian.
#
# picture-uri-dark is set explicitly because Bianbu defaults to dark
# mode under GNOME 46; without it the override only takes effect in
# light mode and the user keeps seeing Bianbu's stock background.

keys=/etc/dconf/db/local.d/00-bg
profile=/etc/dconf/profile/user

install -Dv /dev/null "$keys"
install -Dv /dev/null "$profile"

cat >> "$keys" <<- EOF

[org/gnome/desktop/background]
picture-uri='file:///usr/share/backgrounds/armbian/armbian03-Dre0x-Minum-dark-3840x2160.jpg'
picture-uri-dark='file:///usr/share/backgrounds/armbian/armbian03-Dre0x-Minum-dark-3840x2160.jpg'
picture-options='zoom'
primary-color='#456789'
secondary-color='#FFFFFF'

[org/gnome/desktop/screensaver]
picture-uri='file:///usr/share/backgrounds/armbian/armbian03-Dre0x-Minum-dark-3840x2160.jpg'
picture-options='zoom'
primary-color='#456789'
secondary-color='#FFFFFF'
EOF

echo "user-db:user
system-db:local" >> "$profile"

dconf update

if [ -d /usr/share/glib-2.0/schemas ]; then
glib-compile-schemas /usr/share/glib-2.0/schemas
fi
Loading