summaryrefslogtreecommitdiffstats
path: root/meta/classes/image-prelink.bbclass
diff options
context:
space:
mode:
authorChristopher Clark <christopher.w.clark@gmail.com>2020-03-10 14:55:13 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-11 11:44:12 +0000
commit6bf3e3db355643c4b2e20346230c09e45e519035 (patch)
tree6a9c557635082ae6b23ee8f5db4f581b4dec1d5e /meta/classes/image-prelink.bbclass
parent206580e72336229f8044eb941ecb09d3f0d60d3e (diff)
downloadopenembedded-core-contrib-6bf3e3db355643c4b2e20346230c09e45e519035.tar.gz
image-prelink: remove assumption of sysconfdir presence
If sysconfdir is not present in the image filesystem then the temporary creation of a prelink.conf will fail. Fix this by creating sysconfdir temporarily if needed beforehand and then remove any directories that were created afterwards. fixes: OpenXT OXT-1751 Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image-prelink.bbclass')
-rw-r--r--meta/classes/image-prelink.bbclass17
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/classes/image-prelink.bbclass b/meta/classes/image-prelink.bbclass
index 04dd57c940..ebf6e6d7ee 100644
--- a/meta/classes/image-prelink.bbclass
+++ b/meta/classes/image-prelink.bbclass
@@ -17,6 +17,16 @@ prelink_image () {
pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'`
echo "Size before prelinking $pre_prelink_size."
+ # The filesystem may not contain sysconfdir so establish what is present
+ # to enable cleanup after temporary creation of sysconfdir if needed
+ presentdir="${IMAGE_ROOTFS}${sysconfdir}"
+ while [ "${IMAGE_ROOTFS}" != "${presentdir}" ] ; do
+ [ ! -d "${presentdir}" ] || break
+ presentdir=`dirname "${presentdir}"`
+ done
+
+ mkdir -p "${IMAGE_ROOTFS}${sysconfdir}"
+
# We need a prelink conf on the filesystem, add one if it's missing
if [ ! -e ${IMAGE_ROOTFS}${sysconfdir}/prelink.conf ]; then
cp ${STAGING_ETCDIR_NATIVE}/prelink.conf \
@@ -59,6 +69,13 @@ prelink_image () {
rm $ldsoconf
fi
+ # Remove any directories temporarily created for sysconfdir
+ cleanupdir="${IMAGE_ROOTFS}${sysconfdir}"
+ while [ "${presentdir}" != "${cleanupdir}" ] ; do
+ rmdir "${cleanupdir}"
+ cleanupdir=`dirname ${cleanupdir}`
+ done
+
pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'`
echo "Size after prelinking $pre_prelink_size."
}