desktops/bianbu: enable PVR DRI, fix detection, add menu entries#897
Conversation
WalkthroughRewrites the desktop repo APT pinning to support host-based pins by replacing multiple suite/origin entries with a single Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tools/modules/desktops/yaml/bianbu.yaml`:
- Around line 18-27: Update the preferences list in the YAML so the suite values
exactly match the Release "Suite:" fields instead of the short names; replace
entries that use "noble", "noble-porting", and "noble-updates" with the full
suite strings (e.g. "noble/snapshots/v2.3", "noble-porting/snapshots/v2.3",
"noble-updates/snapshots/v2.3" or the correct vX.Y for this file), add the
missing suite entries referenced in Release files
("noble-security/snapshots/v2.3", "noble-customization/snapshots/v2.3",
"bianbu-v2.3-updates") and also add the corresponding resolute suite entries
(prepare resolute equivalents declared in this YAML) so that the preferences ->
- origin/ suite / priority blocks match the exact Suite values used by APT
pinning.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d51f8173-ff97-45be-9ea6-849094251fdc
📒 Files selected for processing (1)
tools/modules/desktops/yaml/bianbu.yaml
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tools/modules/desktops/scripts/parse_desktop_yaml.py`:
- Around line 434-454: The current code appends a repo preference even when
raw_packages was provided but results in an empty/invalid packages list, causing
a fallback to "Package: *"; modify the block handling raw_packages so that after
building packages via _as_list and filtering with _PKG_RE you check if
raw_packages is not None and packages is empty, then emit a warning (including
de_name and the raw value) and skip adding the tuple to valid_prefs instead of
appending an empty " ". Keep the existing behavior when raw_packages is None
(i.e., allow adding the entry with an empty packages field), and reference the
variables/functions in this change: raw_packages, _as_list, _PKG_RE, packages,
de_name, valid_prefs, uses_release_pin, uses_host_pin, origin, suite,
origin_host, priority.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c4f6ac12-4766-420b-a72c-501cb84814d6
📒 Files selected for processing (4)
tools/modules/desktops/module_desktop_repo.shtools/modules/desktops/postinst/bianbu.shtools/modules/desktops/scripts/parse_desktop_yaml.pytools/modules/desktops/yaml/bianbu.yaml
✅ Files skipped from review due to trivial changes (1)
- tools/modules/desktops/postinst/bianbu.sh
The existing schema only supported broad archive pins of the form
Package: *
Pin: release o=<origin>, n=<suite>
Pin-Priority: <prio>
which requires the upstream Release file's `Suite:` field to remain
stable. Some archives (e.g. Bianbu) set `Suite:` to the full snapshot
path, which changes on every snapshot bump, so a release-form pin
goes stale on every upstream rev.
Add two optional fields per preferences entry:
packages: a list of package names or apt globs ("libdrm*"),
joined into the rendered `Package:` line. When omitted,
the stanza still applies to `*`. When provided but
every name fails validation, the entry is dropped with
a warning instead of silently widening to `*`.
origin_host: when present, render `Pin: origin <host>` (matches
archive hostname) instead of the release form.
Mutually exclusive with origin+suite.
The parser validates that exactly one pin style is present per entry
and rejects malformed entries with a warning (priority remains a
strict positive int; bools are still rejected up-front because
`isinstance(True, int)` is True). The renderer in
module_desktop_repo.sh branches on `origin_host` to pick the right
`Pin:` line; an empty packages list falls back to `*` so existing
release-form pins keep their previous output verbatim.
GNOME Shell on the SpacemiT K1 reaches the GPU via libEGL → Mesa DRI → img-gpu-powervr, but the img-gpu-powervr package only ships the PVR user-space libs. Without a Mesa build that contains the matching PVR DRI backend, the EGL/DRI hand-off fails and the desktop won't render. Two changes against bianbu.yaml so apt resolves the Mesa stack to Bianbu's 24.01bbx fork (which carries the PVR DRI backend) instead of the upstream Mesa in the distro archive: 1. Add the explicit Mesa runtime libs to the minimal tier so the meta-package's deps don't have to pull them in by accident: libegl-mesa0, libglapi-mesa, libgbm1, libgl1-mesa-dri, libglx-mesa0, mesa-vulkan-drivers. 2. Add a per-package APT pin against `archive.spacemit.com` (using the schema added in the previous commit). Glob patterns cover the runtime libs and their `-dev` counterparts so Mesa's strict `=`-version inter-deps stay coherent — the explicit-name attempts that came earlier on this branch broke `libgbm-dev` against the distro `libgbm1` because the runtime was pinned but `-dev` was not. The host-form pin also avoids the `Suite:` chase that bit earlier iterations of this work (Bianbu's Release files set `Suite:` to the full snapshot path, which changes on every bump). Resolute is intentionally not pinned: archive.spacemit.com has no resolute*/snapshots/v3.0/ at all, only resolute-customization and resolute-porting at v4.0betaN. The YAML's resolute release block is stale and would need a separate fix. Tested against the live Packages.gz at archive.spacemit.com/bianbu/dists/noble/snapshots/v2.3/main/binary-riscv64/ to confirm Bianbu ships the matching `-dev` variants of every glob.
The branding step looks for postinst/<de>.sh and runs it after the shared branding assets are deployed (module_desktop_branding.sh:135). There was no bianbu.sh, so installs went out the door wearing Bianbu's stock background instead of the Armbian one. Add a minimal postinst that writes the dconf override for the GNOME background and screensaver. Deliberately does *not* mirror gnome.sh wholesale: that script also overrides favorite-apps, power-saving, and a gnome-ubuntu-panel cleanup that are stock-Armbian-GNOME specific. Bianbu ships its own opinionated favorites and theme from SpacemiT, so we only override the wallpaper here. 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.
b8d4b3a to
0e53adb
Compare
`module_desktops status de=<X>` is the gate every Desktops submenu
entry runs to decide whether to show its "Uninstall / Disable login /
Change tier" actions. The check was a plain
`dpkg -l "$DESKTOP_PRIMARY_PKG" | grep ^ii`, which misfires whenever
two desktops share a primary-tier package — most notably on a Bianbu
install, where bianbu-desktop-minimal-en pulls gnome-session as a
dependency. The Desktops menu would then offer "Uninstall GNOME" and
"Change GNOME to full" while the actual installed DE is Bianbu, and
clicking them would tear down packages Bianbu owns.
Three coupled changes, since fixing detection without also rounding
out the Bianbu menu would leave a Bianbu user with an empty submenu
and only a single mid-tier install entry where every other DE
exposes minimal/mid/full:
1. Introduce _module_desktops_is_installed and route the three
status callers (status, tier, at-tier) through it. Three layers,
falling through in order:
a. /etc/armbian/desktop/<de>.tier exists → installed.
Authoritative because install/remove maintain the marker.
b. A different DE has its marker present → not installed. The
other DE's marker is the tiebreaker against the dpkg
fallback when desktops share packages.
c. No markers anywhere AND DESKTOP_PRIMARY_PKG is dpkg-installed
→ legacy installs that pre-date the marker convention or
were done with apt directly.
2. Add the standard six management entries for Bianbu in
config.system.json (Uninstall, autologin on/off, tier
minimal/mid/full), gated on `module_desktops status de=bianbu`,
so the submenu has actual options once the GNOME entries
correctly hide. IDs allocated as BIAN02/03/04/07/08/09 to match
the slot numbers used by the other DEs.
3. Bring Bianbu's install entries in line with the rest of the menu:
BIAN01 was the only Bianbu install slot and was misnamed —
labelled "Install Bianbu" with tier=mid, where every other DE's
slot 01 is minimal. Repoint BIAN01 to tier=minimal and add BIAN05
(mid) and BIAN06 (full) so the user sees the full minimal/mid/full
choice on a clean install instead of just one entry.
0e53adb to
eca7fb0
Compare
Emit a `desktop-stable-ubuntu-riscv64-bianbu` target alongside the existing XFCE one, scoped to legacy-branch riscv64 boards only and pinned to the noble release. Why so narrow: - Bianbu's PVR DRI userspace is built against the SpacemiT BSP kernel that lives on the legacy branch — current/edge kernels won't have a matching DRI driver, so a Bianbu image on those branches would boot to llvmpipe at best. - archive.spacemit.com only ships SpacemiT's Mesa fork (the 24.01bbx build with the PVR DRI backend, pinned via configng's bianbu.yaml, see armbian/configng#897) for noble snapshots. The resolute archive has no matching snapshots yet — only resolute-customization and resolute-porting at v4.0betaN exist server-side, with no resolute* base. So `RELEASE: noble` is hardcoded literal here, not the substitutable `UBUNTU` token, otherwise the release-targets-promote-resolute-to-stable flag flip on the parent branch would silently retarget Bianbu at a release that can't build. Tier=mid because bianbu-minimal is intentionally bare-bones (DE meta + K1 hardware enablement only); mid adds the full Bianbu desktop + camera stack, which is what users picking a Bianbu image expect. Items reference *stable-legacy-riscv64 (already defined upstream when legacy_riscv64 is non-empty), so the same gate applies and the block is skipped on builds with no legacy riscv64 boards.
Emit a `desktop-stable-ubuntu-riscv64-bianbu` target alongside the existing XFCE one, scoped to legacy-branch riscv64 boards only and pinned to the noble release. Why so narrow: - Bianbu's PVR DRI userspace is built against the SpacemiT BSP kernel that lives on the legacy branch — current/edge kernels won't have a matching DRI driver, so a Bianbu image on those branches would boot to llvmpipe at best. - archive.spacemit.com only ships SpacemiT's Mesa fork (the 24.01bbx build with the PVR DRI backend, pinned via configng's bianbu.yaml, see armbian/configng#897) for noble snapshots. The resolute archive has no matching snapshots yet — only resolute-customization and resolute-porting at v4.0betaN exist server-side, with no resolute* base. So `RELEASE: noble` is hardcoded literal here, not the substitutable `UBUNTU` token, otherwise the release-targets-promote-resolute-to-stable flag flip on the parent branch would silently retarget Bianbu at a release that can't build. Tier=mid because bianbu-minimal is intentionally bare-bones (DE meta + K1 hardware enablement only); mid adds the full Bianbu desktop + camera stack, which is what users picking a Bianbu image expect. Items reference *stable-legacy-riscv64 (already defined upstream when legacy_riscv64 is non-empty), so the same gate applies and the block is skipped on builds with no legacy riscv64 boards.
generate_exposed_map() picks the (release, branch, suffix) tuple
algorithmically — riscv64 → xfce_desktop, fast video → gnome,
slow video → xfce, headless → ubuntu minimal, loongarch → no
desktop pattern. When a vendor BSP is tied to a combination outside
the algorithmic default — e.g. SpacemiT K1 boards on noble/legacy
with Bianbu desktop, where archive.spacemit.com only ships the PVR
DRI Mesa fork (24.01bbx) for noble and the matching kernel BSP
lives on the legacy branch — the algorithm picks the wrong target
and "recommended images" point at images that never get built.
Add a sidecar release-targets/exposed.map.overrides.yaml whose
entries can redirect either of the two regex patterns
generate_exposed_map emits per board:
overrides:
- boardfamily: <name> # OR boards: [b1, b2, ...]
minimal: # pattern 1 override
release: <codename>
branch: <branch>
suffix: <token> # default "minimal"
desktop: # pattern 2 override
release: <codename>
branch: <branch>
suffix: <token> # full literal tail, e.g. bianbu_desktop
Either inner block may be omitted to leave that pattern at its
algorithmic default. Inside each block, every field is optional
and falls through.
A per-board entry overlays a boardfamily entry block-by-block, then
field-by-field. A per-board entry that sets only `minimal:` keeps
the family's `desktop:` block intact; a per-board
`desktop: {suffix: x}` keeps the family's
`desktop.{release, branch}` while replacing only `suffix`. Use this
to carve a partial exception out of a boardfamily rule without
repeating its other blocks.
First-shipped overrides:
* spacemit boardfamily → minimal=noble/legacy,
desktop=noble/legacy/bianbu_desktop. Matches the build target
`desktop-stable-ubuntu-riscv64-bianbu` (added in a separate
commit) and the configng pinning of Bianbu's Mesa fork
(armbian/configng#897).
* bananapif3 + musepipro per-board overlay → minimal=trixie/current
(those two boards do ship a current-branch trixie minimal
alongside the noble/legacy desktop), desktop unchanged from the
family entry via the overlay merge.
Loader is regex-only (no bash sourcing); cycles in source-via-yaml
references are guarded by a visited set; malformed entries (no
match key, non-mapping inner blocks, unknown top-level keys) are
dropped with a warning so a typo can't silently rewrite the
recommended-image set for every board in the world.
Emit a `desktop-stable-ubuntu-riscv64-bianbu` target alongside the existing XFCE one, scoped to legacy-branch riscv64 boards only and pinned to the noble release. Why so narrow: - Bianbu's PVR DRI userspace is built against the SpacemiT BSP kernel that lives on the legacy branch — current/edge kernels won't have a matching DRI driver, so a Bianbu image on those branches would boot to llvmpipe at best. - archive.spacemit.com only ships SpacemiT's Mesa fork (the 24.01bbx build with the PVR DRI backend, pinned via configng's bianbu.yaml, see armbian/configng#897) for noble snapshots. The resolute archive has no matching snapshots yet — only resolute-customization and resolute-porting at v4.0betaN exist server-side, with no resolute* base. So `RELEASE: noble` is hardcoded literal here, not the substitutable `UBUNTU` token, otherwise the release-targets-promote-resolute-to-stable flag flip on the parent branch would silently retarget Bianbu at a release that can't build. Tier=mid because bianbu-minimal is intentionally bare-bones (DE meta + K1 hardware enablement only); mid adds the full Bianbu desktop + camera stack, which is what users picking a Bianbu image expect. Items reference *stable-legacy-riscv64 (already defined upstream when legacy_riscv64 is non-empty), so the same gate applies and the block is skipped on builds with no legacy riscv64 boards.
generate_exposed_map() picks the (release, branch, suffix) tuple
algorithmically — riscv64 → xfce_desktop, fast video → gnome,
slow video → xfce, headless → ubuntu minimal, loongarch → no
desktop pattern. When a vendor BSP is tied to a combination outside
the algorithmic default — e.g. SpacemiT K1 boards on noble/legacy
with Bianbu desktop, where archive.spacemit.com only ships the PVR
DRI Mesa fork (24.01bbx) for noble and the matching kernel BSP
lives on the legacy branch — the algorithm picks the wrong target
and "recommended images" point at images that never get built.
Add a sidecar release-targets/exposed.map.overrides.yaml whose
entries can redirect either of the two regex patterns
generate_exposed_map emits per board:
overrides:
- boardfamily: <name> # OR boards: [b1, b2, ...]
minimal: # pattern 1 override
release: <codename>
branch: <branch>
suffix: <token> # default "minimal"
desktop: # pattern 2 override
release: <codename>
branch: <branch>
suffix: <token> # full literal tail, e.g. bianbu_desktop
Either inner block may be omitted to leave that pattern at its
algorithmic default. Inside each block, every field is optional
and falls through.
A per-board entry overlays a boardfamily entry block-by-block, then
field-by-field. A per-board entry that sets only `minimal:` keeps
the family's `desktop:` block intact; a per-board
`desktop: {suffix: x}` keeps the family's
`desktop.{release, branch}` while replacing only `suffix`. Use this
to carve a partial exception out of a boardfamily rule without
repeating its other blocks.
First-shipped overrides:
* spacemit boardfamily → minimal=noble/legacy,
desktop=noble/legacy/bianbu_desktop. Matches the build target
`desktop-stable-ubuntu-riscv64-bianbu` (added in a separate
commit) and the configng pinning of Bianbu's Mesa fork
(armbian/configng#897).
* bananapif3 + musepipro per-board overlay → minimal=trixie/current
(those two boards do ship a current-branch trixie minimal
alongside the noble/legacy desktop), desktop unchanged from the
family entry via the overlay merge.
Loader is regex-only (no bash sourcing); cycles in source-via-yaml
references are guarded by a visited set; malformed entries (no
match key, non-mapping inner blocks, unknown top-level keys) are
dropped with a warning so a typo can't silently rewrite the
recommended-image set for every board in the world.
Summary
Make the Bianbu desktop on the SpacemiT K1 actually work end-to-end. Four logical commits:
repo.preferenceslearns per-package + host-based pinning.Why each piece exists
1. Schema: per-package + host-based pinning
repo.preferencespreviously only spoke release-form pins (Pin: release o=<origin>, n=<suite>), which require the upstream Release file'sSuite:field to be stable. Bianbu setsSuite:to the full snapshot path (noble/snapshots/v2.3), so a release-form pin would go stale on every snapshot bump. Earlier iterations on this branch chased that target throughmantic-*→noble→noble/snapshots/v2.3and ran into exactly that problem.Two new optional fields per entry:
packages:libdrm*). Joined into thePackage:line. Omitted → applies to*. Provided-but-all-invalid → entry dropped with a warning (no silent widening to*).origin_host:Pin: origin <host>. Mutually exclusive withorigin:+suite:.Existing release-form pins (any other DE YAML, currently none) render unchanged.
2. Bianbu Mesa pinning
img-gpu-powervronly ships PVR user-space libs. GNOME Shell reaches the GPU via:The middle hop needs a Mesa build that carries the PVR DRI backend. The upstream Mesa in the distro archive does not — Bianbu's
24.01bbxfork does. Without it, the EGL/DRI hand-off fails and the desktop won't come up.Two changes to bianbu.yaml:
archive.spacemit.comusing the new schema. Glob patterns cover the runtime libs and their-devcounterparts — the explicit-name attempts that came earlier on this branch brokelibgbm-devagainst the distrolibgbm1because the runtime was pinned but-devwas not. Mesa's strict=-version inter-deps need both sides to come from the same archive.Verified against
archive.spacemit.com/bianbu/dists/noble/snapshots/v2.3/main/binary-riscv64/Packages.gzthat Bianbu ships matching-devvariants of every glob.Out of scope: the YAML's
resoluterelease block is stale — the archive has noresolute*/snapshots/v3.0/at all (onlyresolute-customizationandresolute-portingatv4.0betaN). That's a separate fix; this PR pins only the noble side.3. Bianbu wallpaper
The branding step looks for
postinst/<de>.shand runs it. There was nobianbu.sh, so installs went out wearing Bianbu's stock background. Newpostinst/bianbu.shwrites the dconf override for the GNOME background and screensaver — minimal scope on purpose: Bianbu ships its own opinionated favorites/theme/panel from SpacemiT and we leave those alone.picture-uri-darkis set explicitly because Bianbu defaults to dark mode under GNOME 46.4. DE-detection fix + Bianbu menu entries
module_desktops status de=<X>is the gate every Desktops submenu entry runs in itsconditionfield. The old check was a plaindpkg -l "$DESKTOP_PRIMARY_PKG" | grep ^ii, which misfires whenever two desktops share a primary-tier package — exactly the case here, since Bianbu'sbianbu-desktop-minimal-enpullsgnome-sessionas a dependency. The Desktops menu would offer "Uninstall GNOME" and "Change GNOME to full" while the installed DE was actually Bianbu, and clicking them would tear down packages Bianbu owns.Three coupled changes (the fix alone leaves the user with an empty submenu and a single mid-tier install entry):
_module_desktops_is_installedroutes through three layers:/etc/armbian/desktop/<de>.tierexists → installed (authoritative; written byinstall, removed byremove).DESKTOP_PRIMARY_PKGis dpkg-installed → legacy fallback for installs done before the marker convention or via apt directly.config.system.json(BIAN02Uninstall,BIAN03/04autologin on/off,BIAN07/08/09change-tier minimal/mid/full) following the GNOME pattern.BIAN01was the only Bianbu install entry and was misnamed — labelled "Install Bianbu" withtier=mid, where every other DE's slot 01 isminimal. RepointedBIAN01totier=minimaland addedBIAN05(mid) andBIAN06(full) so a clean-install user sees the full minimal/mid/full choice on the install menu instead of a single ambiguous entry.Test plan
midtier and boot on a SpacemiT K1 board.apt-cache policy libgl1-mesa-drishows priority 1001 againstarchive.spacemit.com.apt-cache policy libgbm-devmatcheslibgbm1versions (no-dev↔ runtime split).armbian-config→ System → Desktops shows three Bianbu install entries (minimal / mid / full).armbian-config→ System → Desktops shows Bianbu management entries (Uninstall, autologin, tier change) and no GNOME entries.dconf dump /org/gnome/desktop/background/).History
This branch went through several dead-ends (chasing
Suite:strings, partial-pin dep collisions). Earlier exploratory commits have been squashed into the four logical changes above; the messy iteration is preserved in the PR's force-push history if anyone wants the trail.