diff --git a/dracut-ukify b/dracut-ukify index 3a9c18b..46ae6e9 100755 --- a/dracut-ukify +++ b/dracut-ukify @@ -140,8 +140,8 @@ SecureBootPrivateKey=/etc/kernel/secure-boot.key.pem SecureBootCertificate=/etc/kernel/secure-boot.cert.pem SignKernel=yes PCRBanks=sha384,sha512 -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" +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 [PCRSignature:initrd] PCRPrivateKey=/etc/kernel/pcr-initrd.key.pem @@ -171,11 +171,14 @@ if [[ $keys_count < 6 ]]; then do if [ -f "${i}" ]; then rm "${i}" + keys_count=$(expr $keys_count - 1) fi done fi -/usr/lib/systemd/ukify genkey --config "${ukify_conf}" +if [ -f "${ukify_conf}" ] && [ $keys_count == 0 ]; then + /usr/lib/systemd/ukify genkey --config "${ukify_conf}" +fi function gen_image() { check_root