diff options
author | Christopher Larson <chris_larson@mentor.com> | 2013-11-27 11:07:01 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-05 14:25:29 +0000 |
commit | df1505e91a3de03cb4e47312813a60865ed15670 (patch) | |
tree | ca6f4cd45631753e59154fbc605713855f2f6529 /meta/recipes-core/update-rc.d | |
parent | 77c4f158c6dbc8a373d2064552224f5dfe1a7bd2 (diff) | |
download | ast2050-yocto-poky-df1505e91a3de03cb4e47312813a60865ed15670.zip ast2050-yocto-poky-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/update-rc.d')
-rw-r--r-- | meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch | 26 |
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 6f402dd..075171a 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. Upstream-Status: Pending Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> +Signed-off-by: Christopher Larson <chris_larson@mentor.com> Index: git/update-rc.d =================================================================== ---- git.orig/update-rc.d 2013-01-16 12:12:58.349814356 +0200 -+++ git/update-rc.d 2013-01-16 13:02:42.490864939 +0200 -@@ -147,13 +147,29 @@ +--- git.orig/update-rc.d ++++ git/update-rc.d +@@ -147,13 +147,34 @@ fi bn=$1 shift +sn=$initd/$bn +if [ -L "$sn" -a -n "$root" ]; then -+ readlink=$(which readlink) ++ if which readlink >/dev/null; then ++ while true; do ++ linksn="$(readlink "$sn")" ++ if [ -z "$linksn" ]; then ++ break ++ fi + -+ if [ -n "$readlink" ]; then -+ sn=$($readlink "$sn") -+ case "$sn" in -+ /*) sn=${root}${sn} ;; -+ *) sn=$initd/$sn ;; -+ esac ++ sn="$linksn" ++ case "$sn" in ++ /*) sn="$root$sn" ;; ++ *) sn="$initd/$sn" ;; ++ esac ++ done + else + echo "update-rc.d: readlink tool not present, cannot check whether \ + $sn symlink points to a valid file." >&2 |