docs: sync with code (topologies, mount scheme, CLI flags, UEFI/BIOS, fstab) and fix relative src links in docs/ to ../src/

This commit is contained in:
2025-09-29 23:24:25 +02:00
parent 7cef73368b
commit b0d8c0bc75
9 changed files with 451 additions and 373 deletions

View File

@@ -2,7 +2,7 @@
One-shot disk provisioning utility intended for initramfs. It discovers eligible disks, plans a GPT layout based on a chosen topology, creates filesystems, mounts them under a predictable scheme, and emits a machine-readable report. Safe-by-default with a non-destructive preview mode.
Status: first-draft preview capable. Partition apply, mkfs, and mounts are gated until the planning is validated in your environment.
Status: apply mode implemented. Partition application (sgdisk), filesystem creation (vfat/btrfs/bcachefs), mount scheme with subvolumes, and optional fstab writing are available. Preview mode remains supported.
Key modules
- CLI and entrypoint:
@@ -33,8 +33,9 @@ Requirements
- Linux with /proc and /sys mounted (initramfs friendly)
- External tools discovered at runtime:
- blkid (for probing UUIDs and signatures)
- sgdisk (for GPT application) — planned
- mkfs.vfat, mkfs.btrfs, bcachefs (for formatting) — invoked by fs/plan when enabled in execution phase
- sgdisk (for GPT application)
- mkfs.vfat, mkfs.btrfs, bcachefs (for formatting)
- udevadm (optional; for settle after partitioning)
- Tracing/logging to stderr by default; optional file at /run/zosstorage/zosstorage.log
Install and build
@@ -57,6 +58,7 @@ CLI usage
- Other:
-c, --config PATH Merge a YAML config file (overrides defaults)
-s, --fstab Enable writing /etc/fstab entries (when mounts are applied)
-a, --apply Perform partitioning, filesystem creation, and mounts (destructive)
-f, --force Present but not implemented (returns an error)
Examples
@@ -68,6 +70,8 @@ Examples
sudo ./zosstorage --show -t ssd-hdd-bcachefs --allow-removable -l debug
- Quiet plan to file:
sudo ./zosstorage --report /run/zosstorage/plan.json -t dual-independent
- Apply single-disk btrfs (DESTRUCTIVE; wipes target disk):
sudo ./zosstorage --apply -t btrfs-single
Preview JSON shape (examples)
1) Already provisioned (idempotency success):
@@ -107,14 +111,15 @@ Preview JSON shape (examples)
}
],
"filesystems_planned": [
{ "kind": "vfat", "from_roles": ["esp"], "label": "ZOSBOOT", "planned_mountpoint": null },
{ "kind": "btrfs", "from_roles": ["data"], "devices_planned": 2, "label": "ZOSDATA", "planned_mountpoint_template": "/var/cache/{UUID}" }
{ "kind": "vfat", "from_roles": ["esp"], "label": "ZOSBOOT" },
{ "kind": "btrfs", "from_roles": ["data"], "devices_planned": 2, "label": "ZOSDATA" }
],
"mount": {
"scheme": "per_uuid",
"base_dir": "/var/cache",
"fstab_enabled": false,
"target_template": "/var/cache/{UUID}"
"root_mount_template": "/var/mounts/{UUID}",
"final_targets": ["/var/cache/system", "/var/cache/etc", "/var/cache/modules", "/var/cache/vm-meta"]
}
}