Make compatible with cryptsetup's encrypt hook

Open Tallero Tallero requested to merge tallero/mkinitcpio-archiso:crypto into master

This merge request makes archiso hook compatible with the correct output of the encrypt hook, that can so be enabled and configured to handle LUKS encrypted archiso systems.


When the encrypt successfully ends, it exports a static root variable containing the path of the device mapper representing the root device (by default /dev/mapper/root).

Since the root device here is on a file on the bootmnt and not on a disk directly, I've changed the cryptsetup encrypt hook to support an intermediate mount for bootmnt on /run/cryptdev.

Compatibility is obtained by bind mounting /run/cryptdev to bootmnt and replacing the loopmount with root if it exists.

Value of archisodevice has been changed from /dev/disk/by-label/$archisolabel to dev/disk/by-uuid/$archisouuid to avoid boot problems when multiple archisolabel'd devices are inserted.

Depends on nested cryptkey support cryptsetup merge request (where should it be submitted for review?).

Solves #14 and #15 (moved).

See specular MR on archlinux/archiso!217 (closed).

Edited by Tallero Tallero

Merge request reports