Modify APP and APP_b partitions sizes

Hi,

You need to modify three files in toal: flash.sh, board config file, and partition layout file.

For flash.sh, three sections to take care of:

In System mandatory vars:, add a new line to include the ROOTFSSIZE_b variable:

  getsize    rootfssize	ROOTFSSIZE;	# .conf mandatory
+ getsize    rootfssize_b	ROOTFSSIZE_b;

In APP_TAG: RootFS, add this so the script set different sizes for APP and APP_b in the final generated flash.xml:

+	if [[ "${rootfs_ab}" == 1 ]]; then
+		APP_TAG+="-e s/APPSIZE_b/${rootfssize_b}/ ";
+	fi;
	APP_TAG+="-e s/APPSIZE/${rootfssize}/ ";

In function create_fsimg, use ${rootfssize_b} so the size of raw image is modified accordingly:

			# check if APP_b exist in layout file
			get_value_from_PT_table "APP_b" "filename" "${cfgfile}" sysfile
			if [ "${sysfile}" != "" ]; then
				if [ "${target_partname}" = "" ] || \
				   [ "${target_partname}" = "APP_b" ] || [ -n "${with_systemimg}" ]; then
					build_fsimg "${localsysfile}_b" "${fillpat}" \
+						    "${rootfssize_b}" "${rootfs_type}" \
-						    "${rootfssize}" "${rootfs_type}" \
						    "${source_folder}" "${cmdline_b}" "${do_sign}";
				fi;
			fi;

For the board config file, as you are using AGX Orin, modify p3701.conf.common and set the size you want for APP and APP_b, respectively:

# Rootfs A/B:
if [ "${ROOTFS_AB}" == 1 ]; then
	rootfs_ab=1;
-	val=$(echo ${ROOTFSSIZE} | sed 's/GiB//g');
-	val=`expr ${val} / 2`;
-	ROOTFSSIZE="${val}GiB";
+   ROOTFSSIZE="XGiB";
+   ROOTFSSIZE_b="YGiB";
fi;

For the partition layout file, find the correct file you are using (Linux_for_Tegra/bootloader/t186ref/cfg/flash_t234_qspi_sdmmc_rootfs_ab.xml in your case.), and replace the size variable for APP_b 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>
-            <filename> APPFILE </filename>
            <description> **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`. </description>
        </partition>