Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lmp/build: check availability of the image manifest #313

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ls will fail if no files match the pattern, find works

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
Loading