summaryrefslogtreecommitdiffstats
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:29 +0000
commit59e64ae58c3f2454b4fe2c12dcad0e7f730b181b (patch)
tree9c997efe25207977bb2dd8c75c821b654d986753
parentcb659c2b1d27bfc7966bbdb6429580047781bbc9 (diff)
downloadpoky-59e64ae58c3f2454b4fe2c12dcad0e7f730b181b.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 (From OE-Core rev: 6bf3e3db355643c4b2e20346230c09e45e519035) Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 () {
17 pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'` 17 pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'`
18 echo "Size before prelinking $pre_prelink_size." 18 echo "Size before prelinking $pre_prelink_size."
19 19
20 # The filesystem may not contain sysconfdir so establish what is present
21 # to enable cleanup after temporary creation of sysconfdir if needed
22 presentdir="${IMAGE_ROOTFS}${sysconfdir}"
23 while [ "${IMAGE_ROOTFS}" != "${presentdir}" ] ; do
24 [ ! -d "${presentdir}" ] || break
25 presentdir=`dirname "${presentdir}"`
26 done
27
28 mkdir -p "${IMAGE_ROOTFS}${sysconfdir}"
29
20 # We need a prelink conf on the filesystem, add one if it's missing 30 # We need a prelink conf on the filesystem, add one if it's missing
21 if [ ! -e ${IMAGE_ROOTFS}${sysconfdir}/prelink.conf ]; then 31 if [ ! -e ${IMAGE_ROOTFS}${sysconfdir}/prelink.conf ]; then
22 cp ${STAGING_ETCDIR_NATIVE}/prelink.conf \ 32 cp ${STAGING_ETCDIR_NATIVE}/prelink.conf \
@@ -59,6 +69,13 @@ prelink_image () {
59 rm $ldsoconf 69 rm $ldsoconf
60 fi 70 fi
61 71
72 # Remove any directories temporarily created for sysconfdir
73 cleanupdir="${IMAGE_ROOTFS}${sysconfdir}"
74 while [ "${presentdir}" != "${cleanupdir}" ] ; do
75 rmdir "${cleanupdir}"
76 cleanupdir=`dirname ${cleanupdir}`
77 done
78
62 pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'` 79 pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'`
63 echo "Size after prelinking $pre_prelink_size." 80 echo "Size after prelinking $pre_prelink_size."
64} 81}