You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (whiptail $BG_COLOR_WARNING --title 'Flash the BIOS with a new ROM' \
33
-
--yesno "You will need to insert a USB drive containing your BIOS image (*.rom, *.npf or *.tgz).\n\nAfter you select this file, this program will reflash your BIOS.\n\nDo you want to proceed?" 0 80);then
60
+
--yesno "You will need to insert a USB drive containing your BIOS image (*.zip or\n*.$UPDATE_PLAIN_EXT).\n\nAfter you select this file, this program will reflash your BIOS.\n\nDo you want to proceed?" 0 80);then
34
61
mount_usb
35
62
if grep -q /media /proc/mounts;then
36
-
find /media ! -path '*/\.*' -type f \( -name '*.rom' -o -name '*.tgz' -o -type f -name '*.npf'\)| sort >/tmp/filelist.txt
--yesno "This will replace your current ROM with:\n\n${PKG_FILE#"/media/"}\n\nDo you want to proceed?" 0 80;then
107
+
exit 1
108
+
fi
109
+
110
+
# Continue on using the verified ROM
111
+
ROM="$PACKAGE_ROM"
59
112
else
113
+
# talos-2 uses a .tgz file for its "plain" update, contains other parts as well, validated against hashes under flash.sh
114
+
# Skip prompt for hash validation for talos-2. Only method is through tgz or through bmc with individual parts
115
+
if [ "${CONFIG_BOARD%_*}"!= talos-2 ];then
60
116
# a rom file was provided. exit if we shall not proceed
117
+
ROM="$PKG_FILE"
61
118
ROM_HASH=$(sha256sum "$ROM"| awk '{print $1}')|| die "Failed to hash ROM file"
62
119
if! (whiptail $CONFIG_ERROR_BG_COLOR --title 'Flash ROM without integrity check?' \
63
-
--yesno "You have provided a *.rom file. The integrity of the file can not be\nchecked automatically for this file type.\n\nROM: $ROM\nSHA256SUM: $ROM_HASH\n\nIf you do not know how to check the file integrity yourself,\nyou should use a *.npf file instead.\n\nIf the file is damaged, you will not be able to boot anymore.\nDo you want to proceed flashing without file integrity check?" 0 80);then
64
-
exit
120
+
--yesno "You have provided a *.$UPDATE_PLAIN_EXT file. The integrity of the file can not be\nchecked automatically for this file type.\n\nROM: $ROM\nSHA256SUM: $ROM_HASH\n\nIf you do not know how to check the file integrity yourself,\nyou should use a *.zip file instead.\n\nIf the file is damaged, you will not be able to boot anymore.\nDo you want to proceed flashing without file integrity check?" 0 80);then
121
+
exit 1
122
+
fi
123
+
else
124
+
#We are on talos-2, so we have a tgz file. We will pass it directly to flash.sh which will take care of it
125
+
ROM="$PKG_FILE"
65
126
fi
66
127
fi
67
128
@@ -79,7 +140,7 @@ while true; do
79
140
/bin/flash.sh "$ROM"
80
141
fi
81
142
whiptail --title 'ROM Flashed Successfully' \
82
-
--msgbox "${ROM#"/media/"}\n\nhas been flashed successfully.\n\nPress Enter to reboot\n" 0 80
143
+
--msgbox "${PKG_FILE#"/media/"}\n\nhas been flashed successfully.\n\nPress Enter to reboot\n" 0 80
0 commit comments