Partition planning and apply backend for LevitateOS install flows.
recpart is responsible for partitioning, formatting, and mount orchestration only.
It does not perform full OS installation.
The canonical interactive TUI flow lives at
tui/apps/install/disk-plan, built on tui/kit/core and recpart
backend JSON contracts.
- Provide a safe disk partition workflow for backend consumers.
- Support two layout modes:
ab(default): A/B immutable-ready partition layout.mutable: classic mutable root layout.
- Preview exact commands/scripts before destructive actions.
- Fail fast with explicit diagnostics and remediation.
- Slot switching or commit/rollback state machine.
- Integrity policy enforcement (dm-verity, signature verification, measured boot).
- Full install automation (rootfs extraction, chroot config, service enablement).
- Select target disk.
- Select layout mode (
abdefault,mutable). - Show partition plan and generated
sfdiskscript. - Explicit destructive confirmation.
- Apply partition table.
- Format filesystems and apply labels.
- Mount targets under a predictable tree for downstream tools.
- Print next commands (
recstrap,recfstab,recchroot).
planmodule:- deterministic partition plan model
- mode-specific templates
sfdiskscript generation
execmodule:- command runner with structured logs
- idempotent safety checks
- Input: selected disk + mode + optional layout request values (policy defaults apply when omitted).
- Output: mounted target topology + machine-readable summary.
- Downstream tools:
recstraprecfstabrecchrootrecab(A/B mode consumers)
| Code | Meaning |
|---|---|
1 (E001) |
Invalid target disk / target safety failure |
2 (E002) |
Required tool missing |
3 (E003) |
Plan generation or policy validation failure |
4 (E004) |
Missing destructive confirmation |
5 (E005) |
Partition apply failure |
6 (E006) |
Filesystem format failure |
7 (E007) |
Mount validation or mount execution failure |
8 (E008) |
Handoff generation failure |
9 (E009) |
JSON serialization failure |
10 (E010) |
Reserved not-implemented code |
11 (E011) |
Root privileges required |
12 (E012) |
Internal/runtime error |