Skip to content

build: misc cleanup — DEBUG-gated mmdebstrap verbosity, DOCKER_PRUNE opt-in, disable broken drm/xe patches#9704

Open
igorpecovnik wants to merge 3 commits intomainfrom
misc-build-cleanup
Open

build: misc cleanup — DEBUG-gated mmdebstrap verbosity, DOCKER_PRUNE opt-in, disable broken drm/xe patches#9704
igorpecovnik wants to merge 3 commits intomainfrom
misc-build-cleanup

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

@igorpecovnik igorpecovnik commented Apr 20, 2026

Summary

Three small, independent build-framework fixes that were originally riding on top of the larger desktops → armbian-config module_desktops migration (#9683) but have nothing to do with desktop. Split out here for cleaner review and to let them land on their own schedule.

Commits

  1. rootfs-create: add --verbose to mmdebstrap when DEBUG=yes
    mmdebstrap setup failures land in build logs as a one-line E: setup failed with no context about which dep resolution actually blew up (recent example: sid/loong64 gnupg2 >= 2.4.9-4 vs dirmngr 2.4.8-4 port-sync skew). Pass --verbose to mmdebstrap when the user has already opted into DEBUG=yes, so the solver + per-package download lines become visible in the build log. Default builds (DEBUG unset) keep the terse log — no behaviour change for anyone who hasn't asked for it.

  2. docker: gate image cleanup behind DOCKER_PRUNE=yes (default off)
    docker_cli_prepare() called docker_cleanup_old_images unconditionally, which enumerates docker images and rmi's old armbian tags. Broken on hosts where several build framework invocations share one dockerd — the usual setup when multiple self-hosted GH Actions runners live on the same machine. Two concurrent invocations race: runner A's cleanup fires docker rmi <id> on a tag runner B just committed between Successfully built <sha> and dockerd writing the imagedb digest file. B aborts with failed to get digest sha256:…: no such file or directory. Default-off makes shared-daemon setups safe out of the box; users flip DOCKER_PRUNE=yes for the old behaviour.

  3. patch: disable drm/xe patches that don't apply to current kernels (@amazingfate )
    Rename two drm/xe kernel patches under patch/kernel/archive/uefi-loong64-7.0/ to .patch.NEED_FIX so the patch driver skips them. Both broke on a recent upstream rebase and need maintainer attention. Not a behaviour change — patches were already failing apply — but stops the noise in build logs and makes it obvious at a glance which patches need refreshing.

Relationship to #9683

#9683 was originally 10 commits spanning the desktop migration plus these three miscellaneous fixes. Splitting these out leaves #9683 focused on the single storyline of replacing config/desktop/ with armbian-config's module_desktops. This PR (3 commits) can land on its own schedule — none of the three is a prerequisite for #9683 and vice-versa.

Test plan

  • Default build (./compile.sh …) has no mmdebstrap output change vs main — terse log as before.
  • DEBUG=yes ./compile.sh … shows mmdebstrap's per-package solver + download progress (visible failure context for bootstrap issues).
  • On a multi-runner self-hosted host running parallel ./compile.sh jobs with the default DOCKER_PRUNE unset: no failed to get digest errors.
  • DOCKER_PRUNE=yes ./compile.sh behaves as before (cleanup runs).
  • Kernel build on a board pinned to uefi-loong64-7.0 skips the .NEED_FIX patches without erroring.

Summary by CodeRabbit

  • Behavioral Changes
    • Docker image cleanup is now opt-in via DOCKER_PRUNE (disabled by default); when disabled, the system skips cleanup and provides guidance to enable it.
    • Root filesystem creation increases command logging when DEBUG=yes to provide more verbose output; otherwise it runs with the standard logging level.

@igorpecovnik igorpecovnik requested review from a team and amazingfate as code owners April 20, 2026 13:31
@igorpecovnik igorpecovnik requested review from iav and rpardini and removed request for a team April 20, 2026 13:31
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 20, 2026

📝 Walkthrough

Walkthrough

Docker image cleanup in docker_cli_prepare() is now opt-in via the DOCKER_PRUNE environment variable (cleanup runs only when DOCKER_PRUNE=yes); otherwise a debug alert is emitted. In rootfs creation, debootstrap_arguments are conditionally appended with --verbose when DEBUG=yes; otherwise the argument list is left unchanged.

Changes

Cohort / File(s) Summary
Docker Cleanup Configuration
lib/functions/host/docker.sh
docker_cli_prepare() no longer always runs docker_cleanup_old_images; it runs cleanup only when DOCKER_PRUNE=yes. If disabled, emits a debug display_alert advising to set DOCKER_PRUNE=yes.
Rootfs Verbosity Flag
lib/functions/rootfs/rootfs-create.sh
create_new_rootfs_cache_via_debootstrap() conditionally appends --verbose to debootstrap_arguments when DEBUG=yes; otherwise leaves the arguments unchanged (no --debug insertion).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble through scripts with a twitchy nose,
Prune on request where the tidy wind blows.
Verbose in debug, quiet when shy,
Hopping through flags with a gleam in my eye. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title references multiple changes (mmdebstrap verbosity, DOCKER_PRUNE opt-in, drm/xe patches) but only covers two of three objectives; it is partially related to the changeset but omits the kernel patch renaming component mentioned in objectives.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch misc-build-cleanup

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/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Framework Framework components Patches Patches related to kernel, U-Boot, ... labels Apr 20, 2026
mmdebstrap setup failures land in build logs as a one-line
'E: setup failed' with no context about which dep resolution
actually blew up (recent example: sid/loong64 gnupg2 >= 2.4.9-4
vs dirmngr 2.4.8-4 port-sync skew).

Pass --verbose to mmdebstrap when the user has already opted into
DEBUG=yes. That surfaces apt's per-package solver + download work
so the failing line is visible in the build log without a dedicated
DEBUG rebuild.

Default builds (DEBUG unset) keep the terse log as before — no
mmdebstrap output change for anyone who hasn't asked for it.
docker_cli_prepare() called docker_cleanup_old_images
unconditionally, which enumerates 'docker images' and rmi's old
armbian tags. Fine on a single-daemon workstation; broken on
hosts where several build framework invocations share one
dockerd — the usual setup when multiple self-hosted GH Actions
runners live on the same machine.

Two concurrent invocations race: runner A's cleanup fires
'docker rmi <id>' on a tag runner B just committed between
'Successfully built <sha>' and dockerd writing the imagedb
digest file. B's build then aborts with:

  Successfully built ed6bcbe445e6
  failed to get digest sha256:ed6bcbe445e6…:
    open /var/lib/docker/image/overlay2/imagedb/content/sha256/…:
    no such file or directory

Make the cleanup opt-in via DOCKER_PRUNE=yes. Default-off keeps
shared-daemon setups safe out of the box; single-host users who
want automatic disk reclaim flip the flag and either accept the
race risk or serialise their builds.

No behaviour change for users who add DOCKER_PRUNE=yes — same
codepath runs. Only the default changes.
…EDS FIXING)

Rename two .patch files to .patch.NEED_FIX so the patch driver
skips them on apply. Both are drm/xe kernel patches that stopped
applying cleanly after an upstream rebase and haven't been
refreshed yet:

  - 0002-drm-xe-guc-use-GUC_SIZE-SZ_4K-for-alignment.patch
  - 0005-drm-xe-query-use-PAGE_SIZE-as-the-minimum-page-align.patch

Kernels that were picking these up need them re-based against
current upstream drm/xe before re-enabling. Not a behaviour
change on its own — the patches were already failing the apply
step — but stops the noise in build logs and makes it obvious
at a glance which patches need maintainer attention.
@igorpecovnik igorpecovnik changed the title build: misc cleanup — verbose mmdebstrap, DOCKER_PRUNE opt-in, disable broken drm/xe patches build: misc cleanup — DEBUG-gated mmdebstrap verbosity, DOCKER_PRUNE opt-in, disable broken drm/xe patches Apr 20, 2026
@igorpecovnik igorpecovnik removed request for iav and rpardini April 20, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Framework Framework components Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

1 participant