Preparing UEFI boot order through the CLI
A separate plan, a BootOrder-only change and independent verification on an isolated Debian VM.
Inspection of a fresh Debian image did not confirm UEFI readiness for our subsequent workflow. Boot-order preparation now has its own CLI operation: obtain a plan, apply its exact SHA256 and independently read the result. We performed this exercise on an isolated VM, rather than the installed educational VPS.
BootCurrent and BootOrder have different roles
BootCurrent identifies the entry used for the current boot. BootOrder defines the normal sequence of firmware entries. Our bounded scenario requires the current active entry at the start of that sequence.
The operation creates no loader. It accepts only an existing BootCurrent already present in the initial BootOrder, moves it first and preserves every other entry's relative order. If BootNext exists, the command refuses the operation; it does not automatically clear a one-time boot selection.
The variable attributes are retained as well. In the efivarfs file interface, the first four bytes preceding the data contain UEFI attributes in little-endian format. The Linux kernel efivarfs documentation describes this representation.
Obtain a private plan first
ROOT_ENV and CURRENT_CONSOLE_REQUEST are absolute paths to the prepared root environment and current access request. They reference independently verified known_hosts and machine/current-boot confirmation from a separate console. NEW_EFI_PLAN is a new private file outside Git.
deploy-cli host image efi-plan \
--env-file "$ROOT_ENV" \
--request-file "$CURRENT_CONSOLE_REQUEST" \
--plan-file "$NEW_EFI_PLAN" \
--approve-local-write
This command reads the server and creates a local plan. The plan retains the exact initial BootOrder bytes, the sole permitted permutation, the current boot and required input-file fingerprints. A changed root key, trust, console record or firmware state must not silently expand a reviewed plan.
Apply one reviewed permutation
After review, provide the same plan and its exact SHA256. EFI_PLAN points to the prepared file; REVIEWED_PLAN_SHA256 is that file's retained and checked digest.
deploy-cli host image efi-apply \
--env-file "$ROOT_ENV" \
--request-file "$CURRENT_CONSOLE_REQUEST" \
--plan-file "$EFI_PLAN" \
--plan-sha256 "$REVIEWED_PLAN_SHA256" \
--approve-privileges
Before writing, the CLI retains a private operation intent, rechecks the preimage and writes only the existing BootOrder variable. Boot#### entries, all other order elements, the four attribute bytes and loader files are preserved. Packages, Secure Boot settings and reboot are outside this operation.
Read the result through a new SSH connection
The CLI performs a fresh read after apply. The separate verify command can inspect the same completed result again without another write:
deploy-cli host image efi-verify \
--env-file "$ROOT_ENV" \
--request-file "$CURRENT_CONSOLE_REQUEST" \
--plan-file "$EFI_PLAN" \
--plan-sha256 "$REVIEWED_PLAN_SHA256"
These are selected fields from the actual verify response, with private plan and journal digests omitted:
{
"status": "passed",
"write_performed": false,
"action": "efi-verify",
"access_verified": true,
"checks": {
"original_efi_validator": "passed",
"reboot_dispatched": "false"
}
}
Of 51 selected configuration and EFI files, only BootOrder changed; the other 50 remained exact. A separate private operation journal was created. Independent EFI validation admitted the live state, and verification through a separate SSH connection confirmed completion. The image inspection's EFI prerequisite changed from unavailable to passed.
Another apply is not a verification method
Applying the same plan again was refused before another write. Use verify for observation. If a failure follows the intent, partial or unknown state remains available for inspection; the command neither guesses a write retry nor automatically rolls firmware back.


The image still needs package preparation
Successful EFI validation did not make the entire image ready. A second complete kernel/initrd pair is still absent. The full wizard also lacks an explicit input for accepting completed preparation: the presence of its journal is not treated as automatic trust in the result.
The next step is initial installation of the required signed packages with their verifiable history preserved, followed by explicit handoff of accepted results to the wizard. This run dispatched neither APT nor reboot and did not test an actual boot through the changed order. That is a separate practical operation after the remaining foundation is prepared.