This commit is contained in:
Valeria Fadeeva 2023-10-14 15:24:49 +05:00
parent 9f9bdca991
commit 878cc320dc
1 changed files with 32 additions and 7 deletions

View File

@ -155,28 +155,53 @@ function gen_image() {
dracut --force --hostonly --no-hostonly-cmdline --kver "$kernel_version" "$initrd_image"
declare -a ukify_args=("${ukify_global_args[@]}")
ukify_args+=(--linux "$vmlinuz")
if [ -f "/boot/amd-ucode.img" ];then
ukify_args+=(--initrd "/boot/amd-ucode.img")
fi
if [ -f "/boot/intel-ucode.img" ];then
ukify_args+=(--initrd "/boot/intel-ucode.img")
fi
ukify_args+=(--initrd "$initrd_image")
ukify_args+=(--cmdline "$cmdline")
ukify_args+=(--uname "$kernel_version")
ukify_args+=(--os-release "/etc/os-release")
ukify_args+=(--uname "$kernel_version")
ukify_args+=(--output "$efi_image")
ukify_args+=("$vmlinuz" "$initrd_image")
echo "==> Ukify image $kernel_name $efi_image"
/usr/lib/systemd/ukify "${ukify_args[@]}"
if [ -f "/etc/kernel/uki.conf" ]; then
# ukify_args+=(--sbat='sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
# uki.author.myimage,1,UKI for System,uki.author.myimage,1,https://www.freedesktop.org/software/systemd/man/systemd-stub.html')
/usr/lib/systemd/ukify -c /etc/kernel/uki.conf build "${ukify_args[@]}"
else
/usr/lib/systemd/ukify build "${ukify_args[@]}"
fi
echo "==> Building initrd image $kernel_name $initrd_image_fallback"
dracut --force --kver "$kernel_version" "$initrd_image_fallback"
declare -a ukify_args=("${ukify_global_args[@]}")
ukify_args+=(--linux "$vmlinuz")
if [ -f "/boot/amd-ucode.img" ];then
ukify_args+=(--initrd "/boot/amd-ucode.img")
fi
if [ -f "/boot/intel-ucode.img" ];then
ukify_args+=(--initrd "/boot/intel-ucode.img")
fi
ukify_args+=(--initrd "$initrd_image_fallback")
ukify_args+=(--cmdline "$cmdline")
ukify_args+=(--uname "$kernel_version")
ukify_args+=(--os-release "/etc/os-release")
ukify_args+=(--uname "$kernel_version")
ukify_args+=(--output "$efi_image_fallback")
ukify_args+=("$vmlinuz" "$initrd_image_fallback")
echo "==> Ukify image $kernel_name $efi_image_fallback"
/usr/lib/systemd/ukify "${ukify_args[@]}"
if [ -f "/etc/kernel/uki.conf" ]; then
# ukify_args+=(--sbat='sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
# uki.author.myimage,1,UKI for System,uki.author.myimage,1,https://www.freedesktop.org/software/systemd/man/systemd-stub.html')
/usr/lib/systemd/ukify -c /etc/kernel/uki.conf build "${ukify_args[@]}"
else
/usr/lib/systemd/ukify build "${ukify_args[@]}"
fi
rm -f "$initrd_image"
rm -f "$initrd_image_fallback"