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 Oct 4, 2024
1 parent 2fa13e8 commit baff753
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions lmp/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,30 @@ 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
for img in ${DEPLOY_DIR_IMAGE}/*${MACHINE}*.manifest; do
# mfgtool-files
if [ "${DISTRO}" = "lmp-mfgtool" ]; then
break
fi
if ! [ -e "${img}" ]; then
status "Image manifest not found, license manifest can't be collected"
eixt 1
fi
# only consider symbolic links
if ! [ -h "${img}" ]; then
continue
fi
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
if [ -f ${DEPLOY_DIR}/licenses*/${image_name}/license.manifest ]; then
cp ${DEPLOY_DIR}/licenses*/${image_name}/license.manifest ${DEPLOY_DIR_IMAGE}/${image_name}.license.manifest
else
status "Image ${image_name} license.manifest not found, license manifest can't be collected"
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
if [ -f ${DEPLOY_DIR}/licenses*/${image_name}/image_license.manifest ]; then
cp ${DEPLOY_DIR}/licenses*/${image_name}/image_license.manifest ${DEPLOY_DIR_IMAGE}/${image_name}.image_license.manifest
else
status "Image ${image_name} image_license.manifest not found, license manifest can't be collected"
fi
done

Expand Down Expand Up @@ -187,9 +200,9 @@ if [ -d "${archive}" ] ; then
## Targets that support iMX redundant boot
cp ${DEPLOY_DIR_IMAGE}/sit-${MACHINE}.bin ${archive}/other/ || true

# mfgtool-files (iMX targets)
# mfgtool-files
if [ "${DISTRO}" = "lmp-mfgtool" ]; then
cp ${DEPLOY_DIR_IMAGE}/mfgtool-files-${MACHINE}.tar.gz ${archive}/ || true
cp ${DEPLOY_DIR_IMAGE}/*mfgtool-files-${MACHINE}.tar.gz ${archive}/ || true
fi
# Handle user provided extra artifacts
if [ ! -z "${EXTRA_ARTIFACTS}" ]; then
Expand Down

0 comments on commit baff753

Please sign in to comment.