From d57120ec9499dd1b015d3536f9edf403192e7e7e Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Fri, 3 Nov 2023 09:29:01 +0000 Subject: [PATCH] lmp/build: check availability of the image manifest Skip the loop if image manifest not found, instead of failing blindly. Also show some status about not found license manifests. Fix the following: | + for img in ${DEPLOY_DIR_IMAGE}/*${MACHINE}.manifest | ++ basename '/srv/oe/build/deploy/images/intel-corei7-64/*intel-corei7-64.manifest' | ++ sed -e s/.manifest// | + image_name='*intel-corei7-64' | ++ readlink '/srv/oe/build/deploy/images/intel-corei7-64/*intel-corei7-64.manifest' | ++ sed -e 's/\..*manifest//' | + image_name_id= | Script completed with error(s) Signed-off-by: Jose Quaresma --- lmp/build.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lmp/build.sh b/lmp/build.sh index afa2c14c..485d1453 100755 --- a/lmp/build.sh +++ b/lmp/build.sh @@ -83,17 +83,25 @@ rm -f ${DEPLOY_DIR_IMAGE}/*.txt rm -f ${DEPLOY_DIR_IMAGE}/*.wic # Link the license manifest for all the images produced by the build -for img in ${DEPLOY_DIR_IMAGE}/*${MACHINE}.manifest; do +imgs="$(ls ${DEPLOY_DIR_IMAGE}/*${MACHINE}.manifest)" +if [ "$imgs" = "" ]; then + status "Image manifest not found, license manifest will be skipped" +fi +for img in $imgs; do image_name=`basename ${img} | sed -e "s/.manifest//"` image_name_id=`readlink ${img} | sed -e "s/\..*manifest//"` if [ -f ${DEPLOY_DIR}/licenses/${image_name_id}/license.manifest ]; then cp ${DEPLOY_DIR}/licenses/${image_name_id}/license.manifest ${DEPLOY_DIR_IMAGE}/${image_name_id}.license.manifest ln -sf ${image_name_id}.license.manifest ${DEPLOY_DIR_IMAGE}/${image_name}.license.manifest + else + status "Image ${image_name_id} license.manifest not found, skipping" fi # Also take care of the image_license, which contains the binaries used by wic outside the rootfs if [ -f ${DEPLOY_DIR}/licenses/${image_name_id}/image_license.manifest ]; then cp ${DEPLOY_DIR}/licenses/${image_name_id}/image_license.manifest ${DEPLOY_DIR_IMAGE}/${image_name_id}.image_license.manifest ln -sf ${image_name_id}.image_license.manifest ${DEPLOY_DIR_IMAGE}/${image_name}.image_license.manifest + else + status "Image ${image_name_id} image_license.manifest not found, skipping" fi done