initrd: speed up non-GUI booting

by not generating the kexec_tree diff in that case
This commit is contained in:
3hhh 2023-01-12 17:18:52 +01:00
parent f52466edbf
commit e368c3f6ea
No known key found for this signature in database
GPG Key ID: EB03A691DB2F0833
2 changed files with 3 additions and 1 deletions

View File

@ -52,7 +52,7 @@ verify_global_hashes()
{
echo "+++ Checking verified boot hash file "
# Check the hashes of all the files
if verify_checksums "$bootdir" ; then
if verify_checksums "$bootdir" "$gui_menu" ; then
echo "+++ Verified boot hashes "
valid_hash='y'
valid_global_hash='y'

View File

@ -400,6 +400,7 @@ escape_zero() {
verify_checksums()
{
local boot_dir="$1"
local gui="${2:-y}"
(
set +e -o pipefail
@ -412,6 +413,7 @@ verify_checksums()
print_tree > /tmp/tree_output || ret=1
if ! cmp -s "$TMP_TREE_FILE" /tmp/tree_output &> /dev/null ; then
ret=1
[[ "$gui" != "y" ]] && exit "$ret"
# produce a diff that can safely be presented to the user
# this is relatively hard as file names may e.g. contain backslashes etc.,
# which are interpreted by whiptail, less, ...