Skip to content

Commit

Permalink
lmp/build: check availability of the image manifest
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
quaresmajose committed Nov 3, 2023
1 parent 7461fb6 commit 433915d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lmp/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 433915d

Please sign in to comment.