You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bc483d8
Browse filesBrowse the repository at this point in the historyBrowse files
--dry-run never writes to the target: no resume, no tune hand-off, no unmount or close, no journal replay, and a cleanup that undoes only its own
luks-deploy.sh's resume path had no DRY_RUN check: a dry run answered "yes",
or given LUKS_RESUME=yes, ran cryptsetup reencrypt --resume-only (and
cryptsetup repair after a hard interruption) on the target. The script's own
header promised that nothing on the target is modified in a dry run.
The whole script was audited for anything that can write to the target, or
change what a dry run leaves behind, before the point of no return. Fixed -
each prints "[dry-run] Would ..." and stops, as convert_luks1 does:
- resume: stops before the prompt, whatever LUKS_RESUME says, and before
any passphrase is asked for;
- the hand-off to luks-tune.sh: stops, and names luks-tune.sh --dry-run;
- a mapper an earlier run left open: kept, it is read as it stands and
/mnt is not unmounted; closing it stops the dry run;
- a kept mapper backed by another device: stops instead of closing it;
- a mount an earlier run left at /mnt_temp: stops instead of mounting over
it.
Two more that wrote without anyone asking:
- the exit trap unmounted everything under /mnt, deleted /mnt/tmp/.luks-*
and closed the mapper on every exit, dry run included, whoever had
mounted or opened them - and unmounting a read-write filesystem writes to
it. A dry run now undoes only its own /mnt_temp mounts, its probe mounts
and a mapper it opened itself. A real run's cleanup is unchanged.
- "ro" is not "no writes": a dirty ext3/4, xfs, btrfs or f2fs replays its
journal even on a read-only mount. Discovery's mounts of the root and of
/boot, and lib-uki.sh's uki_probe_dev, now go through ll_ro_mount, which
in a dry run adds noload (ext3/4), norecovery (xfs, f2fs) or
rescue=nologreplay, falling back to nologreplay (btrfs). A real run
mounts with plain "ro" as before.
Checked and already safe: ensure_unmounted (reports, unmounts nothing),
convert_luks1 (exits before its header backup and convert; its read-only open
is skipped; the GRUB probe mounts FAT read-only), the ALIGN partition move
(after the confirm gate; the dry run only plans it), the integrity check
(skipped), the state backup (to the deployment drive), every
luksHeaderBackup (after the dry-run exits), the partition check's probes (FAT
ro, ext3/4 ro,noload), and everything after the point of no return. A
config-only dry run still opens the container to read it, as documented.
Tests. loopback-core-test.sh section 12 (root, CI): the real luks-deploy.sh
--dry-run against a LUKS2 volume mid-encryption with LUKS_RESUME=yes and a
passphrase file - not resumed, every byte of the device unchanged, the
online-reencrypt flag still there; against a finished LUKS2 with
LUKS_EXISTING=tune; and three times with a mapper left open and its
filesystem mounted at /mnt (kept with another target, closed, kept through
config-only), each leaving both as they were. Section 11's runs now use their
own mapper name, so a host whose root mapper is root_crypt cannot interfere.
uki-fixture-test.sh section 11: ll_ro_mount's options for every filesystem in
both modes, the btrfs fallback, the discovery mounts going through it, and
the cleanup trap with its commands recorded - dry run with and without its
own mounts, and a real run unchanged. Against 1.6.5 the new uki checks report
7 failures.
The script's --dry-run text, the README, ABOUT, INSTALL and SECURITY now
say exactly this. CI: actions/checkout@v7, as linux-backup-system uses; the
runners stay pinned, so no required check changes its name.
uki 117/0 (1 skip) on the M2 Max and again with every Asahi signal hidden
in a user namespace; cmdline 71/0; bash -n and shellcheck -S warning clean.
loopback needs root and runs in CI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments