Skip to content

Commit 4e22b50

Browse files
committed
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>
1 parent d128fa3 commit 4e22b50

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

initrd/bin/config-gui.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,21 @@ while true; do
182182
\n\nDo you want to proceed?" 0 80) then
183183
read_rom /tmp/config-gui.rom
184184
# clear local keyring
185-
rm /.gnupg/* | true
185+
rm -rf /.gnupg/* || true
186+
186187
# clear /boot signatures/checksums
188+
detect_boot_device
187189
mount -o remount,rw /boot
188-
rm /boot/kexec* | true
190+
rm -f /boot/kexec* || true
189191
mount -o remount,ro /boot
192+
190193
# clear GPG keys and user settings
191194
for i in `cbfs.sh -o /tmp/config-gui.rom -l | grep -e "heads/"`; do
192195
cbfs.sh -o /tmp/config-gui.rom -d $i
193196
done
194197
# flash cleared ROM
195-
196-
197198
/bin/flash.sh -c /tmp/config-gui.rom
199+
198200
# reset TPM if present
199201
if [ "$CONFIG_TPM" = "y" ]; then
200202
/bin/tpm-reset

0 commit comments

Comments
 (0)