Per-profile user DT overlay drop-ins (/etc/kernel/dtbo) + add-dtbo#113
Open
Yury-MonZon wants to merge 3 commits into
Open
Per-profile user DT overlay drop-ins (/etc/kernel/dtbo) + add-dtbo#113Yury-MonZon wants to merge 3 commits into
Yury-MonZon wants to merge 3 commits into
Conversation
Apply every *.dtbo a user drops in a profile's /etc/kernel/dtbo/ to that profile's BLS entries. emit_entry merges them (subvol-prefixed, after the profile-declared overlays) into the devicetree-overlay line; flipper_write_entry scans the target root so clones pick up their own. Silent when the dir is empty.
U-Boot's btrfs driver can't decompress inline zstd extents, so small zstd-compressed .dtbo overlays fail to load (zstd_decompress error 70). On every kernel-install add, set the kernel rockchip/ DT dir and /etc/kernel/dtbo to compression=none and rewrite the flipper base .dtb + overlays uncompressed (property alone only affects future writes). Covers build-time and future/runtime kernel installs; clones inherit via COW. Also create /etc/kernel/dtbo compression=none in the image build, before @Minimal_stock is snapshotted, so every profile root carries the property via COW even ahead of the kernel-install hook.
flipper-bls.sh: dt_overlay_line (+profile-only) shared by emit_entry and the new flipper_rewrite_overlay; add-dtbo (--list/--clear/--all-kernels, or copy FILE.dtbo) rewrites only the booted profile+kernel entry's devicetree-overlay line, no kernel-install.
Yury-MonZon
force-pushed
the
load-dtbo-files
branch
from
July 10, 2026 09:16
437ae4f to
bec5b95
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Lets a user drop device-tree overlays into a per-profile directory and have them applied to that
profile's boot, without rebuilding the image or a full kernel-install. Three parts:
Per-profile user overlays (
flipper-bls.sh): every*.dtboin a profile's/etc/kernel/dtbo/is merged into that profile's BLSdevicetree-overlayline, subvol-prefixed(
/@<subvol>/etc/kernel/dtbo/...), alongside the kernel-shipped profile overlays. Un-versioned,so drop-ins survive kernel updates.
Uncompressed DT files (
85-flipper-dtb-uncompress.install): U-Boot's btrfs driver can't readinline zstd extents (
zstd_decompress: failed to decompress: 70), and small files like.dtboget inlined. On every
kernel-install addthis sets the DT dirs (/usr/lib/linux-image-<ver>/rockchipand
/etc/kernel/dtbo) tocompression=noneand rewrites the base.dtb+ every.dtbouncompressed. This also un-breaks the pre-existing kernel-shipped overlays (e.g. hdmi-cec).
add-dtboCLI: apply/manage a profile's drop-in overlays in-place (rewrites only the bootedprofile's
devicetree-overlayline viased, no re-staging/initrd rebuild):add-dtbo FILE.dtbo ...copy in + apply (multiple at once)add-dtbo --rm NAME ...remove named overlay(s) + applyadd-dtbo --clearremove all (deletes the files, durable across kernel updates)add-dtbo --applyre-sync the entry to the diradd-dtbo --list,add-dtbo --help;--all-kernelsscopes to every installed kernelBare invocation prints usage; unknown options are rejected.
Why the uncompress step
The root subvol is
compress=zstd, so a freshly written.dtbois compressed and U-Boot fails toload it.
compression=noneon the containing dir (inherited by new files; existing extents rewritten)is the same approach already used for
/boot.On-device validation (flipper1, @minimal)
and uncompressed; U-Boot boot log shows it retrieving/applying
/@Minimal/etc/kernel/dtbo/<x>.dtbo,and
/proc/device-tree/<node>confirms it took effect after reboot.--rmdrops just the named overlay;--clearempties the dir and the line.-hbehave correctly.