Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] initscripts: populate-volatile: suppress read-only-rootfs warnings
@ 2016-12-20  9:02 André Draszik
  0 siblings, 0 replies; only message in thread
From: André Draszik @ 2016-12-20  9:02 UTC (permalink / raw)
  To: openembedded-core

From: André Draszik <adraszik@tycoint.com>

rm: can't remove '/etc/resolv.conf': Read-only file system
ln: /etc/resolv.conf: File exists

/etc/default/volatiles contains an entry:
l root root 0644 /etc/resolv.conf /var/run/resolv.conf

which causes populate-volatile.sh to execute the following in link_file():
  if [ -L \"$2\" ]; then
    [ \"\$(readlink -f \"$2\")\" != \"\$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
  elif [ -d \"$2\" ]; then
    ...

At the time the image is created, /etc/resolv.conf is already a
symlink to /var/run/resolv.conf, but at boot time when
populate-volatiles.sh is run, /var/run/resolv.conf doesn't
exist, causing it to try to rm -f and ln -sf which of course
fails due to the read-only filesystem.

[YOCTO #10814]

Signed-off-by: André Draszik <adraszik@tycoint.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 ce4622a5e5..74e1e6e17c 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -70,7 +70,7 @@ mk_dir() {
 link_file() {
 	EXEC="
 	if [ -L \"$2\" ]; then
-		[ \"\$(readlink -f \"$2\")\" != \"\$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
+		[ \"\$(readlink -f \"$2\")\" != \"$1\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
 	elif [ -d \"$2\" ]; then
 		if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then
 			cp -a $2/* $1 2>/dev/null;
-- 
2.11.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-20  9:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-20  9:02 [PATCH] initscripts: populate-volatile: suppress read-only-rootfs warnings André Draszik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox