Skip to content

AsahiLocker 2.2.1

Choose a tag to compare

@doug445 doug445 released this 20 Nov 11:55
· 3 commits to main since this release
Immutable release. Only release title and notes can be modified.

AsahiLocker 2.2.1: audited a third time, and harder to get wrong

A third full audit of every script, test and document, this one for ease of use as much as for safety: what you actually meet when you mistype, forget sudo, or start a script from the wrong place. Thirteen findings, each reproduced on the released code before it was fixed — on a loop device, or in a KVM guest running the official Fedora Asahi Remix 45 image, old script and new side by side. Then this tree encrypted that guest from the RAM rescue, passed the 12-point gate, and booted.

Nothing changes in how a volume is encrypted, in the KDF, or in any volume an earlier release made. If you are already encrypted, there is nothing to redo.

A mistyped passphrase no longer costs you the run

cryptsetup asks for the new passphrase before it writes anything, and stops if the two entries differ, if it refuses the passphrase as too weak, or if its YES is not in capitals. That used to end the whole run, after every other prompt and a btrfs check of up to half an hour. Now the script checks the partition to prove nothing was written (no LUKS header, btrfs still in place) and asks again. Three attempts, each through the Caps Lock check.

It tells you when you are about to go wrong, before anything happens

  • Running it on the system you are sitting in? It now gives you the command for the built-in RAM rescue: no USB stick, no second install.
  • Running it from a drive mounted on /mnt, or from the partition about to be encrypted? Refused up front. Before, the script mounted the target over its own directory and stopped after the encryption, unable to write the header copy.
  • Forgot sudo? One line. Before: a log file and a page of recovery advice for an encryption that never started.
  • Stopped before anything changed? It says exactly that. Recovery advice is kept for when it applies, and now names your device.
  • Encrypting a second install from one AsahiLocker already encrypted? It names the fix (LUKS_MAPPER_NAME) instead of reporting a "previous run" and dead-ending.

luks-mount.sh

  • In a UTF-8 locale it tried /boot/efi before /boot, so a maintenance chroot silently had no EFI partition. Fixed, and a failed mount is now reported.
  • mount /dev/X /mnt/ followed by umount /mnt left the volume unlocked. A directory is now one place however you spell it.
  • umount acts only on what mount recorded, and never on a mountpoint that is not its own.

Also fixed

  • A partition menu whose input had closed looped for ever, writing to the deploy log on every pass: 1.5 GB in six minutes.
  • Both installers treated any argument they did not know as "install": install.sh --help installed. Arguments are now strict.
  • post-encryption-setup.sh warned that it "could not confirm crypt support" in the initramfs of every correctly encrypted system.
  • The exit trap unmounted whatever you had on /mnt, on a dry run too.
  • A silent exit in the sector-alignment path; a summary that reported 4096-byte sectors for a 512-byte volume; two tracebacks in uboot-efivar.py.
  • luks-tune.sh checks custom memory and thread limits before the header backup and the passphrase, not after.

Every script answers --help

Without root, and every script refuses an option it does not know.

Tests: more than 100 checks on every push

  • New: tests/cli-smoke-test.sh — the command line of every script, no root needed (26 checks).
  • New: tests/luks-mount-test.sh — a loop-image install laid out like an Asahi disk, plain and encrypted (13 checks).
  • loopback-core-test.sh gains a stage proving that a refused passphrase writes nothing (43 checks); multi-install-selection-test.sh gains the closed-stdin menu (12).
  • The released 2.2.0 scripts fail the new command-line, menu and luks-mount.sh checks; 2.2.1 passes all of them.

Docs

  • INSTALL.md: the prompt table matches the script again, including the prompt that waits for you after the encryption finishes, and the RAM rescue is offered at Step 1.
  • RECOVERY.md: one-command shortcuts with luks-mount.sh, and a corrected recipe for restoring the ESP stub.
  • README: why AsahiLocker, in numbers; the three ways to run it; the audit record.

Upgrade

cd AsahiLocker && git pull

A rescue image built with 2.2.0 carries the old scripts: sudo ./bin/ram-rescue.sh build rebuilds it.

Tested: every finding reproduced, then verified fixed; the full --defaults run from the RAM rescue with a mismatched passphrase first, the 12-point gate, an encrypted boot, post-encryption-setup.sh, the boot guards and ram-rescue.sh remove, all in a KVM guest on the official Fedora Asahi Remix 45 image. The RAM rescue and luks-mount.sh have still not been run on Apple hardware by this project.

Audit by Claude Fable 5.2 (Anthropic). Full record: README, Audit.