From 4e22b503bac90b190056c12d5edeec66cae36389 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Mon, 28 Oct 2024 16:24:35 -0400 Subject: [PATCH] config-gui.sh: fix bug happening when clearing all user config settings/calling config-gui.sh from recovery shell Signed-off-by: Thierry Laurion --- initrd/bin/config-gui.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/initrd/bin/config-gui.sh b/initrd/bin/config-gui.sh index 730a2a38..7f8142e6 100755 --- a/initrd/bin/config-gui.sh +++ b/initrd/bin/config-gui.sh @@ -182,19 +182,21 @@ while true; do \n\nDo you want to proceed?" 0 80) then read_rom /tmp/config-gui.rom # clear local keyring - rm /.gnupg/* | true + rm -rf /.gnupg/* || true + # clear /boot signatures/checksums + detect_boot_device mount -o remount,rw /boot - rm /boot/kexec* | true + rm -f /boot/kexec* || true mount -o remount,ro /boot + # clear GPG keys and user settings for i in `cbfs.sh -o /tmp/config-gui.rom -l | grep -e "heads/"`; do cbfs.sh -o /tmp/config-gui.rom -d $i done # flash cleared ROM - - /bin/flash.sh -c /tmp/config-gui.rom + # reset TPM if present if [ "$CONFIG_TPM" = "y" ]; then /bin/tpm-reset