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 the disto image manifest not exist
- Fail if the manifest file pattern not exist
- Consider only the symbolic links of the images manifest
- Look for the license with the image name in the licenses deploy
- Fail if the file not found
- Copy the wic images if they exist

| + 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 8e82f7f commit 25a2d72
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 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
if [ "${DISTRO}" = "lmp-mfgtool" ]; then
status "Image manifest not exist in this distro, skipping"
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
license=`find ${DEPLOY_DIR}/licenses -name "${image_name}" -type l`
if [ -f ${license}/license.manifest ]; then
cp ${license}/license.manifest ${DEPLOY_DIR_IMAGE}/${image_name}.license.manifest
else
status "Image ${image_name} license.manifest not found on ${DEPLOY_DIR}/licenses, license manifest can't be collected"
exit 1
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 ${license}/image_license.manifest ]; then
cp ${license}/image_license.manifest ${DEPLOY_DIR_IMAGE}/${image_name}.image_license.manifest
fi
done

Expand Down

0 comments on commit 25a2d72

Please sign in to comment.