UniOHOS Builder CLI & Storage Tooling (UniOHOS/builder)
UniOHOS/builder (Apache-2.0) provides the declarative device manifest validator, Approach A specification CLI, Approach B offline BYOF planner, generic 64KB PTE_CONT EROFS storage tools (fs-tools/), and single-file hotbind harness (harness/).
1. Installation
git clone https://github.com/UniOHOS/builder.git
cd builder
pip install -e .You can also invoke the CLI directly without editable installation via python3 -m uniohos_builder.
2. Subcommand Reference (uniohos-builder)
validate-device
Validates a declarative device.yaml recipe against schemas/device.schema.json, verifying required sections, enum constraints, zero_remote_blobs == true, and zero_neverallow == true.
uniohos-builder validate-device examples/dijun-reference.yaml
uniohos-builder validate-device examples/dijun-reference.yaml --schema schemas/device.schema.json --jsonopen-base-info
Displays the Approach A pure open-source Apache-2.0 OpenHarmony base rootfs specification (uniohos-open-base-<arch>.erofs).
uniohos-builder open-base-info --arch arm64
uniohos-builder open-base-info --arch x86_64 --jsonbyof-plan
Validates a device recipe and emits the reproducible 5-step Approach B offline dry-run synthesis plan (remote_blob_downloads: 0).
uniohos-builder byof-plan --device examples/dijun-reference.yaml --dry-run
uniohos-builder byof-plan --device examples/dijun-reference.yaml --dry-run --json| Subcommand | Required Arguments | Optional Flags |
|---|---|---|
validate-device | <device_yaml> | --schema <path>, --json |
open-base-info | (none) | `--arch arm64 |
byof-plan | --device <device_yaml> | --schema <path>, --dry-run (default true), --json |
3. Storage Tooling (fs-tools/) & Hotbind Harness (harness/)
fs-tools/tools/erofs_v2_64k_packer.py: Packs tiered read-only EROFS images (Tier-0uncompressed64KBPTE_CONTalignedFLAT_PLAIN+Tier-1lz4hc+Tier-2zstd), checksphys_blkaddr % 16 == 0, verifies unmodifiedfsck.erofs --extractSHA-256 parity, and checks deterministicR1 == R2builds.fs-tools/tools/hmfs_ioctl_compat.h: UserspaceHMFSioctlUAPI header paired with the kernel's native F2FS compatibility layer.fs-tools/configs/: Genericerofs_tier_rules_super_v21.jsonanderofs_compress_hints_super_v21.txttemplates.harness/hotbind_test_harness.sh: Fast single-fileMS_BINDtesting harness; see Inner-Loop Hotbind Testing.
4. Running Tests & Hygiene Checks
python3 -m unittest discover -s tests -v
python3 scripts/check_hygiene.py