diff mbox series

[meta-swupdate,v2,2/3] Enable building .swu images via swu image fstype

Message ID 20210216095258.514-3-agust@denx.de
State Changes Requested
Headers show
Series Extend swupdate class to support swu image fstype | expand

Commit Message

Anatolij Gustschin Feb. 16, 2021, 9:52 a.m. UTC
Add image_types_swu class to support swu image type. To use this
in an image recipe following changes should be added in it:

 - inherit image_types_swu class
 - add SRC_URI with sw-description (and more required files)
 - add IMAGE_FSTYPES, i.e. "ext4.gz swu" or "ext4.gz.enc swu"
 - SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ext4.gz"
 - IMAGE_DEPENDS = "core-image-full-cmdline"
 - SWUPDATE_IMAGES = "core-image-full-cmdline"

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 classes/image_types_swu.bbclass | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 classes/image_types_swu.bbclass
diff mbox series

Patch

diff --git a/classes/image_types_swu.bbclass b/classes/image_types_swu.bbclass
new file mode 100644
index 0000000..6b5c6b5
--- /dev/null
+++ b/classes/image_types_swu.bbclass
@@ -0,0 +1,21 @@ 
+inherit swupdate
+inherit swupdate-enc
+inherit image_types
+
+IMAGE_CMD_swu () {
+    # We cannot use existing python swupdate class code here,
+    # so this is a dummy command to make image_types class work.
+    # The .swu image generation is in separate do_swuimage task.
+}
+
+clean_swuimages () {
+    cd ${DEPLOY_DIR_IMAGE}
+    rm -rf ${IMAGE_LINK_NAME}*.swu
+}
+
+do_clean_swuimage[doc] = "Removes .swu output files from image deploy dir"
+do_clean_swuimage[nostamp] = "1"
+python do_clean_swuimage () {
+    bb.build.exec_func('clean_swuimages', d)
+}
+addtask clean_swuimage after do_rootfs before do_image