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

Anshul Dalal <[email protected]>
Newsgroups org.yoctoproject.lists.meta-arago
Message-ID <[email protected]>
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 <[email protected]>
---
 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 --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"
-- 
2.52.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.