Skip to content

chore(omnect-os-init): replaces legacy initramfs scripts with Rust init - #636

Draft
JoergZeidler wants to merge 21 commits into
omnect:mainfrom
JoergZeidler:feature_init_rust
Draft

chore(omnect-os-init): replaces legacy initramfs scripts with Rust init#636
JoergZeidler wants to merge 21 commits into
omnect:mainfrom
JoergZeidler:feature_init_rust

Conversation

@JoergZeidler

Copy link
Copy Markdown
Contributor

initial draft PR to deal with current implementation of

@JoergZeidler
JoergZeidler force-pushed the feature_init_rust branch 4 times, most recently from 069caea to 2a80451 Compare March 30, 2026 18:23
@JoergZeidler JoergZeidler changed the title chore(omnect-is-int): replaces legacy initramfs scripts with Rust init chore(omnect-os-init): replaces legacy initramfs scripts with Rust init Apr 15, 2026
Refactors GRUB's root partition identification by transitioning from a static `rootblk` parameter to a dynamic filesystem UUID. This enhances boot reliability by eliminating dependency on potentially unstable block device names. The GRUB `probe` command is leveraged to detect the boot partition's UUID and pass it to the kernel as `bootpart_fsuuid`.
Adds `util-linux-blkid` to the initramfs, providing essential tools for robust identification of block devices, which is crucial for locating and mounting the root filesystem.

Introduces conditional Cargo features for the Rust-based `omnect-os-init` based on the detected bootloader (`grub` for EFI, `uboot` otherwise). This allows the init process to be compiled with bootloader-specific logic, improving its adaptability and ensuring correct behavior across different boot environments.
Refreshes the recipe to align with the latest upstream changes in the omnect-os-init repository.

Bumps the SRCREV for the primary source.
Significantly reduces the number of Rust crate dependencies and their checksums, resulting in a leaner dependency footprint for the project.
Ensures the `resize-data` feature is appended with a comma as a prefix, aligning with the expected comma-separated format for Cargo features. This consistency prevents incorrect parsing of build features.
Updates the `omnect-os-init` Rust component to a newer commit.
Includes `e2fsprogs-e2fsck` in the initramfs image to enable
filesystem checks, likely required by the updated init for enhanced
system integrity and recovery.
…features

Enable GPT support by default for all targets and conditionally enable features for release images and persistent logging based on build configuration.
omnect_first_boot_done, omnect_factory_reset_last_error and omnect_fsck_<part>
were missing from the writeable env flags list. Unlisted variables are not
guaranteed to survive a u-boot saveenv, and omnect_update_flow calls saveenv on
both update paths, so the variables are lost across an update boot while
omnect_extra_bootargs and the other listed ones survive.

Observed effect: after an A/B update the device reports first_boot true again
and repeats the first-boot work (resize preflight, extra-bootargs sync). The
same applies to a stored fsck record, which is exactly the case the env is
meant to carry across a reboot.

The list now matches BootEnvKey::as_str() in omnect-os-init. The fsck entries
name the partitions the initramfs runs fsck on; the flags syntax takes exact
names, so they are enumerated.

No change needed for grub: it persists named variables via save_env and keeps
the rest of the block, so it has no equivalent drop.

Signed-off-by: Joerg Zeidler <62105035+JoergZeidler@users.noreply.github.com>
omnect_first_boot_done, omnect_factory_reset_last_error and omnect_fsck_<part>
were missing from the writeable env flags list. Unlisted variables are not
guaranteed to survive a u-boot saveenv, and omnect_update_flow calls saveenv on
both update paths, so the variables are lost across an update boot while
omnect_extra_bootargs and the other listed ones survive.

Observed effect: after an A/B update the device reports first_boot true again
and repeats the first-boot work (resize preflight, extra-bootargs sync). The
same applies to a stored fsck record, which is exactly the case the env is
meant to carry across a reboot.

The list now matches BootEnvKey::as_str() in omnect-os-init. The fsck entries
name the partitions the initramfs runs fsck on; the flags syntax takes exact
names, so they are enumerated.

No change needed for grub: it persists named variables via save_env and keeps
the rest of the block, so it has no equivalent drop.

Signed-off-by: Joerg Zeidler <62105035+JoergZeidler@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant