if(whiptail --title 'Flash the BIOS with a new ROM'\
--yesno "This requires you insert a USB drive containing:\n* Your BIOS image (*.rom)\n\nAfter you select this file, this program will reflash your BIOS\n\nDo you want to proceed?"16 90)then
mount_usb
if grep -q /media /proc/mounts ;then
find /media -name '*.rom' > /tmp/filelist.txt
file_selector "/tmp/filelist.txt""Choose the ROM to flash"
if["$FILE"==""];then
return
else
ROM=$FILE
fi
if(whiptail --title 'Flash ROM?'\
--yesno "This will replace your old ROM with $ROM\n\nDo you want to proceed?"16 90)then
if(whiptail --title 'ROM and GPG public key required'\
--yesno "This requires you insert a USB drive containing:\n* Your GPG public key (*.key or *.asc)\n* Your BIOS image (*.rom)\n\nAfter you select these files, this program will reflash your BIOS\n\nDo you want to proceed?"16 90)then
mount_usb
if grep -q /media /proc/mounts ;then
find /media -name '*.key' > /tmp/filelist.txt
find /media -name '*.asc' >> /tmp/filelist.txt
file_selector "/tmp/filelist.txt""Choose your GPG public key"
if["$FILE"==""];then
return
else
PUBKEY=$FILE
fi
find /media -name '*.rom' > /tmp/filelist.txt
file_selector "/tmp/filelist.txt""Choose the ROM to load your key onto"
--msgbox "$ROM flashed successfully.\n\nIf your keys have changed, be sure to re-sign all files in /boot\nafter you reboot.\n\nPress Enter to reboot"1660
--yesno "Flashing the running BIOS requires you insert a USB drive containing:\n* Your GPG public key (*.key or *.asc)\n\nAfter you select this file, this program will copy and reflash your BIOS\n\nDo you want to proceed?"16 90)then
mount_usb
if grep -q /media /proc/mounts ;then
find /media -name '*.key' > /tmp/filelist.txt
find /media -name '*.asc' >> /tmp/filelist.txt
file_selector "/tmp/filelist.txt""Choose your GPG public key"
--msgbox "BIOS updated successfully.\n\nIf your keys have changed, be sure to re-sign all files in /boot\nafter you reboot.\n\nPress Enter to reboot"1660