From 5230b9225cde43a07a688f82b83a54bf2bbf8de2 Mon Sep 17 00:00:00 2001 From: Alexandru Costache Date: Tue, 26 Nov 2024 16:05:43 +0000 Subject: [PATCH] hostapp-update-hooks: Remove hardcoded internal devices ... and determine the internal device during HUP, as this would allow to boot the flasher Orins from multiple targets, depending on the flasher config.json settings. Signed-off-by: Alexandru Costache --- .../files/99-resin-bootfiles-agx-orin-devkit | 2 +- .../files/99-resin-bootfiles-agx-orin-devkit-64gb | 2 +- .../files/99-resin-bootfiles-orin-nano-devkit-nvme | 2 +- .../files/99-resin-bootfiles-orin-nano-seeed-j3010 | 2 +- .../files/99-resin-bootfiles-orin-nx-seeed-j4012 | 2 +- .../files/99-resin-bootfiles-orin-nx-xavier-nx-devkit | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-agx-orin-devkit b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-agx-orin-devkit index 7f6830e6..890c1d14 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-agx-orin-devkit +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-agx-orin-devkit @@ -12,7 +12,7 @@ source /usr/bin/uefi_common.func DURING_UPDATE=${DURING_UPDATE:-0} bootloader_blob="/opt/tegra-binaries/TEGRA_BL_3701.Cap.gz" bootloader_device="/dev/mtdblock0" -internal_storage="/dev/mmcblk0" +internal_storage="/dev/$(findmnt --noheadings --canonicalize --output SOURCE "/mnt/sysroot/active/" | xargs lsblk -no pkname)" use_capsule=1 efivars_dir="/sys/firmware/efi/efivars/" # See https://github.com/OE4T/meta-tegra/blob/master/recipes-bsp/tools/setup-nv-boot-control/setup-nv-boot-control.sh.in diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-agx-orin-devkit-64gb b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-agx-orin-devkit-64gb index f67cb472..6e34c7e7 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-agx-orin-devkit-64gb +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-agx-orin-devkit-64gb @@ -11,7 +11,7 @@ source /usr/bin/uefi_common.func DURING_UPDATE=${DURING_UPDATE:-0} bootloader_device="/dev/mtdblock0" -internal_storage="/dev/nvme0n1" +internal_storage="/dev/$(findmnt --noheadings --canonicalize --output SOURCE "/mnt/sysroot/active/" | xargs lsblk -no pkname)" use_capsule=1 bootloader_blob="/opt/tegra-binaries/TEGRA_BL_3701_64.Cap.gz" efivars_dir="/sys/firmware/efi/efivars/" diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nano-devkit-nvme b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nano-devkit-nvme index 280ce073..dc9e135b 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nano-devkit-nvme +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nano-devkit-nvme @@ -20,7 +20,7 @@ device_type="jetson-orin-nano-devkit" DURING_UPDATE=${DURING_UPDATE:-0} bootloader_device="/dev/mtdblock0" -internal_storage="/dev/nvme0n1" +internal_storage="/dev/$(findmnt --noheadings --canonicalize --output SOURCE "/mnt/sysroot/active/" | xargs lsblk -no pkname)" use_capsule=1 bootloader_blob="/opt/tegra-binaries/TEGRA_BL_Orin_Nano.Cap.gz" boardspec=$(tegra-boardspec 2>/dev/null) diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nano-seeed-j3010 b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nano-seeed-j3010 index 006b206d..38f1107e 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nano-seeed-j3010 +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nano-seeed-j3010 @@ -11,7 +11,7 @@ source /usr/bin/uefi_common.func DURING_UPDATE=${DURING_UPDATE:-0} bootloader_device="/dev/mtdblock0" -internal_storage="/dev/nvme0n1" +internal_storage="/dev/$(findmnt --noheadings --canonicalize --output SOURCE "/mnt/sysroot/active/" | xargs lsblk -no pkname)" use_capsule=1 bootloader_blob="/opt/tegra-binaries/TEGRA_BL_Seeed_j3010.Cap.gz" efivars_dir="/sys/firmware/efi/efivars/" diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-seeed-j4012 b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-seeed-j4012 index 6dfb4b74..375fbb60 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-seeed-j4012 +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-seeed-j4012 @@ -11,7 +11,7 @@ source /usr/bin/uefi_common.func DURING_UPDATE=${DURING_UPDATE:-0} bootloader_device="/dev/mtdblock0" -internal_storage="/dev/nvme0n1" +internal_storage="/dev/$(findmnt --noheadings --canonicalize --output SOURCE "/mnt/sysroot/active/" | xargs lsblk -no pkname)" use_capsule=1 bootloader_blob="/opt/tegra-binaries/TEGRA_BL_Seeed_j4012.Cap.gz" efivars_dir="/sys/firmware/efi/efivars/" diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-xavier-nx-devkit b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-xavier-nx-devkit index 21c61e3c..5c9ff1f4 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-xavier-nx-devkit +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-xavier-nx-devkit @@ -11,7 +11,7 @@ source /usr/bin/uefi_common.func DURING_UPDATE=${DURING_UPDATE:-0} bootloader_device="/dev/mtdblock0" -internal_storage="/dev/nvme0n1" +internal_storage="/dev/$(findmnt --noheadings --canonicalize --output SOURCE "/mnt/sysroot/active/" | xargs lsblk -no pkname)" use_capsule=1 bootloader_blob="/opt/tegra-binaries/TEGRA_BL_Orin_NX.Cap.gz" efivars_dir="/sys/firmware/efi/efivars/"