mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-20 09:16:21 +00:00
gpg_flash_rom(): ensure files exist before adding to CBFS
Check that any files added to cbfs exist before attempting to add them, so flashing doesn't fail after a reset. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
This commit is contained in:
parent
928f003550
commit
29f89ae47b
@ -105,7 +105,9 @@ gpg_flash_rom() {
|
||||
if (cbfs -o /tmp/gpg-gui.rom -l | grep -q "heads/initrd/.gnupg/trustdb.gpg") then
|
||||
cbfs -o /tmp/gpg-gui.rom -d "heads/initrd/.gnupg/trustdb.gpg"
|
||||
fi
|
||||
cbfs -o /tmp/gpg-gui.rom -a "heads/initrd/.gnupg/trustdb.gpg" -f /.gnupg/trustdb.gpg
|
||||
if [ -e /.gnupg/trustdb.gpg ]; then
|
||||
cbfs -o /tmp/gpg-gui.rom -a "heads/initrd/.gnupg/trustdb.gpg" -f /.gnupg/trustdb.gpg
|
||||
fi
|
||||
|
||||
#Remove old method owner trust exported file
|
||||
if (cbfs -o /tmp/gpg-gui.rom -l | grep -q "heads/initrd/.gnupg/otrust.txt") then
|
||||
@ -116,8 +118,9 @@ gpg_flash_rom() {
|
||||
if (cbfs -o /tmp/gpg-gui.rom -l | grep -q "heads/initrd/etc/config.user") then
|
||||
cbfs -o /tmp/gpg-gui.rom -d "heads/initrd/etc/config.user"
|
||||
fi
|
||||
cbfs -o /tmp/gpg-gui.rom -a "heads/initrd/etc/config.user" -f /etc/config.user
|
||||
|
||||
if [ -e /etc/config.user ]; then
|
||||
cbfs -o /tmp/gpg-gui.rom -a "heads/initrd/etc/config.user" -f /etc/config.user
|
||||
fi
|
||||
/bin/flash.sh /tmp/gpg-gui.rom
|
||||
|
||||
if (whiptail --title 'BIOS Flashed Successfully' \
|
||||
|
Loading…
x
Reference in New Issue
Block a user