1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

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.

(From OE-Core rev: ab42fcaf1427a29c31ac2e93965e20849b1b1234)

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jens Rehsack
2016-02-12 10:17:32 +01:00
committed by Richard Purdie
parent be5b72cf27
commit 85ac8eb473
@@ -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/'`