tegra-helper-scripts: disable initrd-flash USB instance check

USB instances might not be consistent between the Jetson boot ROM
and the mass storage USB gadget in the running OS, so make the
cross-check of the instance ID optional, and off by default.

This means that when flashing secureboot-enabled devices using
pre-signed binaries, only one target can be flashed at a time
from a given host.

Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
Matt Madison
2025-01-21 04:04:46 -08:00
parent 65b8d6e0d5
commit afce451aaa

View File

@@ -48,6 +48,7 @@ sbk_keyfile=
skip_bootloader=0
early_final_status=0
erase_nvme=0
check_usb_instance="${TEGRAFLASH_CHECK_USB_INSTANCE:-no}"
ARGS=$(getopt -n $(basename "$0") -l "usb-instance:,help,skip-bootloader,erase-nvme" -o "u:v:h" -- "$@")
if [ $? -ne 0 ]; then
@@ -267,7 +268,7 @@ wait_for_usb_storage() {
if [ "$cand_model" = "$sessid" ]; then
ok=yes
fi
elif [ -n "$usbi" ]; then
elif [ -n "$usbi" -a "$check_usb_instance" = "yes" ]; then
cand_devpath=$(udevadm info --query=property $candidate | grep '^DEVPATH=' | cut -d= -f2)
if echo "$cand_devpath" | grep -q "/$usbi/" 2>/dev/null; then
ok=yes