From: Jens Rehsack Date: Fri, 12 Feb 2016 09:17:32 +0000 (+0100) Subject: initscripts: populate-volatiles.sh: add mount-bind feature X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~27017 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab42fcaf1427a29c31ac2e93965e20849b1b1234;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git initscripts: populate-volatiles.sh: add mount-bind feature Add ability to run "mount --bind" to populate-volatiles. Since several programs use realpath to determine several full qualified file names, there is no symlink to be resolved. So when speccing /run/lock - that's the location - not /var/run/lock because of the program is smarter than the operator/distributor. See https://github.com/rehsack/meta-jens/blob/jethro/recipes-core/initscripts/initscripts/volatiles for an example how to use the "b" feature. Signed-off-by: Jens Rehsack Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh index 904037eeaa5..ce4622a5e55 100755 --- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh +++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh @@ -163,6 +163,16 @@ apply_cfgfile() { continue } + [ "${TTYPE}" = "b" ] && { + TSOURCE="$TLTARGET" + [ "${VERBOSE}" != "no" ] && echo "Creating mount-bind -${TNAME}- from -${TSOURCE}-." + mount --bind "${TSOURCE}" "${TNAME}" + EXEC=" + mount --bind \"${TSOURCE}\" \"${TNAME}\"" + test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build + continue + } + [ -L "${TNAME}" ] && { [ "${VERBOSE}" != "no" ] && echo "Found link." NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'`