Skip to content

Commit 6873df6

Browse files
Remove CONFIG_BRAND_UPDATE_PKG_EXT, use zip everywhere
Nitrokey is going to switch from npf to zip per discussion. Remove this config. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
1 parent 56d38e1 commit 6873df6

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CB_OUTPUT_BASENAME := $(shell echo $(BRAND_NAME) | tr A-Z a-z)-$(BOARD)-$(HEADS_
1616
CB_OUTPUT_FILE := $(CB_OUTPUT_BASENAME).rom
1717
CB_OUTPUT_FILE_GPG_INJ := $(CB_OUTPUT_BASENAME)-gpg-injected.rom
1818
CB_BOOTBLOCK_FILE := $(CB_OUTPUT_BASENAME).bootblock
19+
CB_UPDATE_PKG_FILE := $(CB_OUTPUT_BASENAME).zip
1920
LB_OUTPUT_FILE := linuxboot-$(BOARD)-$(HEADS_GIT_VERSION).rom
2021

2122
all:
@@ -58,11 +59,6 @@ CONFIG_LEGACY_FLASH := n
5859

5960
include $(CONFIG)
6061

61-
# Default update package extension is 'zip' unless a brand wants a branded
62-
# extension
63-
CONFIG_BRAND_UPDATE_PKG_EXT ?= zip
64-
CB_UPDATE_PKG_FILE := $(CB_OUTPUT_BASENAME).$(CONFIG_BRAND_UPDATE_PKG_EXT)
65-
6662
# Unless otherwise specified, we are building for heads
6763
CONFIG_HEADS ?= y
6864

initrd/bin/flash-gui.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ if [ "$CONFIG_RESTRICTED_BOOT" = y ]; then
1313
exit 1
1414
fi
1515

16-
# A brand can override the extension used for update packages if desired
17-
UPDATE_PKG_EXT="${CONFIG_BRAND_UPDATE_PKG_EXT:-zip}"
18-
1916
# Most boards use a .rom file as a "plain" update, contents of the BIOS flash
2017
UPDATE_PLAIN_EXT=rom
2118
# talos-2 uses a .tgz file for its "plain" update, contains other parts as well
@@ -60,13 +57,13 @@ while true; do
6057
;;
6158
f | c)
6259
if (whiptail $BG_COLOR_WARNING --title 'Flash the BIOS with a new ROM' \
63-
--yesno "You will need to insert a USB drive containing your BIOS image (*.$UPDATE_PKG_EXT 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
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
6461
mount_usb
6562
if grep -q /media /proc/mounts; then
6663
if [ "${CONFIG_BOARD%_*}" = talos-2 ]; then
6764
find /media ! -path '*/\.*' -type f -name "*.$UPDATE_PLAIN_EXT" | sort >/tmp/filelist.txt
6865
else
69-
find /media ! -path '*/\.*' -type f \( -name "*.$UPDATE_PLAIN_EXT" -o -type f -name "*.$UPDATE_PKG_EXT" \) | sort >/tmp/filelist.txt
66+
find /media ! -path '*/\.*' -type f \( -name "*.$UPDATE_PLAIN_EXT" -o -type f -name "*.zip" \) | sort >/tmp/filelist.txt
7067
fi
7168
file_selector "/tmp/filelist.txt" "Choose the ROM to flash"
7269
if [ "$FILE" == "" ]; then
@@ -76,7 +73,7 @@ while true; do
7673
fi
7774

7875
# is an update package provided?
79-
if [ -z "${PKG_FILE##*.$UPDATE_PKG_EXT}" ]; then
76+
if [ -z "${PKG_FILE##*.zip}" ]; then
8077
# Unzip the package
8178
PKG_EXTRACT="/tmp/flash_gui/update_package"
8279
rm -rf "$PKG_EXTRACT"
@@ -120,7 +117,7 @@ while true; do
120117
ROM="$PKG_FILE"
121118
ROM_HASH=$(sha256sum "$ROM" | awk '{print $1}') || die "Failed to hash ROM file"
122119
if ! (whiptail $CONFIG_ERROR_BG_COLOR --title 'Flash ROM without integrity check?' \
123-
--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 *.$UPDATE_PKG_EXT 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
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
124121
exit 1
125122
fi
126123
else

0 commit comments

Comments
 (0)