diff options
Diffstat (limited to 'meta/recipes-core/update-rc.d/update-rc.d')
-rw-r--r-- | meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch | 49 | ||||
-rw-r--r-- | meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch | 53 |
2 files changed, 102 insertions, 0 deletions
diff --git a/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch b/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch new file mode 100644 index 0000000000..fb443ff15e --- /dev/null +++ b/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | --- update-rc.d/update-rc.d.org 2005-01-03 00:30:47.000000000 +0200 | ||
4 | +++ update-rc.d/update-rc.d 2007-12-01 19:41:08.000000000 +0200 | ||
5 | @@ -19,6 +19,7 @@ | ||
6 | notreally=0 | ||
7 | force=0 | ||
8 | dostart=0 | ||
9 | +verbose=0 | ||
10 | |||
11 | usage() | ||
12 | { | ||
13 | @@ -28,6 +29,7 @@ | ||
14 | update-rc.d [-n] [-r <root>] [-s] <basename> start|stop NN runlvl [runlvl] [...] . | ||
15 | -n: not really | ||
16 | -f: force | ||
17 | + -v: verbose | ||
18 | -r: alternate root path (default is /) | ||
19 | -s: invoke start methods if appropriate to current runlevel | ||
20 | EOF | ||
21 | @@ -69,7 +71,7 @@ | ||
22 | lev=`echo $2 | cut -d/ -f1` | ||
23 | nn=`echo $2 | cut -d/ -f2` | ||
24 | fn="${etcd}${lev}.d/${startstop}${nn}${bn}" | ||
25 | - echo " $fn -> ../init.d/$bn" | ||
26 | + [ $verbose -eq 1 ] && echo " $fn -> ../init.d/$bn" | ||
27 | if [ $notreally -eq 0 ]; then | ||
28 | mkdir -p `dirname $fn` | ||
29 | ln -s ../init.d/$bn $fn | ||
30 | @@ -89,7 +91,7 @@ | ||
31 | exit 0 | ||
32 | fi | ||
33 | |||
34 | - echo " Adding system startup for $initd/$bn ..." | ||
35 | + echo " Adding system startup for $initd/$bn." | ||
36 | |||
37 | for i in $startlinks; do | ||
38 | dolink S $i | ||
39 | @@ -105,6 +107,10 @@ | ||
40 | shift | ||
41 | continue | ||
42 | ;; | ||
43 | + -v) verbose=1 | ||
44 | + shift | ||
45 | + continue | ||
46 | + ;; | ||
47 | -f) force=1 | ||
48 | shift | ||
49 | continue | ||
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 new file mode 100644 index 0000000000..6f402ddb6d --- /dev/null +++ b/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | Check if symlinks are valid | ||
2 | |||
3 | When using root option and $initd/$bn is a symlink, the script would fail because | ||
4 | the symlink points to a path on target. For example: | ||
5 | |||
6 | /path/to/target/rootfs/etc/init.d/syslog -> /etc/init.d/syslog.busybox | ||
7 | |||
8 | Hence, [ -f /path/to/target/rootfs/etc/init.d/syslog ] condition would return | ||
9 | false. | ||
10 | |||
11 | This patch adds the posibility to check whether the file the symlink points to | ||
12 | actually exists in rootfs path and then continue. | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> | ||
17 | |||
18 | Index: git/update-rc.d | ||
19 | =================================================================== | ||
20 | --- git.orig/update-rc.d 2013-01-16 12:12:58.349814356 +0200 | ||
21 | +++ git/update-rc.d 2013-01-16 13:02:42.490864939 +0200 | ||
22 | @@ -147,13 +147,29 @@ | ||
23 | bn=$1 | ||
24 | shift | ||
25 | |||
26 | +sn=$initd/$bn | ||
27 | +if [ -L "$sn" -a -n "$root" ]; then | ||
28 | + readlink=$(which readlink) | ||
29 | + | ||
30 | + if [ -n "$readlink" ]; then | ||
31 | + sn=$($readlink "$sn") | ||
32 | + case "$sn" in | ||
33 | + /*) sn=${root}${sn} ;; | ||
34 | + *) sn=$initd/$sn ;; | ||
35 | + esac | ||
36 | + else | ||
37 | + echo "update-rc.d: readlink tool not present, cannot check whether \ | ||
38 | + $sn symlink points to a valid file." >&2 | ||
39 | + fi | ||
40 | +fi | ||
41 | + | ||
42 | if [ $1 != "remove" ]; then | ||
43 | - if [ ! -f "$initd/$bn" ]; then | ||
44 | + if [ ! -f "$sn" ]; then | ||
45 | echo "update-rc.d: $initd/$bn: file does not exist" >&2 | ||
46 | exit 1 | ||
47 | fi | ||
48 | else | ||
49 | - if [ -f "$initd/$bn" ]; then | ||
50 | + if [ -f "$sn" ]; then | ||
51 | if [ $force -eq 1 ]; then | ||
52 | echo "update-rc.d: $initd/$bn exists during rc.d purge (continuing)" >&2 | ||
53 | else | ||