Skip to content

desktops: replace legacy machinery with armbian-config module_desktops#9683

Draft
igorpecovnik wants to merge 16 commits intomainfrom
desktop-to-armbian-config
Draft

desktops: replace legacy machinery with armbian-config module_desktops#9683
igorpecovnik wants to merge 16 commits intomainfrom
desktop-to-armbian-config

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

@igorpecovnik igorpecovnik commented Apr 16, 2026

Summary

Replaces the entire build-time desktop machinery with armbian-config's YAML-driven module_desktops. Three commits:

1. build: clean up chroot environment + systemd disable noise

  • chroot_custom / chroot_custom_long_running: add LC_ALL="C" LANG="C" LANGUAGE="" SUDO_USER="" (parity with chroot_sdcard/chroot_mount).
  • disable_systemd_service_sdcard: use systemctl --root= to operate directly on the chroot filesystem instead of D-Bus. Output routed through display_alert at debug level — silent in normal builds, visible with DEBUG=yes.

2. desktops: delete legacy config tree + package builders

deleted lines
config/desktop/ (~229 files) ~10,400
artifact-armbian-desktop.sh + artifact-armbian-bsp-desktop.sh ~215
armbian-desktop-deb.sh + armbian-bsp-desktop-deb.sh ~128
rootfs-desktop.sh 33

3. desktops: wire armbian-config module_desktops into rootfs creation

New variable: DESKTOP_TIER (minimal/mid/full) replaces DESKTOP_ENVIRONMENT_CONFIG_NAME + DESKTOP_APPGROUPS_SELECTED.

Interactive menu: clones configng via fetch_from_repo, queries the standalone Python parser for DE list + tier selection. Tier dialog notes that tiers can be upgraded/downgraded at runtime via armbian-config.

Desktop install in rootfs-create.sh (before cache — desktop packages are cached):

chroot_sdcard "SUDO_USER= DEBIAN_FRONTEND=noninteractive DIALOG=read \
  armbian-config --api module_desktops install \
  de=${DESKTOP_ENVIRONMENT} tier=${DESKTOP_TIER:-mid} mode=build"

Plymouth artifact moved to rootfs-create.sh (before cache, before desktop install).

DM disable in distro-agnostic.sh (after cache restore — runs on every build including cache hits).

Rootfs cache hash includes DESKTOP_TIER + configng desktops HEAD commit hash — any change to YAML/parser/module code invalidates the cache.

Cleanup across 17 files: artifacts registry, aggregation pipeline, Python tools, CLI commands, action.yml, templates, library-functions.sh source lines.

Net effect

before after
config files ~229 0 (YAML in configng)
library files 5 0
build variables DESKTOP_ENVIRONMENT + CONFIG_NAME + APPGROUPS DESKTOP_ENVIRONMENT + DESKTOP_TIER
package install per-DE .deb via artifact system armbian-config --api module_desktops install
DE list source config/desktop/<release>/environments/ configng Python parser
desktop cached yes (in rootfs-create) yes (same position)

Test plan

  • Interactive: DE + tier selection from configng JSON
  • Non-interactive: BUILD_DESKTOP=yes DESKTOP_ENVIRONMENT=gnome DESKTOP_TIER=minimal
  • Desktop image boots with working DE
  • DMs disabled in rootfs, re-enabled by firstlogin
  • Build log clean of locale / systemd disable warnings
  • Cache hit: second build of same (board, release, DE, tier) reuses rootfs cache
  • Cache invalidation: configng desktops commit change → new cache

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5610a400-75d7-48f1-b241-ad3902ec6a9c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch desktop-to-armbian-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added 05 Milestone: Second quarter release size/large PR with 250 lines or more Desktop Graphical user interface Needs review Seeking for review Framework Framework components Documentation Documentation changes or additions labels Apr 16, 2026
igorpecovnik added a commit to armbian/documentation that referenced this pull request Apr 16, 2026
Adds the `mode=build` parameter to the command synopsis and the
install lifecycle table. Each step is now tagged:

  [B] = runs in both modes (build + runtime)
  [R] = runtime-only (skipped when mode=build)

Explains when/why mode=build is used (image-build time, no user)
and how the first boot inherits skel + graphical.target.

Matches armbian/configng#859 (implementation) and armbian/build#9683
(build framework consumer).
@igorpecovnik igorpecovnik force-pushed the desktop-to-armbian-config branch from ddbbcc0 to bda6655 Compare April 16, 2026 12:15
@igorpecovnik igorpecovnik changed the title desktops: replace legacy machinery with armbian-config module_desktops desktops: replace legacy machinery with armbian-config + silence build log noise Apr 16, 2026
@igorpecovnik igorpecovnik force-pushed the desktop-to-armbian-config branch 4 times, most recently from 9e10a14 to e7fbcdc Compare April 16, 2026 22:22
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@igorpecovnik igorpecovnik force-pushed the desktop-to-armbian-config branch 6 times, most recently from bef77d3 to f2b2344 Compare April 16, 2026 23:58
@igorpecovnik igorpecovnik changed the title desktops: replace legacy machinery with armbian-config + silence build log noise desktops: replace legacy machinery with armbian-config module_desktops Apr 16, 2026
@igorpecovnik igorpecovnik force-pushed the desktop-to-armbian-config branch from 4e957b7 to 8cefebb Compare April 17, 2026 09:38
@github-actions github-actions bot added the GitHub GitHub-related changes like labels, templates, ... label Apr 17, 2026
chroot_custom / chroot_custom_long_running: add LC_ALL="C" LANG="C"
LANGUAGE="" SUDO_USER="" (parity with chroot_sdcard/chroot_mount).

disable_systemd_service_sdcard: use systemctl --root= instead of
D-Bus; output at debug level only.
config/desktop/  (~229 files)
lib/functions/artifacts/artifact-armbian-{desktop,bsp-desktop}.sh
lib/functions/compilation/packages/armbian-desktop-deb.sh
lib/functions/bsp/armbian-bsp-desktop-deb.sh
lib/functions/rootfs/rootfs-desktop.sh
Interactive DE selection: clones configng, queries the Python
parser for JSON DE list + tier menu (no host armbian-config needed).

New DESKTOP_TIER variable replaces DESKTOP_ENVIRONMENT_CONFIG_NAME
and DESKTOP_APPGROUPS_SELECTED.

Desktop install in rootfs-create.sh (cached):
  chroot_sdcard "SUDO_USER= DEBIAN_FRONTEND=noninteractive
    DIALOG=read armbian-config --api module_desktops install
    de=$DE tier=$TIER mode=build"

Plymouth artifact moved to rootfs-create (before cache).
DM disable moved to distro-agnostic (after cache restore).
Rootfs hash tracks configng desktops HEAD commit.

Cleanup: artifacts registry, aggregation pipeline, Python tools,
CLI commands, action.yml, templates, library-functions.sh sources.
The configng API landed two orthogonal catalog filters: --filter
(computed availability) and --status (editorial status keep-list).
Push the EXPERT-mode policy server-side:

  default:   --status supported
  EXPERT:    --status supported,community

unsupported DEs are never offered from the build dialog — they're
vendor-specific (bianbu) and only reachable via armbian-config on a
running system, not baked into an image.

Also rename the JSON field probed by the inline python from the
old 'supported' to 'available' (the configng rename), and replace
the generic '[status]' label suffix with a '[CSC]' marker on
community DEs.
module_desktops install mode=build (invoked before the rootfs
cache is saved) already runs srv_disable for $DESKTOP_DM,
display-manager, and psd.service when mode=build. The cache is
therefore saved with DMs already disabled, so the post-cache
disable_systemd_service_sdcard calls in distro-agnostic.sh are
no-ops and can go.
When a userpatch or board config still sets the pre-tier
DESKTOP_APPGROUPS_SELECTED variable (office, multimedia,
programming, etc.) and hasn't explicitly chosen a DESKTOP_TIER,
auto-select tier=full — the old appgroup extras are the full
tier's package set — and emit a warning so the auto-choice is
visible in the log. Explicit DESKTOP_TIER values are preserved.
Promote per-package download/install progress to the default
mmdebstrap output. With DEBUG=yes escalate to --debug (superset
of --verbose) which also adds mmdebstrap's own debug messages
and bash xtrace on every --setup-hook / --customize-hook.
find_armbian_src_path() raised 'Can't find config/desktop' the moment
that directory went away, breaking userspace-inventory.py,
mapper-oci-uptodate.py, and download-debs.py at import time. Make
core_desktop_path optional (None when absent), short-circuit
get_desktop_inventory_for_distro to return [] in that case, and mark
the downstream desktop-target loop in targets-compositor.py with a
TODO pointing at the proper fix: invoke configng's
parse_desktop_yaml.py --list-json and translate its JSON into the
{id, support, arches} shape the compositor consumes.

Visible regression until the TODO is done: the desktop build matrix
emits no targets (CLI / minimal / cloud images still work).
…moval

Cleanups spotted while reviewing the desktop-to-armbian-config PR:

- .github/labeler.yml: drop the 'Desktop' label rule and the
  config/desktop/** exclusion from 'Hardware'; the path no longer
  exists so those globs never match.
- config/boards/olimex-som204-a20.eos, virtual-qemu.eos: remove
  PACKAGE_LIST_DESKTOP_BOARD (xinput-calibrator / spice-vdagent).
  Both boards are EOS and the variable has no consumer since the
  old desktop aggregation went away.
- lib/tools/info/targets-compositor.py: drop the dead
  appgroups_comma variable (never referenced).
- lib/tools/aggregation.py: prune several 'Desktop ... removed —
  armbian-config handles it now' tombstone comments; the git log
  already says what went and why.
- config/templates/targets-default.yaml: the comment claimed
  'Ubuntu LTS without appgroups / config_base', neither of which
  is accurate — update to reflect the actual sid + tier=mid
  vars on this target.
The quick fix in bd9bb71 left the desktop build matrix empty because
get_desktop_inventory_for_distro had no data source after config/desktop/
was deleted. Wire it up to armbian-configng's parse_desktop_yaml.py:

- find_armbian_src_path(): expose configng_yaml_dir and configng_parser
  (resolved from cache/sources/armbian-configng) instead of the dead
  core_desktop_path. Both are None when the cache is missing; callers
  already short-circuit on None.
- get_desktop_inventory_for_distro(): shell out to
  parse_desktop_yaml.py --list-json <release> amd64 --filter all,
  translate each JSON entry to the existing {id, support, arches}
  shape. Drop status: unsupported DEs (vendor-specific); keep
  status: supported and status: community.
- cli-jsoninfo.sh: fetch_from_repo armbian-configng before running
  userspace-inventory.py so the cache exists when Python reads it.
- targets-compositor.py: drop the now-obsolete TODO banner.

Smoke-tested with userspace-inventory.py against a populated cache:
noble returns 10 desktops (kde-neon, 6 supported DEs, 3 community);
trixie/bookworm 9 (no kde-neon, Ubuntu-only); sid/forky/jammy/resolute
7 (supported-only — community DEs don't declare those releases yet).
bianbu and xmonad correctly excluded under status: unsupported.
Tighten get_desktop_inventory_for_distro so only status: supported
DEs populate userspace["desktops"]. Community-status DEs (budgie,
deepin, enlightenment) stay installable interactively via the
EXPERT-mode dialog and explicitly via DESKTOP_ENVIRONMENT=..., but
shouldn't silently generate CI build targets by default — leave
that choice to whoever wires a custom targets.yaml.

After this change:
  noble    → 7 DEs (6 supported + kde-neon)
  trixie, bookworm, sid, forky, jammy, resolute → 6 first-tier DEs each
  EOS releases remain empty
Lets targets.yaml scope board-based inventory items by ARCH:

  items-from-inventory:
    not-eos-with-video:
      skip-arches: [loong64, riscv64]   # or only-arches: [arm64]

Stops the compositor from emitting combinations that compile.sh
will just reject downstream as 'target not supported' (e.g.
noble + uefi-loong64, because noble doesn't declare loong64 in
its architectures list). Cuts log noise and runner minutes.

Resolution of the board's ARCH:
- armbian_utils.armbian_parse_board_file_for_static_info already
  picks up any ARCH='…' line it finds in the board conf via the
  generic top-level var regex.
- armbian_get_all_boards_inventory now falls back to the board's
  BOARDFAMILY family conf (config/sources/families/<fam>.conf)
  for boards that don't carry an explicit ARCH. The family conf
  is bash-sourced in a throwaway subshell with an EXIT trap so
  ARCH is captured even when the family conf aborts mid-source
  on a ${FOO:?required} check (ls1046a, etc).
- Family-file results are cached per family.
- Five boards with unresolvable ARCH under the fallback get an
  explicit ARCH="arm64" declaration:
    aml-t95z-plus.tvb   (comment apostrophe breaks BOARDFAMILY regex)
    ayn-odin2mini.csc   (sources ayn-odin2.csc — parser doesn't follow)
    ayn-odin2portal.csc (ditto)
    ayn-thor.csc        (ditto)
    gateway-dk.conf     (family conf aborts before subshell captures ARCH)

All 367 boards now report ARCH; breakdown: arm64=272, armhf=76,
riscv64=15, amd64=3, loong64=1. Smoke-tested with a targets.yaml
carrying skip-arches: [loong64, riscv64] — compositor drops 17
entries cleanly, no leakage of filtered arches in final output.

userspace inventory has its own internal arch filtering via the
existing 'arches:' key and is not affected.
The backwards-compat path added in 74af496 auto-selects
tier=full whenever DESKTOP_APPGROUPS_SELECTED is non-empty — but
the legacy targets at armbian/os hardcode
DESKTOP_APPGROUPS_SELECTED="none" (the old sentinel for no
appgroups) on every matrix entry, so every existing CI run gets
bumped to tier=full instead of keeping the intended tier=mid
default. Treat "none" as empty so only a genuine appgroup
selection triggers the bump.
Restore the pre-branch install location for armbian-plymouth-theme:
post-cache in distro-agnostic.sh, alongside the 'if PLYMOUTH != yes
then apt-get remove plymouth' branch. That keeps both halves of the
PLYMOUTH toggle in one spot and stops straddling the rootfs-create
→ distro-agnostic boundary.

Previously moved to rootfs-create.sh (before the rootfs cache) so
that module_desktops install could apt-install armbian-plymouth-theme
from the just-populated apt source. The configng side is changing
in lockstep: when mode=build, module_desktops no longer tries to
install armbian-plymouth-theme — the build framework installs the
locally-built .deb artifact directly instead, here in
distro-agnostic.sh.
With the new armbian-config-driven desktop install path running
inside rootfs-create.sh (module_desktops install mode="build"),
the rootfs-build chroot needs apt.armbian.com's <release>-utils
and <release>-desktop components reachable: armbian-config itself
lives in -utils, and firefox / chromium / gnome-branded packages
live in -desktop. Forcing SKIP_ARMBIAN_REPO=yes at artifact-rootfs
time meant create_sources_list_and_deploy_repo_key renamed
armbian.sources to armbian.sources.disabled before the desktop
install ran, so every apt install for those packages 404'd and
the rootfs cache shipped without them.

Drop the force. Default is now "no" (repo enabled, components
still intentionally exclude 'main' at this stage — see
distro-specific.sh:295 — so armbian/build's own .debs don't
collide). Boards / userpatches that specifically want the
repo-free rootfs behaviour can still set SKIP_ARMBIAN_REPO=yes
explicitly, and the existing downstream readers (rootfs-image.sh,
distro-specific.sh, bcm2711.conf, change-tracking.sh) honour it
unchanged.

Also fix the inverted documentation in config/boards/README.md:
it claimed SKIP_ARMBIAN_REPO=yes meant "Include (default)" and
no meant "Do NO include", which is the opposite of what the
variable name and all readers in the codebase actually do.
@igorpecovnik igorpecovnik force-pushed the desktop-to-armbian-config branch from 4dfe80e to ca3f9e9 Compare April 18, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Desktop Graphical user interface Documentation Documentation changes or additions Framework Framework components GitHub GitHub-related changes like labels, templates, ... Needs review Seeking for review size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

1 participant