diff --git a/.github/workflows/jetson-xavier-nx-devkit-emmc.yml b/.github/workflows/jetson-xavier-nx-devkit-emmc.yml index cb9c21e5..8c6057a7 100644 --- a/.github/workflows/jetson-xavier-nx-devkit-emmc.yml +++ b/.github/workflows/jetson-xavier-nx-devkit-emmc.yml @@ -1,6 +1,22 @@ name: "Nvidia Jetson Xavier NX Devkit eMMC" on: + # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore + # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet + pull_request: + branches: + - main + - master + # ESR branches glob pattern + #- 20[0-9][0-9].[0-1]?[1470].x + pull_request_target: + branches: + - main + - master + push: + tags: + # Semver tags glob pattern (includes ESR in format v20YY.MM.PATCH) + - v[0-9]+.[0-9]+.[0-9]+\+?r?e?v?* # Allows you to run this workflow manually from the Actions tab workflow_dispatch: inputs: @@ -9,6 +25,11 @@ on: required: false type: boolean default: false + deploy-environment: + description: Environment to use for build and deploy + required: false + type: string + default: balena-staging.com permissions: id-token: write # This is required for requesting the JWT #https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#requesting-the-access-token @@ -21,12 +42,24 @@ jobs: yocto: name: Yocto uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build-deploy.yml@master + # Prevent duplicate workflow executions for pull_request (PR) and pull_request_target (PRT) events. + # Both PR and PRT will be triggered for the same pull request, whether it is internal or from a fork. + # This condition will prevent the workflow from running twice for the same pull request while + # still allowing it to run for all other event types. + if: (github.event.pull_request.head.repo.full_name == github.repository) == (github.event_name == 'pull_request') secrets: inherit with: machine: jetson-xavier-nx-devkit-emmc + # worker_type defaults to testbot + # worker_fleets defaults to balena/testbot-rig,balena/testbot-rig-partners,balena/testbot-rig-x86,balena/testbot-rig-partners-x86 + test_matrix: > + { + "test_suite": ["os","cloud"], + "environment": ["balena-cloud.com"], + "worker_type": ["testbot"], + "runs_on": [["ubuntu-latest"]] + } # Allow manual workflow runs to force finalize without checking previous test runs force-finalize: ${{ inputs.force-finalize || false }} - # This workflow is just for building and then deploying to staging, nothing else - # This workflow is just for building and then deploying to staging, nothing else - deploy-environment: balena-staging.com - + # Default to balena-staging.com for workflow dispatch, but balena-cloud.com for other events + deploy-environment: ${{ inputs.deploy-environment || 'balena-cloud.com' }} diff --git a/.github/workflows/jetson-xavier-nx-devkit.yml b/.github/workflows/jetson-xavier-nx-devkit.yml index 0358a873..b23930a6 100644 --- a/.github/workflows/jetson-xavier-nx-devkit.yml +++ b/.github/workflows/jetson-xavier-nx-devkit.yml @@ -1,6 +1,22 @@ name: "Nvidia Jetson Xavier NX Devkit SD-CARD" on: + # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore + # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet + pull_request: + branches: + - main + - master + # ESR branches glob pattern + #- 20[0-9][0-9].[0-1]?[1470].x + pull_request_target: + branches: + - main + - master + push: + tags: + # Semver tags glob pattern (includes ESR in format v20YY.MM.PATCH) + - v[0-9]+.[0-9]+.[0-9]+\+?r?e?v?* # Allows you to run this workflow manually from the Actions tab workflow_dispatch: inputs: @@ -9,6 +25,11 @@ on: required: false type: boolean default: false + deploy-environment: + description: Environment to use for build and deploy + required: false + type: string + default: balena-staging.com permissions: id-token: write # This is required for requesting the JWT #https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#requesting-the-access-token @@ -21,12 +42,24 @@ jobs: yocto: name: Yocto uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build-deploy.yml@master + # Prevent duplicate workflow executions for pull_request (PR) and pull_request_target (PRT) events. + # Both PR and PRT will be triggered for the same pull request, whether it is internal or from a fork. + # This condition will prevent the workflow from running twice for the same pull request while + # still allowing it to run for all other event types. + if: (github.event.pull_request.head.repo.full_name == github.repository) == (github.event_name == 'pull_request') secrets: inherit with: machine: jetson-xavier-nx-devkit + # worker_type defaults to testbot + # worker_fleets defaults to balena/testbot-rig,balena/testbot-rig-partners,balena/testbot-rig-x86,balena/testbot-rig-partners-x86 + test_matrix: > + { + "test_suite": ["os","cloud"], + "environment": ["balena-cloud.com"], + "worker_type": ["testbot"], + "runs_on": [["ubuntu-latest"]] + } # Allow manual workflow runs to force finalize without checking previous test runs force-finalize: ${{ inputs.force-finalize || false }} - # This workflow is just for building and then deploying to staging, nothing else - # This workflow is just for building and then deploying to staging, nothing else - deploy-environment: balena-staging.com - \ No newline at end of file + # Default to balena-staging.com for workflow dispatch, but balena-cloud.com for other events + deploy-environment: ${{ inputs.deploy-environment || 'balena-cloud.com' }} diff --git a/.github/workflows/jetson-xavier.yml b/.github/workflows/jetson-xavier.yml index 6f980616..bab686ee 100644 --- a/.github/workflows/jetson-xavier.yml +++ b/.github/workflows/jetson-xavier.yml @@ -1,6 +1,22 @@ name: "Nvidia Jetson Xavier" on: + # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore + # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet + pull_request: + branches: + - main + - master + # ESR branches glob pattern + #- 20[0-9][0-9].[0-1]?[1470].x + pull_request_target: + branches: + - main + - master + push: + tags: + # Semver tags glob pattern (includes ESR in format v20YY.MM.PATCH) + - v[0-9]+.[0-9]+.[0-9]+\+?r?e?v?* # Allows you to run this workflow manually from the Actions tab workflow_dispatch: inputs: @@ -9,6 +25,11 @@ on: required: false type: boolean default: false + deploy-environment: + description: Environment to use for build and deploy + required: false + type: string + default: balena-staging.com permissions: id-token: write # This is required for requesting the JWT #https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#requesting-the-access-token @@ -21,11 +42,24 @@ jobs: yocto: name: Yocto uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build-deploy.yml@master + # Prevent duplicate workflow executions for pull_request (PR) and pull_request_target (PRT) events. + # Both PR and PRT will be triggered for the same pull request, whether it is internal or from a fork. + # This condition will prevent the workflow from running twice for the same pull request while + # still allowing it to run for all other event types. + if: (github.event.pull_request.head.repo.full_name == github.repository) == (github.event_name == 'pull_request') secrets: inherit with: machine: jetson-xavier + # worker_type defaults to testbot + # worker_fleets defaults to balena/testbot-rig,balena/testbot-rig-partners,balena/testbot-rig-x86,balena/testbot-rig-partners-x86 + test_matrix: > + { + "test_suite": ["os","cloud"], + "environment": ["balena-cloud.com"], + "worker_type": ["testbot"], + "runs_on": [["ubuntu-latest"]] + } # Allow manual workflow runs to force finalize without checking previous test runs force-finalize: ${{ inputs.force-finalize || false }} - # This workflow is just for building and then deploying to staging, nothing else - # This workflow is just for building and then deploying to staging, nothing else - deploy-environment: balena-staging.com + # Default to balena-staging.com for workflow dispatch, but balena-cloud.com for other events + deploy-environment: ${{ inputs.deploy-environment || 'balena-cloud.com' }} diff --git a/layers/meta-balena b/layers/meta-balena index 553a15b4..ee7ac3e7 160000 --- a/layers/meta-balena +++ b/layers/meta-balena @@ -1 +1 @@ -Subproject commit 553a15b444e85d07a389349cdc21156b82c012df +Subproject commit ee7ac3e7582a4fcc7e40d459e212c7462c1d8728 diff --git a/layers/meta-balena-jetson/conf/samples/conf-notes.txt b/layers/meta-balena-jetson/conf/samples/conf-notes.txt index a18efeb7..d5c9756d 100644 --- a/layers/meta-balena-jetson/conf/samples/conf-notes.txt +++ b/layers/meta-balena-jetson/conf/samples/conf-notes.txt @@ -10,8 +10,7 @@ Resin specific images available: balena-image -Forecr DSBOARD NX2 Xavier NX eMMC : $ MACHINE=forecr-dsb-nx2-xavier-nx-emmc bitbake balena-image -Nvidia Jetson AGX Orin Devkit : $ MACHINE=jetson-agx-orin-devkit bitbake balena-image -Nvidia Jetson Orin NX in Xavier NX Devkit : $ MACHINE=jetson-orin-nx-xavier-nx-devkit bitbake balena-image -Nvidia Jetson Xavier AGX : $ MACHINE=jetson-xavier bitbake balena-image +Jetson Xavier NX Devkit eMMC : $ MACHINE=jetson-xavier-nx-devkit-emmc bitbake balena-image +Nvidia Jetson Xavier NX Devkit SD-CARD : $ MACHINE=jetson-xavier-nx-devkit bitbake balena-image +Nvidia Jetson Xavier : $ MACHINE=jetson-xavier bitbake balena-image diff --git a/layers/meta-balena-jetson/recipes-core/balena-rollback/balena-rollback.bbappend b/layers/meta-balena-jetson/recipes-core/balena-rollback/balena-rollback.bbappend deleted file mode 100644 index 8802adbb..00000000 --- a/layers/meta-balena-jetson/recipes-core/balena-rollback/balena-rollback.bbappend +++ /dev/null @@ -1 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/files:" diff --git a/layers/meta-balena-jetson/recipes-core/balena-rollback/files/rollback-board-healthcheck b/layers/meta-balena-jetson/recipes-core/balena-rollback/files/rollback-board-healthcheck deleted file mode 100644 index 43052ab5..00000000 --- a/layers/meta-balena-jetson/recipes-core/balena-rollback/files/rollback-board-healthcheck +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -set -o errexit - -fw_version=$(/usr/sbin/nvbootctrl dump-slots-info | grep -E -o 'Current version: [0-9]+[.]+[0-9]' | awk '{print $3}') -kernel_l4t=$(uname -r | grep -E -o 'l4t-r[0-9]+[.]+[0-9]' | cut -d "r" -f 2) - -echo "Rollback: UEFI firmware L4T version: ${fw_version}" -echo "Rollback: Kernel L4T version: ${kernel_l4t}" - -if [[ "$fw_version" == "$kernel_l4t" ]]; then - echo "Rollback: L4T versions match" -else - echo "Rollback: L4T versions do not match" - exit 1 -fi diff --git a/layers/meta-balena-jetson/recipes-core/images/balena-image-flasher.bbappend b/layers/meta-balena-jetson/recipes-core/images/balena-image-flasher.bbappend deleted file mode 100644 index 13d55f66..00000000 --- a/layers/meta-balena-jetson/recipes-core/images/balena-image-flasher.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -include balena-image.inc - -IMAGE_INSTALL:remove:jetson-orin-nx-xavier-nx-devkit="l4t-launcher-extlinux" -IMAGE_INSTALL:append = "efitools-utils efibootmgr" - diff --git a/layers/meta-balena-jetson/recipes-core/images/balena-image.bbappend b/layers/meta-balena-jetson/recipes-core/images/balena-image.bbappend index 0c7a5356..5ce86bda 100644 --- a/layers/meta-balena-jetson/recipes-core/images/balena-image.bbappend +++ b/layers/meta-balena-jetson/recipes-core/images/balena-image.bbappend @@ -4,24 +4,14 @@ do_image:balenaos-img[depends] += " tegra-flash-dry:do_deploy" # Leave some space, just in case future L4Ts add device specific partitions # All values are in KiB -DEVICE_SPECIFIC_SPACE:jetson-agx-orin-devkit = "331776" -DEVICE_SPECIFIC_SPACE:jetson-orin-nx-xavier-nx-devkit = "331776" -DEVICE_SPECIFIC_SPACE:jetson-orin-nano-devkit-nvme = "598016" -DEVICE_SPECIFIC_SPACE:jetson-orin-nx-seeed-j4012 = "598016" DEVICE_SPECIFIC_SPACE:jetson-xavier = "921600" DEVICE_SPECIFIC_SPACE:jetson-xavier-nx-devkit-emmc = "593920" DEVICE_SPECIFIC_SPACE:jetson-xavier-nx-devkit = "593920" -BALENA_BOOT_SIZE:jetson-orin-nx-xavier-nx-devkit = "121440" -BALENA_BOOT_SIZE:jetson-orin-nano-devkit-nvme = "121440" BALENA_BOOT_SIZE:jetson-xavier = "121440" BALENA_BOOT_SIZE:jetson-xavier-nx-devkit-emmc = "121440" BALENA_BOOT_SIZE:jetson-xavier-nx-devkit = "121440" -IMAGE_ROOTFS_SIZE:jetson-agx-orin-devkit = "1003520" -IMAGE_ROOTFS_SIZE:jetson-orin-nx-xavier-nx-devkit = "983040" -IMAGE_ROOTFS_SIZE:jetson-orin-nx-seeed-j4012 = "733184" -IMAGE_ROOTFS_SIZE:jetson-orin-nano-devkit-nvme = "733184" IMAGE_ROOTFS_SIZE:jetson-xavier = "733184" IMAGE_ROOTFS_SIZE:jetson-xavier-nx-devkit-emmc = "733184" IMAGE_ROOTFS_SIZE:jetson-xavier-nx-devkit = "733184" @@ -32,8 +22,6 @@ BALENA_BOOT_PARTITION_FILES:append = " \ " PART_SPEC_FILE = "partition_specification234.txt" -PART_SPEC_FILE:jetson-orin-nano-devkit-nvme = "partition_specification234_orin_nano.txt" -PART_SPEC_FILE:jetson-orin-nx-seeed-j4012 = "partition_specification234_orin_nano.txt" PART_SPEC_FILE:jetson-xavier-nx-devkit-emmc = "partition_specification194_nxde.txt" PART_SPEC_FILE:jetson-xavier-nx-devkit = "partition_specification194_nxde.txt" PART_SPEC_FILE:jetson-xavier = "partition_specification194.txt" diff --git a/layers/meta-balena-jetson/recipes-core/images/balena-image.inc b/layers/meta-balena-jetson/recipes-core/images/balena-image.inc index 87d53c5e..288145ec 100644 --- a/layers/meta-balena-jetson/recipes-core/images/balena-image.inc +++ b/layers/meta-balena-jetson/recipes-core/images/balena-image.inc @@ -19,58 +19,6 @@ IMAGE_INSTALL:remove = "setup-nv-boot-control-service" MACHINE_EXTRA_RRECOMMENDS += " kernel-image-initramfs" MACHINE_EXTRA_RDEPENDS += " kernel-image-initramfs" -IMAGE_INSTALL:append:jetson-orin-nano-devkit-nvme = " \ - parted \ - gptfdisk \ - tegra-nvpmodel \ - tegra-configs-nvstartup \ - tegra-configs-udev \ - mtd-utils \ - tegra-bluetooth \ - tegra-wifi \ - tegra-firmware-rtl8822 \ - l4t-launcher-extlinux \ - jetson-dtbs \ - nvidia-display-driver \ - tegra-nvpower \ -" - -IMAGE_INSTALL:append:jetson-agx-orin-devkit = " \ - parted \ - gptfdisk \ - tegra-nvpmodel \ - tegra-configs-nvstartup \ - tegra-configs-udev \ - mtd-utils \ - tegra-bluetooth \ - tegra-wifi \ - tegra-firmware-rtl8822 \ - l4t-launcher-extlinux \ - jetson-dtbs \ - nvidia-display-driver \ - tegra-nvfancontrol \ - dtc \ -" - -IMAGE_INSTALL:append:jetson-orin-nx-xavier-nx-devkit = " \ - parted \ - gptfdisk \ - tegra-nvpmodel \ - tegra-configs-nvstartup \ - tegra-configs-udev \ - mtd-utils \ - tegra-bluetooth \ - tegra-wifi \ - tegra-firmware-rtl8822 \ - l4t-launcher-extlinux \ - jetson-dtbs \ - nvidia-display-driver \ - tegra-nvfancontrol \ - linux-firmware-rtl8168 \ - kernel-module-realtek \ - pciutils \ -" - XAVIER_PACKAGES = " \ tegra-redundant-boot \ tegra-nv-boot-control-config \ diff --git a/layers/meta-balena-jetson/recipes-core/systemd/systemd_%.bbappend b/layers/meta-balena-jetson/recipes-core/systemd/systemd_%.bbappend index 6a0cdd76..81c799c9 100644 --- a/layers/meta-balena-jetson/recipes-core/systemd/systemd_%.bbappend +++ b/layers/meta-balena-jetson/recipes-core/systemd/systemd_%.bbappend @@ -2,5 +2,5 @@ DEPENDS += "acl" do_install:append() { # It appears that 10s is not enough for high loads after hup - sed -i 's/10s/60s/g' ${D}/${sysconfdir}/systemd/system.conf.d/watchdog.conf + sed -i 's/10s/30s/g' ${D}/${sysconfdir}/systemd/system.conf.d/watchdog.conf } diff --git a/layers/meta-balena-jetson/recipes-kernel/linux/jetson-dtbs.bb b/layers/meta-balena-jetson/recipes-kernel/linux/jetson-dtbs.bb index 34ffda83..539722c1 100644 --- a/layers/meta-balena-jetson/recipes-kernel/linux/jetson-dtbs.bb +++ b/layers/meta-balena-jetson/recipes-kernel/linux/jetson-dtbs.bb @@ -9,39 +9,6 @@ do_install[depends] += " linux-tegra:do_deploy " S = "${WORKDIR}" DTBNAME = "${@os.path.basename(d.getVar('KERNEL_DEVICETREE', True).split()[0])}" -SRC_URI:append:jetson-agx-orin-devkit = " file://tegra234-p3701-0000-p3737-0000-spi.dtb " - -do_install:jetson-agx-orin-devkit() { - install -d ${D}/boot/ - install -m 0644 "${DEPLOY_DIR_IMAGE}/${DTBNAME}" "${D}/boot/${DTBNAME}" - install -m 0644 "${DEPLOY_DIR_IMAGE}/tegra234-p3701-0004-p3737-0000.dtb" "${D}/boot/tegra234-p3701-0004-p3737-0000.dtb" - install -m 0644 "${WORKDIR}/tegra234-p3701-0000-p3737-0000-spi.dtb" "${D}/boot/tegra234-p3701-0000-p3737-0000-spi.dtb" -} - -FILES:${PN}:jetson-agx-orin-devkit += " \ - /boot/tegra234-p3701-0000-p3737-0000.dtb \ - /boot/tegra234-p3701-0004-p3737-0000.dtb \ - /boot/tegra234-p3701-0000-p3737-0000-spi.dtb \ -" - -do_install:jetson-orin-nx-xavier-nx-devkit() { - install -d ${D}/boot/ - install -m 0644 "${DEPLOY_DIR_IMAGE}/${DTBNAME}" "${D}/boot/${DTBNAME}" -} - -FILES:${PN}:jetson-orin-nx-xavier-nx-devkit += " \ - /boot/tegra234-p3767-0000-p3509-a02.dtb \ -" - -do_install:jetson-orin-nano-devkit-nvme() { - install -d ${D}/boot/ - install -m 0644 "${DEPLOY_DIR_IMAGE}/${DTBNAME}" "${D}/boot/${DTBNAME}" -} - -FILES:${PN}:jetson-orin-nano-devkit-nvme += " \ - /boot/tegra234-p3767-0003-p3768-0000-a0.dtb \ -" - do_install:jetson-xavier() { install -d ${D}/boot/ install -m 0644 "${DEPLOY_DIR_IMAGE}/${DTBNAME}" "${D}/boot/${DTBNAME}" diff --git a/layers/meta-balena-jetson/recipes-kernel/linux/linux-tegra_%.bbappend b/layers/meta-balena-jetson/recipes-kernel/linux/linux-tegra_%.bbappend index 84237861..c007722c 100644 --- a/layers/meta-balena-jetson/recipes-kernel/linux/linux-tegra_%.bbappend +++ b/layers/meta-balena-jetson/recipes-kernel/linux/linux-tegra_%.bbappend @@ -90,7 +90,7 @@ BALENA_CONFIGS[binder] = " \ L4TVER=" l4tver=${L4T_VERSION}" -KERNEL_ARGS = " firmware_class.path=/etc/firmware fbcon=map:0 " +KERNEL_ARGS = " firmware_class.path=/etc/firmware fbcon=map:0 rootdelay=1 roottimeout=120" KERNEL_ARGS:append:jetson-xavier = " video=efifb:off nospectre_bhb " KERNEL_ARGS:append:jetson-xavier-nx-devkit-emmc = " video=efifb:off nospectre_bhb " KERNEL_ARGS:append:jetson-xavier-nx-devkit = " video=efifb:off nospectre_bhb " diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/98-efivars-agx-orin-devkit/after b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/98-efivars-agx-orin-devkit/after deleted file mode 100644 index cc2e8eae..00000000 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/98-efivars-agx-orin-devkit/after +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -set -o errexit - -# Helper function for triggering the capsule update -# on select Jetson Orin devices. Currently the L4T BSP -# offers this feature for the AGX Orin only. We can't call -# this block of code from a os-helper-* script, because -# the old OS in which this hook is run may not contain the -# os-helper. An alternative to this is not using the after -# hook at all, and use the legacy method as long as the old -# OS doesn't bindmount sysfs in the hostapp-update script - -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 -platform_spec_efivar="${efivars_dir}TegraPlatformSpec-781e084c-a330-417c-b678-38e696380cb9" -platform_compat_spec_efivar="${efivars_dir}TegraPlatformCompatSpec-781e084c-a330-417c-b678-38e696380cb9" -os_indications_efivar="${efivars_dir}OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c" -tmp_file="/tmp/platformspecfile.bin" -device_type="jetson-agx-orin-devkit" - -source /usr/bin/uefi_common.func - -boardspec=$(tegra-boardspec 2>/dev/null) -TegraPlatformSpec="${boardspec}-${device_type}-" -compatspec=$(echo "$boardspec" | gen_compat_spec) -TegraPlatformCompatSpec="${compatspec}-${device_type}-" - -write_jetson_update_efivars() { - echo "Writing of jetson efivars triggered from old OS hook" - if [ -d $efivars_dir ]; then - # If the file already exists, writing to it will fail - # causing the entire hook to fail - if [ ! -e ${platform_spec_efivar} ]; then - printf "\x07\x00\x00\x00" > ${tmp_file} - printf "%s" "${TegraPlatformSpec}" >> ${tmp_file} - dd if=${tmp_file} of=${platform_spec_efivar} - echo "PlatformSpec variable created" - else - echo "PlatformSpec variable already exists" - fi - - if [ ! -e ${platform_compat_spec_efivar} ]; then - printf "\x07\x00\x00\x00" > ${tmp_file} - printf "%s" "${TegraPlatformCompatSpec}" >> ${tmp_file} - dd if=${tmp_file} of=${platform_compat_spec_efivar} - echo "PlatformCompatSpec variable created" - else - echo "PlatformCompatSpec variable already exists" - fi - - printf "%b" '\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00' > ${tmp_file} - dd if=${tmp_file} of=${os_indications_efivar} - echo "OsIndications variable written" - else - echo "sysfs not accessible!" - return 1 - fi - - return 0 -} - -# We should at least have OsIndicationsSupported if -# the directory is populated -if [ $(ls -l ${efivars_dir}OsIndications* | wc -l) -gt 0 ]; then - write_jetson_update_efivars -else - echo "efivars directory is is empty" -fi diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/98-efivars-orin-nano-devkit-nvme/after b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/98-efivars-orin-nano-devkit-nvme/after deleted file mode 100644 index 019173e7..00000000 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/98-efivars-orin-nano-devkit-nvme/after +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -set -o errexit - -# Helper function for triggering the capsule update -# on select Jetson Orin devices. Currently the L4T BSP -# offers this feature for the AGX Orin only. We can't call -# this block of code from a os-helper-* script, because -# the old OS in which this hook is run may not contain the -# os-helper. An alternative to this is not using the after -# hook at all, and use the legacy method as long as the old -# OS doesn't bindmount sysfs in the hostapp-update script - -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 -platform_spec_efivar="${efivars_dir}TegraPlatformSpec-781e084c-a330-417c-b678-38e696380cb9" -platform_compat_spec_efivar="${efivars_dir}TegraPlatformCompatSpec-781e084c-a330-417c-b678-38e696380cb9" -os_indications_efivar="${efivars_dir}OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c" -tmp_file="/tmp/platformspecfile.bin" - -device_type="jetson-orin-nano-devkit" - -source /usr/bin/uefi_common.func - -boardspec=$(tegra-boardspec 2>/dev/null) -TegraPlatformSpec="${boardspec}-${device_type}-" -compatspec=$(echo "$boardspec" | gen_compat_spec) -TegraPlatformCompatSpec="${compatspec}-${device_type}-" - - -write_jetson_update_efivars() { - echo "Writing of jetson efivars triggered from old OS hook" - if [ -d $efivars_dir ]; then - # If the file already exists, writing to it will fail - # causing the entire hook to fail - if [ ! -e ${platform_spec_efivar} ]; then - printf "\x07\x00\x00\x00" > ${tmp_file} - printf "%s" "${TegraPlatformSpec}" >> ${tmp_file} - dd if=${tmp_file} of=${platform_spec_efivar} - echo "PlatformSpec variable created" - else - echo "PlatformSpec variable already exists" - fi - - if [ ! -e ${platform_compat_spec_efivar} ]; then - printf "\x07\x00\x00\x00" > ${tmp_file} - printf "%s" "${TegraPlatformCompatSpec}" >> ${tmp_file} - dd if=${tmp_file} of=${platform_compat_spec_efivar} - echo "PlatformCompatSpec variable created" - else - echo "PlatformCompatSpec variable already exists" - fi - - printf "%b" '\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00' > ${tmp_file} - dd if=${tmp_file} of=${os_indications_efivar} - echo "OsIndications variable written" - else - echo "sysfs not accessible!" - return 1 - fi - - return 0 -} - -# We should at least have OsIndicationsSupported if -# the directory is populated -if [ $(ls -l ${efivars_dir}OsIndications* | wc -l) -gt 0 ]; then - write_jetson_update_efivars -else - echo "efivars directory is is empty" -fi diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/98-efivars-orin-nx-xavier-nx-devkit/after b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/98-efivars-orin-nx-xavier-nx-devkit/after deleted file mode 100644 index 5bfa6321..00000000 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/98-efivars-orin-nx-xavier-nx-devkit/after +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh - -set -o errexit - -# Helper function for triggering the capsule update -# on select Jetson Orin devices. Currently the L4T BSP -# offers this feature for the AGX Orin only. We can't call -# this block of code from a os-helper-* script, because -# the old OS in which this hook is run may not contain the -# os-helper. An alternative to this is not using the after -# hook at all, and use the legacy method as long as the old -# OS doesn't bindmount sysfs in the hostapp-update script - -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 -platform_spec_efivar="${efivars_dir}TegraPlatformSpec-781e084c-a330-417c-b678-38e696380cb9" -platform_compat_spec_efivar="${efivars_dir}TegraPlatformCompatSpec-781e084c-a330-417c-b678-38e696380cb9" -os_indications_efivar="${efivars_dir}OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c" -tmp_file="/tmp/platformspecfile.bin" - -# As per the UpdateAndRedundancy bup gen docs, -# the Orin NX uses the Orin Nano type -device_type="jetson-orin-nano-devkit" - -source /usr/bin/uefi_common.func - -boardspec=$(tegra-boardspec 2>/dev/null) -TegraPlatformSpec="${boardspec}-${device_type}-" -compatspec=$(echo "$boardspec" | gen_compat_spec) -TegraPlatformCompatSpec="${compatspec}-${device_type}-" - -write_jetson_update_efivars() { - echo "Writing of jetson efivars triggered from old OS hook" - if [ -d $efivars_dir ]; then - # If the file already exists, writing to it will fail - # causing the entire hook to fail - if [ ! -e ${platform_spec_efivar} ]; then - printf "\x07\x00\x00\x00" > ${tmp_file} - printf "%s" "${TegraPlatformSpec}" >> ${tmp_file} - dd if=${tmp_file} of=${platform_spec_efivar} - echo "PlatformSpec variable created" - else - echo "PlatformSpec variable already exists" - fi - - if [ ! -e ${platform_compat_spec_efivar} ]; then - printf "\x07\x00\x00\x00" > ${tmp_file} - printf "%s" "${TegraPlatformCompatSpec}" >> ${tmp_file} - dd if=${tmp_file} of=${platform_compat_spec_efivar} - echo "PlatformCompatSpec variable created" - else - echo "PlatformCompatSpec variable already exists" - fi - - printf "%b" '\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00' > ${tmp_file} - dd if=${tmp_file} of=${os_indications_efivar} - echo "OsIndications variable written" - else - echo "sysfs not accessible!" - return 1 - fi - - return 0 -} - -# We should at least have OsIndicationsSupported if -# the directory is populated -if [ $(ls -l ${efivars_dir}OsIndications* | wc -l) -gt 0 ]; then - write_jetson_update_efivars -else - echo "efivars directory is is empty" -fi 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 deleted file mode 100644 index 323f4e06..00000000 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-agx-orin-devkit +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/sh -set -o errexit - -# Script which writes the appropriate -# device tree with embedded cmdline -# and updates the kernel, as well as -# the rest of the bootloader binaries - -. /usr/libexec/os-helpers-fs -. /usr/sbin/balena-config-vars - -DURING_UPDATE=${DURING_UPDATE:-0} -bootloader_device="/dev/mtdblock0" -internal_storage="/dev/mmcblk0" -use_capsule=1 - -bootloader_blob="/opt/tegra-binaries/TEGRA_BL_3701.Cap.gz" - -info_log() -{ - echo "[INFO] $@" -} - -check_disable_xudc() -{ - extlinuxfile="/mnt/sysroot/active/current/boot/extlinux/extlinux.conf" - - if [ -e $extlinuxfile ]; then - if grep -q "l4tver=35.1.0" "${extlinuxfile}"; then - info_log "Old root is running L4T 35.1.0, will disable tegra-xudc from the device-trees" - use_capsule=0 - for dtbfile in `find /mnt/sysroot/active/ -name "*.dtb" -type f`; do - info_log "Disabling tegra-xudc in $dtbfile ..."; - fdtput -t s $dtbfile /xudc status disabled - fdtput -t s $dtbfile / nvidia,dtsfilename "tegra234-p3701-0000-p3737-0000_xudc_disabled.dts" - current_xudc_status=$(fdtget $dtbfile /xudc status) - info_log "$dtbfile now has xudc $current_xudc_status" - done - else - info_log "extlinux file not found in old rootfs" - fi; - fi; -} - -# While the UEFI firmware accepts loading the uefi bootloader -# from any partition, it doesn't do the same for -# the update capsule, which needs to reside on a partition -# that has the boot,esp flags set. Since we originally -# integrated this device type using the default xml -# which sets these flags for the 'esp' partition only and -# we preferred to include the efi bootloader in our -# own 'resin-boot' partition instead, we do not have the flags -# set by the nvidia flashing tools and have to -# set them now. This way, on the next update the -# UEFI firmware will not load the UEFI bootloader -# from the boot partition, and instead will read the -# capsule and perform the update. -check_and_update_esp_flags() { - data_type="EBD0A0A2-B9E5-4433-87C0-68B6B72699C7" - esp_type="C12A7328-F81F-11D2-BA4B-00A0C93EC93B" - esp_index="5" - resin_boot_index="6" - - esp_part_type=$(sfdisk --part-type $internal_storage $esp_index) - resin_boot_part_type=$(sfdisk --part-type $internal_storage $resin_boot_index) - - if [ "$esp_type" = "$esp_part_type" ]; then - info_log "esp partition has esp flag, will be cleared" - sfdisk --part-type $internal_storage $esp_index $data_type - sync - else - info_log "no type change needed on esp partition" - fi - - if [ "$resin_boot_part_type" != "$esp_type" ]; then - info_log "resin-boot partition does not have esp type, must be added" - sfdisk --part-type $internal_storage $resin_boot_index $esp_type - sync - else - info_log "no type change needed on resin-boot partition" - fi -} - -check_disable_xudc - -info "Bootloader blob is $bootloader_blob" - -do_capsule_update() { - # Unzip capsule to the boot partition - mkdir -p /mnt/boot/EFI/UpdateCapsule/ - gunzip -k -c ${bootloader_blob} | dd of=/mnt/boot/EFI/UpdateCapsule/TEGRA_BL.Cap - sync - - if [ $(ls -l ${efivars_dir}OsIndications* | wc -l) -gt 0 ]; then - info "Once a release that bindmounts sysfs is available in production, the efi vars can be updated from here instead of the after hook" - else - # Once the above condition is met, we could drop the after hook and use the legacy update mode if the base release is older - # than the one with sysfs bindmount in hostapp-update - info "Sysfs directory exists, but is not bindmounted. After hook will write the efi variables from the old OS" - fi -} - -do_legacy_update() { - bootloader_blob="/opt/tegra-binaries/boot0.img.gz" - existing_bootloader_md5sum=$(dd if=$bootloader_device bs=1M status=none | md5sum | awk '{print $1}') - update_bootloader_md5sum=$(md5sum $bootloader_blob | awk '{print $1}') - - if [ ! "$existing_bootloader_md5sum" = "$update_bootloader_md5sum" ]; then - info_log "Will clear bootloader device before the update" - flash_erase /dev/mtd0 0 0 || true - info_log "Updating bootloader device" - gunzip -k -c $bootloader_blob | dd of=$bootloader_device - info_log "Updated bootloader device" - else - info_log "No need to update bootloader device" - fi - - # Sync internal memory - sync ${bootloader_device} -} - - -info "Pre-update A/B slots info:" -info "==========================" -/usr/sbin/nvbootctrl dump-slots-info || true -info "==========================" - -if [ $use_capsule -eq 1 ]; then - do_capsule_update -else - do_legacy_update -fi - -check_and_update_esp_flags 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 deleted file mode 100644 index b9b857cd..00000000 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nano-devkit-nvme +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh -set -o errexit - -# Script which writes the appropriate -# device tree with embedded cmdline -# and updates the kernel, as well as -# the rest of the bootloader binaries - -. /usr/libexec/os-helpers-fs -. /usr/sbin/balena-config-vars - -DURING_UPDATE=${DURING_UPDATE:-0} -bootloader_device="/dev/mtdblock0" -internal_storage="/dev/nvme0n1" -use_capsule=1 - -bootloader_blob="/opt/tegra-binaries/TEGRA_BL_Orin_Nano.Cap.gz" - -info_log() -{ - echo "[INFO] $@" -} - -# While the UEFI firmware accepts loading the uefi bootloader -# from any partition, it doesn't do the same for -# the update capsule, which needs to reside on a partition -# that has the boot,esp flags set. Since we originally -# integrated this device type using the default xml -# which sets these flags for the 'esp' partition only and -# we preferred to include the efi bootloader in our -# own 'resin-boot' partition instead, we do not have the flags -# set by the nvidia flashing tools and have to -# set them now. This way, on the next update the -# UEFI firmware will not load the UEFI bootloader -# from the boot partition, and instead will read the -# capsule and perform the update. -check_and_update_esp_flags() { - data_type="EBD0A0A2-B9E5-4433-87C0-68B6B72699C7" - esp_type="C12A7328-F81F-11D2-BA4B-00A0C93EC93B" - esp_index="10" - resin_boot_index="14" - - esp_part_type=$(sfdisk --part-type $internal_storage $esp_index) - resin_boot_part_type=$(sfdisk --part-type $internal_storage $resin_boot_index) - - if [ "$esp_type" = "$esp_part_type" ]; then - info_log "esp partition has esp flag, will be cleared" - sfdisk --part-type $internal_storage $esp_index $data_type - sync - else - info_log "no type change needed on esp partition" - fi - - if [ "$resin_boot_part_type" != "$esp_type" ]; then - info_log "resin-boot partition does not have esp type, must be added" - sfdisk --part-type $internal_storage $resin_boot_index $esp_type - sync - else - info_log "no type change needed on resin-boot partition" - fi -} - -info "Bootloader blob is $bootloader_blob" - -do_capsule_update() { - # Unzip capsule to the boot partition - mkdir -p /mnt/boot/EFI/UpdateCapsule/ - gunzip -k -c ${bootloader_blob} | dd of=/mnt/boot/EFI/UpdateCapsule/TEGRA_BL.Cap - sync - - if [ $(ls -l ${efivars_dir}OsIndications* | wc -l) -gt 0 ]; then - info "Once a release that bindmounts sysfs is available in production, the efi vars can be updated from here instead of the after hook" - else - # Once the above condition is met, we could drop the after hook and use the legacy update mode if the base release is older - # than the one with sysfs bindmount in hostapp-update - info "Sysfs directory exists, but is not bindmounted. After hook will write the efi variables from the old OS" - fi -} - -info "Pre-update A/B slots info:" -info "==========================" -/usr/sbin/nvbootctrl dump-slots-info || true -info "==========================" - -do_capsule_update -check_and_update_esp_flags 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 deleted file mode 100644 index d589dd13..00000000 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-seeed-j4012 +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/sh -set -o errexit - -# Script which writes the appropriate -# device tree with embedded cmdline -# and updates the kernel, as well as -# the rest of the bootloader binaries - -. /usr/libexec/os-helpers-fs -. /usr/sbin/balena-config-vars - -DURING_UPDATE=${DURING_UPDATE:-0} -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 -platform_spec_efivar="${efivars_dir}TegraPlatformSpec-781e084c-a330-417c-b678-38e696380cb9" -platform_compat_spec_efivar="${efivars_dir}TegraPlatformCompatSpec-781e084c-a330-417c-b678-38e696380cb9" -os_indications_efivar="${efivars_dir}OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c" -capsule_file="/opt/tegra-binaries/TEGRA_BL_Seeed_j4012.Cap.gz" -tmp_file="/tmp/platformspecfile.bin" - -# As per the UpdateAndRedundancy bup gen docs, -# the Orin NX uses the Orin Nano type -device_type="jetson-orin-nano-devkit" - -source /usr/bin/uefi_common.func - -boardspec=$(tegra-boardspec 2>/dev/null) -TegraPlatformSpec="${boardspec}-${device_type}-" -compatspec=$(echo "$boardspec" | gen_compat_spec) -TegraPlatformCompatSpec="${compatspec}-${device_type}-" - -info_log() -{ - echo "[INFO] $@" -} - -write_jetson_update_efivars() { - echo "Writing of jetson efivars triggered from old OS hook" - if [ -d $efivars_dir ]; then - # If the file already exists, writing to it will fail - # causing the entire hook to fail - if [ ! -e ${platform_spec_efivar} ]; then - printf "\x07\x00\x00\x00" > ${tmp_file} - printf "%s" "${TegraPlatformSpec}" >> ${tmp_file} - dd if=${tmp_file} of=${platform_spec_efivar} - echo "PlatformSpec variable created" - else - echo "PlatformSpec variable already exists" - fi - - if [ ! -e ${platform_compat_spec_efivar} ]; then - printf "\x07\x00\x00\x00" > ${tmp_file} - printf "%s" "${TegraPlatformCompatSpec}" >> ${tmp_file} - dd if=${tmp_file} of=${platform_compat_spec_efivar} - echo "PlatformCompatSpec variable created" - else - echo "PlatformCompatSpec variable already exists" - fi - - printf "%b" '\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00' > ${tmp_file} - dd if=${tmp_file} of=${os_indications_efivar} - echo "OsIndications variable written" - else - echo "sysfs not accessible!" - return 1 - fi - - return 0 -} - - -do_capsule_update() { - # Unzip capsule to the boot partition - mkdir -p /mnt/boot/EFI/UpdateCapsule/ - gunzip -k -c ${capsule_file} | dd of=/mnt/boot/EFI/UpdateCapsule/TEGRA_BL.Cap - sync -} - -info "Pre-update A/B slots info:" -info "==========================" -/usr/sbin/nvbootctrl dump-slots-info || true -info "==========================" - -write_jetson_update_efivars -do_capsule_update 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 deleted file mode 100644 index a3b4524e..00000000 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/files/99-resin-bootfiles-orin-nx-xavier-nx-devkit +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh -set -o errexit - -# Script which writes the appropriate -# device tree with embedded cmdline -# and updates the kernel, as well as -# the rest of the bootloader binaries - -. /usr/libexec/os-helpers-fs -. /usr/sbin/balena-config-vars - -DURING_UPDATE=${DURING_UPDATE:-0} -bootloader_device="/dev/mtdblock0" -internal_storage="/dev/nvme0n1" -use_capsule=1 - -bootloader_blob="/opt/tegra-binaries/TEGRA_BL_Orin_NX.Cap.gz" - -info_log() -{ - echo "[INFO] $@" -} - -# While the UEFI firmware accepts loading the uefi bootloader -# from any partition, it doesn't do the same for -# the update capsule, which needs to reside on a partition -# that has the boot,esp flags set. Since we originally -# integrated this device type using the default xml -# which sets these flags for the 'esp' partition only and -# we preferred to include the efi bootloader in our -# own 'resin-boot' partition instead, we do not have the flags -# set by the nvidia flashing tools and have to -# set them now. This way, on the next update the -# UEFI firmware will not load the UEFI bootloader -# from the boot partition, and instead will read the -# capsule and perform the update. -check_and_update_esp_flags() { - data_type="EBD0A0A2-B9E5-4433-87C0-68B6B72699C7" - esp_type="C12A7328-F81F-11D2-BA4B-00A0C93EC93B" - esp_index="5" - resin_boot_index="6" - - esp_part_type=$(sfdisk --part-type $internal_storage $esp_index) - resin_boot_part_type=$(sfdisk --part-type $internal_storage $resin_boot_index) - - if [ "$esp_type" = "$esp_part_type" ]; then - info_log "esp partition has esp flag, will be cleared" - sfdisk --part-type $internal_storage $esp_index $data_type - sync - else - info_log "no type change needed on esp partition" - fi - - if [ "$resin_boot_part_type" != "$esp_type" ]; then - info_log "resin-boot partition does not have esp type, must be added" - sfdisk --part-type $internal_storage $resin_boot_index $esp_type - sync - else - info_log "no type change needed on resin-boot partition" - fi -} - -info "Pre-update A/B slots info:" -info "==========================" -/usr/sbin/nvbootctrl dump-slots-info || true -info "==========================" - -info "Bootloader blob is $bootloader_blob" - -do_capsule_update() { - # Unzip capsule to the boot partition - mkdir -p /mnt/boot/EFI/UpdateCapsule/ - gunzip -k -c ${bootloader_blob} | dd of=/mnt/boot/EFI/UpdateCapsule/TEGRA_BL.Cap - sync - - if [ $(ls -l ${efivars_dir}OsIndications* | wc -l) -gt 0 ]; then - info "Once a release that bindmounts sysfs is available in production, the efi vars can be updated from here instead of the after hook" - else - # Once the above condition is met, we could drop the after hook and use the legacy update mode if the base release is older - # than the one with sysfs bindmount in hostapp-update - info "Sysfs directory exists, but is not bindmounted. After hook will write the efi variables from the old OS" - fi -} - -do_capsule_update -check_and_update_esp_flags diff --git a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/hostapp-update-hooks.bbappend b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/hostapp-update-hooks.bbappend index 3d96d3ea..77abc6ca 100644 --- a/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/hostapp-update-hooks.bbappend +++ b/layers/meta-balena-jetson/recipes-support/hostapp-update-hooks/hostapp-update-hooks.bbappend @@ -1,42 +1,7 @@ FILESEXTRAPATHS:append := ":${THISDIR}/files" -FILESEXTRAPATHS:append := ":${THISDIR}/98-efivars-agx-orin-devkit" -FILESEXTRAPATHS:append := ":${THISDIR}/98-efivars-orin-nx-xavier-nx-devkit" -FILESEXTRAPATHS:append := ":${THISDIR}/98-efivars-orin-nano-devkit-nvme" DEPENDS:append = " tegra-flash-dry" -HOSTAPP_HOOKS:append:jetson-agx-orin-devkit = " \ - 99-resin-uboot \ - 99-resin-bootfiles-agx-orin-devkit \ -" - -HOSTAPP_HOOKS:append:jetson-orin-nx-xavier-nx-devkit = " \ - 99-resin-uboot \ - 99-resin-bootfiles-orin-nx-xavier-nx-devkit \ -" - -HOSTAPP_HOOKS:append:jetson-orin-nano-devkit-nvme = " \ - 99-resin-uboot \ - 99-resin-bootfiles-orin-nano-devkit-nvme \ -" - -HOSTAPP_HOOKS_DIRS:append:jetson-agx-orin-devkit = " 98-efivars-agx-orin-devkit" -HOSTAPP_HOOKS:append:jetson-agx-orin-devkit = " 98-efivars-agx-orin-devkit/after " - -HOSTAPP_HOOKS_DIRS:append:jetson-orin-nx-xavier-nx-devkit = " 98-efivars-orin-nx-xavier-nx-devkit" -HOSTAPP_HOOKS:append:jetson-orin-nx-xavier-nx-devkit = " 98-efivars-orin-nx-xavier-nx-devkit/after " - -HOSTAPP_HOOKS_DIRS:append:jetson-orin-nano-devkit-nvme = " 98-efivars-orin-nano-devkit-nvme" -HOSTAPP_HOOKS:append:jetson-orin-nano-devkit-nvme = " 98-efivars-orin-nano-devkit-nvme/after " - -HOSTAPP_HOOKS:remove:jetson-orin-nx-seeed-j4012 = "99-resin-bootfiles-orin-nx-xavier-nx-devkit" -HOSTAPP_HOOKS:append:jetson-orin-nx-seeed-j4012 = " \ - 99-resin-bootfiles-orin-nx-seeed-j4012 \ -" - -HOSTAPP_HOOKS_DIRS:remove:jetson-orin-nx-seeed-j4012 = " 98-efivars-orin-nx-xavier-nx-devkit" -HOSTAPP_HOOKS:remove:jetson-orin-nx-seeed-j4012 = " 98-efivars-orin-nx-xavier-nx-devkit/after" - # 98-resin-bootfiles-jetson-xavier HOSTAPP_HOOKS:append:jetson-xavier = " \ 99-resin-uboot \ diff --git a/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher-board.bbappend b/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher-board.bbappend deleted file mode 100644 index d5050a86..00000000 --- a/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher-board.bbappend +++ /dev/null @@ -1,8 +0,0 @@ -FILESEXTRAPATHS:append := "${THISDIR}/${PN}" - -SRC_URI:jetson-xavier = "file://resin-init-flasher-board-xavier-agx-emmc" - -do_install:jetson-xavier() { - install -d ${D}${bindir} - install -m 0755 ${WORKDIR}/resin-init-flasher-board-xavier-agx-emmc ${D}${bindir}/resin-init-flasher-board -} diff --git a/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher-board/resin-init-flasher-board b/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher-board/resin-init-flasher-board deleted file mode 100755 index 47c5571f..00000000 --- a/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher-board/resin-init-flasher-board +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -set -e - -mtd_debug erase /dev/mtd0 0x0 0x4000000 -gunzip -k -c /opt/tegra-binaries/boot0.img.gz | dd of=/tmp/boot0.img bs=1M -mtd_debug write /dev/mtd0 0x0 0x4000000 /tmp/boot0.img -sync - -# Relocate secondary gpt after writing image to the nvme with dd -sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/nvme0n1 - v - w -EOF diff --git a/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher-board/resin-init-flasher-board-xavier-agx-emmc b/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher-board/resin-init-flasher-board-xavier-agx-emmc deleted file mode 100755 index e5ace822..00000000 --- a/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher-board/resin-init-flasher-board-xavier-agx-emmc +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -set -e - -echo 0 > /sys/block/mmcblk0boot0/force_ro -dd if=/opt/tegra-binaries/boot0_mmcblk0boot0.img of=/dev/mmcblk0boot0 bs=1M -echo 1 > /sys/block/mmcblk0boot0/force_ro -sync - -# Relocate secondary gpt after writing image to the emmc with dd -sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/mmcblk0 - v - w -EOF diff --git a/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher.bbappend b/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher.bbappend deleted file mode 100644 index 873a59d6..00000000 --- a/layers/meta-balena-jetson/recipes-support/resin-init/resin-init-flasher.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -# write internal balenaOS image to the NVME -INTERNAL_DEVICE_KERNEL = "nvme0n1" - -# or to the eMMC, in the case of the Xavier AGX -INTERNAL_DEVICE_KERNEL:jetson-xavier = "mmcblk0"