diff options
author | Martin Hundebøll <martin@geanix.com> | 2019-08-21 12:25:53 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-28 11:31:21 +0100 |
commit | 4cac7b155339d71409a82c8048a8361cae06db80 (patch) | |
tree | e4d4ef54323d18aa44468accbdf701723d32424c /meta/recipes-core | |
parent | 3f5c70649a9aaa13ef755ea57576d2bd6d9d2e60 (diff) | |
download | poky-4cac7b155339d71409a82c8048a8361cae06db80.tar.gz |
initscripts: remove warnings on read-only-rootfs (again)
When the populate-volatile.sh initscript tests if a configured symlink
is already in place, it uses readlink with the '-f' (follow) option:
> [ "$(readlink -f $source)" = "$dest" ]
If the test fails, it proceeds to delete the exisiting folder/file, and
create the configured symlink.
However, the '-f' option to readlink makes it follow symlinks pointing
at symlinks. If the $dest argument is a symlink, the above test fails,
and warnings are printed due to changing a read-only rootfs.
This is the case for /tmp, and /etc/resolv.conf:
> /tmp -> /var/tmp -> /var/volatile/tmp
> /etc/resolv.conf -> /var/run/resolv.conf -> /run/resolv.conf
Fix the warnings by removing the '-f' option, so that the test matches
the configuration.
[ YOCTO #10814 ]
(From OE-Core rev: fb028a0a25c02ab56ad262afd8e6e9495a44673d)
Signed-off-by: Martin Hundebøll <martin@geanix.com>
Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rwxr-xr-x | meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh | 2 |
1 files changed, 1 insertions, 1 deletions
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 6f965a6870..1c525b71bd 100755 --- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh +++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh | |||
@@ -80,7 +80,7 @@ mk_dir() { | |||
80 | link_file() { | 80 | link_file() { |
81 | EXEC=" | 81 | EXEC=" |
82 | if [ -L \"$2\" ]; then | 82 | if [ -L \"$2\" ]; then |
83 | [ \"\$(readlink -f \"$2\")\" != \"$1\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; }; | 83 | [ \"\$(readlink \"$2\")\" != \"$1\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; }; |
84 | elif [ -d \"$2\" ]; then | 84 | elif [ -d \"$2\" ]; then |
85 | if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then | 85 | if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then |
86 | cp -a $2/* $1 2>/dev/null; | 86 | cp -a $2/* $1 2>/dev/null; |