[OE-core] [PATCH 1/2] initscripts: populate-volatiles.sh: add mount-bind feature

Jens Rehsack rehsack at gmail.com
Fri Feb 12 09:17:32 UTC 2016


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 <sno at netbsd.org>
---
 .../initscripts/initscripts-1.0/populate-volatile.sh           | 10 ++++++++++
 1 file changed, 10 insertions(+)

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 904037e..ce4622a 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/'`
--
2.6.3


--
Jens Rehsack - rehsack at gmail.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160212/207971cf/attachment-0002.sig>


More information about the Openembedded-core mailing list