Hi,
I am trying to intergrate Mender with a Jetson Orin NX using an NVME.
- The Yocto branch: scarthgap
- Jetpack: 6
- Carrier Boad: Seeed Studio A603
I have tested the changes made here: Jetpack 6 fixes
My local.conf:
# AB-upgrades
USE_REDUNDANT_FLASH_LAYOUT_DEFAULT = "1"
# mender-artifact
MENDER_ARTIFACT_NAME = "gha_autobuild"
# mender-full
INHERIT += "mender-full"
# 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"
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}"
# equivalent: EMMC_SIZE = "32 * 1024 * 1024 * 1024"
EMMC_SIZE = "34359738368"
MENDER_STORAGE_DEVICE = " /dev/nvme0n1"
The flash works but growfs-data fails and mender update also:
$ mender-update install update.mender
Installing artifact...
100%record_id=1 severity=info time="2024-Dec-06 15:54:48.930581" name="Global" msg="Update Module output (stdout): ================ STATISTICS ================"
record_id=2 severity=info time="2024-Dec-06 15:54:48.930847" name="Global" msg="Update Module output (stdout): Blocks written: 6356"
record_id=3 severity=info time="2024-Dec-06 15:54:48.930900" name="Global" msg="Update Module output (stdout): Blocks omitted: 8662"
record_id=4 severity=info time="2024-Dec-06 15:54:48.930916" name="Global" msg="Update Module output (stdout): Bytes written: 6664749056"
record_id=5 severity=info time="2024-Dec-06 15:54:48.930932" name="Global" msg="Update Module output (stdout): ============================================"
record_id=6 severity=info time="2024-Dec-06 15:54:50.469785" name="Global" msg="Update Module output (stderr): sync: ignoring all arguments"
record_id=7 severity=info time="2024-Dec-06 15:54:50.624517" name="Global" msg="Update Module output (stderr): sync: ignoring all arguments"
record_id=8 severity=info time="2024-Dec-06 15:54:50.785870" name="Global" msg="Running State Script: /var/lib/mender/scripts/ArtifactInstall_Leave_50_switch-rootfs"
record_id=9 severity=info time="2024-Dec-06 15:54:50.848821" name="Global" msg="Collected output (stderr) while running script: gha_autobuild: ArtifactInstall_Leave_50_switch-rootfs was called!"
record_id=10 severity=info time="2024-Dec-06 15:54:50.853409" name="Global" msg="Collected output (stderr) while running script: current_slot=0"
Installed, but not committed.
Use 'commit' to update, or 'rollback' to roll back the update.
At least one payload requested a reboot of the device it updated.
And mender-update commit
$ mender-update commit
record_id=1 severity=info time="2024-Dec-06 15:55:36.137172" name="Global" msg="Running State Script: /var/lib/mender/scripts/ArtifactCommit_Leave_50_verify-slot"
record_id=2 severity=info time="2024-Dec-06 15:55:36.141554" name="Global" msg="Collected output (stderr) while running script: Error: memory map failed"
record_id=3 severity=info time="2024-Dec-06 15:55:36.141656" name="Global" msg="Collected output (stderr) while running script: Error clear SR value node_name[0]"
record_id=4 severity=info time="2024-Dec-06 15:55:36.141720" name="Global" msg="Collected output (stdout) while running script: Info: variable BootChainFwStatus is not found."
record_id=5 severity=error time="2024-Dec-06 15:55:36.143029" name="Global" msg="Error during Commit Leave script: NonZero exit code error: Received error code: 70"
record_id=6 severity=error time="2024-Dec-06 15:55:36.284245" name="Global" msg="NonZero exit code error: Received error code: 70"
Installed, but one or more post-commit steps failed.
Could not fulfill request: NonZero exit code error: Received error code: 70
Regarding growfs-data
failure:
$ mender-resize-data-part
/usr/bin/mender-resize-data-part: line 7: /dev/nvme0n1p15: Permission denied
fdisk:
$ fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 447.13 GiB, 480103981056 bytes, 937703088 sectors
Disk model: SFPC480GM1AR2MT-I-7C-22H-STD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 05F3730C-62C9-4B6F-BB43-7DE9AAB52B94
Device Start End Sectors Size Type
/dev/nvme0n1p1 3057664 35432447 32374784 15.4G Microsoft basic data
/dev/nvme0n1p2 35432448 67807231 32374784 15.4G Microsoft basic data
/dev/nvme0n1p3 2048 264191 262144 128M Microsoft basic data
/dev/nvme0n1p4 264192 265727 1536 768K Microsoft basic data
/dev/nvme0n1p5 266240 331007 64768 31.6M Microsoft basic data
/dev/nvme0n1p6 331776 593919 262144 128M Microsoft basic data
/dev/nvme0n1p7 593920 595455 1536 768K Microsoft basic data
/dev/nvme0n1p8 595968 660735 64768 31.6M Microsoft basic data
/dev/nvme0n1p9 661504 825343 163840 80M Microsoft basic data
/dev/nvme0n1p10 825344 826367 1024 512K Microsoft basic data
/dev/nvme0n1p11 827392 958463 131072 64M EFI System
/dev/nvme0n1p12 958464 1122303 163840 80M Microsoft basic data
/dev/nvme0n1p13 1122304 1123327 1024 512K Microsoft basic data
/dev/nvme0n1p14 1124352 1255423 131072 64M Microsoft basic data
/dev/nvme0n1p15 1255424 2074623 819200 400M Microsoft basic data
/dev/nvme0n1p16 2074624 3056639 982016 479.5M Microsoft basic data
Parted:
parted
GNU Parted 3.6
Using /dev/nvme0n1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: SFPC480GM1AR2MT-I-7C-22H-STD (nvme)
Disk /dev/nvme0n1: 480GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
3 1049kB 135MB 134MB A_kernel msftdata
4 135MB 136MB 786kB A_kernel-dtb msftdata
5 136MB 169MB 33.2MB A_reserved_on_user msftdata
6 170MB 304MB 134MB B_kernel msftdata
7 304MB 305MB 786kB B_kernel-dtb msftdata
8 305MB 338MB 33.2MB B_reserved_on_user msftdata
9 339MB 423MB 83.9MB recovery msftdata
10 423MB 423MB 524kB recovery-dtb msftdata
11 424MB 491MB 67.1MB fat32 esp boot, esp
12 491MB 575MB 83.9MB recovery_alt msftdata
13 575MB 575MB 524kB recovery-dtb_alt msftdata
14 576MB 643MB 67.1MB esp_alt msftdata
15 643MB 1062MB 419MB ext4 UDA msftdata
16 1062MB 1565MB 503MB reserved msftdata
1 1566MB 18.1GB 16.6GB ext4 APP msftdata
2 18.1GB 34.7GB 16.6GB ext4 APP_b msftdata
How can I solve this ?
Thank you.
The mender-update
issue was solved by patching the linux-yocto 6.10 kernel linux-yocto: add patch to fix compatibility with nvbootctrl by Austriker · Pull Request #1785 · OE4T/meta-tegra · GitHub
Regarding the mender-growfs-data
I am still working on it but the issue seems to come from the location of the UDA partition.
Mender Tegra integration only appends a new property but doesn’t move UDA.
This is the stock partition layout:
<?xml version="1.0"?>
<!--
# SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.
-->
<!-- Nvidia Tegra Partition Layout Version 1.0.0 -->
<partition_layout version="01.00.0000">
<device type="external" instance="0" sector_size="512" num_sectors="EXT_NUM_SECTORS" >
<partition name="master_boot_record" type="protective_master_boot_record">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 512 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
</partition>
<partition name="primary_gpt" type="primary_gpt">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 19968 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
</partition>
<partition name="A_kernel" id="3" type="kernel">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 134217728 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> LNXFILE </filename>
</partition>
<partition name="A_kernel-dtb" type="kernel_dtb">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 786432 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> DTB_FILE </filename>
</partition>
<partition name="A_reserved_on_user" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 33161216 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
</partition>
<partition name="B_kernel" type="kernel">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 134217728 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> LNXFILE_b </filename>
</partition>
<partition name="B_kernel-dtb" type="kernel_dtb">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 786432 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> DTB_FILE </filename>
</partition>
<partition name="B_reserved_on_user" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 33161216 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
</partition>
<partition name="RECNAME" type="kernel">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> RECSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> RECFILE </filename>
</partition>
<partition name="RECDTB-NAME" type="kernel_dtb">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 524288 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> RECDTB-FILE </filename>
</partition>
<partition name="esp" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 67108864 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> ESP_FILE </filename>
<partition_type_guid> C12A7328-F81F-11D2-BA4B-00A0C93EC93B </partition_type_guid>
<description> **Required.** EFI system partition with L4T Launcher. </description>
</partition>
<partition name="RECNAME_alt" type="kernel">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> RECSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
</partition>
<partition name="RECDTB-NAME_alt" type="kernel_dtb">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 524288 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
</partition>
<partition name="esp_alt" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 67108864 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** EFI system partition for fail-safe ESP update. </description>
</partition>
<partition name="UDA" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 419430400 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<align_boundary> 16384 </align_boundary>
<description> **Required.** This partition may be mounted and used to store user
data. </description>
</partition>
<partition name="reserved" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 502792192 </size> <!-- Recalculate the size if RECSIZE changed -->
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **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. </description>
</partition>
<partition name="APP" id="1" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> APPSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<align_boundary> 16384 </align_boundary>
<percent_reserved> 0 </percent_reserved>
<unique_guid> APPUUID </unique_guid>
<filename> APPFILE </filename>
<description> **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/nvme0n1p1`. </description>
</partition>
<partition name="APP_b" id="2" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> APPSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<align_boundary> 16384 </align_boundary>
<percent_reserved> 0 </percent_reserved>
<unique_guid> APPUUID_b </unique_guid>
<filename> APPFILE_b </filename>
<description> **Required.** Contains the rootfs. This partition must be assigned
the "2" 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/nvme0n1p2`. </description>
</partition>
<partition name="secondary_gpt" type="secondary_gpt">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 0xFFFFFFFFFFFFFFFF </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
</partition>
</device>
</partition_layout>
I solved the issue for the data partition layout.
The description for UDA is cryptic but the reality is that it’s a NVIDIA reserved partition and should not be used. Jetson Orin NX Custom Partition Layout fails with UDA at the end - #6 by JerryChang - Jetson Orin NX - NVIDIA Developer Forums
Unfortunately meta-mender-tegra
relies on the UDA partition to work in the default configuration. meta-mender-community/meta-mender-tegra/recipes-bsp/tegra-binaries/tegra-storage-layout-base_%.bbappend at cb5dd30c043efcd4fab501d0cf9a8670031ab8df · mendersoftware/meta-mender-community · GitHub
In order to solve the issue and having Mender working on Jetson Orin NX you need to create a new partition
<partition name="permanet_user_storage" id= "17" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 419430400 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x808 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<align_boundary> 16384 </align_boundary>
<filename> DATAFILE </filename>
<description> **Required.** This partition is used to store permanent user
and device data between A/B updates</description>
</partition>
<partition name="secondary_gpt" type="secondary_gpt">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 0xFFFFFFFFFFFFFFFF </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
</partition>
and set in the local.conf
MENDER_DATA_PART_NUMBER = "17"
You can also disable mender-growfs-data
since the line following line
<allocation_attribute> 0x808 </allocation_attribute>
Will automatically grow the partition to the end at flash.
Cheers