Reusable A/B boot, signed OTA, verified-boot, and block-device safety utilities for Arch Linux appliances.
Requires a .NET 10 SDK compatible with global.json (10.0.109, with latestFeature roll-forward). Run the C host tests on Linux with GNU Make, Python 3, and a host C compiler (cc by default).
git clone https://github.com/Akaishi-Tech/system-utils.git
cd system-utilsdotnet restore system-utils.slnx
dotnet build system-utils.slnx --no-restore -p:TreatWarningsAsErrors=true
dotnet test tests/HomeHarbor.SystemUtils.Tests/HomeHarbor.SystemUtils.Tests.csproj --no-buildRun the C host tests with mocked EFI services and shutdown system calls:
make -C boot/bootloader test
make -C boot/init testThese commands compile the .NET tooling and run unit and C host tests. Runtime or destructive integration tests must run in disposable VMs, never on the host.
- EFI A/B boot-state and one-shot/default slot helpers.
- Signed OTA manifest canonicalization and release anti-rollback sequencing.
- OTA bundle apply/commit orchestration, inactive-slot writes, and atomic ESP selector updates.
- AVB partition naming, super-device mapping, and archive/path safety helpers.
- C boot selector, AVB verifier, and initramfs dm-verity helper under
boot/. - mkinitcpio install and runtime hooks under
os/mkinitcpio/. - Shared command runner, bounded fetcher, and runtime SELinux synchronization helpers.
system-build pins this repository as external/system-utils. HomeHarbor pins system-build recursively, which gives runtime projects and the image builder one exact system-utils revision.
SystemUtilityAssets resolves the checkout from ARCH_AB_SYSTEM_UTILS_ROOT, from the standard tools/system-build/external/system-utils consumer layout, or by walking up from the current binary.
Extracted from HomeHarbor, this repository retains the HomeHarbor.Tooling assembly and namespace for consumer compatibility.
See AGENTS.md for contribution, verification, and writing conventions.
Pass ArchAbProductProfile to boot and OTA APIs. Compatibility overloads without a profile require ARCH_AB_PRODUCT_PROFILE to name a profile JSON file; they fail when it is absent. The OTA CLI also accepts --product-profile PATH, which takes precedence over the environment setting. Product names, EFI paths, variable prefixes, and vendor GUIDs must come from the consumer. Set the optional packagePrefix when package, bundle, and runtime path prefixes differ from the product id; otherwise those prefixes derive from the supplied id. ArchAbProductProfile.HomeHarbor remains an explicitly selected compatibility profile, never a fallback.
The C init/AVB sources and mkinitcpio assets retain their historical filenames as template paths. Before compiling or installing them, the consumer must replace these tokens with validated profile values:
@ARCH_AB_PACKAGE_PREFIX@@ARCH_AB_KERNEL_PARAMETER_PREFIX@@ARCH_AB_ENVIRONMENT_PREFIX@@ARCH_AB_EFI_VARIABLE_PREFIX@@ARCH_AB_EFI_VENDOR_GUID@
system-build performs this rendering. Direct helper Makefile builds require PRODUCT_SOURCE to name the rendered source. The EFI selector requires a consumer-generated PRODUCT_HEADER; its header has no product defaults. ARCH_AB_DEBUG_INITRAMFS_SHELL=1 remains restricted to ARCH_AB_CHANNEL=dev.
SELinux runtime APIs require the consumer-owned /etc/arch-ab/selinux-runtime.json file. Declare policyType, an immutableSeedPath below /usr, dataRootPath, and a nonempty requiredDirectories array containing path, octal mode, owner, and group. Optional managedPaths entries contain path and required; optional dataManagedPaths must stay below dataRootPath. Consumers can provide different directory requirements in their system and recovery images. Existing SELinux digest and marker formats remain unchanged.
Caddy trust configuration requires explicit hostname and certificate download path arguments, or ARCH_AB_CONTROL_HOSTNAME and ARCH_AB_CA_DOWNLOAD_PATH for its compatibility entry point.
GPL-3.0-only. See LICENSE.