From 1321769bb54fa5ad02b65ffb2f5be90615a7f485 Mon Sep 17 00:00:00 2001 From: Nick Booker Date: Tue, 28 Mar 2023 15:10:41 +0100 Subject: [PATCH] Fix booting from encrypted root filesystem with systemd (#78) * Fix booting from encrypted root filesystem with systemd systemd needs to be built with cryptsetup for it to work * Limit cryptsetup USE flag and emerge to systemd --- scripts/main.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/main.sh b/scripts/main.sh index 7fd4e9c..709bf2e 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -401,6 +401,14 @@ EOF try emerge --verbose sys-fs/cryptsetup fi + if [[ $SYSTEMD == "true" && $USED_LUKS == "true" ]] ; then + einfo "Enabling cryptsetup USE flag on sys-apps/systemd" + echo "sys-apps/systemd cryptsetup" > /etc/portage/package.use/systemd \ + || die "Could not write /etc/portage/package.use/systemd" + einfo "Rebuilding systemd with changed USE flag" + try emerge --verbose --changed-use --oneshot sys-apps/systemd + fi + # Install btrfs-progs if we used btrfs if [[ $USED_BTRFS == "true" ]]; then einfo "Installing btrfs-progs"