Skip to content

Commit

Permalink
fix(dracut.sh): handle sbsign errors for UEFI builds
Browse files Browse the repository at this point in the history
`sbsign` does not issue any error if there is not enough disk space to create
the signed file using its `--output` option. So, verify the signed image after
its creation using `sbverify`.

Fixes issue #2197
  • Loading branch information
aafeijoo-suse authored and johannbg committed Feb 13, 2023
1 parent 8602df7 commit a6dd5bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2496,9 +2496,11 @@ if [[ $uefi == yes ]]; then
${uefi_secureboot_engine:+--engine "$uefi_secureboot_engine"} \
--key "${uefi_secureboot_key}" \
--cert "${uefi_secureboot_cert}" \
--output "$outfile" "${uefi_outdir}/linux.efi"; then
--output "$outfile" "${uefi_outdir}/linux.efi" \
&& sbverify --cert "${uefi_secureboot_cert}" "$outfile" > /dev/null 2>&1; then
dinfo "*** Creating signed UEFI image file '$outfile' done ***"
else
rm -f -- "$outfile"
dfatal "*** Creating signed UEFI image file '$outfile' failed ***"
exit 1
fi
Expand Down

0 comments on commit a6dd5bf

Please sign in to comment.