config-gui.sh: fix bug happening when clearing all user config settings/calling config-gui.sh from recovery shell

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
Thierry Laurion 2024-10-28 16:24:35 -04:00
parent d128fa3f87
commit 4e22b503ba

View File

@ -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