Patchwork image_types.bbclass: only create links if the target exists

login
register
mail settings
Submitter Andreas Oberritter
Date March 18, 2013, 12:42 p.m.
Message ID <1363610528-10705-1-git-send-email-obi@opendreambox.org>
Download mbox | patch
Permalink /patch/46383/
State Accepted
Commit a3409b909d20bd91a4e44d9c09dab2471ce4dac5
Headers show

Comments

Andreas Oberritter - March 18, 2013, 12:42 p.m.
When creating images containing many partitions, rootfs.$type
may not be available.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/classes/image_types.bbclass |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 6bb113d..f7b8314 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -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
 }