Btrfs migration 4: build stamping#98
Draft
Yury-MonZon wants to merge 7 commits into
Draft
Conversation
This was referenced Jun 30, 2026
alchark
requested changes
Jul 1, 2026
alchark
left a comment
Collaborator
There was a problem hiding this comment.
Please split out the fixups to motd and set-hostname-and-banner.sh into a separate commit directly on top of the dev branch and let us merge it, as it's not tied to the Btrfs logic.
For the build ID though - we can't record it at the rootfs generation stage, because a rootfs can be reused in multiple builds when e.g. only U-Boot changes between them, meaning that all the later builds will record an incorrect build ID. Let's give it more thought.
11d95f0 to
b78ed2f
Compare
0e1480c to
ec54542
Compare
Contributor
Author
|
Agreed, done. I'll keep this as draft until we figure out better solution. Thanks! |
Define the subvolume layout (@, @home, @var-log, @var-cache, @snapshots, boot) with per-subvolume mount options, keep /boot uncompressed so U-Boot can read the kernel/dtb/initrd, and factor out root device retrieval into a helper. Generate the BLS boot entries, deriving the devicetreedir/overlay prefix from each entry's root subvolume so U-Boot resolves the in-entry paths correctly, with FDT_SUBVOL_PREFIX as an override. Install btrfs-progs and btrfs-compsize.
journald's append-heavy writes fragment badly under btrfs copy-on-write. Pre-create the journal directory with NODATACOW while it is still empty so the journal files written on first boot inherit it.
Once the rootfs and kernel are fully deployed, take a read-only snapshot of @ into .snapshots/@_Factory-Image for rollback. It captures @ only; the nested subvolumes (boot/home/var-*) are separate and excluded.
Build a read-only @Minimal_stock golden base, then derive one read-only @<Profile>_stock per profile (Desktop, TV-Media-Box, Router) and a writable @<Profile> snapshot of each. @minimal itself is re-created as a writable child of @Minimal_stock so it matches the other profiles instead of being the parentless build origin. Profile-specific overlays move under overlays/profile-<name>/, and profile naming is finalised (stock bases, Desktop replaces KDE).
b78ed2f to
60d3657
Compare
Capture this image build's git state and a BUILD_ID (CI-provided, or a UTC timestamp fallback) and write both into /etc/os-release of @minimal before it is snapshotted to @Minimal_stock, so every profile inherits them via COW. Resolve the os-release symlink so the real file is edited in place. The MOTD and login banner now report the build ID instead of a decoded timestamp.
ec54542 to
ed4869b
Compare
60d3657 to
a080135
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.
Build stamping for the image (depends on #96).
BUILD_ID(CI-provided, or a UTC timestamp fallback) and write both into/etc/os-releaseof@Minimalbefore it is snapshotted to@Minimal_stock, so every profile inherits them via COW.os-releasesymlink so the real file is edited in place.Stack (merge bottom-up)
btrfs-foundation->devbtrfs-profiles->btrfs-foundationcog-kodi-display->btrfs-profilesbuild-stamping->btrfs-profiles(this PR)