oem-factory-reset: GPG Comment is required in current code base, not optional. Change Questionnaire and validate size properly

Fixes https://github.com/linuxboot/heads/issues/1949

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
Thierry Laurion 2025-04-03 13:00:49 -04:00
parent ed06b416a5
commit ea5d948819
No known key found for this signature in database
GPG Key ID: 9A53E1BB3FF00461

View File

@ -1164,13 +1164,13 @@ if [ "$use_defaults" == "n" -o "$use_defaults" == "N" ]; then
}
done
echo -e "\nEnter Comment (Optional, to distinguish this key from others with same previous attributes. Must be smaller then 60 characters):"
read -r GPG_USER_COMMENT
while [[ ${#GPG_USER_COMMENT} -gt 60 ]]; do
{
echo -e "\nEnter Comment (Optional, to distinguish this key from others with same previous attributes. Must be smaller then 60 characters):"
read -r GPG_USER_COMMENT
}
echo -e "\nEnter Comment (Required: Use this to distinguish this key from others, e.g., its purpose or usage context. Must be 1-60 characters):"
while true; do
read -r GPG_USER_COMMENT
if [[ ${#GPG_USER_COMMENT} -ge 1 && ${#GPG_USER_COMMENT} -le 60 ]]; then
break
fi
echo -e "\nComment must be 1-60 characters long. Please try again:"
done
fi