Skip to contentSkip to conversation

image_types_sparse: create symlinks for generated sparse images

PATCH In review AshishKumar Mishra 2 participants 2 messages Sep 2 – Sep 8

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image_types_sparse: create symlinks for generated sparse images

Ensure that symbolic links (${IMAGE_LINK_NAME}) are created for both sparse images, matching standard Yocto image deployment behavior

---
 meta-oe/classes/image_types_sparse.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-oe/classes/image_types_sparse.bbclass +3 -1
index 5c1d92bd18..2ee4aa1159 100644
@@ -16,11 +16,13 @@ CONVERSION_CMD:sparse = " \
     case '${type}' in \
         ext*) \
             bbnote 'Running e2fsprogs-derived ext2simg_android..' ; \
-            ext2simg_android '${IMAGE_NAME}.${type}' '${IMAGE_NAME}.${type}.simg' || bberror 'ext2simg_android failed' \
+            ext2simg_android '${IMAGE_NAME}.${type}' '${IMAGE_NAME}.${type}.simg' || bberror 'ext2simg_android failed' ;\
+            ln -sf '${IMAGE_NAME}.${type}.simg' '${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${type}.simg'; \
             ;; \
         *) \
             bbnote 'Generating sparse image for non-ext filesystem...'; \
             img2simg -s '${IMAGE_NAME}.${type}' '${IMAGE_NAME}.${type}.sparse' ${SPARSE_BLOCK_SIZE}; \
+            ln -sf '${IMAGE_NAME}.${type}.sparse' '${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${type}.sparse'; \
             ;; \
     esac; \
     if [ "${DELETE_RAWIMAGE_AFTER_SPARSE_CMD}" = "1" ]; then \
Signature · 1 line
2.43.0
#1 lore raw

Hello,

Quoted 15 lines · Ashish Mishra

Ensure that symbolic links (${IMAGE_LINK_NAME}) are created for both sparse images, matching standard Yocto image deployment behavior

---
meta-oe/classes/image_types_sparse.bbclass | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
meta-oe/classes/image_types_sparse.bbclass +0 -0
index 5c1d92bd18..2ee4aa1159 100644

meta-oe/classes/image_types_sparse.bbclass CONVERSION_CMD:sparse = " \ · line 23

Quoted 9 lines
meta-oe/classes/image_types_sparse.bbclass +2 -1
@@ -16,11 +16,13 @@ CONVERSION_CMD:sparse = " \
 case '${type}' in \
 ext*) \
 bbnote 'Running e2fsprogs-derived ext2simg_android..' ; \
- ext2simg_android '${IMAGE_NAME}.${type}' '${IMAGE_NAME}.${type}.simg' ||
 bberror 'ext2simg_android failed' \
+ ext2simg_android '${IMAGE_NAME}.${type}' '${IMAGE_NAME}.${type}.simg' ||
 bberror 'ext2simg_android failed' ;\
+ ln -sf '${IMAGE_NAME}.${type}.simg'
 '${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${type}.simg'; \

Wouldn't it be simpler to use same .sparse extension name for this image too, that way the IMAGE_LINK_NAME symlink is created by oe-core image.bbclass. It is what I've done in this change: https://lists.openembedded.org/g/openembedded-devel/message/129709 (sorry did not saw this one before submitting mine).

Quoted 8 lines
meta-oe/classes/image_types_sparse.bbclass +0 -0
 ;; \
 *) \
 bbnote 'Generating sparse image for non-ext filesystem...'; \

img2simg -s '${IMAGE_NAME}.${type}' '${IMAGE_NAME}.${type}.sparse' ${SPARSE_BLOCK_SIZE}; \
+ ln -sf '${IMAGE_NAME}.${type}.sparse' '${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${type}.sparse'; \

I think this is already covered by the oe-core image.bbclass: https://github.com/openembedded/openembedded-core/blob/master/meta/classes-recipe/image.bbclass#L493
So this line is not needed.

Quoted 6 lines

;; \
esac; \
if [ "${DELETE_RAWIMAGE_AFTER_SPARSE_CMD}" = "1" ]; then \
--
2.43.0

Regards