summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2013-11-27 11:07:01 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-05 14:25:29 +0000
commitdf1505e91a3de03cb4e47312813a60865ed15670 (patch)
treeca6f4cd45631753e59154fbc605713855f2f6529 /meta/recipes-core
parent77c4f158c6dbc8a373d2064552224f5dfe1a7bd2 (diff)
downloadpoky-df1505e91a3de03cb4e47312813a60865ed15670.tar.gz
update-rc.d: process symlinks recursively
When processing startup scripts which use update-alternatives, we need to keep resolving the symlink recursively until we hit a real file, due to the alternatives indirection. This fixes the ability to run certain postinsts at do_rootfs time, which is needed for good read-only-rootfs support. (From OE-Core rev: 987a203f85e9474fd1807e577c7fd8c30ecf78d6) Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch26
1 files changed, 16 insertions, 10 deletions
diff --git a/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch b/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch
index 6f402ddb6d..075171a5a3 100644
--- a/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch
+++ b/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch
@@ -14,25 +14,31 @@ actually exists in rootfs path and then continue.
14Upstream-Status: Pending 14Upstream-Status: Pending
15 15
16Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> 16Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
17Signed-off-by: Christopher Larson <chris_larson@mentor.com>
17 18
18Index: git/update-rc.d 19Index: git/update-rc.d
19=================================================================== 20===================================================================
20--- git.orig/update-rc.d 2013-01-16 12:12:58.349814356 +0200 21--- git.orig/update-rc.d
21+++ git/update-rc.d 2013-01-16 13:02:42.490864939 +0200 22+++ git/update-rc.d
22@@ -147,13 +147,29 @@ 23@@ -147,13 +147,34 @@ fi
23 bn=$1 24 bn=$1
24 shift 25 shift
25 26
26+sn=$initd/$bn 27+sn=$initd/$bn
27+if [ -L "$sn" -a -n "$root" ]; then 28+if [ -L "$sn" -a -n "$root" ]; then
28+ readlink=$(which readlink) 29+ if which readlink >/dev/null; then
30+ while true; do
31+ linksn="$(readlink "$sn")"
32+ if [ -z "$linksn" ]; then
33+ break
34+ fi
29+ 35+
30+ if [ -n "$readlink" ]; then 36+ sn="$linksn"
31+ sn=$($readlink "$sn") 37+ case "$sn" in
32+ case "$sn" in 38+ /*) sn="$root$sn" ;;
33+ /*) sn=${root}${sn} ;; 39+ *) sn="$initd/$sn" ;;
34+ *) sn=$initd/$sn ;; 40+ esac
35+ esac 41+ done
36+ else 42+ else
37+ echo "update-rc.d: readlink tool not present, cannot check whether \ 43+ echo "update-rc.d: readlink tool not present, cannot check whether \
38+ $sn symlink points to a valid file." >&2 44+ $sn symlink points to a valid file." >&2