11DEPENDS :append = " tegra-helper-scripts-native"
22PATH =. "${STAGING_BINDIR_NATIVE} /tegra-flash:"
33
4- # Override NVMe partition layout for WendyOS to:
5- # 1. Remove "reserved" partition (between UDA and APP)
6- # 2. Rename "permanet_user_storage" (p17) to "mender_data"
7- # 3. Update mender_data size to 512MB (will auto-expand)
8- # 4. Change allocation_attribute from 0x808 to 0x8 (allow expansion)
9- # 5. Add partition type GUID for Linux filesystem
10- #
11- # This runs AFTER meta-mender-tegra's do_install:append which creates the _rootfs_ab.xml variant
4+ # Override partition layouts for WendyOS Jetson machines.
5+ # Runs AFTER meta-mender-tegra's do_install:append which injects DATAFILE into UDA.
126
137do_install :append () {
14- # Only apply to NVMe variants (both Nano and AGX use same T234 partition layout)
158 case "${MACHINE} " in
16- jetson -orin -nano -devkit -nvme -wendyos |jetson -agx -orin -devkit -nvme -wendyos )
17- ;;
18- *)
19- return
20- ;;
21- esac
229
23- # Modify the _rootfs_ab.xml file created by meta-mender-tegra
24- local layout_file = "flash_l4t_t234_nvme_rootfs_ab.xml"
25- local layout_path = "${D}${datadir} /l4t-storage-layout/${layout_file} "
10+ jetson -orin -nano -devkit -nvme -wendyos |jetson -agx -orin -devkit -nvme -wendyos )
11+ # ------------------------------------------------------------------
12+ # NVMe: modify flash_l4t_t234_nvme_rootfs_ab.xml
13+ #
14+ # 1. Remove "reserved" partition (blocks expansion, not needed)
15+ # 2. Add "mender_data" (p17) after APP_b — persistent Mender store
16+ # 2.5. Add "wendy_config" (p16, 64 MB FAT32) before mender_data
17+ # 3. Remove DATAFILE from UDA (UDA kept for NVIDIA compat, not used)
18+ # ------------------------------------------------------------------
19+ local layout_file = "flash_l4t_t234_nvme_rootfs_ab.xml"
20+ local layout_path = "${D}${datadir} /l4t-storage-layout/${layout_file} "
2621
27- if [ ! -f "${layout_path} " ]; then
28- bbwarn "Layout file ${layout_file} not found at ${layout_path} , skipping WendyOS modifications"
29- return
30- fi
22+ if [ ! -f "${layout_path} " ]; then
23+ bbwarn "Layout file ${layout_file} not found at ${layout_path} , skipping WendyOS NVMe modifications"
24+ return
25+ fi
3126
32- bbnote "wendyos: Modifying ${layout_file} to use mender_data partition ..."
27+ bbnote "wendyos: Modifying ${layout_file} for NVMe ( mender_data + wendy_config) ..."
3328
34- # 1. Remove the "reserved" partition (between UDA and APP)
35- # This partition blocks expansion and is not needed
36- nvflashxmlparse --remove --partitions -to -remove reserved \
37- --output ${WORKDIR} /${layout_file} . tmp1 \
38- ${layout_path}
29+ # 1. Remove the "reserved" partition
30+ nvflashxmlparse --remove --partitions -to -remove reserved \
31+ --output ${WORKDIR} /${layout_file} . tmp1 \
32+ ${layout_path}
3933
40- # 2. Add new "mender_data" partition AFTER APP_b and BEFORE secondary_gpt
41- # Insert the partition definition using sed
42- sed -i '/<partition name="secondary_gpt"/i\
34+ # 2. Add "mender_data" AFTER APP_b and BEFORE secondary_gpt
35+ sed -i '/<partition name="secondary_gpt"/i\
4336 <partition name="mender_data" id="17" type="data">\
4437 <allocation_policy> sequential </allocation_policy>\
4538 <filesystem_type> basic </filesystem_type>\
@@ -52,11 +45,11 @@ do_install:append() {
5245 <filename> DATAFILE </filename>\
5346 <description> **WendyOS/Mender.** Data partition for persistent storage (home directories, user data, Mender state). Positioned after APP_b to allow expansion to fill remaining disk space. Auto-expands via mender-grow-data.service on first boot. UDA (p15) is kept for NVIDIA compatibility but not mounted by wendyos. </description>\
5447 </partition>' \
55- ${WORKDIR} /${layout_file} . tmp1
48+ ${WORKDIR} /${layout_file} . tmp1
5649
57- # 2.5. Add wendy_config partition (id=16) BEFORE mender_data (id=17)
58- # 64 MB FAT32, Microsoft Basic Data GUID → macOS auto-mounts as /Volumes/WENDYCONFIG
59- sed -i '/<partition name="mender_data" id="17"/i\
50+ # 2.5. Add wendy_config (id=16) BEFORE mender_data (id=17)
51+ # Microsoft Basic Data GUID → macOS auto-mounts as /Volumes/WENDYCONFIG
52+ sed -i '/<partition name="mender_data" id="17"/i\
6053 <partition name="wendy_config" id="16" type="data">\
6154 <allocation_policy> sequential </allocation_policy>\
6255 <filesystem_type> basic </filesystem_type>\
@@ -69,19 +62,72 @@ do_install:append() {
6962 <filename> wendy-config.fat32.img </filename>\
7063 <description> WendyOS first-boot config partition (FAT32, 64 MB). </description>\
7164 </partition>' \
72- ${WORKDIR} /${layout_file} . tmp1
65+ ${WORKDIR} /${layout_file} . tmp1
7366
74- # 3. Remove DATAFILE filename from UDA partition
75- # Prevent flash error when dataimg is larger than UDA partition
76- # UDA is not used by WendyOS (mender_data is used instead)
77- # UDA is kept for NVIDIA compatibility but should not have pre-written content
78- # The filename field causes flash tools to fail during signing
79- sed -i '/<partition name="UDA"/,/<\/partition>/ {
80- /<filename>/d
81- }' ${WORKDIR} /${layout_file} . tmp1
67+ # 3. Remove DATAFILE from UDA (prevents flash error; UDA not mounted by WendyOS)
68+ sed -i '/<partition name="UDA"/,/<\/partition>/ {
69+ /<filename>/d
70+ }' ${WORKDIR} /${layout_file} . tmp1
8271
83- # Install the modified layout
84- install -m 0644 ${WORKDIR} /${layout_file} . tmp1 ${layout_path}
72+ install -m 0644 ${WORKDIR} /${layout_file} . tmp1 ${layout_path}
73+ bbnote "WendyOS: Successfully modified ${layout_file} for NVMe"
74+ ;;
8575
86- bbnote "WendyOS: Successfully added mender_data partition to ${layout_file} "
76+ jetson -orin -nano -devkit -wendyos )
77+ # ------------------------------------------------------------------
78+ # SD card: modify the SD template layout XML.
79+ #
80+ # With USE_REDUNDANT_FLASH_LAYOUT=1 and
81+ # PARTITION_LAYOUT_TEMPLATE_DEFAULT_SUPPORTS_REDUNDANT unset,
82+ # PARTITION_LAYOUT_TEMPLATE resolves to
83+ # flash_t234_qspi_sd_rootfs_ab.xml (not flash_t234_qspi_sd.xml).
84+ # Use ${PARTITION_LAYOUT_TEMPLATE} to follow the same variable that
85+ # the base recipe and meta-mender-tegra use.
86+ #
87+ # Add wendy_config (id=17, 64 MB FAT32) AFTER APP_b (id=2) in the
88+ # sdcard device block, immediately before secondary_gpt.
89+ # APP_b (id=2) is the last data partition on the SD card.
90+ # UDA (p15, mender data) is unaffected — no machine conf changes needed.
91+ # id=17 is the next free GPT slot after reserved (slot 16).
92+ # ------------------------------------------------------------------
93+ local layout_file = "${PARTITION_LAYOUT_TEMPLATE} "
94+ local layout_path = "${D}${datadir} /l4t-storage-layout/${layout_file} "
95+
96+ if [ ! -f "${layout_path} " ]; then
97+ bbwarn "Layout file ${layout_file} not found at ${layout_path} , skipping WendyOS SD modifications"
98+ return
99+ fi
100+
101+ bbnote "wendyos: Modifying ${layout_file} for SD (wendy_config)..."
102+
103+ cp "${layout_path} " "${WORKDIR} /${layout_file} .tmp1"
104+
105+ # Add wendy_config AFTER APP_b (id=2), before secondary_gpt.
106+ # The range APP_b-opening → first </partition> captures the APP_b
107+ # block exactly; a\ appends the new partition immediately after it.
108+ sed -i '/<partition name="APP_b" id="2"/,/<\/partition>/{
109+ /<\/partition>/a\
110+ <partition name="wendy_config" id="17" type="data">\
111+ <allocation_policy> sequential </allocation_policy>\
112+ <filesystem_type> basic </filesystem_type>\
113+ <size> 67108864 </size>\
114+ <file_system_attribute> 0 </file_system_attribute>\
115+ <allocation_attribute> 0x8 </allocation_attribute>\
116+ <partition_type_guid> EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 </partition_type_guid>\
117+ <percent_reserved> 0 </percent_reserved>\
118+ <align_boundary> 16384 </align_boundary>\
119+ <filename> wendy-config.fat32.img </filename>\
120+ <description> WendyOS first-boot config partition (FAT32, 64 MB). </description>\
121+ </partition>
122+ }' \
123+ "${WORKDIR} /${layout_file} .tmp1"
124+
125+ install -m 0644 "${WORKDIR} /${layout_file} .tmp1" "${layout_path} "
126+ bbnote "WendyOS: Successfully added wendy_config to ${layout_file} "
127+ ;;
128+
129+ *)
130+ return
131+ ;;
132+ esac
87133}
0 commit comments