- Install Asahi
- Add cryptsetup into initrd
- Make initrd spawn a shell before mounting disk
- Reencrypt the partition in-place
- Configure grub and rebuild initramfs to open LUKS device during startup.
- Cleanup
Just curl https://alx.sh | sh and follow the prompts. Move on to the next step once you boot into Asahi.
Add crypt dracut module
echo 'add_dracutmodules+=" crypt "' >/etc/dracut.conf.d/crypt.conf
Add cryptsetup and dependencies
cat >/etc/dracut.conf.d/cryptsetup.conf <<EOF
# cryptsetup binary
install_items+=" /usr/sbin/cryptsetup "
# cracklib because cryptsetup checks the password using it
install_items+=" /usr/share/cracklib/* "
EOF
Make dracut stop before mounting root - edit the GRUB_CMDLINE_LINUX_DEFAULT entry in /etc/default/grub:
- remove
rhgbandquiet - add
rd.break=pre-mountto it.
Rebuild the initrd
dracut -f
All should be set now, reboot away.
reboot
Hopefully the boot process should stop and you should be able to log in as root.
Follow https://davidalger.com/posts/fedora-asahi-remix-on-apple-silicon-with-luks-encryption/ starting from "Shrink the btrfs filesystem to make room for the LUKS header."
The arch-chroot utility is not available in the initrd, but we can work around that. Assuming you have your fedora partition mounted under $FEDORA_MNT you can do the following:
mount --bind /dev $FEDORA_MNT/dev
mount --bind /sys $FEDORA_MNT/sys
mount -t proc none proc
$FEDORA_MNT/usr/sbin/chroot $FEDORA_MNT bash
Edit the GRUB_CMDLINE_LINUX_DEFAULT entry in /etc/default/grub to not include rd.break=pre-mount and add back the previously removed options (rhgb and quiet).
Drop the things we previously added to the initrd
rm /etc/dracut.conf.d/cryptsetup.conf
Rebuild initrd and regenerate grub config once more
grub2-mkconfig -o /boot/grub2/grub.cfg
dracut -f
Thanks for the awesome guide. Tested and it works fine. No need to boot from USB anymore.
Some random minor comments:
User "root" has to be unlocked and password set before you boot into emergency mode otherwise you will see an error "Cannot open access to console, the root account is locked".
Font on emergency console by defauilt is way to small to read. You may need to run this to double font size:
You can setup any test key during initial setup with "--force-password" and change it into more secure later (when you have normal terminal):
Encryption of 1TB take ~11 min
Change the password