diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b4d2434..6732d5ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,6 +90,8 @@ jobs: experimental: true - board: rock-pi-e experimental: true + - board: jetson-agx-orin-devkit + experimental: true runs-on: [self-hosted, linux, x64] container: diff --git a/kas/include/tegra-base.yml b/kas/include/tegra-base.yml new file mode 100644 index 00000000..ccea9d73 --- /dev/null +++ b/kas/include/tegra-base.yml @@ -0,0 +1,32 @@ +header: + version: 11 + +repos: + meta-tegra: + url: https://github.com/OE4T/meta-tegra.git + meta-tegra-community: + url: https://github.com/OE4T/meta-tegra-community.git + meta-tegrademo: + url: https://github.com/OE4T/tegra-demo-distro.git + layers: + layers/meta-tegra-support: + layers/meta-demo-ci: + layers/meta-tegrademo: + + meta-openembedded: + layers: + meta-filesystems: + meta-networking: + meta-python: + + meta-virtualization: + url: https://git.yoctoproject.org/meta-virtualization.git + +distro: tegrademo + +local_conf_header: + tegra: | + # these two classes only work as intended when being inherited in the + # OE4t setup-env.sh style environment, as they modify bblayers.conf + # and expect additional information on the host. + INHERIT:remove = "tegra-support-sanity distro_layer_buildinfo" \ No newline at end of file diff --git a/kas/include/tegra-jetpack4.yml b/kas/include/tegra-jetpack4.yml new file mode 100644 index 00000000..8ce5e9ed --- /dev/null +++ b/kas/include/tegra-jetpack4.yml @@ -0,0 +1,29 @@ +header: + version: 11 + includes: + - kas/include/tegra-base.yml + +repos: + meta-tegra: + refspec: kirkstone-l4t-r32.7.x + layers: + .: + contrib: + meta-tegra-community: + refspec: kirkstone-l4t-r32.7.x + meta-tegrademo: + refspec: kirkstone-l4t-r32.7.x + meta-virtualization: + refspec: kirkstone + + meta-mender-community: + layers: + meta-mender-tegra/meta-mender-tegra-jetpack4: + +distro: tegrademo-mender + +#local_conf_header: +# tegra-jetpack4: | +# INHERIT:remove = "tegra-support-sanity distro_layer_buildinfo" +# MENDER_FEATURES_ENABLE:append = " mender-growfs-data" +# MENDER_FEATURES_DISABLE:append = " mender-uboot" \ No newline at end of file diff --git a/kas/include/tegra-jetpack5.yml b/kas/include/tegra-jetpack5.yml new file mode 100644 index 00000000..be4a4d17 --- /dev/null +++ b/kas/include/tegra-jetpack5.yml @@ -0,0 +1,28 @@ +header: + version: 11 + includes: + - kas/include/tegra-base.yml + +repos: + meta-tegra: + refspec: 2a808b6afb221974196d2eeab3537140ebb63cc7 + meta-tegra-community: + refspec: f5a9cf859a1414bc7654fc57c09fb7ee1b116194 + meta-tegrademo: + refspec: kirkstone + + meta-virtualization: + refspec: b3b3dbc67504e8cd498d6db202ddcf5a9dd26a9d + + meta-mender-community: + layers: + meta-mender-tegra/meta-mender-tegra-jetpack5: + +local_conf_header: + tegra-jetpack5: | + INHERIT += "tegra-mender-setup" + MENDER_FEATURES_ENABLE:append = " mender-growfs-data" + MENDER_FEATURES_DISABLE:append = " mender-uboot" + IMAGE_FSTYPES:tegra = "tegraflash mender dataimg" + IMAGE_FSTYPES:pn-tegra-minimal-initramfs:tegra = "${INITRAMFS_FSTYPES}" + IMAGE_FSTYPES:pn-tegra-initrd-flash-initramfs:tegra = "${TEGRA_INITRD_FLASH_INITRAMFS_FSTYPES}" \ No newline at end of file diff --git a/kas/include/tegra.yml b/kas/include/tegra.yml deleted file mode 100644 index 5d7582e6..00000000 --- a/kas/include/tegra.yml +++ /dev/null @@ -1,23 +0,0 @@ -header: - version: 11 - -repos: - meta-tegra: - url: https://github.com/OE4T/meta-tegra.git - refspec: kirkstone-l4t-r32.7.x - meta-tegra-community: - url: https://github.com/OE4T/meta-tegra-community.git - refspec: kirkstone-l4t-r32.7.x - - meta-openembedded: - layers: - meta-python: - - meta-mender-community: - layers: - meta-mender-tegra/meta-mender-tegra-jetpack4: - -local_conf_header: - tegra: | - INHERIT += "tegra-mender-setup" - MENDER_FEATURES_ENABLE:append = " mender-growfs-data" \ No newline at end of file diff --git a/kas/jetson-agx-orin-devkit.yml b/kas/jetson-agx-orin-devkit.yml new file mode 100644 index 00000000..5c13307c --- /dev/null +++ b/kas/jetson-agx-orin-devkit.yml @@ -0,0 +1,7 @@ +header: + version: 11 + includes: + - kas/include/mender-full.yml + - kas/include/tegra-jetpack5.yml + +machine: jetson-agx-orin-devkit diff --git a/kas/jetson-agx-xavier-devkit.yml b/kas/jetson-agx-xavier-devkit.yml index 728531ef..ea17aefd 100644 --- a/kas/jetson-agx-xavier-devkit.yml +++ b/kas/jetson-agx-xavier-devkit.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-agx-xavier-devkit diff --git a/kas/jetson-nano-2gb-devkit.yml b/kas/jetson-nano-2gb-devkit.yml index 5151754d..31fe4c09 100644 --- a/kas/jetson-nano-2gb-devkit.yml +++ b/kas/jetson-nano-2gb-devkit.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-nano-2gb-devkit diff --git a/kas/jetson-nano-devkit-emmc.yml b/kas/jetson-nano-devkit-emmc.yml index f8ce00cf..b6b5dbd6 100644 --- a/kas/jetson-nano-devkit-emmc.yml +++ b/kas/jetson-nano-devkit-emmc.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-nano-devkit-emmc diff --git a/kas/jetson-nano-devkit.yml b/kas/jetson-nano-devkit.yml index 1df83837..d105a372 100644 --- a/kas/jetson-nano-devkit.yml +++ b/kas/jetson-nano-devkit.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-nano-devkit diff --git a/kas/jetson-tx2-devkit-4gb.yml b/kas/jetson-tx2-devkit-4gb.yml index f0f384d7..b5f0c95e 100644 --- a/kas/jetson-tx2-devkit-4gb.yml +++ b/kas/jetson-tx2-devkit-4gb.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-tx2-devkit-4gb diff --git a/kas/jetson-tx2-devkit-tx2i.yml b/kas/jetson-tx2-devkit-tx2i.yml index cfb0ff16..0caa613c 100644 --- a/kas/jetson-tx2-devkit-tx2i.yml +++ b/kas/jetson-tx2-devkit-tx2i.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-tx2-devkit-tx2i diff --git a/kas/jetson-tx2-devkit.yml b/kas/jetson-tx2-devkit.yml index 3f58a649..782b9352 100644 --- a/kas/jetson-tx2-devkit.yml +++ b/kas/jetson-tx2-devkit.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-tx2-devkit diff --git a/kas/jetson-xavier-nx-devkit-emmc.yml b/kas/jetson-xavier-nx-devkit-emmc.yml index e9fe749a..6c68a5af 100644 --- a/kas/jetson-xavier-nx-devkit-emmc.yml +++ b/kas/jetson-xavier-nx-devkit-emmc.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-xavier-nx-devkit-emmc diff --git a/kas/jetson-xavier-nx-devkit-tx2-nx.yml b/kas/jetson-xavier-nx-devkit-tx2-nx.yml index 40a53c88..440c8929 100644 --- a/kas/jetson-xavier-nx-devkit-tx2-nx.yml +++ b/kas/jetson-xavier-nx-devkit-tx2-nx.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-xavier-nx-devkit-tx2-nx diff --git a/kas/jetson-xavier-nx-devkit.yml b/kas/jetson-xavier-nx-devkit.yml index 2cae99e7..74ea3b20 100644 --- a/kas/jetson-xavier-nx-devkit.yml +++ b/kas/jetson-xavier-nx-devkit.yml @@ -3,6 +3,6 @@ header: includes: - kas/include/mender-full.yml - kas/include/poky.yml - - kas/include/tegra.yml + - kas/include/tegra-jetpack4.yml machine: jetson-xavier-nx-devkit diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/README.md b/meta-mender-tegra/meta-mender-tegra-jetpack5/README.md new file mode 100644 index 00000000..2a0edc53 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/README.md @@ -0,0 +1,49 @@ +# meta-mender-tegra + +Mender integration layer for NVIDIA Tegra hardware. + +The supported and tested boards are: + +- [Jetson TX2](https://hub.mender.io/t/nvidia-tegra-jetson-tx2/123) +- [Jetson Nano](https://hub.mender.io/t/nvidia-tegra-jetson-nano/1360) +- [Jetson Xavier NX](https://hub.mender.io/t/nvidia-tegra-jetson-xavier-nx/2615) +- [Jetson AGX Xavier](https://hub.mender.io/t/nvidia-tegra-agx-xavier/2616) + +Visit the individual board links above for more information on status of the +integration and more detailed instructions on how to build and use images +together with Mender for the mentioned boards. + + +## Dependencies + +This layer depends on: + +``` +URI: https://github.com/madisongh/meta-tegra.git +layers: meta-tegra +branch: dunfell-l4t-r32.4.3 +revision: HEAD +``` + +``` +URI: https://github.com/mendersoftware/meta-mender.git +layers: meta-mender-core +branch: dunfell +revision: HEAD +``` + + +## Quick start + +See the mender hub pages and the documentation for the `tegrademo-mender` +distro on the [tegra-demo-distro](https://github.com/OE4T/tegra-demo-distro) repository +for the most up to date instructions on starting out with mender and tegra. + +## Acknowlegements + +Special thanks to [Matt Madison](https://github.com/madisongh) for his contributions to +support zeus and later branches and his work on meta-tegra which makes this mender +integration possible. + +Thanks also to [Kurt Keifer](https://github.com/kekiefer/) for his contributions and +cleanup to support additional platforms and the tegra-demo-distro on the dunfell release. diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/classes/image_types_mender_tegra.bbclass b/meta-mender-tegra/meta-mender-tegra-jetpack5/classes/image_types_mender_tegra.bbclass new file mode 100644 index 00000000..b914e370 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/classes/image_types_mender_tegra.bbclass @@ -0,0 +1,4 @@ +inherit image_types_tegra + +DATAFILE ?= "${IMAGE_BASENAME}-${MACHINE}.dataimg" +IMAGE_TEGRAFLASH_DATA ?= "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.dataimg" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/classes/tegra-mender-setup.bbclass b/meta-mender-tegra/meta-mender-tegra-jetpack5/classes/tegra-mender-setup.bbclass new file mode 100644 index 00000000..50ebb5f1 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/classes/tegra-mender-setup.bbclass @@ -0,0 +1,158 @@ +inherit l4t_bsp + +python () { + # insert l4t-mender- as a machine-specific override for tegra platforms + machine_overrides = d.getVar('MACHINEOVERRIDES', False).split(':') + try: + i = machine_overrides.index('tegra') + l4t_ver = 'l4t-mender-%s' % d.getVar('L4T_VERSION').replace('.','-') + d.setVar('MACHINEOVERRIDES', ':'.join(machine_overrides[:i] + [l4t_ver] + machine_overrides[i:])) + except ValueError: + pass +} + +def tegra_mender_set_rootfs_partsize(calc_rootfs_size_kb): + return calc_rootfs_size_kb * 1024 + +def tegra_mender_image_rootfs_size(d): + rootfspart_size = d.getVar('ROOTFSPART_SIZE') + if rootfspart_size: + calc_rootfs_size = int(rootfspart_size) // 1024 + else: + calc_rootfs_size = int(d.getVar('MENDER_CALC_ROOTFS_SIZE')) + calc_rootfs_size = (calc_rootfs_size * 95) // 100 + return calc_rootfs_size - eval(d.getVar('IMAGE_ROOTFS_EXTRA_SPACE')) + +# meta-tegra and tegraflash requirements +IMAGE_CLASSES += "image_types_mender_tegra" +IMAGE_FSTYPES += "tegraflash" + +ARTIFACTIMG_FSTYPE = "ext4" +# Generate dataimg for use with tegraflash +IMAGE_TYPEDEP:tegraflash += " dataimg" +IMAGE_FSTYPES += "dataimg" +PREFERRED_PROVIDER_u-boot-fw-utils = "u-boot-fw-utils-tegra" +PREFERRED_PROVIDER_libubootenv:tegra = "${@'libubootenv-fake' if d.getVar('PREFERRED_PROVIDER_virtual/bootloader').startswith('cboot') else 'libubootenv'}" +PREFERRED_RPROVIDER_u-boot-fw-utils = "u-boot-fw-utils-tegra" +PREFERRED_RPROVIDER_libubootenv-bin:tegra = "${@'libubootenv-fake' if d.getVar('PREFERRED_PROVIDER_virtual/bootloader').startswith('cboot') else 'libubootenv-bin'}" +PREFERRED_PROVIDER_libubootenv:tegra234 = "libubootenv-fake" + +# Note: this isn't really a boot file, just put it here to keep the mender build from +# complaining about empty IMAGE_BOOT_FILES. We won't use the full image anyway, just the mender file +IMAGE_BOOT_FILES = "u-boot-dtb.bin" +# Mender customizations to support jetson platforms. This needs to +# match up with your defined flash or sdcard layout. +# You will need to update these partition values when you update the flash layout. One way to find the correct number is to +# boot into an emergency shell and examine the /dev/mmcblk* devices, +# or use the uboot console to look at mtdparts +MENDER_DATA_PART_NUMBER_DEFAULT:tegra186 = "34" +MENDER_DATA_PART_NUMBER_DEFAULT:tegra194 = "43" +MENDER_DATA_PART_NUMBER_DEFAULT:tegra210 = "${@'16' if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1' else '23'}" +MENDER_DATA_PART_NUMBER_DEFAULT:jetson-nano-emmc = "19" +MENDER_DATA_PART_NUMBER_DEFAULT:xavier-nx = "12" +MENDER_DATA_PART_NUMBER_DEFAULT:tegra234 = "16" +MENDER_ROOTFS_PART_A_NUMBER_DEFAULT = "1" +MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:tegra186 = "33" +MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:tegra194 = "42" +MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:tegra210 = "${@'15' if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1' else '22'}" +MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:jetson-nano-emmc = "18" +MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:xavier-nx = "11" +MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:tegra234 = "2" + +# Machine name and flash layout changed for SDcard Nanos in L4T R32.5.x +MENDER_DATA_PART_NUMBER_DEFAULT:jetson-nano-devkit = "3" +MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:jetson-nano-devkit = "2" +# Machine name changed for Nano-eMMC in L4T R32.5.x +MENDER_DATA_PART_NUMBER_DEFAULT:jetson-nano-devkit-emmc = "19" +MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:jetson-nano-devkit-emmc = "18" +# Added in L4T R32.5.x +MENDER_DATA_PART_NUMBER_DEFAULT:jetson-nano-2gb-devkit = "4" +MENDER_ROOTFS_PART_B_NUMBER_DEFAULT:jetson-nano-2gb-devkit = "2" + +# Use a 4096 byte alignment for support of tegraflash scheme and default partition locations +MENDER_PARTITION_ALIGNMENT = "4096" + +MENDER_RESERVED_SPACE_BOOTLOADER_DATA = "0" + +# See note in https://docs.mender.io/1.7/troubleshooting/running-yocto-project-image#i-moved-from-an-older-meta-mender-branch-to-the-thud-branch-and +# Prevents build failure during mkfs.ext4 step on warrior +MENDER_PARTITIONING_OVERHEAD_KB = "0" +# We don't use a boot partition in the mender image, we use tegraflash to setup our boot partition +MENDER_BOOT_PART = "" +MENDER_BOOT_PART_SIZE_MB = "0" + +# Calculate the ROOTFSPART_SIZE value based on the *calculated* +# IMAGE_ROOTFS_SIZE set by mender. Do *not* use ${IMAGE_ROOTFS_SIZE} +# here; when we're called on in the context of an initramfs image +# build (for BUP payload generation), its size is set smaller than +# the actual rootfs image, so the resulting flash layout XML files +# will be different between the two contexts, leading to boot +# failures after bootloader updates. +ROOTFSPART_SIZE = "${@tegra_mender_set_rootfs_partsize(${MENDER_CALC_ROOTFS_SIZE})}" + +# See https://hub.mender.io/t/yocto-thud-release-and-mender/144 +# Default for thud and later is grub integration but we need to use u-boot integration already included. +# Leave out sdimg since we don't use this with tegra (instead use +# tegraflash) +MENDER_FEATURES_ENABLE:append:tegra = "${@tegra_mender_uboot_feature(d)}" +MENDER_FEATURES_DISABLE:append:tegra = " mender-grub mender-image-uefi" + +# Use these variables to adjust your total rootfs size across both +# images. Rootfs size will be approximately 1/2 of +# MENDER_STORAGE_TOTAL_SIZE_MB (ignoring alignment). +# Calculate the total size based on the eMMC or SDcard size configured +# for the machine, subtracting off space for the boot-related files +# and other NVIDIA-specific partitions (by default, 1GiB). +def tegra_mender_calc_total_size(d): + # For pre-production Nanos, use SDCard size, which in the machine + # config ends with a size factor (K, M, or G). Note that the + # factors are kilo/mega/giga, rather than kibi/mibi/gibi. + if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1': + sdcard_size = d.getVar('TEGRAFLASH_SDCARD_SIZE') + fchar = sdcard_size[-1:].upper() + sdcard_size = int(sdcard_size[:-1]) + if fchar == 'G': + total_size_bytes = sdcard_size * 1000 * 1000 * 1000 + elif fchar == 'K': + total_size_bytes = sdcard_size * 1000 + elif fchar == 'M': + total_size_bytes = sdcard_size * 1000 * 1000 + else: + bb.error('TEGRAFLASH_SDCARD_SIZE does not end with G, K, or M') + else: + total_size_bytes = int(d.getVar('EMMC_SIZE')) + # Mender uses mibibytes, not megabytes + return total_size_bytes // (1024*1024) - int(d.getVar('TEGRA_MENDER_RESERVED_SPACE_MB')) + +MENDER_IMAGE_ROOTFS_SIZE_DEFAULT = "${@tegra_mender_image_rootfs_size(d)}" +TEGRA_MENDER_RESERVED_SPACE_MB_DEFAULT = "1024" +TEGRA_MENDER_RESERVED_SPACE_MB_DEFAULT:jetson-nano-2gb-devkit = "5120" +TEGRA_MENDER_RESERVED_SPACE_MB ?= "${TEGRA_MENDER_RESERVED_SPACE_MB_DEFAULT}" +MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT:tegra = "${@tegra_mender_calc_total_size(d)}" + +def tegra_mender_uboot_feature(d): + if (d.getVar('PREFERRED_PROVIDER_virtual/bootloader') or '').startswith('cboot'): + return " mender-persist-systemd-machine-id" + return " mender-uboot mender-persist-systemd-machine-id" + +_MENDER_IMAGE_DEPS_EXTRA = "" +_MENDER_IMAGE_DEPS_EXTRA:tegra = "tegra-state-scripts:do_deploy" +do_image_mender[depends] += "${_MENDER_IMAGE_DEPS_EXTRA}" + +# mender-setup-image adds kernel-image and kernel-devicetree +# to MACHINE_ESSENTIAL_EXTRA_RDEPENDS, but they should *not* +# be included by default on cboot platforms. +MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:tegra194 = "kernel-image kernel-devicetree" +MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:tegra186 = "${@'kernel-image kernel-devicetree' if (d.getVar('PREFERRED_PROVIDER_virtual/bootloader') or '').startswith('cboot') else ''}" + +# Compatibility settings for handling the machine name changes +# made in L4T R32.5.x, to allow for upgrades. This does not +# include jetson-nano-qspi-sd (now jetson-nano-devkit) due to +# major changes in the flash layout. +MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-tx1-devkit = " jetson-tx1" +MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-tx2-devkit = " jetson-tx2" +MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-tx2-devkit-tx2i = " jetson-tx2i" +MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-tx2-devkit-4gb = " jetson-tx2-4gb" +MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-agx-xavier-devkit = " jetson-xavier" +MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-agx-xavier-devkit-8gb = " jetson-xavier-8gb" +MENDER_DEVICE_TYPES_COMPATIBLE:append:jetson-nano-devkit-emmc = " jetson-nano-emmc" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/conf/layer.conf b/meta-mender-tegra/meta-mender-tegra-jetpack5/conf/layer.conf new file mode 100644 index 00000000..56848cd4 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/conf/layer.conf @@ -0,0 +1,19 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "meta-mender-tegra-jetpack5" +BBFILE_PATTERN_meta-mender-tegra-jetpack5 = "^${LAYERDIR}/" +BBFILE_PRIORITY_meta-mender-tegra-jetpack5 = "10" +LAYERVERSION_meta-mender-tegra-jetpack5 = "1" +LAYERSERIES_COMPAT_meta-mender-tegra-jetpack5 = "kirkstone" +LAYERDEPENDS_meta-mender-tegra-jetpack5 = "tegra" + +BBMASK:tegra234:append = " \ + recipes-bsp/cboot/ \ + recipes-bsp/u-boot/patches \ + recipes-bsp/u-boot/libubootenv_.* \ + recipes-bsp/u-boot/u-boot.* \ + " diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/cboot/cboot-t18x_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/cboot/cboot-t18x_%.bbappend new file mode 100644 index 00000000..1a0b3847 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/cboot/cboot-t18x_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG:append = " machine-id" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/cboot/cboot-t19x_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/cboot/cboot-t19x_%.bbappend new file mode 100644 index 00000000..1a0b3847 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/cboot/cboot-t19x_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG:append = " machine-id" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-agx-orin-devkit/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-agx-orin-devkit/flash_mender.xml new file mode 100644 index 00000000..791c6fa2 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-agx-orin-devkit/flash_mender.xml @@ -0,0 +1,760 @@ + + + + + + + + + + sequential + basic + 1048576 + 0 + 8 + 0 + + + sequential + basic + 524288 + 0 + 8 + 0 + MB1FILE + 262144 + + + sequential + basic + 262144 + 0 + 8 + 0 + PSCBL1FILE + 65536 + + + sequential + basic + 131072 + 0 + 8 + 0 + 65536 + + + sequential + basic + 262144 + 0 + 8 + 0 + 65536 + + + sequential + basic + 1048576 + 0 + 8 + 0 + TSECFW + 65536 + + + sequential + basic + 1048576 + 0 + 8 + 0 + NVHOSTNVDEC + 65536 + + + sequential + basic + 524288 + 0 + 8 + 0 + MB2BLFILE + 65536 + + + sequential + basic + 262144 + 0 + 8 + 0 + XUSB_FW + 65536 + + + sequential + basic + 1572864 + 0 + 8 + 0 + BPFFILE + 65536 + + + sequential + basic + 4194304 + 0 + 8 + 0 + BPFDTB_FILE + 65536 + + + sequential + basic + 786432 + 0 + 8 + 0 + PSCFW + 65536 + + + sequential + basic + 524288 + 0 + 8 + 0 + MCE_IMAGE + 65536 + + + sequential + basic + 196608 + 0 + 8 + 0 + WB0FILE + 65536 + + + sequential + basic + 196608 + 0 + 8 + 0 + PSCRF_IMAGE + 65536 + + + sequential + basic + 131072 + 0 + 8 + 0 + MB2RF_IMAGE + 65536 + + + sequential + basic + 3670016 + 0 + 8 + 0 + TBCDTB-FILE + 65536 + + + sequential + basic + 4194304 + 0 + 8 + 0 + TOSFILE + 65536 + + + sequential + basic + 2097152 + 0 + 8 + 0 + 65536 + + + sequential + basic + 262144 + 0 + 8 + 0 + EKSFILE + 65536 + + + sequential + basic + 5242880 + 0 + 8 + 0 + DCE + 65536 + + + sequential + basic + 589824 + 0 + 8 + 0 + SPEFILE + 65536 + + + sequential + basic + 1048576 + 0 + 8 + 0 + CAMERAFW + 65536 + + + sequential + basic + 2097152 + 0 + 8 + 0 + adsp-fw.bin + 65536 + + + sequential + basic + 1376256 + 0 + 8 + 0 + 65536 + + + sequential + basic + 524288 + 0 + 8 + 0 + MB1FILE + 262144 + + + sequential + basic + 262144 + 0 + 8 + 0 + PSCBL1FILE + 65536 + + + sequential + basic + 131072 + 0 + 8 + 0 + 65536 + + + sequential + basic + 262144 + 0 + 8 + 0 + 65536 + + + sequential + basic + 1048576 + 0 + 8 + 0 + TSECFW + 65536 + + + sequential + basic + 1048576 + 0 + 8 + 0 + NVHOSTNVDEC + 65536 + + + sequential + basic + 524288 + 0 + 8 + 0 + MB2BLFILE + 65536 + + + sequential + basic + 262144 + 0 + 8 + 0 + XUSB_FW + 65536 + + + sequential + basic + 1572864 + 0 + 8 + 0 + BPFFILE + 65536 + + + sequential + basic + 4194304 + 0 + 8 + 0 + BPFDTB_FILE + 65536 + + + sequential + basic + 786432 + 0 + 8 + 0 + PSCFW + 65536 + + + sequential + basic + 524288 + 0 + 8 + 0 + MCE_IMAGE + 65536 + + + sequential + basic + 196608 + 0 + 8 + 0 + WB0FILE + 65536 + + + sequential + basic + 196608 + 0 + 8 + 0 + PSCRF_IMAGE + 65536 + + + sequential + basic + 131072 + 0 + 8 + 0 + MB2RF_IMAGE + 65536 + + + sequential + basic + 3670016 + 0 + 8 + 0 + TBCDTB-FILE + 65536 + + + sequential + basic + 4194304 + 0 + 8 + 0 + TOSFILE + 65536 + + + sequential + basic + 2097152 + 0 + 8 + 0 + 65536 + + + sequential + basic + 262144 + 0 + 8 + 0 + EKSFILE + 65536 + + + sequential + basic + 5242880 + 0 + 8 + 0 + DCE + 65536 + + + sequential + basic + 589824 + 0 + 8 + 0 + SPEFILE + 65536 + + + sequential + basic + 1048576 + 0 + 8 + 0 + CAMERAFW + 65536 + + + sequential + basic + 2097152 + 0 + 8 + 0 + adsp-fw.bin + 65536 + + + sequential + basic + 1376256 + 0 + 8 + 0 + 65536 + + + sequential + basic + 262144 + 0 + 0x8 + 0 + 65536 + + + sequential + basic + 524288 + 0 + 0x8 + 0 + 65536 + + + sequential + basic + 0x3F70000 + 196608 + 0 + 0x8 + 0 + 65536 + + + sequential + basic + 0x3FA0000 + 65536 + 65536 + 0 + 8 + 0 + + + sequential + basic + 65536 + 65536 + 0 + 8 + 0 + + + sequential + basic + 65536 + 65536 + 0 + 8 + 0 + + + sequential + basic + 0x3FD0000 + 65536 + 65536 + 0 + 0 + 8 + 0 + VERFILE + + + sequential + basic + 65536 + 65536 + 0 + 0 + 8 + 0 + VERFILE + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + + + + + sequential + basic + 512 + 0 + 8 + 0 + + + sequential + basic + 19968 + 0 + 8 + 0 + + + sequential + basic + 134217728 + 0 + 8 + 0 + LNXFILE + + + sequential + basic + 786432 + 0 + 8 + 0 + DTB_FILE + + + sequential + basic + 33161216 + 0 + 8 + 0 + + + sequential + basic + 134217728 + 0 + 8 + 0 + LNXFILE_b + + + sequential + basic + 786432 + 0 + 8 + 0 + DTB_FILE + + + sequential + basic + 33161216 + 0 + 8 + 0 + + + sequential + basic + RECSIZE + 0 + 8 + 0 + RECFILE + + + sequential + basic + 524288 + 0 + 8 + 0 + RECDTB-FILE + + + sequential + basic + 67108864 + 0 + 0x8 + 0 + ESP_FILE + C12A7328-F81F-11D2-BA4B-00A0C93EC93B + **Required.** EFI system partition with L4T Launcher. + + + sequential + basic + RECSIZE + 0 + 8 + 0 + + + sequential + basic + 524288 + 0 + 8 + 0 + + + sequential + basic + 67108864 + 0 + 0x8 + 0 + **Required.** EFI system partition for fail-safe ESP update. + + + sequential + basic + 922222592 + 0 + 8 + 0 + **Required.** Reserve space in case there is any partition change + required in the future, for example, adding new partitions or increasing size + of some partitions. + + + sequential + basic + APPSIZE + 0 + 0x8 + 16384 + 0 + APPUUID + APPFILE + **Required.** Contains the rootfs. This partition must be assigned + the "1" for id as it is physically put to the end of the device, so that it + can be accessed as the fixed known special device `/dev/mmcblk0p1`. + + + sequential + basic + APPSIZE + 0 + 0x8 + 16384 + 0 + APPUUID_b + APPFILE_b + **Required.** Contains the rootfs. This partition must be defined + after `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p2`. + + + sequential + basic + 18432 + 0 + 0x808 + DATAFILE + 0 + **Required.** Automatically takes all remaining space on the device except that + occupied by the `secondary_gpt` partition. Allocation attribute must be set to 0x808. + May be mounted and used to store user data. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-2gb-devkit/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-2gb-devkit/flash_mender.xml new file mode 100644 index 00000000..769deec4 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-2gb-devkit/flash_mender.xml @@ -0,0 +1,272 @@ + + + + + + + + sequential + basic + 262144 + 0 + 8 + 0 + **Required.** Contains Boot Configuration Table (BCT). + + + + sequential + basic + 196608 + 0 + 8 + 0 + NVCFILE + **Required.** Contains TegraBoot binary. + + + + sequential + basic + 65536 + 0 + 8 + 0 + flash.xml.bin + **Required.** Contains Partition Table. + + + + sequential + basic + 196608 + 0 + 8 + 0 + NVCFILE + **Required.** Contains a redundant copy of the TegraBoot + binary. + + + + sequential + basic + 131072 + 0 + 8 + 0 + TBCFILE + **Required.** Contains TegraBoot CPU-side binary. + + + + sequential + basic + 327680 + 0 + 0x8 + 0 + DTBFILE + **Required.** Contains Bootloader DTB binary. + + + + sequential + basic + 589824 + 0 + 8 + 0 + EBTFILE + **Required.** Contains CBoot, the final boot stage CPU bootloader + binary that loads the binary in the kernel partition.. + + + + sequential + basic + 65536 + 0 + 8 + 0 + WB0FILE + **Required.** Contains warm boot binary. + + + + sequential + basic + 196608 + 0 + 0 + 8 + 0 + BPFFILE + **Required.** Contains SC7 entry firmware. + + + + sequential + basic + 65536 + 0 + 8 + 0 + BPFDTB-FILE + **Optional.** Reserved for future use by BPMP DTB binary; + can't remove. + + + + sequential + basic + 458752 + 0 + 0 + 8 + 0 + TOSFILE + **Required.** Contains TOS binary. + + + + sequential + basic + 327680 + 0 + 0x8 + 0 + DTBFILE + **Required.** Contains kernel DTB binary. + + + + sequential + basic + 753664 + 0 + 0x8 + 0 + LNXFILE + **Required.** Contains U-Boot, which loads and launches the kernel from + the rootfs at `/boot`. + + + + sequential + basic + 131072 + 0 + 0x8 + 0 + rp4.blob + **Required.** Contains XUSB firmware file, making XUSB + a true USB 3.0 compliant host controller. + + + + sequential + basic + 0x3B0000 + 131072 + 0 + 8 + 0 + U-Boot environment area + + + + sequential + basic + 0x3E0000 + 32768 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains a redundant copy of BSP version + information. + + + + sequential + basic + 0x3F0000 + 32768 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + + + + sequential + basic + 2097152 + 0 + 8 + 0 + **Required.** Contains primary GPT of the `sdcard` device. All + partitions defined after this entry are configured in the kernel, and are accessible + by standard partition tools such as gdisk and parted. + + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + **Required.** Contains the rootfs. This partition must be defined after + `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + + + + sequential + basic + 4294967296 + 0 + 0x8 + 0 + 4096 + + + + sequential + basic + 2097152 + 0x808 + DATAFILE + + + + sequential + basic + 2097152 + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdcard` device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-devkit-emmc/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-devkit-emmc/flash_mender.xml new file mode 100644 index 00000000..cd91e003 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-devkit-emmc/flash_mender.xml @@ -0,0 +1,408 @@ + + + + + + + + sequential + basic + 1048576 + 8 + **Required.** Contains Boot Configuration Table (BCT). + + + + sequential + basic + 262144 + 8 + NVCFILE + **Required.** Contains TegraBoot binary. + + + + sequential + basic + 131072 + 8 + flash.xml.bin + **Required.** Contains Partition Table. + + + + sequential + basic + 196608 + 8 + TBCFILE + **Required.** Contains TegraBoot CPU-side binary. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains Bootloader DTB binary. + + + + sequential + basic + 655360 + 8 + EBTFILE + **Required.** Contains CBoot, the final boot stage CPU bootloader binary + that loads the binary in kernel partition. + + + + sequential + basic + 131072 + 8 + WB0FILE + **Required.** Contains warm boot binary. + + + + sequential + basic + 262144 + 8 + BPFFILE + **Required.** Contains SC7 entry firmware. + + + + sequential + basic + 458752 + 0 + 8 + 0 + BPFDTB-FILE + **Optional.** Reserved for future use by BPMP DTB binary; can't remove + + + + sequential + basic + 262144 + 8 + NVCFILE + **Required.** Contains a redundant copy of the TegraBoot + binary. + + + + sequential + basic + 131072 + 8 + flash.xml.bin + **Required.** Contains a redundant copy of the Partition + Table. + + + + sequential + basic + 196608 + 8 + TBCFILE + **Required.** Contains a redundant copy of TegraBoot CPU-side binary. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains a redundant copy of the Bootloader + DTB binary. + + + + sequential + basic + 655360 + 8 + EBTFILE + **Required.** Contains a redundant copy of CBoot. + + + + sequential + basic + 131072 + 8 + WB0FILE + **Required.** Contains a redundant copy of the + warm boot binary. + + + + sequential + basic + 262144 + 8 + BPFFILE + **Required.** Contains a redundant copy of the + SC7 Entry Firmware. + + + + sequential + basic + 458752 + 0 + 8 + 0 + BPFDTB-FILE + **Optional.** Reserved for future use by BPMP DTB binary; can't remove + + + + sequential + basic + 0x7A0000 + 262144 + 0 + 8 + 0 + **Required.** Reserved for U-Boot environment. + + + + sequential + basic + 0x7E0000 + 32768 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains a redundant copy of the + BSP version info. + + + + sequential + basic + 0x7F0000 + 32768 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + + + + sequential + basic + 2097152 + 8 + **Required.** Contains primary GPT of the `sdmmc_user` device. All + partitions defined after this entry are configured in the kernel, and are accessible + by standard partition tools such as gdisk and parted. + + + + sequential + basic + APPSIZE + 8 + APPFILE + **Required.** Contains the rootfs. This partition must be defined after + `primary_GPT` so it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains kernel DTB binary. + + + + sequential + basic + 6291456 + 8 + TOSFILE + **Required.** Contains TOS binary. + + + + sequential + basic + 81920 + 8 + EKSFILE + **Optional.** Contains the encrypted keys. + + + + sequential + basic + 67092480 + 8 + LNXFILE + **Required.** Contains U-Boot, which loads and launches the kernel from + the rootfs at `/boot`. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains a redundant copy of the + kernel DTB binary. + + + + sequential + basic + 6291456 + 8 + TOSFILE + **Required.** Contains a redundant copy of the + TOS binary. + + + + sequential + basic + 81920 + 8 + EKSFILE + **Optional.** Contains a redundant copy of the encrypted + keys. + + + + sequential + basic + 67092480 + 8 + LNXFILE + **Required.** Contains a redundant copy of U-Boot, which loads and + launches the kernel from the rootfs at `/boot`. + + + + sequential + basic + 196608 + 8 + bmp.blob + **Optional.** Contains BMP images for splash screen display during + boot. + + + + sequential + basic + 262144 + 8 + rp4.blob + **Required.** Contains the XUSB module’s firmware file, making XUSB a + true USB 3.0 compliant host controller. + + + + sequential + basic + 66060288 + 8 + 0 + **Optional.** Reserved for future use by the recovery image; removable. + + + + sequential + basic + 524288 + 8 + 0 + **Optional.** Reserved for future use by the recovery DTB image; + removable. + + + + sequential + basic + 262144 + 8 + 0 + **Optional.** Reserved for future use by boot control data; removable. + + + + sequential + basic + 262144 + 8 + 0 + **Optional.** Reserved for future use by a redundant copy of the boot control data; + removable. + + + + sequential + basic + 314572800 + 0 + 0x8 + 0 + **Optional.** Reserved for future use by the recovery filesystem; + removable. + + + + sequential + basic + 262144 + 8 + + + + sequential + basic + APPSIZE + 8 + APPFILE + + + + sequential + basic + 2097152 + 0x808 + DATAFILE + + + + sequential + basic + -1 + 8 + **Required.** Contains secondary GPT of the `sdmmc_user` + device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-devkit/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-devkit/flash_mender.xml new file mode 100644 index 00000000..f185b790 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-devkit/flash_mender.xml @@ -0,0 +1,262 @@ + + + + + + + + sequential + basic + 262144 + 0 + 8 + 0 + **Required.** Contains Boot Configuration Table (BCT). + + + + sequential + basic + 196608 + 0 + 8 + 0 + NVCFILE + **Required.** Contains TegraBoot binary. + + + + sequential + basic + 65536 + 0 + 8 + 0 + flash.xml.bin + **Required.** Contains Partition Table. + + + + sequential + basic + 196608 + 0 + 8 + 0 + NVCFILE + **Required.** Contains a redundant copy of the TegraBoot + binary. + + + + sequential + basic + 131072 + 0 + 8 + 0 + TBCFILE + **Required.** Contains TegraBoot CPU-side binary. + + + + sequential + basic + 327680 + 0 + 0x8 + 0 + DTBFILE + **Required.** Contains Bootloader DTB binary. + + + + sequential + basic + 589824 + 0 + 8 + 0 + EBTFILE + **Required.** Contains CBoot, the final boot stage CPU bootloader + binary that loads the binary in the kernel partition.. + + + + sequential + basic + 65536 + 0 + 8 + 0 + WB0FILE + **Required.** Contains warm boot binary. + + + + sequential + basic + 196608 + 0 + 0 + 8 + 0 + BPFFILE + **Required.** Contains SC7 entry firmware. + + + + sequential + basic + 65536 + 0 + 8 + 0 + BPFDTB-FILE + **Optional.** Reserved for future use by BPMP DTB binary; + can't remove. + + + + sequential + basic + 458752 + 0 + 0 + 8 + 0 + TOSFILE + **Required.** Contains TOS binary. + + + + sequential + basic + 327680 + 0 + 0x8 + 0 + DTBFILE + **Required.** Contains kernel DTB binary. + + + + sequential + basic + 753664 + 0 + 0x8 + 0 + LNXFILE + **Required.** Contains U-Boot, which loads and launches the kernel from + the rootfs at `/boot`. + + + + sequential + basic + 131072 + 0 + 0x8 + 0 + rp4.blob + **Required.** Contains XUSB firmware file, making XUSB + a true USB 3.0 compliant host controller. + + + + sequential + basic + 0x3B0000 + 131072 + 0 + 8 + 0 + U-Boot environment area + + + + sequential + basic + 0x3E0000 + 32768 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains a redundant copy of BSP version + information. + + + + sequential + basic + 0x3F0000 + 32768 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + + + + sequential + basic + 2097152 + 0 + 8 + 0 + **Required.** Contains primary GPT of the `sdcard` device. All + partitions defined after this entry are configured in the kernel, and are accessible + by standard partition tools such as gdisk and parted. + + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + **Required.** Contains the rootfs. This partition must be defined after + `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + + + + sequential + basic + 2097152 + 0x808 + DATAFILE + + + + sequential + basic + 2097152 + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdcard` device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-emmc/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-emmc/flash_mender.xml new file mode 100644 index 00000000..f0eb1bea --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-emmc/flash_mender.xml @@ -0,0 +1,406 @@ + + + + + + + + sequential + basic + 1048576 + 8 + **Required.** Contains Boot Configuration Table (BCT). + + + + sequential + basic + 262144 + 8 + NVCFILE + **Required.** Contains TegraBoot binary. + + + + sequential + basic + 131072 + 8 + flash.xml.bin + **Required.** Contains Partition Table. + + + + sequential + basic + 196608 + 8 + TBCFILE + **Required.** Contains TegraBoot CPU-side binary. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains Bootloader DTB binary. + + + + sequential + basic + 655360 + 8 + EBTFILE + **Required.** Contains CBoot, the final boot stage CPU bootloader binary + that loads the binary in kernel partition. + + + + sequential + basic + 131072 + 8 + WB0FILE + **Required.** Contains warm boot binary. + + + + sequential + basic + 262144 + 8 + BPFFILE + **Required.** Contains SC7 entry firmware. + + + + sequential + basic + 458752 + 0 + 8 + 0 + BPFDTB-FILE + **Optional.** Reserved for future use by BPMP DTB binary; can't remove + + + + sequential + basic + 262144 + 8 + NVCFILE + **Required.** Contains a redundant copy of the TegraBoot + binary. + + + + sequential + basic + 131072 + 8 + flash.xml.bin + **Required.** Contains a redundant copy of the Partition + Table. + + + + sequential + basic + 196608 + 8 + TBCFILE + **Required.** Contains a redundant copy of TegraBoot CPU-side binary. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains a redundant copy of the Bootloader + DTB binary. + + + + sequential + basic + 655360 + 8 + EBTFILE + **Required.** Contains a redundant copy of CBoot. + + + + sequential + basic + 131072 + 8 + WB0FILE + **Required.** Contains a redundant copy of the + warm boot binary. + + + + sequential + basic + 262144 + 8 + BPFFILE + **Required.** Contains a redundant copy of the + SC7 Entry Firmware. + + + + sequential + basic + 458752 + 0 + 8 + 0 + BPFDTB-FILE + **Optional.** Reserved for future use by BPMP DTB binary; can't remove + + + + + sequential + basic + 917504 + 0 + 8 + 0 + **Required.** Empty padding. + + + + sequential + basic + 65536 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains a redundant copy of the + BSP version info. + + + + sequential + basic + 65536 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + + + + sequential + basic + 2097152 + 8 + **Required.** Contains primary GPT of the `sdmmc_user` device. All + partitions defined after this entry are configured in the kernel, and are accessible + by standard partition tools such as gdisk and parted. + + + + sequential + basic + APPSIZE + 8 + APPFILE + **Required.** Contains the rootfs. This partition must be defined after + `primary_GPT` so it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains kernel DTB binary. + + + + sequential + basic + 6291456 + 8 + TOSFILE + **Required.** Contains TOS binary. + + + + sequential + basic + 81920 + 8 + EKSFILE + **Optional.** Contains the encrypted keys. + + + + sequential + basic + 67092480 + 8 + LNXFILE + **Required.** Contains U-Boot, which loads and launches the kernel from + the rootfs at `/boot`. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains a redundant copy of the + kernel DTB binary. + + + + sequential + basic + 6291456 + 8 + TOSFILE + **Required.** Contains a redundant copy of the + TOS binary. + + + + sequential + basic + 81920 + 8 + EKSFILE + **Optional.** Contains a redundant copy of the encrypted + keys. + + + + sequential + basic + 67092480 + 8 + LNXFILE + **Required.** Contains a redundant copy of U-Boot, which loads and + launches the kernel from the rootfs at `/boot`. + + + + sequential + basic + 196608 + 8 + bmp.blob + **Optional.** Contains BMP images for splash screen display during + boot. + + + + sequential + basic + 262144 + 8 + rp4.blob + **Required.** Contains the XUSB module’s firmware file, making XUSB a + true USB 3.0 compliant host controller. + + + + sequential + basic + 66060288 + 8 + 0 + **Optional.** Reserved for future use by the recovery image; removable. + + + + sequential + basic + 524288 + 8 + 0 + **Optional.** Reserved for future use by the recovery DTB image; + removable. + + + + sequential + basic + 262144 + 8 + 0 + **Optional.** Reserved for future use by boot control data; removable. + + + + sequential + basic + 262144 + 8 + 0 + **Optional.** Reserved for future use by a redundant copy of the boot control data; + removable. + + + + sequential + basic + 314572800 + 0 + 0x8 + 0 + **Optional.** Reserved for future use by the recovery filesystem; + removable. + + + + sequential + basic + 262144 + 8 + + + + sequential + basic + APPSIZE + 8 + APPFILE + + + + sequential + basic + 2097152 + 0x808 + DATAFILE + + + + sequential + basic + -1 + 8 + **Required.** Contains secondary GPT of the `sdmmc_user` + device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-qspi-sd/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-qspi-sd/flash_mender.xml new file mode 100644 index 00000000..5a974231 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-nano-qspi-sd/flash_mender.xml @@ -0,0 +1,296 @@ + + + + + + + + sequential + basic + 262144 + 0 + 8 + 0 + **Required.** Contains Boot Configuration Table (BCT). + + + + sequential + basic + 196608 + 0 + 8 + 0 + NVCFILE + **Required.** Contains TegraBoot binary. + + + + sequential + basic + 65536 + 0 + 8 + 0 + flash.xml.bin + **Required.** Contains Partition Table. + + + + sequential + basic + 196608 + 0 + 8 + 0 + NVCFILE + **Required.** Contains a redundant copy of the TegraBoot + binary. + + + + sequential + basic + 0x3B0000 + 131072 + 0 + 8 + 0 + U-Boot environment area + + + + sequential + basic + 0x3E0000 + 32768 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains a redundant copy of BSP version + information. + + + + sequential + basic + 0x3F0000 + 32768 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + + + + sequential + basic + 2097152 + 0 + 8 + 0 + **Required.** Contains primary GPT of the `sdcard` device. All + partitions defined after this entry are configured in the kernel, and are accessible + by standard partition tools such as gdisk and parted. + + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + **Required.** Contains the rootfs. This partition must be defined after + `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + + sequential + basic + 131072 + 0 + 8 + 0 + TBCFILE + **Required.** Contains TegraBoot CPU-side binary. + + + + sequential + basic + 458752 + 0 + 0x8 + 0 + DTBFILE + **Required.** Contains Bootloader DTB binary. + + + + sequential + basic + 589824 + 0 + 8 + 0 + EBTFILE + **Required.** Contains CBoot, the final boot stage CPU bootloader + binary that loads the binary in the kernel partition.. + + + + sequential + basic + 65536 + 0 + 8 + 0 + WB0FILE + **Required.** Contains warm boot binary. + + + + sequential + basic + 196608 + 0 + 0 + 8 + 0 + BPFFILE + **Required.** Contains SC7 entry firmware. + + + + sequential + basic + 393216 + 0 + 8 + 0 + BPFDTB-FILE + **Optional.** Reserved for future use by BPMP DTB binary; can't remove. + + + + sequential + basic + 65536 + 0 + 0x8 + 0 + FBFILE + **Optional.** Reserved for fuse bypass; removeable. + + + + sequential + basic + 458752 + 0 + 0 + 8 + 0 + TOSFILE + **Required.** Contains TOS binary. + + + + sequential + basic + 458752 + 0 + 0x8 + 0 + DTBFILE + **Required.** Contains kernel DTB binary. + + + + sequential + basic + 786432 + 0 + 0x8 + 0 + LNXFILE + **Required.** Contains U-Boot, which loads and launches the kernel from + the rootfs at `/boot`. + + + + sequential + basic + 65536 + 0 + 0 + 8 + 0 + EKSFILE + **Optional.** Contains the encrypted keys. + + + + sequential + basic + 81920 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Contains BMP images for splash screen display during + boot. + + + + sequential + basic + 131072 + 0 + 0x8 + 0 + rp4.blob + **Required.** Contains XUSB module’s firmware file, making XUSB + a true USB 3.0 compliant host controller. + + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + + + + sequential + basic + 2097152 + 0x808 + DATAFILE + + + + sequential + basic + 2097152 + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdcard` device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit-emmc/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit-emmc/flash_mender.xml new file mode 100644 index 00000000..a6131cb7 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit-emmc/flash_mender.xml @@ -0,0 +1,665 @@ + + + + sequential + basic + 131072 + 0 + 8 + 0 + **Required.** Contains Boot Configuration Table (BCT). + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot A; contains NVIDIA signed MB1 binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot B; contains NVIDIA signed MB1 binary. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot A; contains MB1 boot configuration table. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot B; contains MB1 boot configuration table. + + + sequential + basic + 262144 + 0 + 8 + 0 + **Required.** Slot A; contains memory configuration table. + + + sequential + basic + 262144 + 0 + 8 + 0 + **Required.** Slot B; contains memory configuration table. + + + sequential + basic + 262144 + 0 + 8 + 0 + SPEFILE + **Required.** Slot A; contains BPMP SPE-FW binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + SPEFILE + **Required.** Slot B; contains BPMP SPE-FW binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + TEGRABOOT + **Required.** Slot A; contains TegraBoot binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + TEGRABOOT + **Required.** Slot B; contains TegraBoot binary. + + + sequential + basic + 65536 + 0 + 8 + 0 + MTSPREBOOT + **Required.** Slot A; contains Denver preboot firmware. + + + sequential + basic + 65536 + 0 + 8 + 0 + MTSPREBOOT + **Required.** Slot B; contains Denver preboot firmware. + + + + sequential + basic + 196608 + 0 + 8 + 0 + MTS_MCE + **Required.** Slot A; contains microcode associated with boot, power management, + and clocks. + + + sequential + basic + 196608 + 0 + 8 + 0 + MTS_MCE + **Required.** Slot B; contains microcode associated with boot, power management, + and clocks. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MTSPROPER + **Required.** Slot A; contains microcode associated with execution + and optimization of ARM code. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MTSPROPER + **Required.** Slot B; contains microcode associated with execution + and optimization of ARM code. + + + sequential + basic + 131072 + 0 + 8 + 0 + WB0BOOT + **Required.** Slot A; contains warm boot firmware. + + + sequential + basic + 131072 + 0 + 8 + 0 + WB0BOOT + **Required.** Slot B; contains warm boot firmware. + + + sequential + basic + 4096 + 65536 + 0 + 0x8 + 0 + SMDFILE + **Required.** Slot A; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 4096 + 65536 + 0 + 0x8 + 0 + SMDFILE + **Required.** Slot B; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 196608 + 65536 + 0 + 8 + 0 + xusb_sil_rel_fw + **Required.** Slot A; contains XUSB module’s firmware file, making XUSB + a true USB 3.0 compliant host controller. + + + sequential + basic + 196608 + 0 + 8 + 0 + xusb_sil_rel_fw + **Required.** Slot B; contains XUSB module’s firmware file, making XUSB + a true USB 3.0 compliant host controller. + + + sequential + basic + 1441792 + 0 + 8 + 0 + TBCFILE + **Required.** Slot A; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in the kernel partition. + + + sequential + basic + 1441792 + 0 + 8 + 0 + TBCFILE + **Required.** Slot B; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in the kernel partition. + + + sequential + basic + 458752 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot A; contains Bootloader device tree blob + (DTB). + + + sequential + basic + 458752 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot B; contains Bootloader device tree blob + (DTB). + + + sequential + basic + 196608 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot A; contains BMP images for splash screen display during + boot. + + + sequential + basic + 196608 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot B; contains BMP images for splash screen display during + boot. + + + sequential + basic + 2621440 + 0 + 8 + 0 + TOSFILE + **Required.** Slot A; contains the trusted OS. + + + sequential + basic + 2621440 + 0 + 8 + 0 + TOSFILE + **Required.** Slot B; contains the trusted OS. + + + sequential + basic + 65536 + 0 + 8 + 0 + EKSFILE + **Optional.** Slot A; contains the encrypted keys. + + + sequential + basic + 65536 + 0 + 8 + 0 + EKSFILE + **Optional.** Slot B; contains the encrypted keys. + + + sequential + basic + 1048576 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot A; contains ADSP software. + + + sequential + basic + 1048576 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot B; contains ADSP software. + + + sequential + basic + 1048576 + 0 + 8 + 0 + CAMERAFW + **Required.** Slot A; contains `camera-rtcpu-rce` firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + CAMERAFW + **Required.** Slot B; contains `camera-rtcpu-rce` firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + + **Required.** Contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + + **Required.** Contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 1572864 + 0 + 8 + 0 + BPFFILE + **Required.** Slot A; contains BPMP firmware. + + + sequential + basic + 1572864 + 0 + 8 + 0 + BPFFILE + **Required.** Slot B; contains BPMP firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB_FILE + **Required.** Slot A; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB_FILE + **Required.** Slot B; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 65536 + 0 + 0x8 + 0 + CBOOTOPTION_FILE + **Optional.** Contains boot device selection priority list. + + + sequential + basic + 65536 + 0 + 0x8 + 0 + CBOOTOPTION_FILE + **Optional.** Contains boot device selection priority list. + + + sequential + basic + 65536 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + sequential + basic + 65536 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains a redundant copy of BSP version information. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `spi` + device. + + + + + sequential + basic + 512 + 0 + 8 + 0 + **Required.** Contains protective MBR. + + + sequential + basic + 19968 + 0 + 8 + 0 + **Required.** Contains primary GPT of the `sdmmc_user` device. All + partitions defined after this entry are configured in the kernel, and are + accessible by standard partition tools such as gdisk and parted. + + + sequential + basic + APPSIZE + 0 + 0x8 + 4096 + 0 + APPFILE + APPUUID + **Required.** Contains the rootfs. This partition must be defined + after `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + sequential + basic + 67108864 + 0 + 8 + 0 + LNXFILE + **Required.** Slot A; contains U-Boot, which loads and launches the kernel + from the rootfs at `/boot`. + + + sequential + basic + 67108864 + 0 + 8 + 0 + LNXFILE + **Required.** Slot B; contains U-Boot, which loads and launches the kernel + from the rootfs at `/boot`. + + + sequential + basic + 458752 + 0 + 8 + 0 + DTB_FILE + **Required.** Slot A; contains kernel device tree blob. + + + sequential + basic + 458752 + 0 + 8 + 0 + DTB_FILE + **Required.** Slot B; contains kernel device tree blob. + + + sequential + basic + RECSIZE + 0 + 8 + 0 + RECFILE + **Required.** Contains recovery image. + + + sequential + basic + 524288 + 0 + 8 + 0 + RECDTB-FILE + **Required.** Contains recovery DTB image. + + + sequential + basic + 262144 + 0 + 8 + 0 + BOOTCTRL-FILE + **Required.** Slot A; contains boot control data. + + + sequential + basic + 262144 + 0 + 8 + 0 + BOOTCTRL-FILE + **Required.** Slot B; contains boot control data. + + + sequential + basic + RECROOTFSSIZE + 0 + 0x8 + 0 + **Optional.** Reserved for future use by the recovery filesystem; + removable. + + + sequential + basic + APPSIZE + 0 + 0x8 + 4096 + 0 + APPFILE + APPUUID + **Required.** Contains the rootfs. This partition must be defined + after `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + sequential + basic + 18432 + 0 + 0x808 + 0 + DATAFILE + **Required.** Automatically takes all remaining space on the device except that + occupied by the `secondary_gpt` partition. Allocation attribute must be set to 0x808. + May be mounted and used to store user data. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdmmc_user` + device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit-tx2-nx/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit-tx2-nx/flash_mender.xml new file mode 100644 index 00000000..af684218 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit-tx2-nx/flash_mender.xml @@ -0,0 +1,583 @@ + + + + + + + + sequential + basic + 32768 + 0 + 8 + 0 + **Required.** Contains Boot Configuration Table. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot A; contains NVIDIA signed MB1 binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot B; contains NVIDIA signed MB1 binary. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot A; contains MB1 boot configuration table. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot B; contains MB1 boot configuration table. + + + sequential + basic + 55296 + 0 + 8 + 0 + DRAMECCFILE + **Optional.** Contains DRAM-ECC firmware. + + + sequential + basic + 4608 + 0 + 8 + 0 + BADPAGEFILE + **Optional.** Slot A; contains badpage firmware. + + + sequential + basic + 4608 + 0 + 8 + 0 + BADPAGEFILE + **Optional.** Slot B; contains badpage firmware. + + + sequential + basic + 131072 + 0 + 8 + 0 + SPEFILE + **Required.** Slot A; contains BPMP SPE-FW binary. + + + sequential + basic + 131072 + 0 + 8 + 0 + SPEFILE + **Required.** Slot B; contains BPMP SPE-FW binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB2FILE + **Required.** Slot A; contains TegraBoot binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB2FILE + **Required.** Slot B; contains TegraBoot binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MPBFILE + **Required.** Slot A; contains Denver preboot firmware. + + + sequential + basic + 262144 + 0 + 8 + 0 + MPBFILE + **Required.** Slot B; contains Denver preboot firmware. + + + sequential + basic + 4096 + 0 + 0x8 + 0 + slot_metadata.bin + **Required.** Slot A; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 4096 + 0 + 0x8 + 0 + slot_metadata.bin + **Required.** Slot B; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 65536 + 0 + 0x8 + 0 + VERFILE + **Required.** Contains a redundant copy of BSP version information. + + + sequential + basic + 65536 + 0 + 0x8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdmmc_boot` + device. + + + + + + sequential + basic + 512 + 0 + 8 + 0 + **Required.** Contains protective MBR. + + + sequential + basic + PPTSIZE + 0 + 8 + 0 + **Required.** Contains primary GPT of the `sdmmc_user` device. All + partitions defined after this entry are configured in the kernel, and are + accessible by standard partition tools such as gdisk and parted. + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + **Required.** Contains the rootfs. This partition must be defined + after `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MBPFILE + **Required.** Slot A; contains Denver boot pack firmware. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MBPFILE + **Required.** Slot B; contains Denver boot pack firmware. + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCFILE + **Required.** Slot A; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in kernel partition. + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCFILE + **Required.** Slot B; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in kernel partition. + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot A; contains Bootloader device tree blob (DTB). + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot B; contains Bootloader device tree blob (DTB). + + + sequential + basic + 3145728 + 0 + 8 + 0 + TOSFILE + **Required.** Slot A; contains the trusted OS. + + + sequential + basic + 3145728 + 0 + 8 + 0 + TOSFILE + **Required.** Slot B; contains the trusted OS. + + + sequential + basic + 2097152 + 0 + 8 + 0 + EKSFILE + **Optional.** Contains the encrypted keys. + + + sequential + basic + 4194304 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot A; contains ADSP software. + + + sequential + basic + 4194304 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot B; contains ADSP software. + + + sequential + basic + 618144 + 0 + 8 + 0 + BPFFILE + **Required.** Slot A; contains BPMP firmware. + + + sequential + basic + 618144 + 0 + 8 + 0 + BPFFILE + **Required.** Slot B; contains BPMP firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB-FILE + **Required.** Slot A; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB-FILE + **Required.** Slot B; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 2097152 + 0 + 8 + 0 + SCEFILE + **Required.** Slot A; contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 2097152 + 0 + 8 + 0 + SCEFILE + **Required.** Slot B; contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 6291456 + 0 + 8 + 0 + WB0FILE + **Required.** Slot A; contains warm boot binary. + + + sequential + basic + 6291456 + 0 + 8 + 0 + WB0FILE + **Required.** Slot B; contains warm boot binary. + + + sequential + basic + 2097152 + 0 + 0x8 + 0 + FBFILE + **Optional.** Reserved for future use; removable. + + + sequential + basic + 134217728 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot A; contains BMP images for splash screen + display during boot. + + + sequential + basic + 134217728 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot B; contains BMP images for splash screen + display during boot. + + + sequential + basic + RECSIZE + 0 + 8 + 0 + RECFILE + **Required.** Contains recovery image. + + + sequential + basic + 524288 + 0 + 8 + 0 + RECDTB-FILE + **Required.** Contains recovery DTB image. + + + sequential + basic + 262144 + 0 + 8 + 0 + BOOTCTRL-FILE + **Required.** Slot A; contains boot control data. + + + sequential + basic + 262144 + 0 + 8 + 0 + BOOTCTRL-FILE + **Required.** Slot B; contains boot control data. + + + sequential + basic + LNXSIZE + 0 + 8 + 0 + LNXFILE + **Required.** Slot A; contains U-Boot, which loads and launches the kernel + from the rootfs at `/boot`. + + + sequential + basic + LNXSIZE + 0 + 8 + 0 + LNXFILE + **Required.** Slot B; contains U-Boot, which loads and launches the kernel + from the rootfs at `/boot`. + + + sequential + basic + 524288 + 0 + 8 + 0 + KERNELDTB-FILE + **Required.** Slot A; contains kernel device tree blob. + + + sequential + basic + 524288 + 0 + 8 + 0 + KERNELDTB-FILE + **Required.** Slot B; contains kernel device tree blob. + + + sequential + basic + 104857600 + 0 + 0x8 + 0 + **Optional.** Reserved for future use by the recovery filesystem; + removable. + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + + + sequential + basic + 18432 + 0 + 0x808 + DATAFILE + 0 + **Required.** Automatically takes all remaining space on the device except that + occupied by the `secondary_gpt` partition. Allocation attribute must be set to 0x808. + May be mounted and used to store user data. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdmmc_user` + device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit/flash_mender.xml new file mode 100644 index 00000000..b8721905 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/jetson-xavier-nx-devkit/flash_mender.xml @@ -0,0 +1,665 @@ + + + + sequential + basic + 131072 + 0 + 8 + 0 + **Required.** Contains Boot Configuration Table (BCT). + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot A; contains NVIDIA signed MB1 binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot B; contains NVIDIA signed MB1 binary. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot A; contains MB1 boot configuration table. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot B; contains MB1 boot configuration table. + + + sequential + basic + 262144 + 0 + 8 + 0 + **Required.** Slot A; contains memory configuration table. + + + sequential + basic + 262144 + 0 + 8 + 0 + **Required.** Slot B; contains memory configuration table. + + + sequential + basic + 262144 + 0 + 8 + 0 + SPEFILE + **Required.** Slot A; contains BPMP SPE-FW binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + SPEFILE + **Required.** Slot B; contains BPMP SPE-FW binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + TEGRABOOT + **Required.** Slot A; contains TegraBoot binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + TEGRABOOT + **Required.** Slot B; contains TegraBoot binary. + + + sequential + basic + 65536 + 0 + 8 + 0 + MTSPREBOOT + **Required.** Slot A; contains Denver preboot firmware. + + + sequential + basic + 65536 + 0 + 8 + 0 + MTSPREBOOT + **Required.** Slot B; contains Denver preboot firmware. + + + + sequential + basic + 196608 + 0 + 8 + 0 + MTS_MCE + **Required.** Slot A; contains microcode associated with boot, power management, + and clocks. + + + sequential + basic + 196608 + 0 + 8 + 0 + MTS_MCE + **Required.** Slot B; contains microcode associated with boot, power management, + and clocks. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MTSPROPER + **Required.** Slot A; contains microcode associated with execution + and optimization of ARM code. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MTSPROPER + **Required.** Slot B; contains microcode associated with execution + and optimization of ARM code. + + + sequential + basic + 131072 + 0 + 8 + 0 + WB0BOOT + **Required.** Slot A; contains warm boot firmware. + + + sequential + basic + 131072 + 0 + 8 + 0 + WB0BOOT + **Required.** Slot B; contains warm boot firmware. + + + sequential + basic + 4096 + 65536 + 0 + 0x8 + 0 + SMDFILE + **Required.** Slot A; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 4096 + 65536 + 0 + 0x8 + 0 + SMDFILE + **Required.** Slot B; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 196608 + 65536 + 0 + 8 + 0 + xusb_sil_rel_fw + **Required.** Slot A; contains XUSB module’s firmware file, making XUSB + a true USB 3.0 compliant host controller. + + + sequential + basic + 196608 + 0 + 8 + 0 + xusb_sil_rel_fw + **Required.** Slot B; contains XUSB module’s firmware file, making XUSB + a true USB 3.0 compliant host controller. + + + sequential + basic + 1441792 + 0 + 8 + 0 + TBCFILE + **Required.** Slot A; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in the kernel partition. + + + sequential + basic + 1441792 + 0 + 8 + 0 + TBCFILE + **Required.** Slot B; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in the kernel partition. + + + sequential + basic + 458752 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot A; contains Bootloader device tree blob + (DTB). + + + sequential + basic + 458752 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot B; contains Bootloader device tree blob + (DTB). + + + sequential + basic + 196608 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot A; contains BMP images for splash screen display during + boot. + + + sequential + basic + 196608 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot B; contains BMP images for splash screen display during + boot. + + + sequential + basic + 2621440 + 0 + 8 + 0 + TOSFILE + **Required.** Slot A; contains the trusted OS. + + + sequential + basic + 2621440 + 0 + 8 + 0 + TOSFILE + **Required.** Slot B; contains the trusted OS. + + + sequential + basic + 65536 + 0 + 8 + 0 + EKSFILE + **Optional.** Slot A; contains the encrypted keys. + + + sequential + basic + 65536 + 0 + 8 + 0 + EKSFILE + **Optional.** Slot B; contains the encrypted keys. + + + sequential + basic + 1048576 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot A; contains ADSP software. + + + sequential + basic + 1048576 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot B; contains ADSP software. + + + sequential + basic + 1048576 + 0 + 8 + 0 + CAMERAFW + **Required.** Slot A; contains `camera-rtcpu-rce` firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + CAMERAFW + **Required.** Slot B; contains `camera-rtcpu-rce` firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + + **Required.** Contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + + **Required.** Contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 1572864 + 0 + 8 + 0 + BPFFILE + **Required.** Slot A; contains BPMP firmware. + + + sequential + basic + 1572864 + 0 + 8 + 0 + BPFFILE + **Required.** Slot B; contains BPMP firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB_FILE + **Required.** Slot A; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB_FILE + **Required.** Slot B; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 65536 + 0 + 0x8 + 0 + CBOOTOPTION_FILE + **Optional.** Contains boot device selection priority list. + + + sequential + basic + 65536 + 0 + 0x8 + 0 + CBOOTOPTION_FILE + **Optional.** Contains boot device selection priority list. + + + sequential + basic + 65536 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + sequential + basic + 65536 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains a redundant copy of BSP version information. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `spi` + device. + + + + + sequential + basic + 512 + 0 + 8 + 0 + **Required.** Contains protective MBR. + + + sequential + basic + 19968 + 0 + 8 + 0 + **Required.** Contains primary GPT of the `sdcard` device. All + partitions defined after this entry are configured in the kernel, and are + accessible by standard partition tools such as gdisk and parted. + + + sequential + basic + APPSIZE + 0 + 0x8 + 4096 + 0 + APPFILE + APPUUID + **Required.** Contains the rootfs. This partition must be defined + after `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + sequential + basic + 67108864 + 0 + 8 + 0 + LNXFILE + **Required.** Slot A; contains U-Boot, which loads and launches the kernel + from the rootfs at `/boot`. + + + sequential + basic + 67108864 + 0 + 8 + 0 + LNXFILE + **Required.** Slot B; contains U-Boot, which loads and launches the kernel + from the rootfs at `/boot`. + + + sequential + basic + 458752 + 0 + 8 + 0 + DTB_FILE + **Required.** Slot A; contains kernel device tree blob. + + + sequential + basic + 458752 + 0 + 8 + 0 + DTB_FILE + **Required.** Slot B; contains kernel device tree blob. + + + sequential + basic + RECSIZE + 0 + 8 + 0 + RECFILE + **Required.** Contains recovery image. + + + sequential + basic + 524288 + 0 + 8 + 0 + RECDTB-FILE + **Required.** Contains recovery DTB image. + + + sequential + basic + 262144 + 0 + 8 + 0 + BOOTCTRL-FILE + **Required.** Slot A; contains boot control data. + + + sequential + basic + 262144 + 0 + 8 + 0 + BOOTCTRL-FILE + **Required.** Slot B; contains boot control data. + + + sequential + basic + RECROOTFSSIZE + 0 + 0x8 + 0 + **Optional.** Reserved for future use by the recovery filesystem; + removable. + + + sequential + basic + APPSIZE + 0 + 0x8 + 4096 + 0 + APPFILE + APPUUID + **Required.** Contains the rootfs. This partition must be defined + after `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + sequential + basic + 18432 + 0 + 0x808 + 0 + DATAFILE + **Required.** Automatically takes all remaining space on the device except that + occupied by the `secondary_gpt` partition. Allocation attribute must be set to 0x808. + May be mounted and used to store user data. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdcard` + device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/tegra186/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/tegra186/flash_mender.xml new file mode 100644 index 00000000..a4da8ee4 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/tegra186/flash_mender.xml @@ -0,0 +1,583 @@ + + + + + + + + sequential + basic + 32768 + 0 + 8 + 0 + **Required.** Contains Boot Configuration Table. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot A; contains NVIDIA signed MB1 binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot B; contains NVIDIA signed MB1 binary. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot A; contains MB1 boot configuration table. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot B; contains MB1 boot configuration table. + + + sequential + basic + 55296 + 0 + 8 + 0 + DRAMECCFILE + **Optional.** Contains DRAM-ECC firmware. + + + sequential + basic + 4608 + 0 + 8 + 0 + BADPAGEFILE + **Optional.** Slot A; contains badpage firmware. + + + sequential + basic + 4608 + 0 + 8 + 0 + BADPAGEFILE + **Optional.** Slot B; contains badpage firmware. + + + sequential + basic + 131072 + 0 + 8 + 0 + SPEFILE + **Required.** Slot A; contains BPMP SPE-FW binary. + + + sequential + basic + 131072 + 0 + 8 + 0 + SPEFILE + **Required.** Slot B; contains BPMP SPE-FW binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB2FILE + **Required.** Slot A; contains TegraBoot binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB2FILE + **Required.** Slot B; contains TegraBoot binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MPBFILE + **Required.** Slot A; contains Denver preboot firmware. + + + sequential + basic + 262144 + 0 + 8 + 0 + MPBFILE + **Required.** Slot B; contains Denver preboot firmware. + + + sequential + basic + 4096 + 0 + 0x8 + 0 + SMDFILE + **Required.** Slot A; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 4096 + 0 + 0x8 + 0 + SMDFILE + **Required.** Slot B; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 65536 + 0 + 0x8 + 0 + VERFILE + **Required.** Contains a redundant copy of BSP version information. + + + sequential + basic + 65536 + 0 + 0x8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdmmc_boot` + device. + + + + + + sequential + basic + 512 + 0 + 8 + 0 + **Required.** Contains protective MBR. + + + sequential + basic + PPTSIZE + 0 + 8 + 0 + **Required.** Contains primary GPT of the `sdmmc_user` device. All + partitions defined after this entry are configured in the kernel, and are + accessible by standard partition tools such as gdisk and parted. + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + **Required.** Contains the rootfs. This partition must be defined + after `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MBPFILE + **Required.** Slot A; contains Denver boot pack firmware. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MBPFILE + **Required.** Slot B; contains Denver boot pack firmware. + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCFILE + **Required.** Slot A; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in kernel partition. + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCFILE + **Required.** Slot B; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in kernel partition. + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot A; contains Bootloader device tree blob (DTB). + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot B; contains Bootloader device tree blob (DTB). + + + sequential + basic + 3145728 + 0 + 8 + 0 + TOSFILE + **Required.** Slot A; contains the trusted OS. + + + sequential + basic + 3145728 + 0 + 8 + 0 + TOSFILE + **Required.** Slot B; contains the trusted OS. + + + sequential + basic + 2097152 + 0 + 8 + 0 + EKSFILE + **Optional.** Contains the encrypted keys. + + + sequential + basic + 4194304 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot A; contains ADSP software. + + + sequential + basic + 4194304 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot B; contains ADSP software. + + + sequential + basic + 618144 + 0 + 8 + 0 + BPFFILE + **Required.** Slot A; contains BPMP firmware. + + + sequential + basic + 618144 + 0 + 8 + 0 + BPFFILE + **Required.** Slot B; contains BPMP firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB-FILE + **Required.** Slot A; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB-FILE + **Required.** Slot B; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 2097152 + 0 + 8 + 0 + SCEFILE + **Required.** Slot A; contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 2097152 + 0 + 8 + 0 + SCEFILE + **Required.** Slot B; contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 6291456 + 0 + 8 + 0 + WB0FILE + **Required.** Slot A; contains warm boot binary. + + + sequential + basic + 6291456 + 0 + 8 + 0 + WB0FILE + **Required.** Slot B; contains warm boot binary. + + + sequential + basic + 2097152 + 0 + 0x8 + 0 + FBFILE + **Optional.** Reserved for future use; removable. + + + sequential + basic + 134217728 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot A; contains BMP images for splash screen + display during boot. + + + sequential + basic + 134217728 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot B; contains BMP images for splash screen + display during boot. + + + sequential + basic + RECSIZE + 0 + 8 + 0 + RECFILE + **Required.** Contains recovery image. + + + sequential + basic + 524288 + 0 + 8 + 0 + RECDTB-FILE + **Required.** Contains recovery DTB image. + + + sequential + basic + 262144 + 0 + 8 + 0 + BOOTCTRL-FILE + **Required.** Slot A; contains boot control data. + + + sequential + basic + 262144 + 0 + 8 + 0 + BOOTCTRL-FILE + **Required.** Slot B; contains boot control data. + + + sequential + basic + LNXSIZE + 0 + 8 + 0 + LNXFILE + **Required.** Slot A; contains U-Boot, which loads and launches the kernel + from the rootfs at `/boot`. + + + sequential + basic + LNXSIZE + 0 + 8 + 0 + LNXFILE + **Required.** Slot B; contains U-Boot, which loads and launches the kernel + from the rootfs at `/boot`. + + + sequential + basic + 524288 + 0 + 8 + 0 + KERNELDTB-FILE + **Required.** Slot A; contains kernel device tree blob. + + + sequential + basic + 524288 + 0 + 8 + 0 + KERNELDTB-FILE + **Required.** Slot B; contains kernel device tree blob. + + + sequential + basic + 314572800 + 0 + 0x8 + 0 + **Optional.** Reserved for future use by the recovery filesystem; + removable. + + + sequential + basic + APPSIZE + 0 + 0x8 + 0 + 4096 + APPFILE + + + sequential + basic + 18432 + 0 + 0x808 + DATAFILE + 0 + **Required.** Automatically takes all remaining space on the device except that + occupied by the `secondary_gpt` partition. Allocation attribute must be set to 0x808. + May be mounted and used to store user data. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdmmc_user` + device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/tegra194/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/tegra194/flash_mender.xml new file mode 100644 index 00000000..2955c590 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/tegra194/flash_mender.xml @@ -0,0 +1,665 @@ + + + + + + + + sequential + basic + 32768 + 0 + 8 + 0 + **Required.** Contains Boot Configuration Table (BCT). + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot A; contains NVIDIA signed MB1 binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + MB1FILE + **Required.** Slot B; contains NVIDIA signed MB1 binary. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot A; contains MB1 boot configuration table. + + + sequential + basic + 65536 + 0 + 8 + 0 + **Required.** Slot B; contains MB1 boot configuration table. + + + sequential + basic + 229376 + 0 + 8 + 0 + **Required.** Slot A; contains memory configuration table. + + + sequential + basic + 229376 + 0 + 8 + 0 + **Required.** Slot B; contains memory configuration table. + + + sequential + basic + 262144 + 0 + 8 + 0 + SPEFILE + **Required.** Slot A; contains BPMP SPE-FW binary. + + + sequential + basic + 262144 + 0 + 8 + 0 + SPEFILE + **Required.** Slot B; contains BPMP SPE-FW binary. + + + sequential + basic + 229376 + 0 + 8 + 0 + TEGRABOOT + **Required.** Slot A; contains TegraBoot binary. + + + sequential + basic + 229376 + 0 + 8 + 0 + TEGRABOOT + **Required.** Slot B; contains TegraBoot binary. + + + sequential + basic + 32768 + 0 + 8 + 0 + MTSPREBOOT + **Required.** Slot A; contains Denver preboot firmware. + + + sequential + basic + 32768 + 0 + 8 + 0 + MTSPREBOOT + **Required.** Slot B; contains Denver preboot firmware. + + + sequential + basic + 4096 + 0 + 0x8 + 0 + SMDFILE + **Required.** Slot A; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 4096 + 0 + 0x8 + 0 + SMDFILE + **Required.** Slot B; contains slot status for A/B boot and A/B + update. + + + sequential + basic + 65536 + 0 + 0x8 + 0 + VERFILE + **Required.** Contains a redundant copy of BSP version information. + + + sequential + basic + 65536 + 0 + 0x8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdmmc_boot` + device. + + + + + + sequential + basic + 512 + 0 + 8 + 0 + **Required.** Contains protective MBR. + + + sequential + basic + 19968 + 0 + 8 + 0 + **Required.** Contains primary GPT of the `sdmmc_user` device. All + partitions defined after this entry are configured in the kernel, and are accessible + by standard partition tools such as gdisk and parted. + + + sequential + basic + APPSIZE + 0 + 0x8 + 4096 + 0 + APPFILE + **Required.** Contains the rootfs. This partition must be defined after + `primary_gpt` so it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + sequential + basic + 163840 + 0 + 8 + 0 + MTS_MCE + **Required.** Slot A; contains microcode associated with boot, power management, + and clocks. + + + sequential + basic + 163840 + 0 + 8 + 0 + MTS_MCE + **Required.** Slot B; contains microcode associated with boot, + power management, and clocks. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MTSPROPER + **Required.** Slot A; contains microcode associated with execution + and optimization of ARM code. + + + sequential + basic + 4194304 + 0 + 8 + 0 + MTSPROPER + **Required.** Slot B; contains microcode associated with execution + and optimization of ARM code. + + + sequential + basic + 1409024 + 0 + 8 + 0 + TBCFILE + **Required.** Slot A; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in the kernel partition. + + + sequential + basic + 1409024 + 0 + 8 + 0 + TBCFILE + **Required.** Slot B; contains CBoot, the final boot stage CPU Bootloader + binary that loads the binary in the kernel partition. + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot A; contains Bootloader device tree blob + (DTB). + + + sequential + basic + 524288 + 0 + 8 + 0 + TBCDTB-FILE + **Required.** Slot B; contains Bootloader device tree blob + (DTB). + + + sequential + basic + 2621440 + 0 + 8 + 0 + TOSFILE + **Required.** Slot A; contains the trusted OS. + + + sequential + basic + 2621440 + 0 + 8 + 0 + TOSFILE + **Required.** Slot B; contains the trusted OS. + + + sequential + basic + 65536 + 0 + 8 + 0 + EKSFILE + **Optional.** Slot A; contains the encrypted keys. + + + sequential + basic + 65536 + 0 + 8 + 0 + EKSFILE + **Optional.** Slot B; contains the encrypted keys. + + + sequential + basic + 1572864 + 0 + 8 + 0 + BPFFILE + **Required.** Slot A; contains BPMP firmware. + + + sequential + basic + 1572864 + 0 + 8 + 0 + BPFFILE + **Required.** Slot B; contains BPMP firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB_FILE + **Required.** Slot A; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 1048576 + 0 + 8 + 0 + BPFDTB_FILE + **Required.** Slot B; contains BPMP firmware device tree blob + (DTB). + + + sequential + basic + 163840 + 0 + 8 + 0 + xusb_sil_rel_fw + **Required.** Slot A; contains XUSB module’s firmware file, making XUSB + a true USB 3.0 compliant host controller. + + + sequential + basic + 163840 + 0 + 8 + 0 + xusb_sil_rel_fw + **Required.** Slot B; contains XUSB module’s firmware file, making XUSB + a true USB 3.0 compliant host controller. + + + sequential + basic + 1048576 + 0 + 8 + 0 + CAMERAFW + **Required.** Slot A; contains `camera-rtcpu-rce` firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + CAMERAFW + **Required.** Slot B; contains `camera-rtcpu-rce` firmware. + + + sequential + basic + 2097152 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot A; contains ADSP software. + + + sequential + basic + 2097152 + 0 + 8 + 0 + adsp-fw.bin + **Required.** Slot B; contains ADSP software. + + + sequential + basic + 1048576 + 0 + 8 + 0 + **Required.** Contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 1048576 + 0 + 8 + 0 + **Required.** Slot B; contains `camera-rtcpu-sce` firmware. + + + sequential + basic + 131072 + 0 + 8 + 0 + WB0BOOT + **Required.** Slot A; contains warm boot firmware. + + + sequential + basic + 131072 + 0 + 8 + 0 + WB0BOOT + **Required.** Slot B; contains warm boot firmware. + + + sequential + basic + 134217728 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot A; contains BMP images for splash screen display during + boot. + + + sequential + basic + 134217728 + 0 + 0x8 + 0 + bmp.blob + **Optional.** Slot B; contains BMP images for splash screen display during + boot. + + + sequential + basic + RECSIZE + 0 + 8 + 0 + RECFILE + **Optional.** Reserved for future use by the recovery image; removable + + + sequential + basic + 524288 + 0 + 8 + 0 + RECDTB-FILE + **Optional.** Reserved for future use by the recovery DTB image; removable + + + sequential + basic + 65536 + 0 + 8 + 0 + BOOTCTRL-FILE + **Optional.** Slot A; reserved for future use by boot control data; removable + + + sequential + basic + 65536 + 0 + 8 + 0 + BOOTCTRL-FILE + **Optional.** Slot B; reserved for future use by boot control data; removable + + + sequential + basic + LNXSIZE + 0 + 8 + 0 + LNXFILE + **Required.** Slot A; contains the Linux kernel. + + + sequential + basic + LNXSIZE + 0 + 8 + 0 + LNXFILE + **Required.** Slot B; contains the Linux kernel. + + + sequential + basic + 524288 + 0 + 8 + 0 + DTB_FILE + **Required.** Slot A; contains kernel device tree blob. + + + sequential + basic + 524288 + 0 + 8 + 0 + DTB_FILE + **Required.** Slot B; contains kernel device tree blob. + + + sequential + basic + 4096 + 0 + 0x8 + 0 + CBOOTOPTION_FILE + **Optional.** Contains boot device selection priority list. + + + sequential + basic + 8388608 + 0 + 0x8 + 0 + **Optional.** A reserved partition. May be mounted and used to store user + data. + + + sequential + basic + 8388608 + 0 + 0x8 + 0 + **Optional.** A reserved partition. May be mounted and used to store user + data. + + + sequential + basic + 314572800 + 0 + 0x8 + 0 + **Optional.** Reserved for future use by the recovery filesystem; + removable. + + + sequential + basic + APPSIZE + 0 + 0x8 + 4096 + 0 + APPFILE + + + sequential + basic + 0 + 0x808 + 0 + 4096 + DATAFILE + **Required.** Automatically takes all remaining space on the device except space + occupied by `secondary_gpt`. Allocation attribute must be set to 0x808. This + partition may be mounted and used to store user data. + + + sequential + basic + 0xFFFFFFFFFFFFFFFF + 0 + 8 + 0 + **Required.** Contains secondary GPT of the `sdmmc_user` + device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/tegra210/flash_mender.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/tegra210/flash_mender.xml new file mode 100644 index 00000000..612551e0 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout/tegra210/flash_mender.xml @@ -0,0 +1,441 @@ + + + + + + + + sequential + basic + 1048576 + 8 + **Required.** Contains Boot Configuration Table (BCT). + + + + sequential + basic + 376832 + 8 + NVCFILE + **Required.** Contains TegraBoot binary. + + + + sequential + basic + 131072 + 8 + flash.xml.bin + **Required.** Contains Partition Table. + + + + sequential + basic + 196608 + 8 + TBCFILE + **Required.** Contains TegraBoot CPU-side binary. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains Bootloader DTB binary. + + + + sequential + basic + 999424 + 8 + EBTFILE + **Required.** Contains CBoot, the final boot stage CPU bootloader binary + that loads the binary in the kernel partition. + + + + sequential + basic + 131072 + 8 + WB0FILE + **Required.** Contains warm boot binary. + + + + sequential + basic + 262144 + 8 + BPFFILE + **Required.** Contains SC7 entry firmware. + + + + sequential + basic + 376832 + 8 + NVCFILE + **Required.** Contains a redundant copy of the + TegraBoot binary. + + + + sequential + basic + 131072 + 8 + flash.xml.bin + **Required.** Contains a redundant copy of the + Partition Table. + + + + sequential + basic + 196608 + 8 + TBCFILE + **Required.** Contains a redundant copy of TegraBoot CPU-side + binary. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains a redundant copy of the Bootloader DTB + binary. + + + + sequential + basic + 999424 + 8 + EBTFILE + **Required.** Contains a redundant copy of CBoot, the final boot stage + CPU bootloader binary. + + + + sequential + basic + 131072 + 8 + WB0FILE + **Required.** Contains a redundant copy of warm boot + binary. + + + + sequential + basic + 262144 + 8 + BPFFILE + **Required.** Contains a redundant copy of the SC7 + entry firmware. + + + + + sequential + basic + 917504 + 0 + 8 + 0 + **Required.** Empty padding. + + + + sequential + basic + 65536 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains a redundant copy of BSP version + information. + + + + sequential + basic + 65536 + 0 + 0 + 8 + 0 + VERFILE + **Required.** Contains BSP version information. + + + + + + sequential + basic + 2097152 + 8 + **Required.** Contains primary GPT of the `sdmmc_user` device. All + partitions defined after this entry are configured in the kernel, and are + accessible by standard partition tools such as gdisk and parted. + + + + sequential + basic + APPSIZE + 8 + APPFILE + **Required.** Contains the rootfs. This partition must be defined after + `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains kernel DTB binary. + + + + sequential + basic + 6291456 + 8 + TOSFILE + **Required.** Contains TOS binary. + + + + sequential + basic + 81920 + 8 + EKSFILE + **Optional.** Contains the encrypted keys. + + + + sequential + basic + 67092480 + 8 + LNXFILE + **Required.** Contains U-Boot, which loads and launches the kernel + from the rootfs at `/boot`. + + + + sequential + basic + 1048576 + 8 + DTBFILE + **Required.** Contains a redundant copy of the kKernel DTB + binary. + + + + sequential + basic + 6291456 + 8 + TOSFILE + **Required.** Contains a redundant copy of the TOS binary. + + + + sequential + basic + 81920 + 8 + EKSFILE + **Optional.** Contains a redundant copy of the encrypted + keys. + + + + sequential + basic + 67092480 + 8 + LNXFILE + **Required.** Contains a redundant copy of U-Boot, which loads and + launches the kernel from the rootfs at `/boot`. + + + + sequential + basic + 196608 + 8 + bmp.blob + **Optional.** Contains BMP images for the splash screen display + during boot. + + + + sequential + basic + 262144 + 8 + rp4.blob + **Required.** Contains XUSB module’s firmware file, making XUSB a true + USB 3.0 compliant host controller. + + + + sequential + basic + 66060288 + 8 + 0 + **Optional.** Reserved for future use by the recovery image; removable. + + + + sequential + basic + 524288 + 8 + 0 + **Optional.** Reserved for future use by the recovery DTB image; + removable. + + + + sequential + basic + 262144 + 8 + 0 + **Optional.** Reserved for future use by boot control data; removable. + + + + sequential + basic + 262144 + 8 + 0 + **Optional.** Reserved for future use by a redundant copy of the boot control data; + removable. + + + + sequential + basic + EFISIZE + 0 + 0 + 0x8 + 0 + EFIFILE + **Optional.** Reserved for EFI image; removeable. + + + + sequential + basic + 2097152 + 0 + 0x8 + 0 + NCTFILE + **Optional.** Reserved for NCT image; removeable. + + + + sequential + basic + 6291456 + 0 + 0 + 8 + 0 + MPBFILE + **Optional.** Reserved for MTS pre-boot image; removeable. + + + + sequential + basic + 6291456 + 0 + 0 + 8 + 0 + MBPFILE + **Optional.** Reserved for MTS boot pack image; removeable. + + + + sequential + basic + 2097152 + 0 + 0x8 + 0 + **Optional.** Reserved; removeable. + + + + sequential + basic + 314572800 + 0 + 0x8 + 0 + **Optional.** Reserved for future use by the recovery filesystem; + removable. + + + + sequential + basic + APPSIZE + 8 + APPFILE + **Required.** Contains the rootfs. This partition must be defined after + `primary_GPT` so that it can be accessed as the fixed known special device + `/dev/mmcblk0p1`. + + + + sequential + basic + 2097152 + 0x808 + DATAFILE + **Required..** Automatically takes all remaining space on the device except for space + occupied by `secondary_gpt`. Allocation attribute must be set to 0x808. This + partition may be mounted and used to store user data. + + + + sequential + basic + -1 + 8 + **Required.** Contains secondary GPT of the `sdmmc_user` + device. + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout_1.0.bb b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout_1.0.bb new file mode 100644 index 00000000..9317aa21 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/mender-custom-flash-layout_1.0.bb @@ -0,0 +1,23 @@ +DESCRIPTION = "Custom flash layout file to add Mender-specific partitions" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +SRC_URI = "file://flash_mender.xml" + +INHIBIT_DEFAULT_DEPS = "1" +COMPATIBLE_MACHINE = "(tegra)" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}-${@d.getVar('L4T_VERSION').replace('.', '-')}:" + +S = "${WORKDIR}" + +do_compile[noexec] = "1" + +do_install() { + install -d ${D}${datadir}/mender-flash-layout + install -m 0644 ${S}/flash_mender.xml ${D}${datadir}/mender-flash-layout/ +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +inherit nopackages diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides/update-nvbootctrl.service.in b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides/update-nvbootctrl.service.in new file mode 100644 index 00000000..8e704cb0 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides/update-nvbootctrl.service.in @@ -0,0 +1,14 @@ +[Unit] +Description=Update bootloader on successful boot +ConditionPathExists=!@LOCALSTATEDIR@/lib/mender/dont-mark-next-boot-successful +Requires=setup-nv-boot-control.service +After=setup-nv-boot-control.service +Before=network.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=@SBINDIR@/update-nvbootctrl + +[Install] +WantedBy=multi-user.target diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides/update-nvbootctrl.sh.in b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides/update-nvbootctrl.sh.in new file mode 100644 index 00000000..e8e64127 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides/update-nvbootctrl.sh.in @@ -0,0 +1,10 @@ +#!/bin/sh +NVBC=@SBINDIR@/nvbootctrl +curslot=$($NVBC get-current-slot) +if [ -n "$curslot" ]; then + if $NVBC set-active-boot-slot $curslot && $NVBC mark-boot-successful; then + exit 0 + fi +fi +echo "ERR: could not update NV boot slots" >&2 +exit 1 diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides_%.bbappend new file mode 100644 index 00000000..6870ae93 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides_%.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" +# RDEPENDS:${PN} += "tegra-redundant-boot-nvbootctrl" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides_1.0.bb b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides_1.0.bb new file mode 100644 index 00000000..b467f5e0 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/redundant-boot-overrides_1.0.bb @@ -0,0 +1,39 @@ +DESCRIPTION = "Configuration override to disable nv_update_verifier when using Mender" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +COMPATIBLE_MACHINE = "(tegra)" +COMPATIBLE_MACHINE:tegra210 = "(-)" + +SRC_URI = "\ + file://update-nvbootctrl.service.in \ + file://update-nvbootctrl.sh.in \ +" + +inherit systemd + +S = "${WORKDIR}" +B = "${WORKDIR}/build" + +run_sed() { + outfile=$(basename "$1" .in) + sed -e's,@SBINDIR@,${sbindir},g' \ + -e's,@LOCALSTATEDIR@,${localstatedir},g' "$1" > ${B}/$outfile +} + +do_configure() { + run_sed ${S}/update-nvbootctrl.service.in + run_sed ${S}/update-nvbootctrl.sh.in +} + +do_compile[noexec] = "1" + +do_install() { + install -d ${D}${sysconfdir}/systemd/system/ + ln -sf /dev/null ${D}${sysconfdir}/systemd/system/nv_update_verifier.service + install -d ${D}${systemd_system_unitdir} ${D}${sbindir} + install -m 0755 ${B}/update-nvbootctrl.sh ${D}${sbindir}/update-nvbootctrl + install -m 0644 ${B}/update-nvbootctrl.service ${D}${systemd_system_unitdir}/ +} + +SYSTEMD_SERVICE:${PN} = "update-nvbootctrl.service" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/tegra-bootfiles_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/tegra-bootfiles_%.bbappend new file mode 100644 index 00000000..a0ee9dd0 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/tegra-bootfiles_%.bbappend @@ -0,0 +1,5 @@ +DEPENDS += "mender-custom-flash-layout" +MENDER_PARTITION_FILE = "${STAGING_DATADIR}/mender-flash-layout/flash_mender.xml" +PARTITION_FILE = "${MENDER_PARTITION_FILE}" + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/tegra-nv-boot-control-config_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/tegra-nv-boot-control-config_%.bbappend new file mode 100644 index 00000000..22b98b10 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/tegra-nv-boot-control-config_%.bbappend @@ -0,0 +1,3 @@ +do_install:append() { + ln -sf /run/tegra-nv-bootctrl/nv_boot_control.conf ${D}${sysconfdir}/ +} diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/tegra-redundant-boot_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/tegra-redundant-boot_%.bbappend new file mode 100644 index 00000000..924af6d7 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-binaries/tegra-redundant-boot_%.bbappend @@ -0,0 +1,5 @@ +EXTRADEPS = "redundant-boot-overrides" +EXTRADEPS:tegra210 = "" +EXTRADEPS:tegra234 = "" +RDEPENDS:${PN} += "${EXTRADEPS}" + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-bup-payload/tegra-bup-payload_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-bup-payload/tegra-bup-payload_%.bbappend new file mode 100644 index 00000000..65421c27 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tegra-bup-payload/tegra-bup-payload_%.bbappend @@ -0,0 +1,2 @@ +RDEPENDS:${PN}:remove = "tegra-redundant-boot" +# RDEPENDS:${PN}:append = " tegra-boot-tools-updater" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tools/setup-nv-boot-control/target-mkdir.conf b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tools/setup-nv-boot-control/target-mkdir.conf new file mode 100644 index 00000000..e0cf18cc --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tools/setup-nv-boot-control/target-mkdir.conf @@ -0,0 +1,2 @@ +[Service] +ExecStartPre=/bin/mkdir -p /run/tegra-nv-bootctrl diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tools/setup-nv-boot-control_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tools/setup-nv-boot-control_%.bbappend new file mode 100644 index 00000000..a3f87028 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/tools/setup-nv-boot-control_%.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" + +SRC_URI += "file://target-mkdir.conf" + +do_install:append() { + install -d ${D}${sysconfdir}/systemd/system/setup-nv-boot-control.service.d + install -m 0644 ${WORKDIR}/target-mkdir.conf ${D}${sysconfdir}/systemd/system/setup-nv-boot-control.service.d/ +} + +FILES:${PN}-service += "${sysconfdir}/systemd/system/setup-nv-boot-control.service.d" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv-fake/fw_printenv b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv-fake/fw_printenv new file mode 100644 index 00000000..7001b5ca --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv-fake/fw_printenv @@ -0,0 +1,60 @@ +#!/bin/sh +LABELCHARS="AB" + +get_bootpart() { + local current_slot=`nvbootctrl get-current-slot 2>/dev/null || tegra-boot-control --current-slot 2>/dev/null` + if [ -z "$current_slot" ]; then + echo "ERR: could not identify current boot slot" >&2 + echo "UNKNOWN" + return + fi + local cfglbl="\"RootfsPart${LABELCHARS:$current_slot:1}\"" + local devnam=`grep -h "$cfglbl:" /etc/mender/mender.conf /var/lib/mender/mender.conf | tr -d '" ,' | grep -o '[0-9]\+$'` + echo "$devnam" +} + +quiet= +if [ "$1" = "-n" ]; then + quiet="yes" + shift + if [ -z "$1" ]; then + echo "ERR: missing var name with -n" >&2 + exit 1 + fi +fi +if [ -z "$1" ]; then + bootpart=`get_bootpart` + echo "mender_boot_part=$bootpart" + exit 0 +fi +while [ -n "$1" ]; do + case "$1" in + mender_boot_part) + bootpart=`get_bootpart` + [ -n "$quiet" ] || echo -n "$1=" + echo "$bootpart" + ;; + mender_boot_part_hex) + bootpart=`get_bootpart` + bootpart_hex=`echo 16o${bootpart}p | dc` + [ -n "$quiet" ] || echo -n "$1=" + echo "$bootpart_hex" + ;; + mender_uboot_separator) + [ -n "$quiet" ] || echo -n "$1=" + echo "something other than just 1" + ;; + upgrade_available) + [ -n "$quiet" ] || echo -n "$1=" + if [ -e "/var/lib/mender/upgrade_available" ]; then + echo "1" + else + echo "0" + fi + ;; + *) + echo "ERR: no such variable: $1" >&2 + exit 1 + esac + shift +done diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv-fake/fw_setenv b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv-fake/fw_setenv new file mode 100644 index 00000000..201cec60 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv-fake/fw_setenv @@ -0,0 +1,13 @@ +#!/bin/sh +if [ "$1" = "-s" ]; then + while IFS="= " read var restofline; do + if [ "$var" = "upgrade_available" ]; then + if [ "$restofline" = "1" ]; then + touch /var/lib/mender/upgrade_available + else + rm -f /var/lib/mender/upgrade_available + fi + fi + done +fi +exit 0 diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv-fake_1.0.bb b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv-fake_1.0.bb new file mode 100644 index 00000000..9b8e488c --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv-fake_1.0.bb @@ -0,0 +1,28 @@ +DESCRIPTION = "Fake implementation of fw_printenv and fw_setenv for Mender" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +SRC_URI = " \ + file://fw_printenv \ + file://fw_setenv \ +" + +PROVIDES += "libubootenv" + +S = "${WORKDIR}" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + install -d ${D}${base_sbindir} + install -m 0755 ${S}/fw_printenv ${S}/fw_setenv ${D}${base_sbindir}/ +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +RPROVIDES:${PN} += "libubootenv-bin u-boot-fw-utils" +RDEPENDS:${PN} = "tegra-boot-tools" +RDEPENDS:${PN}:tegra234 = "" +RCONFLICTS:${PN} = "libubootenv-bin" +RREPLACES:${PN} = "libubootenv-bin" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv_%.bbappend new file mode 100644 index 00000000..47daf849 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/libubootenv_%.bbappend @@ -0,0 +1,13 @@ +include recipes-bsp/u-boot/u-boot-mender-tegra-vars.inc + +# Stash an extra copy of fw_env.config in the rootfs so we +# can handle a change in the env offset/size during an upgrade +do_install:append:tegra() { + install -d ${D}${datadir}/u-boot + install -m 0644 ${WORKDIR}/fw_env.config ${D}${datadir}/u-boot/ +} +FILES:${PN}:append:tegra = " ${datadir}/u-boot" + +# The default environment must be provided by the +# u-boot recipe +RPROVIDES:${PN}:remove:tegra = "u-boot-default-env" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0003-Integration-of-Mender-boot-code-into-U-Boot.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0003-Integration-of-Mender-boot-code-into-U-Boot.patch new file mode 100644 index 00000000..cae1f2d4 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0003-Integration-of-Mender-boot-code-into-U-Boot.patch @@ -0,0 +1,51 @@ +From de38de98f3032825d1553e83fa6957d7438bbdc4 Mon Sep 17 00:00:00 2001 +From: Marcin Pasinski +Date: Wed, 31 Jan 2018 18:10:04 +0100 +Subject: [PATCH 09/16] Integration of Mender boot code into U-Boot. + +Signed-off-by: Kristian Amlie +Signed-off-by: Maciej Borzecki +Signed-off-by: Marcin Pasinski +--- + include/env_default.h | 3 +++ + scripts/Makefile.autoconf | 3 ++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/include/env_default.h b/include/env_default.h +index 23430dc70d..a8c782c725 100644 +--- a/include/env_default.h ++++ b/include/env_default.h +@@ -10,6 +10,8 @@ + #include + #include + ++#include ++ + #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED + env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = { + ENV_CRC, /* CRC Sum */ +@@ -24,6 +26,7 @@ char default_environment[] = { + #else + const char default_environment[] = { + #endif ++ MENDER_ENV_SETTINGS + #ifndef CONFIG_USE_DEFAULT_ENV_FILE + #ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT + ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0" +diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf +index 8a3efdb2db..5f09f52b24 100644 +--- a/scripts/Makefile.autoconf ++++ b/scripts/Makefile.autoconf +@@ -108,7 +108,8 @@ define filechk_config_h + echo \#include \; \ + echo \#include \; \ + echo \#include \; \ +- echo \#include \;) ++ echo \#include \; \ ++ echo \#include \;) + endef + + include/config.h: scripts/Makefile.autoconf create_symlink FORCE +-- +2.32.0 + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0010-tegra-mender-auto-configured-modified.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0010-tegra-mender-auto-configured-modified.patch new file mode 100644 index 00000000..cad074e5 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0010-tegra-mender-auto-configured-modified.patch @@ -0,0 +1,379 @@ +From c6c3285f65ff5daed41beeb271db86d89eeff2c9 Mon Sep 17 00:00:00 2001 +From: Kurt Kiefer +Date: Mon, 24 Aug 2020 22:49:32 -0700 +Subject: [PATCH 10/16] Apply mender_auto_configured.patch + +--- + configs/p2371-0000_defconfig | 33 ++++++++++++++++++++++++++++++-- + configs/p2371-2180_defconfig | 33 ++++++++++++++++++++++++++++++-- + configs/p2571_defconfig | 33 ++++++++++++++++++++++++++++++-- + configs/p2771-0000-000_defconfig | 33 ++++++++++++++++++++++++++++++-- + configs/p2771-0000-500_defconfig | 33 ++++++++++++++++++++++++++++++-- + configs/p3450-0000_defconfig | 33 +++++++++++++++++++++++++++++--- + configs/p3450-0002_defconfig | 31 ++++++++++++++++++++++++++++-- + include/config_distro_bootcmd.h | 1 - + 8 files changed, 214 insertions(+), 16 deletions(-) + +diff --git a/configs/p2371-0000_defconfig b/configs/p2371-0000_defconfig +index 4289c22886..8580db6aa0 100644 +--- a/configs/p2371-0000_defconfig ++++ b/configs/p2371-0000_defconfig +@@ -3,8 +3,6 @@ CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_SYS_MALLOC_LEN=0x2500000 + CONFIG_NR_DRAM_BANKS=16 +-CONFIG_ENV_SIZE=0x2000 +-CONFIG_ENV_OFFSET=0xFFFD8000 + CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2371-0000" + CONFIG_TEGRA210=y + CONFIG_SYS_LOAD_ADDR=0x84000000 +@@ -49,3 +47,34 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x701a + CONFIG_CI_UDC=y + CONFIG_USB_GADGET_DOWNLOAD=y + CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0x3bb000 ++CONFIG_ENV_OFFSET_REDUND=0x3db000 ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++# CONFIG_ENV_IS_NOWHERE is not set ++# CONFIG_ENV_IS_IN_EEPROM is not set ++# CONFIG_ENV_IS_IN_FAT is not set ++# CONFIG_ENV_IS_IN_EXT4 is not set ++# CONFIG_ENV_IS_IN_FLASH is not set ++# CONFIG_ENV_IS_IN_NAND is not set ++# CONFIG_ENV_IS_IN_NVRAM is not set ++# CONFIG_ENV_IS_IN_ONENAND is not set ++# CONFIG_ENV_IS_IN_REMOTE is not set ++# CONFIG_ENV_IS_IN_SPI_FLASH is not set ++# CONFIG_ENV_IS_IN_UBI is not set ++CONFIG_MMC=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FS_GENERIC=y ++# CONFIG_BOOTCOUNT_BOOTLIMIT is not set ++# CONFIG_BOOTCOUNT_GENERIC is not set ++# CONFIG_BOOTCOUNT_EXT is not set ++# CONFIG_BOOTCOUNT_AM33XX is not set ++# CONFIG_BOOTCOUNT_RAM is not set ++# CONFIG_BOOTCOUNT_I2C is not set ++# CONFIG_BOOTCOUNT_AT91 is not set ++# CONFIG_BOOTCOUNT_MEM is not set ++# CONFIG_BOOTCOUNT_ALEN is not set ++CONFIG_BOOTCOUNT_LIMIT=y ++CONFIG_BOOTCOUNT_ENV=y ++# CONFIG_BOOTCOMMAND is not set +diff --git a/configs/p2371-2180_defconfig b/configs/p2371-2180_defconfig +index 1d0228823f..329878dc90 100644 +--- a/configs/p2371-2180_defconfig ++++ b/configs/p2371-2180_defconfig +@@ -3,8 +3,6 @@ CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_SYS_MALLOC_LEN=0x2500000 + CONFIG_NR_DRAM_BANKS=16 +-CONFIG_ENV_SIZE=0x8000 +-CONFIG_ENV_OFFSET=0x3D8000 + CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2371-2180" + CONFIG_TEGRA210=y + CONFIG_TARGET_P2371_2180=y +@@ -62,3 +60,34 @@ CONFIG_USB_STORAGE=y + CONFIG_DOS_PARTITION=y + CONFIG_CMD_CACHE=y + CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0x3bb000 ++CONFIG_ENV_OFFSET_REDUND=0x3db000 ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++# CONFIG_ENV_IS_NOWHERE is not set ++# CONFIG_ENV_IS_IN_EEPROM is not set ++# CONFIG_ENV_IS_IN_FAT is not set ++# CONFIG_ENV_IS_IN_EXT4 is not set ++# CONFIG_ENV_IS_IN_FLASH is not set ++# CONFIG_ENV_IS_IN_NAND is not set ++# CONFIG_ENV_IS_IN_NVRAM is not set ++# CONFIG_ENV_IS_IN_ONENAND is not set ++# CONFIG_ENV_IS_IN_REMOTE is not set ++# CONFIG_ENV_IS_IN_SPI_FLASH is not set ++# CONFIG_ENV_IS_IN_UBI is not set ++CONFIG_MMC=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FS_GENERIC=y ++# CONFIG_BOOTCOUNT_BOOTLIMIT is not set ++# CONFIG_BOOTCOUNT_GENERIC is not set ++# CONFIG_BOOTCOUNT_EXT is not set ++# CONFIG_BOOTCOUNT_AM33XX is not set ++# CONFIG_BOOTCOUNT_RAM is not set ++# CONFIG_BOOTCOUNT_I2C is not set ++# CONFIG_BOOTCOUNT_AT91 is not set ++# CONFIG_BOOTCOUNT_MEM is not set ++# CONFIG_BOOTCOUNT_ALEN is not set ++CONFIG_BOOTCOUNT_LIMIT=y ++CONFIG_BOOTCOUNT_ENV=y ++# CONFIG_BOOTCOMMAND is not set +diff --git a/configs/p2571_defconfig b/configs/p2571_defconfig +index fbcc5072d5..d525a234c1 100644 +--- a/configs/p2571_defconfig ++++ b/configs/p2571_defconfig +@@ -3,8 +3,6 @@ CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_SYS_MALLOC_LEN=0x2500000 + CONFIG_NR_DRAM_BANKS=16 +-CONFIG_ENV_SIZE=0x2000 +-CONFIG_ENV_OFFSET=0xFFFD8000 + CONFIG_DEFAULT_DEVICE_TREE="tegra210-p2571" + CONFIG_TEGRA210=y + CONFIG_TARGET_P2571=y +@@ -50,3 +48,34 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x701a + CONFIG_CI_UDC=y + CONFIG_USB_GADGET_DOWNLOAD=y + CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0x3bb000 ++CONFIG_ENV_OFFSET_REDUND=0x3db000 ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++# CONFIG_ENV_IS_NOWHERE is not set ++# CONFIG_ENV_IS_IN_EEPROM is not set ++# CONFIG_ENV_IS_IN_FAT is not set ++# CONFIG_ENV_IS_IN_EXT4 is not set ++# CONFIG_ENV_IS_IN_FLASH is not set ++# CONFIG_ENV_IS_IN_NAND is not set ++# CONFIG_ENV_IS_IN_NVRAM is not set ++# CONFIG_ENV_IS_IN_ONENAND is not set ++# CONFIG_ENV_IS_IN_REMOTE is not set ++# CONFIG_ENV_IS_IN_SPI_FLASH is not set ++# CONFIG_ENV_IS_IN_UBI is not set ++CONFIG_MMC=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FS_GENERIC=y ++# CONFIG_BOOTCOUNT_BOOTLIMIT is not set ++# CONFIG_BOOTCOUNT_GENERIC is not set ++# CONFIG_BOOTCOUNT_EXT is not set ++# CONFIG_BOOTCOUNT_AM33XX is not set ++# CONFIG_BOOTCOUNT_RAM is not set ++# CONFIG_BOOTCOUNT_I2C is not set ++# CONFIG_BOOTCOUNT_AT91 is not set ++# CONFIG_BOOTCOUNT_MEM is not set ++# CONFIG_BOOTCOUNT_ALEN is not set ++CONFIG_BOOTCOUNT_LIMIT=y ++CONFIG_BOOTCOUNT_ENV=y ++# CONFIG_BOOTCOMMAND is not set +diff --git a/configs/p2771-0000-000_defconfig b/configs/p2771-0000-000_defconfig +index e5a1249aeb..a781da5ef7 100644 +--- a/configs/p2771-0000-000_defconfig ++++ b/configs/p2771-0000-000_defconfig +@@ -1,8 +1,6 @@ + CONFIG_ARM=y + CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 +-CONFIG_ENV_SIZE=0x8000 +-CONFIG_ENV_OFFSET=0x3D8000 + CONFIG_NR_DRAM_BANKS=1043 + CONFIG_DEFAULT_DEVICE_TREE="tegra186-p2771-0000-000" + CONFIG_TEGRA186=y +@@ -38,3 +36,34 @@ CONFIG_SYS_NS16550=y + CONFIG_CMD_CACHE=y + CONFIG_NVME=y + CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0x3bb000 ++CONFIG_ENV_OFFSET_REDUND=0x3db000 ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++# CONFIG_ENV_IS_NOWHERE is not set ++# CONFIG_ENV_IS_IN_EEPROM is not set ++# CONFIG_ENV_IS_IN_FAT is not set ++# CONFIG_ENV_IS_IN_EXT4 is not set ++# CONFIG_ENV_IS_IN_FLASH is not set ++# CONFIG_ENV_IS_IN_NAND is not set ++# CONFIG_ENV_IS_IN_NVRAM is not set ++# CONFIG_ENV_IS_IN_ONENAND is not set ++# CONFIG_ENV_IS_IN_REMOTE is not set ++# CONFIG_ENV_IS_IN_SPI_FLASH is not set ++# CONFIG_ENV_IS_IN_UBI is not set ++CONFIG_MMC=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FS_GENERIC=y ++# CONFIG_BOOTCOUNT_BOOTLIMIT is not set ++# CONFIG_BOOTCOUNT_GENERIC is not set ++# CONFIG_BOOTCOUNT_EXT is not set ++# CONFIG_BOOTCOUNT_AM33XX is not set ++# CONFIG_BOOTCOUNT_RAM is not set ++# CONFIG_BOOTCOUNT_I2C is not set ++# CONFIG_BOOTCOUNT_AT91 is not set ++# CONFIG_BOOTCOUNT_MEM is not set ++# CONFIG_BOOTCOUNT_ALEN is not set ++CONFIG_BOOTCOUNT_LIMIT=y ++CONFIG_BOOTCOUNT_ENV=y ++# CONFIG_BOOTCOMMAND is not set +diff --git a/configs/p2771-0000-500_defconfig b/configs/p2771-0000-500_defconfig +index f0b56ec4c7..9bd7de8034 100644 +--- a/configs/p2771-0000-500_defconfig ++++ b/configs/p2771-0000-500_defconfig +@@ -1,8 +1,6 @@ + CONFIG_ARM=y + CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 +-CONFIG_ENV_SIZE=0x8000 +-CONFIG_ENV_OFFSET=0x3D8000 + CONFIG_NR_DRAM_BANKS=1043 + CONFIG_DEFAULT_DEVICE_TREE="tegra186-p2771-0000-500" + CONFIG_TEGRA186=y +@@ -38,3 +36,34 @@ CONFIG_SYS_NS16550=y + CONFIG_CMD_CACHE=y + CONFIG_NVME=y + CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0x3bb000 ++CONFIG_ENV_OFFSET_REDUND=0x3db000 ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++# CONFIG_ENV_IS_NOWHERE is not set ++# CONFIG_ENV_IS_IN_EEPROM is not set ++# CONFIG_ENV_IS_IN_FAT is not set ++# CONFIG_ENV_IS_IN_EXT4 is not set ++# CONFIG_ENV_IS_IN_FLASH is not set ++# CONFIG_ENV_IS_IN_NAND is not set ++# CONFIG_ENV_IS_IN_NVRAM is not set ++# CONFIG_ENV_IS_IN_ONENAND is not set ++# CONFIG_ENV_IS_IN_REMOTE is not set ++# CONFIG_ENV_IS_IN_SPI_FLASH is not set ++# CONFIG_ENV_IS_IN_UBI is not set ++CONFIG_MMC=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FS_GENERIC=y ++# CONFIG_BOOTCOUNT_BOOTLIMIT is not set ++# CONFIG_BOOTCOUNT_GENERIC is not set ++# CONFIG_BOOTCOUNT_EXT is not set ++# CONFIG_BOOTCOUNT_AM33XX is not set ++# CONFIG_BOOTCOUNT_RAM is not set ++# CONFIG_BOOTCOUNT_I2C is not set ++# CONFIG_BOOTCOUNT_AT91 is not set ++# CONFIG_BOOTCOUNT_MEM is not set ++# CONFIG_BOOTCOUNT_ALEN is not set ++CONFIG_BOOTCOUNT_LIMIT=y ++CONFIG_BOOTCOUNT_ENV=y ++# CONFIG_BOOTCOMMAND is not set +diff --git a/configs/p3450-0000_defconfig b/configs/p3450-0000_defconfig +index 815a6773ac..32f5aff921 100644 +--- a/configs/p3450-0000_defconfig ++++ b/configs/p3450-0000_defconfig +@@ -3,8 +3,6 @@ CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_SYS_MALLOC_LEN=0x2500000 + CONFIG_NR_DRAM_BANKS=16 +-CONFIG_ENV_SIZE=0x8000 +-CONFIG_ENV_OFFSET=0x3D8000 + CONFIG_ENV_SECT_SIZE=0x1000 + CONFIG_DEFAULT_DEVICE_TREE="tegra210-p3450-0000" + CONFIG_TEGRA210=y +@@ -31,7 +29,6 @@ CONFIG_CMD_EXT4_WRITE=y + CONFIG_OF_LIVE=y + CONFIG_ENV_OVERWRITE=y + # CONFIG_ENV_IS_IN_MMC is not set +-CONFIG_ENV_IS_IN_SPI_FLASH=y + CONFIG_DFU_MMC=y + CONFIG_DFU_RAM=y + CONFIG_DFU_SF=y +@@ -64,3 +61,33 @@ CONFIG_USB_STORAGE=y + CONFIG_DOS_PARTITION=y + CONFIG_CMD_CACHE=y + CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0x3b0000 ++CONFIG_ENV_OFFSET_REDUND=0x3d0000 ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++# CONFIG_ENV_IS_NOWHERE is not set ++# CONFIG_ENV_IS_IN_EEPROM is not set ++# CONFIG_ENV_IS_IN_FAT is not set ++# CONFIG_ENV_IS_IN_EXT4 is not set ++# CONFIG_ENV_IS_IN_FLASH is not set ++# CONFIG_ENV_IS_IN_NAND is not set ++# CONFIG_ENV_IS_IN_NVRAM is not set ++# CONFIG_ENV_IS_IN_ONENAND is not set ++# CONFIG_ENV_IS_IN_REMOTE is not set ++CONFIG_ENV_IS_IN_SPI_FLASH=y ++# CONFIG_ENV_IS_IN_UBI is not set ++# CONFIG_ENV_IS_IN_MMC is not set ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FS_GENERIC=y ++# CONFIG_BOOTCOUNT_BOOTLIMIT is not set ++# CONFIG_BOOTCOUNT_GENERIC is not set ++# CONFIG_BOOTCOUNT_EXT is not set ++# CONFIG_BOOTCOUNT_AM33XX is not set ++# CONFIG_BOOTCOUNT_RAM is not set ++# CONFIG_BOOTCOUNT_I2C is not set ++# CONFIG_BOOTCOUNT_AT91 is not set ++# CONFIG_BOOTCOUNT_MEM is not set ++# CONFIG_BOOTCOUNT_ALEN is not set ++CONFIG_BOOTCOUNT_LIMIT=y ++CONFIG_BOOTCOUNT_ENV=y ++# CONFIG_BOOTCOMMAND is not set +diff --git a/configs/p3450-0002_defconfig b/configs/p3450-0002_defconfig +index 595d270b73..d617181548 100644 +--- a/configs/p3450-0002_defconfig ++++ b/configs/p3450-0002_defconfig +@@ -3,8 +3,6 @@ CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_SYS_MALLOC_LEN=0x2500000 + CONFIG_NR_DRAM_BANKS=16 +-CONFIG_ENV_SIZE=0x8000 +-CONFIG_ENV_OFFSET=0x3D8000 + CONFIG_DEFAULT_DEVICE_TREE="tegra210-p3450-0000" + CONFIG_TEGRA210=y + CONFIG_TARGET_P3450_0000=y +@@ -28,6 +26,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y + CONFIG_BOOTP_PREFER_SERVERIP=y + # CONFIG_CMD_NFS is not set + CONFIG_CMD_EXT4_WRITE=y ++CONFIG_CMD_FS_GENERIC=y + CONFIG_OF_LIVE=y + CONFIG_ENV_OVERWRITE=y + CONFIG_ENV_IS_IN_MMC=y +@@ -64,3 +63,31 @@ CONFIG_USB_STORAGE=y + CONFIG_DOS_PARTITION=y + CONFIG_CMD_CACHE=y + CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0x3bb000 ++CONFIG_ENV_OFFSET_REDUND=0x3db000 ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++# CONFIG_ENV_IS_NOWHERE is not set ++# CONFIG_ENV_IS_IN_EEPROM is not set ++# CONFIG_ENV_IS_IN_FAT is not set ++# CONFIG_ENV_IS_IN_EXT4 is not set ++# CONFIG_ENV_IS_IN_FLASH is not set ++# CONFIG_ENV_IS_IN_NAND is not set ++# CONFIG_ENV_IS_IN_NVRAM is not set ++# CONFIG_ENV_IS_IN_ONENAND is not set ++# CONFIG_ENV_IS_IN_REMOTE is not set ++# CONFIG_ENV_IS_IN_SPI_FLASH is not set ++# CONFIG_ENV_IS_IN_UBI is not set ++CONFIG_MMC=y ++# CONFIG_BOOTCOUNT_BOOTLIMIT is not set ++# CONFIG_BOOTCOUNT_GENERIC is not set ++# CONFIG_BOOTCOUNT_EXT is not set ++# CONFIG_BOOTCOUNT_AM33XX is not set ++# CONFIG_BOOTCOUNT_RAM is not set ++# CONFIG_BOOTCOUNT_I2C is not set ++# CONFIG_BOOTCOUNT_AT91 is not set ++# CONFIG_BOOTCOUNT_MEM is not set ++# CONFIG_BOOTCOUNT_ALEN is not set ++CONFIG_BOOTCOUNT_LIMIT=y ++CONFIG_BOOTCOUNT_ENV=y ++# CONFIG_BOOTCOMMAND is not set +diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h +index 2169695506..1578dad536 100644 +--- a/include/config_distro_bootcmd.h ++++ b/include/config_distro_bootcmd.h +@@ -511,7 +511,6 @@ + "done\0" + + #ifndef CONFIG_BOOTCOMMAND +-#define CONFIG_BOOTCOMMAND "run distro_bootcmd" + #endif + + #endif /* _CONFIG_CMD_DISTRO_BOOTCMD_H */ +-- +2.32.0 + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0011-Jetson-TX2-mender-boot-commands.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0011-Jetson-TX2-mender-boot-commands.patch new file mode 100644 index 00000000..dd6d4ffa --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0011-Jetson-TX2-mender-boot-commands.patch @@ -0,0 +1,48 @@ +From 424fd871ab8b39d828d738949f809fd123d2afde Mon Sep 17 00:00:00 2001 +From: Dan Walkes +Date: Tue, 1 Jan 2019 18:00:39 -0700 +Subject: [PATCH 5/7] Jetson TX2 mender boot commands + +Modify u-boot to use bootcmd setting based on +values which support jetson-tx2 boot partition layout +and setup. +--- + include/env_default.h | 4 ++-- + include/env_mender.h | 9 ++++++--- + 2 files changed, 8 insertions(+), 5 deletions(-) + +Index: git/include/env_default.h +=================================================================== +--- git.orig/include/env_default.h ++++ git/include/env_default.h +@@ -37,8 +37,8 @@ const char default_environment[] = { + #ifdef CONFIG_USE_BOOTARGS + "bootargs=" CONFIG_BOOTARGS "\0" + #endif +-#ifdef CONFIG_BOOTCOMMAND +- "bootcmd=" CONFIG_BOOTCOMMAND "\0" ++#ifdef CONFIG_MENDER_BOOTCOMMAND ++ "bootcmd=" CONFIG_MENDER_BOOTCOMMAND "\0" + #endif + #ifdef CONFIG_RAMBOOTCOMMAND + "ramboot=" CONFIG_RAMBOOTCOMMAND "\0" +Index: git/include/env_mender.h +=================================================================== +--- git.orig/include/env_mender.h ++++ git/include/env_mender.h +@@ -146,9 +146,12 @@ + + #define CONFIG_MENDER_BOOTCOMMAND \ + "run mender_setup; " \ +- MENDER_BOOTARGS \ +- MENDER_LOAD_KERNEL_AND_FDT \ +- "${mender_boot_kernel_type} ${kernel_addr_r} - ${fdt_addr_r}; " \ ++ "setenv distro_bootpart ${mender_boot_part}; " \ ++ "setenv distro_bootpart_hex ${mender_boot_part_hex}; " \ ++ "setenv devnum " __stringify(MENDER_UBOOT_STORAGE_DEVICE) "; " \ ++ "setenv devtype " __stringify(MENDER_UBOOT_STORAGE_INTERFACE) "; " \ ++ "setenv prefix /boot/; " \ ++ "sysboot ${devtype} ${devnum}:${distro_bootpart_hex} any ${scriptaddr} ${prefix}extlinux/extlinux.conf; " \ + "run mender_try_to_recover" + + #endif /* !MENDER_AUTO_PROBING */ diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0012-p3541-0000_defconfig-Mender-patch.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0012-p3541-0000_defconfig-Mender-patch.patch new file mode 100644 index 00000000..f31db585 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0012-p3541-0000_defconfig-Mender-patch.patch @@ -0,0 +1,39 @@ +From 0dfa77478807a433716f130b57fdff6f68aabb02 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Fri, 30 Oct 2020 14:29:08 -0700 +Subject: [PATCH 12/16] p3541-0000_defconfig: Mender patch + +Signed-off-by: Matt Madison + +%% original patch: 0012-p3541-0000_defconfig-Mender-patch.patch +--- + configs/p3541-0000_defconfig | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/configs/p3541-0000_defconfig b/configs/p3541-0000_defconfig +index 35dda4228b..fe3f00a30e 100644 +--- a/configs/p3541-0000_defconfig ++++ b/configs/p3541-0000_defconfig +@@ -3,8 +3,10 @@ CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_SYS_MALLOC_LEN=0x2500000 + CONFIG_NR_DRAM_BANKS=16 +-CONFIG_ENV_SIZE=0x8000 +-CONFIG_ENV_OFFSET=0x3D8000 ++CONFIG_ENV_SIZE=0x10000 ++CONFIG_ENV_OFFSET=0x3b0000 ++CONFIG_ENV_OFFSET_REDUND=0x3c0000 ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y + CONFIG_ENV_SECT_SIZE=0x1000 + CONFIG_DEFAULT_DEVICE_TREE="tegra210-p3541-0000" + CONFIG_TEGRA210=y +@@ -64,3 +66,6 @@ CONFIG_USB_STORAGE=y + CONFIG_DOS_PARTITION=y + CONFIG_CMD_CACHE=y + CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_BOOTCOUNT_LIMIT=y ++CONFIG_BOOTCOUNT_ENV=y ++# CONFIG_BOOTCOMMAND is not set +-- +2.32.0 + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0013-Reduce-env-size-on-p3450-0000-to-64KiB.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0013-Reduce-env-size-on-p3450-0000-to-64KiB.patch new file mode 100644 index 00000000..f1739e98 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0013-Reduce-env-size-on-p3450-0000-to-64KiB.patch @@ -0,0 +1,29 @@ +From 4b6e083fda09a390fe597186a6f7f537333a0e50 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Mon, 2 Nov 2020 08:24:14 -0800 +Subject: [PATCH 13/16] Reduce env size on p3450-0000 to 64KiB + +Signed-off-by: Matt Madison +--- + configs/p3450-0000_defconfig | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configs/p3450-0000_defconfig b/configs/p3450-0000_defconfig +index 32f5aff921..8bed4aafef 100644 +--- a/configs/p3450-0000_defconfig ++++ b/configs/p3450-0000_defconfig +@@ -61,9 +61,9 @@ CONFIG_USB_STORAGE=y + CONFIG_DOS_PARTITION=y + CONFIG_CMD_CACHE=y + CONFIG_OF_LIBFDT_OVERLAY=y +-CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_SIZE=0x10000 + CONFIG_ENV_OFFSET=0x3b0000 +-CONFIG_ENV_OFFSET_REDUND=0x3d0000 ++CONFIG_ENV_OFFSET_REDUND=0x3c0000 + CONFIG_SYS_REDUNDAND_ENVIRONMENT=y + # CONFIG_ENV_IS_NOWHERE is not set + # CONFIG_ENV_IS_IN_EEPROM is not set +-- +2.32.0 + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0015-Update-TX1-nano-emmc-defconfigs-for-new-UBENV-locati.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0015-Update-TX1-nano-emmc-defconfigs-for-new-UBENV-locati.patch new file mode 100644 index 00000000..59085bda --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0015-Update-TX1-nano-emmc-defconfigs-for-new-UBENV-locati.patch @@ -0,0 +1,46 @@ +From 1d56e39b15e264ddd96aecdbc21cb9f1e5b3dad7 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Sun, 29 Nov 2020 08:30:37 -0800 +Subject: [PATCH 14/16] Update TX1/nano-emmc defconfigs for new UBENV location + +Signed-off-by: Matt Madison +--- + configs/p2371-2180_defconfig | 4 ++-- + configs/p3450-0002_defconfig | 5 +++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/configs/p2371-2180_defconfig b/configs/p2371-2180_defconfig +index 329878dc90..f62228c805 100644 +--- a/configs/p2371-2180_defconfig ++++ b/configs/p2371-2180_defconfig +@@ -61,8 +61,8 @@ CONFIG_DOS_PARTITION=y + CONFIG_CMD_CACHE=y + CONFIG_OF_LIBFDT_OVERLAY=y + CONFIG_ENV_SIZE=0x20000 +-CONFIG_ENV_OFFSET=0x3bb000 +-CONFIG_ENV_OFFSET_REDUND=0x3db000 ++CONFIG_ENV_OFFSET=0x3a0000 ++CONFIG_ENV_OFFSET_REDUND=0x3c0000 + CONFIG_SYS_REDUNDAND_ENVIRONMENT=y + # CONFIG_ENV_IS_NOWHERE is not set + # CONFIG_ENV_IS_IN_EEPROM is not set +diff --git a/configs/p3450-0002_defconfig b/configs/p3450-0002_defconfig +index d617181548..81698df8b9 100644 +--- a/configs/p3450-0002_defconfig ++++ b/configs/p3450-0002_defconfig +@@ -64,9 +64,10 @@ CONFIG_DOS_PARTITION=y + CONFIG_CMD_CACHE=y + CONFIG_OF_LIBFDT_OVERLAY=y + CONFIG_ENV_SIZE=0x20000 +-CONFIG_ENV_OFFSET=0x3bb000 +-CONFIG_ENV_OFFSET_REDUND=0x3db000 ++CONFIG_ENV_OFFSET=0x3a0000 ++CONFIG_ENV_OFFSET_REDUND=0x3c0000 + CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_SYS_MMC_ENV_PART=2 + # CONFIG_ENV_IS_NOWHERE is not set + # CONFIG_ENV_IS_IN_EEPROM is not set + # CONFIG_ENV_IS_IN_FAT is not set +-- +2.32.0 + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0016-Update-env-for-SPIflash-Nanos-for-R32.5.0-with-Mende.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0016-Update-env-for-SPIflash-Nanos-for-R32.5.0-with-Mende.patch new file mode 100644 index 00000000..423b7cbf --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0016-Update-env-for-SPIflash-Nanos-for-R32.5.0-with-Mende.patch @@ -0,0 +1,52 @@ +From 8594f2beccd0ce6e780858e868e898798dc41c4e Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Thu, 3 Feb 2022 12:34:15 -0800 +Subject: [PATCH 15/16] Update env for SPIflash Nanos for R32.5.0 with Mender + +Need to move the environment area and reduce its +size in order to fit redundant copies between RP4 +and VER_b. + +Signed-off-by: Matt Madison +--- + configs/p3450-0000_defconfig | 6 +++--- + configs/p3541-0000_defconfig | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/configs/p3450-0000_defconfig b/configs/p3450-0000_defconfig +index 8bed4aafef..97e7d70fb7 100644 +--- a/configs/p3450-0000_defconfig ++++ b/configs/p3450-0000_defconfig +@@ -61,9 +61,9 @@ CONFIG_USB_STORAGE=y + CONFIG_DOS_PARTITION=y + CONFIG_CMD_CACHE=y + CONFIG_OF_LIBFDT_OVERLAY=y +-CONFIG_ENV_SIZE=0x10000 +-CONFIG_ENV_OFFSET=0x3b0000 +-CONFIG_ENV_OFFSET_REDUND=0x3c0000 ++CONFIG_ENV_SIZE=0x8000 ++CONFIG_ENV_OFFSET=0x3d0000 ++CONFIG_ENV_OFFSET_REDUND=0x3d8000 + CONFIG_SYS_REDUNDAND_ENVIRONMENT=y + # CONFIG_ENV_IS_NOWHERE is not set + # CONFIG_ENV_IS_IN_EEPROM is not set +diff --git a/configs/p3541-0000_defconfig b/configs/p3541-0000_defconfig +index fe3f00a30e..d9c161483a 100644 +--- a/configs/p3541-0000_defconfig ++++ b/configs/p3541-0000_defconfig +@@ -3,9 +3,9 @@ CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 + CONFIG_SYS_MALLOC_LEN=0x2500000 + CONFIG_NR_DRAM_BANKS=16 +-CONFIG_ENV_SIZE=0x10000 +-CONFIG_ENV_OFFSET=0x3b0000 +-CONFIG_ENV_OFFSET_REDUND=0x3c0000 ++CONFIG_ENV_SIZE=0x8000 ++CONFIG_ENV_OFFSET=0x3d0000 ++CONFIG_ENV_OFFSET_REDUND=0x3d8000 + CONFIG_SYS_REDUNDAND_ENVIRONMENT=y + CONFIG_ENV_SECT_SIZE=0x1000 + CONFIG_DEFAULT_DEVICE_TREE="tegra210-p3541-0000" +-- +2.32.0 + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0017-Jetson-Xavier-NX-TX2-NX-mender.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0017-Jetson-Xavier-NX-TX2-NX-mender.patch new file mode 100644 index 00000000..e7fce64a --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/patches/0017-Jetson-Xavier-NX-TX2-NX-mender.patch @@ -0,0 +1,61 @@ +From 0836e2cf2ba76c50cc25915d398e1684d86396d2 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Thu, 3 Feb 2022 12:34:52 -0800 +Subject: [PATCH 16/16] Jetson Xavier NX TX2-NX mender + +Signed-off-by: Matt Madison +--- + configs/p3636-0001_defconfig | 33 +++++++++++++++++++++++++++++++-- + 1 file changed, 31 insertions(+), 2 deletions(-) + +diff --git a/configs/p3636-0001_defconfig b/configs/p3636-0001_defconfig +index 9e90f1ff8a..3da443ae8b 100644 +--- a/configs/p3636-0001_defconfig ++++ b/configs/p3636-0001_defconfig +@@ -1,8 +1,6 @@ + CONFIG_ARM=y + CONFIG_ARCH_TEGRA=y + CONFIG_SYS_TEXT_BASE=0x80080000 +-CONFIG_ENV_SIZE=0x8000 +-CONFIG_ENV_OFFSET=0x3D8000 + CONFIG_NR_DRAM_BANKS=1043 + CONFIG_DEFAULT_DEVICE_TREE="tegra186-p3636-0001" + CONFIG_TEGRA186=y +@@ -39,3 +37,34 @@ CONFIG_SYS_NS16550=y + CONFIG_CMD_CACHE=y + CONFIG_NVME=y + CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0x3bb000 ++CONFIG_ENV_OFFSET_REDUND=0x3db000 ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++# CONFIG_ENV_IS_NOWHERE is not set ++# CONFIG_ENV_IS_IN_EEPROM is not set ++# CONFIG_ENV_IS_IN_FAT is not set ++# CONFIG_ENV_IS_IN_EXT4 is not set ++# CONFIG_ENV_IS_IN_FLASH is not set ++# CONFIG_ENV_IS_IN_NAND is not set ++# CONFIG_ENV_IS_IN_NVRAM is not set ++# CONFIG_ENV_IS_IN_ONENAND is not set ++# CONFIG_ENV_IS_IN_REMOTE is not set ++# CONFIG_ENV_IS_IN_SPI_FLASH is not set ++# CONFIG_ENV_IS_IN_UBI is not set ++CONFIG_MMC=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FS_GENERIC=y ++# CONFIG_BOOTCOUNT_BOOTLIMIT is not set ++# CONFIG_BOOTCOUNT_GENERIC is not set ++# CONFIG_BOOTCOUNT_EXT is not set ++# CONFIG_BOOTCOUNT_AM33XX is not set ++# CONFIG_BOOTCOUNT_RAM is not set ++# CONFIG_BOOTCOUNT_I2C is not set ++# CONFIG_BOOTCOUNT_AT91 is not set ++# CONFIG_BOOTCOUNT_MEM is not set ++# CONFIG_BOOTCOUNT_ALEN is not set ++CONFIG_BOOTCOUNT_LIMIT=y ++CONFIG_BOOTCOUNT_ENV=y ++# CONFIG_BOOTCOMMAND is not set +-- +2.32.0 + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-bup-payload.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-bup-payload.bbappend new file mode 100644 index 00000000..98aa58df --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-bup-payload.bbappend @@ -0,0 +1 @@ +inherit image_types_mender_tegra diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-mender-tegra-vars.inc b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-mender-tegra-vars.inc new file mode 100644 index 00000000..64051c14 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-mender-tegra-vars.inc @@ -0,0 +1,29 @@ +MENDER_UBOOT_AUTO_CONFIGURE = "0" +MENDER_UBOOT_CONFIG_SYS_MMC_ENV_PART = "2" + +TEGRA_MENDER_BOOTENV_SIZE_DEFAULT = "0x20000" +TEGRA_MENDER_BOOTENV_SIZE_DEFAULT:tegra210 = "${@'0x10000' if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1' else '0x20000'}" +BOOTENV_SIZE ?= "${TEGRA_MENDER_BOOTENV_SIZE_DEFAULT}" + +# Calculate this offset by adding up the offsets of each partition preceeding the uboot_env partition in sdmmc_boot and aligning to the next +# 4096 byte boundary, then subtracting 4 MiB (4194304) since the sdmmc_boot represents the combined boot0 and boot1 partitions +# Please note the suggestions in the nvidia thread at https://devtalk.nvidia.com/default/topic/1063652/jetson-tx2/mmcblk0boot1-usage-at-address-4177408-and-u-boot-parameter-storage-space-availability/ +# regarding suggestions about locating this environment area in mmcblk0boot1 at 0x3BB000 (3911680) +# We use the same offset for tegra210 eMMC. For tegra210 SPI/SD, we +# locate the environment in the padding block, before the VER +# partition when using SPI flash. Otherwise, we use the location of +# the ENV partition on the SDcard - 0xC00000 (12582912). +MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET:tegra186 = "3911680" +# Env offset changed on t210 eMMC platforms in L4T R32.5.x and later +TEGRA_210_EMMC_UBOOT_ENV_OFFSET:l4t-mender-32-4-3 = "3911680" +TEGRA_210_EMMC_UBOOT_ENV_OFFSET = "3801088" +MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET:tegra210 = "${@'3866624' if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1' else '${TEGRA_210_EMMC_UBOOT_ENV_OFFSET}'}" +MENDER_UBOOT_MMC_ENV_LINUX_DEVICE_PATH:tegra210 = "${@'/dev/mtd0' if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1' else mender_get_uboot_env_mmc_linux_device_path(d)}" + +# Optionally use SDcard instead of SPI flash on Jetson Nano dev kits. +# Starting with meta-tegra zeus branch, Nano dev kits use the SPI flash +# for the U-Boot environment (as NVIDIA does with L4T R32.3.1 and +# later). Note that the u-boot environment will still live on SPI flash +# and relocating the environment also to SD may be possible but is not +# supported. +MENDER_UBOOT_STORAGE_DEVICE:tegra210 = "${@'1' if (d.getVar('TEGRA_SPIFLASH_BOOT') or '') == '1' else '0'}" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-mender-tegra.inc b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-mender-tegra.inc new file mode 100644 index 00000000..a10df896 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-mender-tegra.inc @@ -0,0 +1,30 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/patches:" + +SRC_URI:append:mender-uboot = " file://0010-tegra-mender-auto-configured-modified.patch" +SRC_URI:append:mender-uboot = " file://0011-Jetson-TX2-mender-boot-commands.patch" +SRC_URI:append:mender-uboot = " file://0013-Reduce-env-size-on-p3450-0000-to-64KiB.patch" +ADDITIONAL_PATCHES = " \ + file://0012-p3541-0000_defconfig-Mender-patch.patch \ + file://0015-Update-TX1-nano-emmc-defconfigs-for-new-UBENV-locati.patch \ + file://0017-Jetson-Xavier-NX-TX2-NX-mender.patch \ +" +SRC_URI:append:mender-uboot = "${ADDITIONAL_PATCHES}" + +do_provide_mender_defines:append:tegra210() { + if [ "${TEGRA_SPIFLASH_BOOT}" = "1" ]; then + sed -i -e'/^CONFIG_SYS_MMC_ENV/d' ${S}/mender_Kconfig_fragment + fi +} + +mender_get_clean_kernel_devicetree:tegra() { + # Singleton device tree is not required on all platforms, + # and the value is not used on tegra platforms, so just provide a + # dummy value. + echo "dummy" +} + +# Work around Mender's installation of this file (symlink) +# in its libubootenv bbappend +do_install:append:mender-uboot() { + rm -f ${D}${sysconfdir}/fw_env.config +} diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-tegra_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-tegra_%.bbappend new file mode 100644 index 00000000..88eb8b1d --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-tegra_%.bbappend @@ -0,0 +1,3 @@ +require recipes-bsp/u-boot/u-boot-mender.inc +require recipes-bsp/u-boot/u-boot-mender-tegra.inc +require recipes-bsp/u-boot/u-boot-mender-tegra-vars.inc diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-tegra_2022.01.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-tegra_2022.01.bbappend new file mode 100644 index 00000000..ff5a4054 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/u-boot/u-boot-tegra_2022.01.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/patches:" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/edk2-firmware-tegra_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/edk2-firmware-tegra_%.bbappend new file mode 100644 index 00000000..d030091b --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/edk2-firmware-tegra_%.bbappend @@ -0,0 +1,9 @@ + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI += "file://0007-runtime-access-for-KernelCommandLine-efivar.patch;patchdir=.." +SRC_URI += "file://0008-enable-rootfs-redundancy.patch;patchdir=.." +SRC_URI += "file://0009-BootChainDxe-fix.patch;patchdir=.." + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/0007-runtime-access-for-KernelCommandLine-efivar.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/0007-runtime-access-for-KernelCommandLine-efivar.patch new file mode 100644 index 00000000..f41c2668 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/0007-runtime-access-for-KernelCommandLine-efivar.patch @@ -0,0 +1,39 @@ +diff --git edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c +index 90e515ae..a00efb6c 100644 +--- edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c ++++ edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c +@@ -133,7 +133,7 @@ InitializeSettings ( + if (KernelCmdLineLen < sizeof (CmdLine)) { + KernelCmdLineLen = sizeof (CmdLine); + ZeroMem (&CmdLine, KernelCmdLineLen); +- Status = gRT->SetVariable (L"KernelCommandLine", &gNVIDIAPublicVariableGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, KernelCmdLineLen, (VOID *)&CmdLine); ++ Status = gRT->SetVariable (L"KernelCommandLine", &gNVIDIAPublicVariableGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, KernelCmdLineLen, (VOID *)&CmdLine); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Error setting command line variable %r\r\n", __FUNCTION__, Status)); + } +diff --git edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr +index dbc26647..58c9aa91 100644 +--- edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr ++++ edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr +@@ -58,7 +58,7 @@ formset + guid = NVIDIA_TOKEN_SPACE_GUID; + + efivarstore NVIDIA_KERNEL_COMMAND_LINE, +- attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, // EFI variable attributes ++ attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS, // EFI variable attributes + name = KernelCommandLine, + guid = NVIDIA_PUBLIC_VARIABLE_GUID; + +diff --git edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c +index a3fb49d6..f642b433 100644 +--- edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c ++++ edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c +@@ -1023,7 +1023,7 @@ IsPlatformConfigurationNeeded ( + AddlCmdLen = sizeof (AddlCmdLine); + Status = gRT->GetVariable (L"KernelCommandLine", &gNVIDIAPublicVariableGuid, &AddlCmdLineAttributes, &AddlCmdLen, &AddlCmdLine); + if (EFI_ERROR (Status)) { +- AddlCmdLineAttributes = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS; ++ AddlCmdLineAttributes = EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; + ZeroMem (&AddlCmdLine, sizeof (AddlCmdLine)); + } + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/0008-enable-rootfs-redundancy.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/0008-enable-rootfs-redundancy.patch new file mode 100644 index 00000000..556b92e1 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/0008-enable-rootfs-redundancy.patch @@ -0,0 +1,13 @@ +diff --git edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Tegra/DeviceTree/L4TConfiguration.dts edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Tegra/DeviceTree/L4TConfiguration.dts +index 2c619e21..b254ae76 100644 +--- edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Tegra/DeviceTree/L4TConfiguration.dts ++++ edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Tegra/DeviceTree/L4TConfiguration.dts +@@ -37,7 +37,7 @@ + locked; + }; + RootfsRedundancyLevel { +- data = [00 00 00 00]; ++ data = [01 00 00 00]; + runtime; + locked; + }; diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/0009-BootChainDxe-fix.patch b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/0009-BootChainDxe-fix.patch new file mode 100644 index 00000000..d8d56866 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-bsp/uefi/files/0009-BootChainDxe-fix.patch @@ -0,0 +1,15 @@ +diff --git edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Drivers/BootChainDxe/BootChainDxe.c edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Drivers/BootChainDxe/BootChainDxe.c +index cfaf6872..d7eaf0f3 100644 +--- edk2-tegra.a/edk2-nvidia/Silicon/NVIDIA/Drivers/BootChainDxe/BootChainDxe.c ++++ edk2-tegra.b/edk2-nvidia/Silicon/NVIDIA/Drivers/BootChainDxe/BootChainDxe.c +@@ -336,8 +336,8 @@ BootChainExecuteUpdate ( + BCStatus = STATUS_ERROR_BOOT_CHAIN_FAILED; + goto SetStatusAndBootOs; + } +- } else { +- // Status is already ERROR or SUCCESS, finish the update and boot OS ++ } else if (BCStatus != STATUS_SUCCESS) { ++ // Status is already ERROR, finish the update and boot OS + goto FinishUpdateAndBootOs; + } + } diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-core/images/tegra-minimal-initramfs.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-core/images/tegra-minimal-initramfs.bbappend new file mode 100644 index 00000000..40aa4722 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-core/images/tegra-minimal-initramfs.bbappend @@ -0,0 +1,3 @@ +# Prevents circular dependency on u-boot due to EXTRA_IMAGEDEPENDS. +# See https://hub.mender.io/t/warrior-tegra-build-cicular-dependencies/757/5 and comments from Mirza +EXTRA_IMAGEDEPENDS:remove = "u-boot" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-core/initrdscripts/tegra-minimal-init/platform-preboot-cboot.sh b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-core/initrdscripts/tegra-minimal-init/platform-preboot-cboot.sh new file mode 100644 index 00000000..88574cba --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-core/initrdscripts/tegra-minimal-init/platform-preboot-cboot.sh @@ -0,0 +1,23 @@ +slotsfx="" +mayberoot="" +for bootarg in `cat /proc/cmdline`; do + case "$bootarg" in + boot.slot_suffix=*) slotsfx="${bootarg##boot.slot_suffix=}" ;; + root=*) mayberoot="${bootarg##root=}" ;; + ro) opt="ro" ;; + rootwait) wait="yes" ;; + esac +done +rootdev=`blkid -l -t PARTLABEL=APP$slotsfx | cut -d: -f1` +if [ -z "$rootdev" ]; then + if [ -n "$mayberoot" ]; then + rootdev="$mayberoot" + else + rootdev="/dev/mmcblk0p1" + fi +fi + +if which bootcountcheck >/dev/null 2>&1; then + bootcountcheck +fi + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-core/initrdscripts/tegra-minimal-init_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-core/initrdscripts/tegra-minimal-init_%.bbappend new file mode 100644 index 00000000..cb33efc3 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-core/initrdscripts/tegra-minimal-init_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" + +EXTRADEPS = "" +EXTRADEPS:tegra = "tegra-boot-tools-earlyboot" +EXTRADEPS:tegra210 = "" +EXTRADEPS:tegra234 = "" +RDEPENDS:${PN} += "${EXTRADEPS}" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-kernel/linux/linux-tegra_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-kernel/linux/linux-tegra_%.bbappend new file mode 100644 index 00000000..61dd95f5 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-kernel/linux/linux-tegra_%.bbappend @@ -0,0 +1,9 @@ +# Rather ugly hack to ensure that meta-mender-core's files directory +# is also removed from consideration, since linux-yocto.bbclass adds +# all directories that contain config fragments into its file-cksums +# list, which needlessly (for us) changes the task hash. +python() { + extrapaths = d.getVar('FILESEXTRAPATHS').split(':') + newpaths = ':'.join([path for path in extrapaths if not path.endswith('meta-mender-core/recipes-kernel/linux/files')]) + d.setVar('FILESEXTRAPATHS', newpaths) +} diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-client/files/tegra234/efi_systemd_machine_id.sh b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-client/files/tegra234/efi_systemd_machine_id.sh new file mode 100644 index 00000000..c5ea52b7 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-client/files/tegra234/efi_systemd_machine_id.sh @@ -0,0 +1,128 @@ +#!/bin/sh + +function to_unicode() { + local in="$1" + local out + + for (( i=0; i<${#in}; i++)); do + char=${in:i:1} + out+="$char" + out+="\x00" + done + echo -n "$out" +} + + +function fill_to_size() { + local size="$2" + local out="$1" + local fill_size=$(( $size - (${#out}*2/5) )) + + for i in $(seq $fill_size) + do + out+="\x00" + done + + echo -n "$out" +} + + +function write_efivar() { + local readonly varname="781e084c-a330-417c-b678-38e696380cb9-KernelCommandLine" + local readonly total_size=514 + local readonly attr_size=4 + local readonly data_size=$(( $total_size - $attr_size)) + local in="$1" + + #printf "\nin=$in\n" + local out="$(to_unicode "$in")" + out="$(fill_to_size "$out" $data_size)" + + local f=$(mktemp) + printf "$out" > $f + efivar -n $varname -f $f -w + rm ${f} +} + +function read_efivar() { + local readonly varname="/sys/firmware/efi/efivars/KernelCommandLine-781e084c-a330-417c-b678-38e696380cb9" + local var=$(cat $varname | tail -c +5 | tr -d '[\000]') + + echo -n "$var" +} + + +function read_efi_machine_id() { + local var=$(read_efivar) + local id + + for i in $var; do + case $i in + systemd.machine_id=*) + id="${i#*=}" + ;; + *) + ;; + esac + done + echo -n "$id" +} + + +function write_efi_machine_id() { + local id="$1" + local var=$(read_efivar) + local out_var + local sep="" + local id_mod=false + + for i in $var; do + out_var+="$sep" + case $i in + systemd.machine_id=*) + out_var+="systemd.machine_id=$id" + id_mod=true + ;; + *) + out_var+="$i" + ;; + esac + sep=" " + done + + if [ "$id_mod" = false ] ; then + out_var+="${sep}systemd.machine_id=$id" + fi + + write_efivar "$out_var" +} + + +usage="Usage: efi_systemd_machine_id.sh [-r] [-w val]" + +while getopts "rw:" opt; do + case ${opt} in + r ) + printf "$(read_efi_machine_id)\n" + ;; + w ) + write_efi_machine_id $OPTARG + ;; + \? ) + echo "$usage";exit 2 + ;; + esac +done + + +if [ $OPTIND -eq 1 ]; then + echo "$usage"; exit 1 +fi + + + + + + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-client/files/tegra234/tegra234-mender-client-set-systemd-machine-id.sh b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-client/files/tegra234/tegra234-mender-client-set-systemd-machine-id.sh new file mode 100644 index 00000000..841ab4fc --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-client/files/tegra234/tegra234-mender-client-set-systemd-machine-id.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -eu + +BOOTENV_PRINT="efi_systemd_machine_id.sh -r" +BOOTENV_SET="efi_systemd_machine_id.sh -w" + +CURRENT_BOOTLOADER_ID=$($BOOTENV_PRINT 2>/dev/null | cut -d= -f2) +CURRENT_SYSTEMD_ID=$(cat /etc/machine-id) + +rc=0 +if [ -z "${CURRENT_BOOTLOADER_ID}" ] && [ ! -z "${CURRENT_SYSTEMD_ID}" ]; then + $BOOTENV_SET "${CURRENT_SYSTEMD_ID}" + rc=$? +elif [ "${CURRENT_BOOTLOADER_ID}" != "${CURRENT_SYSTEMD_ID}" ]; then + echo "Error; bootloader and systemd disagree on machine-id." >&2 + rc=1 +fi + +exit $rc diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-client/mender-client_%.bbappend b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-client/mender-client_%.bbappend new file mode 100644 index 00000000..61601c2c --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-client/mender-client_%.bbappend @@ -0,0 +1,21 @@ +EXTRADEPS = "" +EXTRADEPS:tegra = "tegra-bup-payload tegra-boot-tools tegra-boot-tools-nvbootctrl tegra-boot-tools-lateboot${@' libubootenv-fake' if d.getVar('PREFERRED_PROVIDER_virtual/bootloader').startswith('cboot') else ''}" +EXTRADEPS:tegra210 = "tegra-bup-payload tegra-boot-tools" +EXTRADEPS:jetson-agx-orin-devkit = "tegra-bup-payload libubootenv-fake mender-update-verifier" +RDEPENDS:${PN} += "${EXTRADEPS}" + +FILESEXTRAPATHS:prepend:tegra234 := "${THISDIR}/files/tegra234:" + +SRC_URI:remove:mender-persist-systemd-machine-id = " \ + file://mender-client-set-systemd-machine-id.sh \ +" +SRC_URI:append:tegra234:mender-persist-systemd-machine-id = " \ + file://tegra234-mender-client-set-systemd-machine-id.sh \ + file://efi_systemd_machine_id.sh \ +" + +do_install:prepend:tegra234:class-target:mender-persist-systemd-machine-id() { + install -d -m 755 ${D}${bindir} + install -m 755 ${WORKDIR}/efi_systemd_machine_id.sh ${D}${bindir}/ + cp ${WORKDIR}/tegra234-mender-client-set-systemd-machine-id.sh ${WORKDIR}/mender-client-set-systemd-machine-id.sh +} diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-update-verifier/files/mender-update-verifier.service b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-update-verifier/files/mender-update-verifier.service new file mode 100644 index 00000000..43e9f3b7 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-update-verifier/files/mender-update-verifier.service @@ -0,0 +1,11 @@ +[Unit] +Description=Mender update verifier +Requires=nv_update_verifier.service +Before=mender-client.service + +[Service] +Type=oneshot +ExecStart=mender-update-verifier.sh + +[Install] +WantedBy=multi-user.target diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-update-verifier/files/mender-update-verifier.sh b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-update-verifier/files/mender-update-verifier.sh new file mode 100755 index 00000000..cbc63e88 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-update-verifier/files/mender-update-verifier.sh @@ -0,0 +1,33 @@ +#!/bin/sh + + +function read_efivar() { + local AB="AB" + local slot="Slot${AB:$1:1}" + local varname="/sys/firmware/efi/efivars/RootfsStatus${slot}-781e084c-a330-417c-b678-38e696380cb9" + local var=$(cat $varname | tail -c +5 | tr -d '[\000]') + + echo -n "$var" +} + + + +function get_bootable_status() { + local status="$(read_efivar "${1}")" + local size="${#status}" + return $size +} + + +function set_update_status() { + get_bootable_status 0 + local slot0=$? + get_bootable_status 1 + local slot1=$? + if [[ "$slot0" -ne 0 || "$slot1" -ne 0 ]]; then + fw_setenv -s <<< upgrade_available=0 + fi +} + +set_update_status + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-update-verifier/mender-update-verifier.bb b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-update-verifier/mender-update-verifier.bb new file mode 100644 index 00000000..02a3b877 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/mender-update-verifier/mender-update-verifier.bb @@ -0,0 +1,21 @@ +DESCRIPTION = "Mender update verifier" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +SRC_URI = "\ + file://mender-update-verifier.service \ + file://mender-update-verifier.sh \ +" + +S = "${WORKDIR}" + +do_install() { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${S}/mender-update-verifier.service ${D}${systemd_system_unitdir} + install -d -m 755 ${D}${bindir} + install -m 755 ${WORKDIR}/mender-update-verifier.sh ${D}${bindir}/ +} + +inherit systemd + +SYSTEMD_SERVICE:${PN} = "mender-update-verifier.service" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/redundant-boot-commit-check-script-uboot b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/redundant-boot-commit-check-script-uboot new file mode 100644 index 00000000..f2764b57 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/redundant-boot-commit-check-script-uboot @@ -0,0 +1,38 @@ +#!/bin/sh + +LABELCHARS="AB" + +echo "Verifying Tegra bootloader update" +curslot=`nvbootctrl get-current-slot 2>/dev/null || tegra-boot-control --current-slot 2>/dev/null` +cfglbl="\"RootfsPart${LABELCHARS:$curslot:1}\"" +devnam=`grep -h "$cfglbl:" /etc/mender/mender.conf /var/lib/mender/mender.conf | cut -d: -f2 | cut -d, -f1 | tr -d '" '` +if [ -z "$devnam" ]; then + echo "ERR: could not determine expected mender device name for boot slot $curslot" >&2 + exit 1 +fi + +# If the rootfs partitions are eMMC/SDcard device names, verify that +# the mender boot partition in U-Boot and the Tegra bootloader boot +# slot match. If not, the Tegra bootloader update failed, and we +# need to reset the boot slot to get the Tegra bootloader and Mender +# resynchronized. +if [ "${devnam##/dev/mmcblk}" != "${devnam}" ]; then + bootpart=`fw_printenv -n mender_boot_part` + if [ -z "$bootpart" ]; then + echo "ERR: could not retrieve mender_boot_part from U-Boot env" >&2 + exit 1 + fi + devnampart=`expr "${devnam##/dev/mmcblk*p}" \+ 0 2>/dev/null` + if [ -z "$devnampart" ]; then + echo "ERR: could not extract partition number from rootfs device name" >&2 + exit 1 + fi + if [ $bootpart -ne $devnampart ]; then + altslot=$(expr 1 - $curslot) + echo "Detected Tegra bootloader upgrade failure, resetting boot slot to $altslot" >&2 + echo "*** Reboot required ***" >&2 + tegra-boot-control --set-active $altslot + exit 1 + fi +fi +exit 0 diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script new file mode 100644 index 00000000..5779ac86 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script @@ -0,0 +1,69 @@ +#!/bin/sh + +mnt= +LABELCHARS="AB" +COPY_MACHINE_ID=@COPY_MACHINE_ID@ + +cleanup() { + [ -n "$mnt" ] || return + for d in sys proc dev run; do + if mountpoint -q "${mnt}/${d}"; then + umount "${mnt}/${d}" >/dev/null 2>&1 || true + fi + done + if mountpoint -q "$mnt"; then + umount "$mnt" >/dev/null 2>&1 || true + fi + rmdir "$mnt" >/dev/null 2>&1 || true +} + +echo "Installing NVIDIA bootloader update payload" + +if which tegra-boot-control >/dev/null 2>&1; then + current_slot=`tegra-boot-control --current-slot` +else + current_slot=`nvbootctrl get-current-slot` +fi +echo "Current boot slot: $current_slot" +otherslot=`expr 1 - $current_slot` +cfglbl="\"RootfsPart${LABELCHARS:$otherslot:1}\"" +devnam=`grep -h "$cfglbl:" /etc/mender/mender.conf /var/lib/mender/mender.conf | cut -d: -f2 | cut -d, -f1 | tr -d '" '` +if [ -z "$devnam" ]; then + echo "ERR: could not determine device name for boot slot $otherslot" >&2 + exit 1 +fi +mnt=`mktemp -d -t nvbup.XXXXXX` +if [ -z "$mnt" -o ! -d "$mnt" ]; then + echo "ERR: could not create directory for mounting install partition" >&2 + exit 1 +fi +mount -o ro "$devnam" "$mnt" +if [ ! -d "${mnt}/opt/ota_package" ]; then + echo "ERR: Missing /opt/ota_package directory in installed rootfs" >&2 + cleanup + exit 1 +fi +# tegra-bootloader-update needs access to these filesystems, +# so bind-mount them into the new rootfs for the chroot +mount --bind /sys "${mnt}/sys" +mount --bind /proc "${mnt}/proc" +mount --bind /dev "${mnt}/dev" +# for tegra-bootinfo +mount --bind /run "${mnt}/run" + +if ! chroot "${mnt}" /usr/bin/tegra-bootloader-update /opt/ota_package/bl_update_payload; then + echo "ERR: bootloader update failed" >&2 + cleanup + exit 1 +fi +echo "Successful bootloader update" +if [ -n "$COPY_MACHINE_ID" ]; then + curid=$(systemd-machine-id-setup --print) + storedid=$(chroot "${mnt}" /usr/bin/tegra-bootinfo -n -v machine_id 2>/dev/null) + if [ "$curid" != "$storedid" ]; then + chroot "${mnt}" /usr/bin/tegra-bootinfo --initialize 2>/dev/null + chroot "${mnt}" /usr/bin/tegra-bootinfo -V machine_id "$curid" + fi +fi +cleanup +exit 0 diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script-uboot b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script-uboot new file mode 100644 index 00000000..27932951 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/redundant-boot-install-script-uboot @@ -0,0 +1,101 @@ +#!/bin/sh + +mnt= +UBOOTVARS="bootcount mender_boot_part mender_boot_part_hex upgrade_available" +ubvarfile= +install_fwenv= + +cleanup() { + [ -n "$mnt" ] || return + for d in sys proc dev run; do + if mountpoint -q "${mnt}/${d}"; then + umount "${mnt}/${d}" >/dev/null 2>&1 || true + fi + done + if mountpoint -q "$mnt"; then + umount "$mnt" >/dev/null 2>&1 || true + fi + rmdir "$mnt" >/dev/null 2>&1 || true +} + +save_vars() { + local v + ubvarfile=$(mktemp -p "$1" ubvars.XXXXXX) + for v in $UBOOTVARS; do + fw_printenv $v >>$ubvarfile + done +} + +echo "Installing NVIDIA bootloader update payload" + +new_boot_part=`fw_printenv -n mender_boot_part` +mnt=`mktemp -d -t nvbup.XXXXXX` +if [ -z "$mnt" -o ! -d "$mnt" ]; then + echo "ERR: could not create directory for mounting install partition" >&2 + exit 1 +fi +mount -o ro /dev/mmcblk0p${new_boot_part} "$mnt" +if [ ! -d "${mnt}/opt/ota_package" ]; then + echo "ERR: Missing /opt/ota_package directory in installed rootfs" >&2 + cleanup + exit 1 +fi +# tegra-bootloader-update needs access to these filesystems, +# so bind-mount them into the new rootfs for the chroot +mount --bind /sys "${mnt}/sys" +mount --bind /proc "${mnt}/proc" +mount --bind /dev "${mnt}/dev" +mount -t tmpfs tmpfs "${mnt}/run" + +# Check for u-boot environment location change; save vars for restoration +# into the new environment after the update +if [ -e "$mnt/usr/share/u-boot/fw_env.config" ]; then + if ! diff -qbi /etc/fw_env.config $mnt/usr/share/u-boot/fw_env.config > /dev/null 2>&1; then + save_vars "${mnt}/run" + install_fwenv=yes + fi +fi + +if ! chroot "${mnt}" /usr/bin/tegra-bootloader-update --dry-run /opt/ota_package/bl_update_payload >/dev/null 2>&1; then + # If the tool reports that the version partitions are corrupted, this is an update on a tegra210 + # device with the old partition layout where the U-Boot environment overwrote the version partition(s), + # in which case we recover via complete initialization. + if chroot "${mnt}" /usr/bin/tegra-bootloader-update --dry-run /opt/ota_package/bl_update_payload 2>&1 | grep -q 'version partitions are corrupted'; then + # For the recoverable case, we will have also detected a change the U-Boot environment change + if [ -n "$install_fwenv" ]; then + echo "Detected bootloader partition upgrade, reinitializing" >&2 + if ! chroot "${mnt}" /usr/bin/tegra-bootloader-update --initialize /opt/ota_package/bl_update_payload; then + echo "ERR: bootloader re-initialization failed" >&2 + cleanup + exit 1 + fi + else + echo "WARN: VER partitions are corrupted" >&2 + echo "WARN: Please refer to https://github.com/OE4T/tegra-demo-distro/pull/113 for additional context" >&2 + echo "WARN: Attempting update anyway" >&2 + fi + else + echo "ERR: cannot perform bootloader update" >&2 + cleanup + exit 1 + fi +elif ! chroot "${mnt}" /usr/bin/tegra-bootloader-update /opt/ota_package/bl_update_payload; then + echo "ERR: bootloader update failed" >&2 + cleanup + exit 1 +fi +# If the U-Boot environment config has changed, propagate the important variables +# to the new environment +if [ -n "$install_fwenv" ]; then + if ! chroot "${mnt}" /usr/bin/fw_setenv -c /usr/share/u-boot/fw_env.config -s /run/$(basename "$ubvarfile"); then + echo "ERR: could not restore U-Boot environment after bootloader update" >&2 + cleanup + exit 1 + fi + if [ -L /etc/fw_env.config ]; then + cp $mnt/usr/share/u-boot/fw_env.config $(readlink /etc/fw_env.config) + fi +fi +echo "Successful bootloader update" +cleanup +exit 0 diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/switch-rootfs b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/switch-rootfs new file mode 100644 index 00000000..1d4c5774 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/files/switch-rootfs @@ -0,0 +1,40 @@ +#!/bin/sh +echo "$(mender show-artifact): $(basename "$0") was called!" >&2 + +get_bootpart() { + local current_slot=`nvbootctrl get-current-slot 2>/dev/null` + if [ -z "$current_slot" ]; then + echo "ERR: could not identify current boot slot" >&2 + echo "UNKNOWN" + return + fi + echo "$current_slot" +} + +reset_unbootable_status() { + local AB="AB" + local slot="Slot${AB:$1:1}" + local varname="781e084c-a330-417c-b678-38e696380cb9-RootfsStatus${slot}" + + local f=$(mktemp) + printf "\x00\x00\x00\x00" > $f + efivar -n "${varname}" -f $f -w + rm ${f} +} + + +current_slot=`get_bootpart` +echo "current_slot=$current_slot" >&2 + +next_slot= +if [ $current_slot = "0" ]; then + next_slot="1" +else + next_slot="0" +fi + +echo "next_slot=$next_slot" >&2 +nvbootctrl set-active-boot-slot $next_slot +reset_unbootable_status $next_slot + +exit 0 diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/tegra-state-scripts_1.0.bb b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/tegra-state-scripts_1.0.bb new file mode 100644 index 00000000..85bd8fc3 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/recipes-mender/tegra-state-scripts/tegra-state-scripts_1.0.bb @@ -0,0 +1,56 @@ +SRC_URI = " \ + file://redundant-boot-commit-check-script-uboot \ + file://redundant-boot-install-script \ + file://redundant-boot-install-script-uboot \ + file://switch-rootfs \ +" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +S = "${WORKDIR}" + +inherit mender-state-scripts + +PERSIST_MACHINE_ID="" +PERSIST_MACHINE_ID:mender-persist-systemd-machine-id = "yes" + +# We have a different install script for U-Boot vs. cboot, since +# the mechanism for determining boot partitions is different between +# the two, and with cboot there is no U-Boot environment for copying +# the machine-id. +copy_install_script() { + sed -e's,@COPY_MACHINE_ID@,${PERSIST_MACHINE_ID},' ${S}/redundant-boot-install-script > ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_80_bl-update +} + +copy_install_script:mender-uboot() { + cp ${S}/redundant-boot-install-script-uboot ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_80_bl-update + cp ${S}/redundant-boot-commit-check-script-uboot ${MENDER_STATE_SCRIPTS_DIR}/ArtifactCommit_Enter_80_bl-check-update +} + +do_compile() { + : +} + +do_compile:tegra194() { + copy_install_script +} + +do_compile:tegra186() { + copy_install_script +} + +do_compile:tegra210() { + cp ${S}/redundant-boot-install-script-uboot ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_80_bl-update +} + +do_compile:tegra234() { + cp ${S}/switch-rootfs ${MENDER_STATE_SCRIPTS_DIR}/ArtifactInstall_Leave_50_switch-rootfs +} + +# Make sure scripts aren't left around from old builds +do_deploy:prepend() { + rm -rf ${DEPLOYDIR}/mender-state-scripts +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/manifest-tegra.xml b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/manifest-tegra.xml new file mode 100644 index 00000000..ab004ff8 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/manifest-tegra.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/README.md b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/README.md new file mode 100644 index 00000000..91af2942 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/README.md @@ -0,0 +1,54 @@ +# Tegra Mender Torture Tests + +To help find problems with tegra redundant boot +mender integration +the scrips in this directory can perform testing on mender based targets. + +The scripts currently only support cboot based targets, see [this pr](https://github.com/BoulderAI/meta-mender-community/pull/1) +for a discussion of additional complexities to support uboot based targets. + +# Setup Python + +Run +``` +pip3 install -r requirements.txt +``` + +## Setup http server + +If using tegra-demo-distro layout you can set this up with the +`meta-mender-tegra/scripts/test/setup_image_server.sh` script. +If using a different layout, use this as an example with the detail below. + +The tests require a http server hosting a .mender update file. + +Start a simple http server on a httpserver machine like this, running in +the directory where the mender image is located (or any directory above it). +``` +python -m SimpleHTTPServer 8080 +``` +You'll want to run this in a different terminal window or screen session. + + +## Running the command + +If using tegra-demo-distro layout you can invoke with the +`meta-mender-tegra/scripts/test/do_mender_test.sh` script. +If using a different layout, use this script as an example with the detail below. + +Execute a command like this to start the mender test, replacing arguments as needed +``` +export devicename= +export httpserver= +export menderfile= +export logfile=/tmp/mender-tegra-torture.log +./mender_tegra_test.py --device ${devicename} --install http://${httpserver}:8080/${menderfile} 2>&1 | tee -a ${logfile} +``` + +If testing on a production target where an SSH key is required, use the `--key ` arguement +to specify the key to use for ssh connectivity. + +The script repeats the steps below 10 times +* Standalone mender updates 10 times in a row, ensuring boot slot changes with each reboot. +* Reboots 20 times in a row, ensuring the boot slot does not change. + +The end result should be 100 mender updates interleaved with 200 reboots. diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/device_test.py b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/device_test.py new file mode 100644 index 00000000..5221cce3 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/device_test.py @@ -0,0 +1,134 @@ +import fabric2 +from fabric2 import Connection +import argparse +import time +import traceback +import sys +import re +import subprocess +import platform + +class DeviceTest: + DEFAULT_USER = 'root' + DEFAULT_BOOT_METHOD = 'cboot' + args = None + connection = None + argparser = None + + def get_parser(self,parent_test="",parent_description=""): + if self.argparser is None: + ''' + Argument parsing for new deployment and provisioning process + ''' + argparser = argparse.ArgumentParser(prog=parent_test, + usage='%(prog)s [options]', + description=parent_description, + formatter_class=argparse.RawTextHelpFormatter) + argparser.add_argument('-d', + '--device', + help='The IP address or name of the device') + + argparser.add_argument('-u', + '--user', + help=f"The SSH username (default is {self.DEFAULT_USER})") + + argparser.add_argument('-p', + '--password', + help='The SSH password (default is no password)') + + argparser.add_argument('-k', + '--key', + help='The SSH key file (used instead of password if specified)') + + self.argparser = argparser + return self.argparser + + + def get_args(self): + if self.args is None: + self.args = self.get_parser().parse_args() + + if self.args.user is None: + print(f"No user specified, using {self.DEFAULT_USER}") + self.args.user=self.DEFAULT_USER + return self.args + + def get_connection(self): + args = self.get_args() + if args.device is None: + print("Missing device argument") + self.get_parser().print_help() + raise RuntimeError("Must specify device as argument") + if self.connection is None: + if args.key is not None: + self.connection = Connection( + host=f'{args.user}@{args.device}', + connect_kwargs={ + "key_filename": args.key, + "password": args.password + }) + elif args.password is not None: + self.connection = Connection( + host=f'{args.user}@{args.device}', + connect_kwargs={ + "password": args.password + }) + else: + self.connection = Connection( + host=f'{args.user}@{args.device}', + connect_kwargs={ + "password": "", + "look_for_keys": False + }) + return self.connection + + def wait_for_device(self): + conn = self.get_connection() + print(f'Trying to connect to {self.get_args().device}....') + success = False + ip = None + quiet = False + while not success: + try: + conn.open() + success = True + except Exception as e: + if not quiet: + print(e) + print('Exception connecting, retrying..') + quiet = True + time.sleep(3) + time.sleep(15) + + def ping(self): + args=self.get_args() + """ + Returns True if host (str) responds to a ping request. + Remember that a host may not respond to a ping (ICMP) request even if the host name is valid. + See https://stackoverflow.com/a/32684938/1446624 + """ + + # Option for the number of packets as a function of + param = '-n' if platform.system().lower() == 'windows' else '-c' + + # Building the command. Ex: "ping -c 1 google.com" + command = ['ping', param, '1', args.device] + + return subprocess.call(command, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) == 0 + + def wait_for_device_removal(self): + while self.ping(): + pass + + def reboot(self): + conn = self.get_connection() + print("Rebooting device") + result = conn.run("reboot", warn=True) + self.wait_for_device_removal() + self.wait_for_device() + self.get_machine_id() # This tests the connection + + def get_machine_id(self): + conn = self.get_connection() + result = conn.run("systemd-machine-id-setup --print", hide=True, timeout=3) + return result.stdout diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/do_mender_test.sh b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/do_mender_test.sh new file mode 100755 index 00000000..aff8dc63 --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/do_mender_test.sh @@ -0,0 +1,78 @@ +#! /bin/bash +set -e +scriptdir="$(dirname "$(readlink -f "$0")")" +PROGNAME=$(basename $0) + +usage() +{ + cat >&2 < --image -- +Options: + -h, --h Print this usage message + -m, --machine Set the MACHINE used for this script. + -i, --image Set the IMAGE used for this script + -d, --device Set the target device hostname or IP address used + for the test. Defaults to MACHINE.local if not + specified + -u, --url Set the mender install url argument to use with the test + Defaults to http://:8080/MACHINE/IMAGE-MACHINE.mender if + not specified (based on defaults in setup_image_server.sh) +Examples: +- To kick off a single mender upgrade test for jetson-xavier-nx-devkit + booted on the local network with name jetson-xavier-nx-devkit.local + with http server running locally based on setup_image_server.sh + $ $0 --machine jetson-xavier-nx-devkit --image demo-image-base +EOF +} + +# get command line options +SHORTOPTS="hm:i:d:u:" +LONGOPTS="help,machine:,image:,device:,url:" + +ARGS=$(getopt --options $SHORTOPTS --longoptions $LONGOPTS --name $PROGNAME -- "$@" ) +if [ $? != 0 ]; then + usage + exit 1 +fi + +eval set -- "$ARGS" +while true; +do + case $1 in + -h | --help) usage; exit 0 ;; + -m | --machine) MACHINE="$2"; shift 2;; + -i | --image) IMAGE="$2"; shift 2;; + -d | --device) DEVICE="$2"; shift 2;; +-u | --url ) MENDER_INSTALL="$2"; shift 2;; + -- ) shift; break ;; + * ) break ;; + esac +done + +if [ -z "${MENDER_INSTALL}" ]; then + if [ -z "$MACHINE" -o -z "$IMAGE" ]; then + echo "Must specify both machine and image if not specifying mender_install" + usage + exit 1 + fi + MENDER_INSTALL="http://$(hostname -I | awk '{print $1}'):8080/${MACHINE}/${IMAGE}-${MACHINE}.mender" + echo "Using mender install argument ${MENDER_INSTALL}." + echo "This assumes you've setup a http mender server locally using" + echo "setup_image_server.sh or similar commands" +fi + +if [ -z "${DEVICE}" ]; then + if [ -z "$MACHINE" ]; then + echo "Must specify machine if not specifying device" + usage + exit 1 + fi + DEVICE="${MACHINE}.local" + echo "Using device ${DEVICE} based on ${MACHINE}. This assumes you are" + echo "using the default hostname for ${MACHINE} builds and you are able to" + echo "resolve .local network names with your network setup. If you have" + echo "issues with this try an IP address for device instead" +fi + +${scriptdir}/mender_tegra_test.py --device ${DEVICE} --mender_install ${MENDER_INSTALL} $@ diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/mender_tegra_test.py b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/mender_tegra_test.py new file mode 100755 index 00000000..15329f9c --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/mender_tegra_test.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python3 +import fabric2 +from fabric2 import Connection +import argparse +import time +import traceback +import sys +import re +import subprocess +import platform +import textwrap +from device_test import DeviceTest + +class MenderTegraTest(DeviceTest): + + def get_parser(self): + if self.argparser is None: + argparser=super().get_parser("mender_tegra_tests.py","Tests mender functionality on tegra devices") + + argparser.add_argument('-m', + '--mender_install', + help=textwrap.dedent('''\ + The mender install argument to use with standalone install, + for instance, http://mylocalserver:8080/machine/imagename.mender + where you've used setup_image_server.sh to setup your image + server in your build/tmp/deploy/images directory or set this + up manually yourself.''')) + + argparser.add_argument('-t', + '--test', + help=textwrap.dedent('''\ + The test to run. Options are: + single [default] - run a single mender update + mender_torture - run the mender torture test + reboot_torture - run the reboot torture test''')) + + return self.argparser + + def mender_install(self): + args = self.get_args() + conn = self.get_connection() + if args.mender_install is None: + self.get_parser().print_help() + print("Missing argument install") + raise RuntimeError("Missing argument mender_install") + result = conn.run(f"mender -install {args.mender_install}") + # Mender doesn't return error states, so we can't check return codes here + match = re.search(r' level=error ', result.stderr, re.MULTILINE) + if match is not None: + raise RuntimeError("Mender install failed with error messages in the logs") + + def add_sentinel_file(self): + conn = self.get_connection() + conn.run("mkdir -p /var/lib/mender") + conn.run("touch /var/lib/mender/dont-mark-next-boot-successful") + + def mender_commit(self): + self.get_connection().run("mender -commit") + + def reboot(self): + conn = self.get_connection() + print("Rebooting device") + result = conn.run("reboot", warn=True) + self.wait_for_device_removal() + self.wait_for_device() + + def nvbootctrl_current_slot(self): + conn = self.get_connection() + result = conn.run("nvbootctrl get-current-slot", hide=True) + return result.stdout.strip() + + def check_partition_mismatch(self): + conn = self.get_connection() + boot_slot = self.nvbootctrl_current_slot() + rootfs_part = None + if boot_slot == '0': + rootfs_part = 'RootfsPartA' + elif boot_slot == '1': + rootfs_part = 'RootfsPartB' + + if rootfs_part != None: + blockdev_result = conn.run(f'grep -h {rootfs_part} /etc/mender/mender.conf /var/lib/mender/mender.conf | cut -d: -f2 | cut -d, -f1 | tr -d \'" \'') + result = conn.run(f'df -h | grep {blockdev_result.stdout.strip()}') + if result.return_code != 0: + raise RuntimeError(f"Boot and Rootfs Partition Mismatch detected, rootfs should be mounted to {blockdev_result} for boot slot {boot_slot}") + else: + raise RuntimeError("Cannot Identify Rootfs Partition Slot") + + + def do_mender_update(self): + # Connecting to the device + print("Starting mender update") + self.wait_for_device() + prev_machine_id = self.get_machine_id() + # mender install + self.mender_install() + # Check Partition Mismatch + self.check_partition_mismatch() + # Get current boot slot after mender update and before reboot + prev_boot_slot = self.nvbootctrl_current_slot() + # reboot the device + self.reboot() + # Getting current_boot_slot after reboot + current_boot_slot = self.nvbootctrl_current_slot() + current_machine_id = self.get_machine_id() + # Check if update was successful after reboot + if prev_boot_slot == current_boot_slot: + raise RuntimeError("Mender Install successful but slot change not reflected after reboot") + if current_machine_id != prev_machine_id: + raise RuntimeError(f"machine ID changed from {prev_machine_id} to {current_machine_id} during mender update") + print(f"Mender update applied successfully with expected boot slot change from" \ + f" {prev_boot_slot} to {current_boot_slot} and no change in machine ID {current_machine_id}") + return current_boot_slot + + ''' + This test isn't currently supported. We'd need a way to prevent the startup script from marking successful + boot in order to prove rollback is happening + ''' + def check_rollback(self): + print("****************************************") + print("Starting test case") + expected_rollback_reboots=7 + boot_slot = self.mender_install() + for i in range(expected_rollback_reboots): + # Check Partition Mismatch + self.check_partition_mismatch() + # check the current boot_slot + if boot_slot != self.nvbootctrl_current_slot(): + raise RuntimeError("Mender Rollback occurred earlier than expected") + self.reboot() + # Device expected to rollback here + if boot_slot != self.nvbootctrl_current_slot(): + print(f"Success: Rollback after {expected_rollback_reboots} reboots") + else: + raise RuntimeError(f"ERROR: No rollback after {expected_rollback_reboots} reboots") + + def do_mender_torture(self): + """ + Do 10 mender updates in a row followed by 20 reboots, then repeat the + entire loop 10 times + """ + big_loops = 10 + mender_updates_per_loop = 10 + reboots_per_loop = 20 + print(f"Starting mender torture tests with {big_loops} loops of {mender_updates_per_loop} mender updates" \ + f" followed by {reboots_per_loop} reboots") + boot_slot = None + for bigloop in range (big_loops): + for i in range (mender_updates_per_loop): + print(f"Starting mender update {mender_updates_per_loop*bigloop+i+1}") + boot_slot = self.do_mender_update() + for i in range (reboots_per_loop): + print(f"Starting reboot {reboots_per_loop*bigloop+i+1}") + prev_boot_slot = self.nvbootctrl_current_slot() + self.reboot() + boot_slot = self.nvbootctrl_current_slot() + if boot_slot != prev_boot_slot: + raise RuntimeError(f"Boot slot changed from {prev_boot_slot} to {boot_slot} after {i} reboots on iteration {bigloop}") + + def do_reboot_torture(self): + """ + Do 200 reboots, making sure boot slot doesn't change + """ + num_reboots=100 + print(f"Starting reboot torture tests with {num_reboots} reboots") + boot_slot = None + for i in range (num_reboots): + print("Starting reboot {}".format(i)) + prev_boot_slot = self.nvbootctrl_current_slot() + self.reboot() + boot_slot = self.nvbootctrl_current_slot() + if boot_slot != prev_boot_slot: + raise RuntimeError(f"Boot slot changed from {prev_boot_slot} to {boot_slot} after {i} reboots") + + def do_test(self): + print("Starting test") + args = self.get_args() + test = args.test + ret = 0 + if test is None: + print("No test specified, using single test type") + test = "single" + if test == "single": + print("Starting single mender install test") + self.do_mender_update() + elif test == "mender_torture": + self.do_mender_torture() + elif test == "reboot_torture": + self.do_reboot_torture() + else: + ret = -1 + self.get_parser().print_help() + print(f"Unsupported test argument {test}") + return ret + +if __name__ == '__main__': + test = MenderTegraTest() + sys.exit(test.do_test()) diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/requirements.txt b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/requirements.txt new file mode 100644 index 00000000..a9e5175e --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/requirements.txt @@ -0,0 +1 @@ +fabric2>=2.5.0 \ No newline at end of file diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/setup_image_server.sh b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/setup_image_server.sh new file mode 100755 index 00000000..a5e3e10f --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/scripts/test/setup_image_server.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +scriptdir="$(dirname "$(readlink -f "$0")")" +imagesdir=$(realpath ${scriptdir}/../../../../../build/tmp/deploy/images) +echo "Serving images from ${imagesdir}" +pushd ${imagesdir} +python -m SimpleHTTPServer 8080 diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/templates/bblayers.conf.sample b/meta-mender-tegra/meta-mender-tegra-jetpack5/templates/bblayers.conf.sample new file mode 100644 index 00000000..d213006c --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/templates/bblayers.conf.sample @@ -0,0 +1,16 @@ +# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +POKY_BBLAYERS_CONF_VERSION = "1" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ${TOPDIR}/../sources/poky/meta \ + ${TOPDIR}/../sources/poky/meta-poky \ + ${TOPDIR}/../sources/poky/meta-yocto-bsp \ + ${TOPDIR}/../sources/meta-tegra \ + ${TOPDIR}/../sources/meta-mender/meta-mender-core \ + ${TOPDIR}/../sources/meta-mender/meta-mender-demo \ + ${TOPDIR}/../sources/meta-mender-community/meta-mender-tegra \ +" diff --git a/meta-mender-tegra/meta-mender-tegra-jetpack5/templates/local.conf.append b/meta-mender-tegra/meta-mender-tegra-jetpack5/templates/local.conf.append new file mode 100644 index 00000000..7d41a6cd --- /dev/null +++ b/meta-mender-tegra/meta-mender-tegra-jetpack5/templates/local.conf.append @@ -0,0 +1,14 @@ +# See README for other supported options +MACHINE ?= "jetson-tx2" + +# Tegra specific mender setup variables +INHERIT += "tegra-mender-setup" + +# Grow the data partition by default +MENDER_FEATURES_ENABLE:append = " mender-growfs-data" + +# Not required for mender support, but gives you access via SSH by default +# Note that the ssh key will change on each upgrade. To fix this you need to +# symlink /etc/dropbear/dropbear_rsa_host_key to the data partition or use an +# overlay setup that maps the key to the data partition +EXTRA_IMAGE_FEATURES += " ssh-server-dropbear"