Skip to content

Commit c6af840

Browse files
quaresmajosericardosalveti
authored andcommitted
lmp/build: check availability of the image manifest
- Skip lmp-mfgtool disto variant - Fail if the image manifest not exist - Consider only the symbolic links of the images manifest - From the licenses deploy dir of the image: - Copy the license.manifest, if not possible fail - Copy the image_license.manifest | + 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]>
1 parent 65d305b commit c6af840

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

lmp/build.sh

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,31 @@ rm -f ${DEPLOY_DIR_IMAGE}/*.txt
8181
## Only publish wic.gz
8282
rm -f ${DEPLOY_DIR_IMAGE}/*.wic
8383

84-
status "Post-build processing (license)"
84+
IMAGE_MANIFESTS=""
85+
if [ "${DISTRO}" != "lmp-mfgtool" ]; then
86+
status "Post-build processing (license)"
87+
# find image manifests and only consider symbolic links
88+
IMAGE_MANIFESTS=$(find ${DEPLOY_DIR_IMAGE} -type l -name "*${MACHINE}*.manifest")
89+
if [ "${IMAGE_MANIFESTS}" = "" ]; then
90+
status "Image manifest not found on ${DEPLOY_DIR_IMAGE}, license manifest can't be collected"
91+
exit 1
92+
fi
93+
fi
8594
# Link the license manifest for all the images produced by the build
86-
for img in ${DEPLOY_DIR_IMAGE}/*${MACHINE}.manifest; do
95+
for img in ${IMAGE_MANIFESTS}; do
8796
image_name=`basename ${img} | sed -e "s/.manifest//"`
88-
image_name_id=`readlink ${img} | sed -e "s/\..*manifest//"`
89-
if [ -f ${DEPLOY_DIR}/licenses/${image_name_id}/license.manifest ]; then
90-
cp ${DEPLOY_DIR}/licenses/${image_name_id}/license.manifest ${DEPLOY_DIR_IMAGE}/${image_name_id}.license.manifest
97+
image_path=`find ${DEPLOY_DIR}/licenses -name "${image_name}*" -type d`
98+
image_name_id=`basename ${image_path}`
99+
if [ -f ${image_path}/license.manifest ]; then
100+
cp ${image_path}/license.manifest ${DEPLOY_DIR_IMAGE}/${image_name_id}.license.manifest
91101
ln -sf ${image_name_id}.license.manifest ${DEPLOY_DIR_IMAGE}/${image_name}.license.manifest
102+
else
103+
status "Image ${image_name} license manifest not found on ${DEPLOY_DIR}/licenses, license manifest can't be collected"
104+
exit 1
92105
fi
93106
# Also take care of the image_license, which contains the binaries used by wic outside the rootfs
94-
if [ -f ${DEPLOY_DIR}/licenses/${image_name_id}/image_license.manifest ]; then
95-
cp ${DEPLOY_DIR}/licenses/${image_name_id}/image_license.manifest ${DEPLOY_DIR_IMAGE}/${image_name_id}.image_license.manifest
107+
if [ -f ${image_path}/image_license.manifest ]; then
108+
cp ${image_path}/image_license.manifest ${DEPLOY_DIR_IMAGE}/${image_name_id}.image_license.manifest
96109
ln -sf ${image_name_id}.image_license.manifest ${DEPLOY_DIR_IMAGE}/${image_name}.image_license.manifest
97110
fi
98111
done

0 commit comments

Comments
 (0)