initrd: assert_signable: use recovery() instead of die()

and display some more information to the user, if
available
This commit is contained in:
3hhh 2023-01-14 10:27:42 +01:00
parent c65d6b92c0
commit 2ae7f53e04
No known key found for this signature in database
GPG Key ID: EB03A691DB2F0833

View File

@ -410,7 +410,10 @@ assert_signable() {
local del='\001-\037\134\177-\377'
LC_ALL=C tr -d "$del" < /tmp/signable.ref > /tmp/signable.del || die "Failed to execute tr."
if ! cmp -s "/tmp/signable.ref" "/tmp/signable.del" &> /dev/null ; then
die "Some /boot file names contain characters that are currently not supported by heads: $del"$'\n'"Please investigate!"
local user_out="/tmp/hash_output_mismatches"
local add="Please investigate!"
[ -f "$user_out" ] && add="Please investigate the following relative paths to /boot (where # are sanitized invalid characters):"$'\n'"$(cat "$user_out")"
recovery "Some /boot file names contain characters that are currently not supported by heads: $del"$'\n'"$add"
fi
rm -f /tmp/signable.*
}