Merged
Conversation
Build rootfs (erofs) and initramfs (cpio.zst) images from RPM package sysroots instead of using pre-built Yocto images. This enables AVOCADO_OS_BUILD_ID injection into os-release for hardware-rooted boot verification. Key changes: - Add top-level rootfs/initramfs config sections with sensible defaults - Install initramfs sysroot alongside rootfs during sdk install - Build rootfs erofs and initramfs cpio images during runtime build - Create usrmerge symlinks, empty /etc/machine-id, /init symlink - Add offline systemctl wrapper for service enablement in sysroots - Add depmod wrapper gated by AVOCADO_SYSROOT_SCRIPTS for cross-arch - Use host-native ldconfig -r for cross-arch ld.so.cache generation - Run systemd preset-all at build time for read-only rootfs - Clean initramfs sysroot in sdk clean - Add initramfs sysroot type to lockfile
Add `avocado rootfs {install,image,clean}` and `avocado initramfs
{install,image,clean}` as top-level commands. The image subcommands
support `--out` for specifying the output directory.
Refactor sdk/install.rs and runtime/build.rs to call into the new
shared modules instead of duplicating the sysroot install and image
build logic inline. This removes ~320 lines of duplicated code.
- Replace avocado-build-$TARGET_ARCH hook call with direct `stone bundle` invocation, building the .aos bundle before var partition assembly - Add os_bundle field (image_id + sha256) to runtime manifest (v2) when the .aos file is produced by stone bundle - Update connect upload to discover and upload .aos artifact alongside extension images - Reorder build script: stone bundle runs after rootfs/initramfs but before var assembly, so the manifest can include the bundle hash
Move var partition assembly (var_files, manifest, mkfs.btrfs) before stone bundle so the var image exists when stone bundle copies manifest inputs to the build directory. This fixes provision failing with "Image file 'avocado-image-var-*.btrfs' not found". The manifest baked into the var partition no longer contains os_bundle (it doesn't exist yet). After stone bundle produces the .aos, a post-bundle step patches the manifest in var-staging with os_bundle for connect upload (which reads var-staging directly, not the btrfs).
…ages Write AVOCADO_OS_BUILD_ID to the sysroot os-release in addition to the work copy so stone bundle can read it for the verify section. Also fix rootfs install to install all configured packages instead of only the first one.
Fix map_clone clippy lint by using .cloned() and apply cargo fmt.
The initramfs build was only writing the content-addressable hash to os-release-initrd but not to initrd-release, leaving BUILD_ID as "0". Now injects AVOCADO_OS_BUILD_ID into both files.
Add erofs-lz4 and erofs-zst as valid filesystem types, passing the appropriate -z compression flag to mkfs.erofs. Introduce compute_ext_input_hash_with_fs so that changing the filesystem format invalidates the image stamp. Resolve the effective filesystem early from per-extension config or the rootfs default.
The stone build directory at $AVOCADO_PREFIX/output/runtimes/$RUNTIME_NAME/stone persisted between builds, causing stone to reuse cached rootfs images instead of picking up freshly built ones. Add rm -rf before invoking stone bundle as a defensive measure.
2f0677a to
0fe355e
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.
Summary
rootfsandinitramfsCLI commands with shared codeTest plan
cargo fmt --all -- --checkpassescargo clippy --all-targets --all-features -- -D warningspassescargo build --verbosepassescargo test --verbosepassescargo auditpasses (0 vulnerabilities, 0 warnings)