From 6d889d70de447f414ee0a3275920d19d5d98368c Mon Sep 17 00:00:00 2001
From: Piotr Kubik <piotr.kubik@iopsys.eu>
Date: Wed, 23 Oct 2024 16:00:14 +0200
Subject: [PATCH] [wip]airoha: Use FITBLK structure for boot and rootfs

tbd
---
 airoha/base-files/lib/upgrade/platform.sh | 2 +-
 airoha/image/Makefile                     | 5 +++--
 airoha/image/iopsys-image-common.mk       | 4 +---
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/airoha/base-files/lib/upgrade/platform.sh b/airoha/base-files/lib/upgrade/platform.sh
index 87924f6c6..e864c6753 100644
--- a/airoha/base-files/lib/upgrade/platform.sh
+++ b/airoha/base-files/lib/upgrade/platform.sh
@@ -49,7 +49,7 @@ platform_list_image_components() {
 	#		<type>			/configuration/<name>	<required>	<target device>
 	echo 	"pre_upgrade		upgrade_bundle		optional"
 	echo	"image				boot				required	boot\${next_bank_id}"
-	echo	"image				rootfs				required	rootfs\${next_bank_id}"
+	echo	"image				rootfs				optional	rootfs\${next_bank_id}"
 if  bootloader_upgrade_enabled 2>/dev/null "$image" "bootloader" "$boot_dev" ; then
 	echo	"bootloader			bootloader			optional	$boot_dev"
 fi
diff --git a/airoha/image/Makefile b/airoha/image/Makefile
index b2d0e1f5c..d654b57f7 100755
--- a/airoha/image/Makefile
+++ b/airoha/image/Makefile
@@ -27,9 +27,10 @@ define Device/Default-airoha-common
   $(Device/Default-airoha-nand)
   PROFILES = Default
   DEVICE_VENDOR := IOPSYS
-  IMAGE/sysupgrade.itb := iopsys-fit-upgrade-image | iopsys-sign-image | create-last-link -squashfs-sysupgrade.itb last.itb
+  IMAGE/sysupgrade.itb := append-kernel | iowrt-kernel-fit lzma external-static-with-rootfs-with-u-boot-ram | \
+                          iopsys-fit-upgrade-image | iopsys-sign-image | create-last-link -squashfs-sysupgrade.itb last.itb
   IMAGES := sysupgrade.itb .img
-  KERNEL := kernel-bin | lzma | generate-uboot-images | iowrt-kernel-fit lzma external-static-with-u-boot-ram
+  KERNEL := kernel-bin | lzma | generate-uboot-images
   KERNEL_INITRAMFS := kernel-bin | lzma | iowrt-kernel-fit lzma external-static-with-initrd
   KERNEL_NAME := vmlinux
   DEVICE_UBI_LAYOUT := ubinize.cfg.in
diff --git a/airoha/image/iopsys-image-common.mk b/airoha/image/iopsys-image-common.mk
index fc75ca01c..87366a7e8 100644
--- a/airoha/image/iopsys-image-common.mk
+++ b/airoha/image/iopsys-image-common.mk
@@ -8,15 +8,13 @@ define Build/iopsys-fit-upgrade-image
 	@echo GenerateUpgradeFIT
 	$(call iopsys-fit-upgrade-image-prepare, $@, \
 		bootloader $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-$(DEVICE_NAME)-u-boot-nand.bin \
-		boot $(IMAGE_KERNEL) \
-		rootfs $(IMAGE_ROOTFS) \
+		boot $@ \
 		u-boot-env $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-env_dump_filtered.bin)
 	$(call iopsys-fit-upgrade-image-add-configs-same, $@.its, \
 		compat_versions:"1 0", \
 		first, \
 			bootloader \
 			boot \
-			rootfs \
 			u-boot-env \
 			$(if $(CONFIG_TARGET_UPGRADE_BUNDLE),upgrade_bundle) \
 	)
-- 
GitLab