
我正在嘗試在具有加密根分割區的系統上安裝 OpenSuSE Tumbleweed。起初我嘗試設定GRUB,但它拒絕識別 LUKS 加密的分割區。
目前我正在嘗試使用統一核心映像它使用安全啟動金鑰對核心和 initrd 進行簽署以防止篡改。 Debian 有西赫布特為此,Arch 已更新。
SUSE 中使用的 initrd Dracut 似乎也有此功能內建。不幸的是,dracut 安裝後腳本(出現在下面/usr/lib/module-init-tools/regenerate-initrd-posttrans
並在下面複製)似乎對 dracut 命令列進行了硬編碼。有沒有其他方法可以在 RPM 更新後自動產生統一的核心映像?
#!/bin/sh
#
# Packages that install kernels or kernel-modules create a flag
#
# /run/regenerate-initrd/<kernel image>
#
# to have the initrd for <kernel image> generated, or
#
# /run/regenerate-initrd/all
#
# to have all initrds generated. This script is called from posttrans
# and takes care of generating the initrds
: ${DRACUT:=/usr/bin/dracut}
if [ ! -x "$DRACUT" ]; then
echo "${0##*/}: dracut is not installed, not rebuilding the initrd" >&2
exit 0
fi
dir=/run/regenerate-initrd
if ! test -d "$dir"; then
exit 0
fi
for f in "$dir"/*; do
case $f in
"$dir/*")
[ -e "$f" ] || break;;
esac
# check if we are in a build chroot
if ! [ -f /etc/fstab -a ! -e /.buildenv -a -x "$DRACUT" ] ; then
echo "Please run \"$DRACUT -f --regenerate-all\" as soon as your system is complete." >&2
rm "$dir"/*
exit 0
fi
break
done
if test -e "$dir/all"; then
rm "$dir"/*
"$DRACUT" -f --regenerate-all
exit
fi
err=0
for f in "$dir"/*; do
case $f in
"$dir/*")
[ -e "$f" ] || break;;
esac
rm "$f"
image=${f##*/}
kver=${image#*-}
if ! test -e "/boot/$image"; then
echo "$0: /boot/$image does not exist, initrd won't be generated"
continue
fi
if ! "$DRACUT" -f "/boot/initrd-$kver" "$kver"; then
err=$?
fi
done
exit $err
答案1
它接縫加入uefi="yes"
到 dracut.conf導致 Dracut 在 EFI 分割區上產生統一的映像(位於下列位置)systemd-boot 所期望的),這應該可以解決問題[我還沒有時間檢查這個]