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
This commit is contained in:
Nick Booker 2023-03-28 15:10:41 +01:00 committed by GitHub
parent b2ea9b360d
commit 1321769bb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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"