diff mbox series

[meta-arago,scarthgap,RFC,2/4] swupdate: add creation of update image

Message ID 20251202111603.1616989-3-anshuld@ti.com
State New
Headers show
Series Add support for SWUpdate | expand

Commit Message

Anshul Dalal Dec. 2, 2025, 11:15 a.m. UTC
SWUpdate makes use of a CPIO archive with a sw-description header that
contains the metadata for the update image.

This patch adds a new update-image recipe which enables creation of such
image based on what the user sets IMAGE_BASENAME to.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
---
 meta-arago-distro/conf/distro/arago.conf      |  2 ++
 .../images/files/sw-description               | 32 +++++++++++++++++++
 .../recipes-swupdate/images/update-image.bb   | 23 +++++++++++++
 3 files changed, 57 insertions(+)
 create mode 100644 meta-arago-distro/recipes-swupdate/images/files/sw-description
 create mode 100644 meta-arago-distro/recipes-swupdate/images/update-image.bb
diff mbox series

Patch

diff --git a/meta-arago-distro/conf/distro/arago.conf b/meta-arago-distro/conf/distro/arago.conf
index d8630718..42124577 100644
--- a/meta-arago-distro/conf/distro/arago.conf
+++ b/meta-arago-distro/conf/distro/arago.conf
@@ -31,6 +31,8 @@  SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_VERSION}"
 SDKPATHINSTALL = "/opt/${SDK_NAME}"
 
 IMAGE_FSTYPES += "tar.xz.md5sum"
+IMAGE_FSTYPES:append:ti-swupdate = " ext4.gz"
+IMAGE_INSTALL:append:ti-swupdate = " swupdate swupdate-www"
 
 # Extra boot files for WIC images
 do_image_wic[depends] += "tisdk-uenv:do_deploy"
diff --git a/meta-arago-distro/recipes-swupdate/images/files/sw-description b/meta-arago-distro/recipes-swupdate/images/files/sw-description
new file mode 100644
index 00000000..8dc4e2b2
--- /dev/null
+++ b/meta-arago-distro/recipes-swupdate/images/files/sw-description
@@ -0,0 +1,32 @@ 
+software =
+{
+	version = "0.1.0";
+
+	@@MACHINE@@ = {
+		hardware-compatibility: [ "1.0"];
+		stable : {
+
+			copy1 : {
+				images: (
+					{
+						filename = "@@IMAGE_BASENAME@@-@@MACHINE@@.rootfs.ext4.gz";
+						device = "/dev/mmcblk0p1";
+						type = "raw";
+						compressed = "zlib";
+					},
+				);
+			};
+
+			copy2 : {
+				images: (
+					{
+						filename = "@@IMAGE_BASENAME@@-@@MACHINE@@.rootfs.ext4.gz";
+						device = "/dev/mmcblk0p2";
+						type = "raw";
+						compressed = "zlib";
+					},
+				);
+			};
+		};
+	}
+}
diff --git a/meta-arago-distro/recipes-swupdate/images/update-image.bb b/meta-arago-distro/recipes-swupdate/images/update-image.bb
new file mode 100644
index 00000000..33b0b74c
--- /dev/null
+++ b/meta-arago-distro/recipes-swupdate/images/update-image.bb
@@ -0,0 +1,23 @@ 
+inherit swupdate
+
+IMAGE_BASENAME ?= "tisdk-default-image"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "\
+    file://sw-description \
+"
+
+# images to build before building swupdate image
+IMAGE_DEPENDS = "${IMAGE_BASENAME}"
+
+SWUPDATE_IMAGES = "${IMAGE_BASENAME}"
+
+SWUPDATE_IMAGES_FSTYPES[tisdk-base-image] = ".rootfs.ext4.gz"
+SWUPDATE_IMAGES_FSTYPES[tisdk-tiny-image] = ".rootfs.ext4.gz"
+SWUPDATE_IMAGES_FSTYPES[tisdk-default-image] = ".rootfs.ext4.gz"
+SWUPDATE_IMAGES_FSTYPES[tisdk-bootstrap-image] = ".rootfs.ext4.gz"
+SWUPDATE_IMAGES_FSTYPES[tisdk-jailhouse-image] = ".rootfs.ext4.gz"
+SWUPDATE_IMAGES_FSTYPES[tisdk-thinlinux-image] = ".rootfs.ext4.gz"
+SWUPDATE_IMAGES_FSTYPES[tisdk-bootstrap-base-image] = ".rootfs.ext4.gz"