Skip to contentSkip to conversation

image_types.bbclass: only create links if the target exists

PATCH New Andreas Oberritter 1 participant 1 message Mar 18, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image_types.bbclass: only create links if the target exists

When creating images containing many partitions, rootfs.$type may not be available.

---
 meta/classes/image_types.bbclass |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/image_types.bbclass +3 -1
index 6bb113d..f7b8314 100644
@@ -95,7 +95,9 @@ runimagecmd () {
         # And create the symlinks
         if [ -n "${IMAGE_LINK_NAME}" ]; then
             for type in ${subimages}; do
-                ln -s ${IMAGE_NAME}.rootfs.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
+                if [ -e ${IMAGE_NAME}.rootfs.$type ]; then
+                    ln -s ${IMAGE_NAME}.rootfs.$type ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.$type
+                fi
             done
         fi
 }
Signature · 1 line
1.7.10.4