diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2016-01-29 14:12:23 +0100 |
---|---|---|
committer | Nora Björklund <nora.bjorklund@enea.com> | 2016-02-08 14:30:51 +0100 |
commit | b878cf381de0a0d158f1e97cf8726ea1756fd2fa (patch) | |
tree | 24cd38525e85e9de3a58b2a5034f368eb86ec117 | |
parent | de0b35a0d18ec23b7be6b0bde88b3254c951d6ac (diff) | |
download | meta-el-common-b878cf381de0a0d158f1e97cf8726ea1756fd2fa.tar.gz |
connman: Rewrite to a patch to the connman file
The original .bbappend was adding a new "connman" file that replaced the
one provided in the original recipe. This meant that any changes in the
original file from poky would be overwritten.
The .bbappend now patches the connman file so that any changes in it
are either included or caught with merge conflict. To achieve this I did
an artifice of copying the connman file in S to be patched by do_patch,
then copied it back in WORKDIR to be installed on target by do_install.
Also renamed the recipe .bbappend to cover all versions of connman and
renamed the files folder.
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Signed-off-by: Nora Björklund <nora.bjorklund@enea.com>
-rw-r--r-- | recipes-connectivity/connman/connman/0001-added-noipconfig-option.patch (renamed from recipes-connectivity/connman/files/0001-added-noipconfig-option.patch) | 0 | ||||
-rw-r--r-- | recipes-connectivity/connman/connman/connman.patch | 18 | ||||
-rw-r--r-- | recipes-connectivity/connman/connman_%.bbappend | 20 | ||||
-rw-r--r-- | recipes-connectivity/connman/connman_1.25.bbappend | 5 | ||||
-rw-r--r-- | recipes-connectivity/connman/files/connman | 83 |
5 files changed, 38 insertions, 88 deletions
diff --git a/recipes-connectivity/connman/files/0001-added-noipconfig-option.patch b/recipes-connectivity/connman/connman/0001-added-noipconfig-option.patch index d86b778..d86b778 100644 --- a/recipes-connectivity/connman/files/0001-added-noipconfig-option.patch +++ b/recipes-connectivity/connman/connman/0001-added-noipconfig-option.patch | |||
diff --git a/recipes-connectivity/connman/connman/connman.patch b/recipes-connectivity/connman/connman/connman.patch new file mode 100644 index 0000000..e3ff2f9 --- /dev/null +++ b/recipes-connectivity/connman/connman/connman.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | --- ./connman.orig 2016-01-28 17:03:08.000315610 +0100 | ||
2 | +++ ./connman 2016-01-28 17:05:24.393956927 +0100 | ||
3 | @@ -36,13 +36,13 @@ do_start() { | ||
4 | if [ "$NET_ADDR" = dhcp ]; then | ||
5 | ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"` | ||
6 | if [ ! -z "$ethn" ]; then | ||
7 | - EXTRA_PARAM="-I $ethn" | ||
8 | + EXTRA_PARAM="--noipconfig $ethn" | ||
9 | fi | ||
10 | else | ||
11 | for i in $NET_DEVS; do | ||
12 | ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'` | ||
13 | if [ "$NET_ADDR" = "$ADDR" ]; then | ||
14 | - EXTRA_PARAM="-I $i" | ||
15 | + EXTRA_PARAM="--noipconfig $i" | ||
16 | break | ||
17 | fi | ||
18 | done | ||
diff --git a/recipes-connectivity/connman/connman_%.bbappend b/recipes-connectivity/connman/connman_%.bbappend new file mode 100644 index 0000000..a32d4b3 --- /dev/null +++ b/recipes-connectivity/connman/connman_%.bbappend | |||
@@ -0,0 +1,20 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/connman:" | ||
2 | |||
3 | SRC_URI += "file://0001-added-noipconfig-option.patch \ | ||
4 | file://connman.patch \ | ||
5 | " | ||
6 | |||
7 | python do_patch_prepend() { | ||
8 | import shutil | ||
9 | workdir = d.getVar('WORKDIR', True) | ||
10 | source = d.getVar('S', True) | ||
11 | shutil.move(os.path.join(workdir, "connman"), source) | ||
12 | } | ||
13 | |||
14 | |||
15 | python do_patch_append() { | ||
16 | import shutil | ||
17 | workdir = d.getVar('WORKDIR', True) | ||
18 | source = d.getVar('S', True) | ||
19 | shutil.move(os.path.join(source, "connman"), workdir) | ||
20 | } | ||
diff --git a/recipes-connectivity/connman/connman_1.25.bbappend b/recipes-connectivity/connman/connman_1.25.bbappend deleted file mode 100644 index 4f72ec3..0000000 --- a/recipes-connectivity/connman/connman_1.25.bbappend +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
2 | |||
3 | SRC_URI += "file://0001-added-noipconfig-option.patch \ | ||
4 | file://connman \ | ||
5 | " | ||
diff --git a/recipes-connectivity/connman/files/connman b/recipes-connectivity/connman/files/connman deleted file mode 100644 index a7b7c7b..0000000 --- a/recipes-connectivity/connman/files/connman +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | DAEMON=/usr/sbin/connmand | ||
4 | PIDFILE=/var/run/connmand.pid | ||
5 | DESC="Connection Manager" | ||
6 | |||
7 | if [ -f /etc/default/connman ] ; then | ||
8 | . /etc/default/connman | ||
9 | fi | ||
10 | |||
11 | set -e | ||
12 | |||
13 | nfsroot=0 | ||
14 | |||
15 | exec 9<&0 < /proc/mounts | ||
16 | while read dev mtpt fstype rest; do | ||
17 | if test $mtpt = "/" ; then | ||
18 | case $fstype in | ||
19 | nfs | nfs4) | ||
20 | nfsroot=1 | ||
21 | break | ||
22 | ;; | ||
23 | *) | ||
24 | ;; | ||
25 | esac | ||
26 | fi | ||
27 | done | ||
28 | |||
29 | do_start() { | ||
30 | EXTRA_PARAM="" | ||
31 | if test $nfsroot -eq 1 ; then | ||
32 | NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'` | ||
33 | NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'` | ||
34 | |||
35 | if [ ! -z "$NET_ADDR" ]; then | ||
36 | if [ "$NET_ADDR" = dhcp ]; then | ||
37 | ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"` | ||
38 | if [ ! -z "$ethn" ]; then | ||
39 | EXTRA_PARAM="--noipconfig $ethn" | ||
40 | fi | ||
41 | else | ||
42 | for i in $NET_DEVS; do | ||
43 | ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'` | ||
44 | if [ "$NET_ADDR" = "$ADDR" ]; then | ||
45 | EXTRA_PARAM="--noipconfig $i" | ||
46 | break | ||
47 | fi | ||
48 | done | ||
49 | fi | ||
50 | fi | ||
51 | fi | ||
52 | if [ -f @LIBDIR@/connman/wired-setup ] ; then | ||
53 | . @LIBDIR@/connman/wired-setup | ||
54 | fi | ||
55 | $DAEMON $EXTRA_PARAM | ||
56 | } | ||
57 | |||
58 | do_stop() { | ||
59 | start-stop-daemon --stop --name connmand --quiet | ||
60 | } | ||
61 | |||
62 | case "$1" in | ||
63 | start) | ||
64 | echo "Starting $DESC" | ||
65 | do_start | ||
66 | ;; | ||
67 | stop) | ||
68 | echo "Stopping $DESC" | ||
69 | do_stop | ||
70 | ;; | ||
71 | restart|force-reload) | ||
72 | echo "Restarting $DESC" | ||
73 | do_stop | ||
74 | sleep 1 | ||
75 | do_start | ||
76 | ;; | ||
77 | *) | ||
78 | echo "Usage: $0 {start|stop|restart|force-reload}" >&2 | ||
79 | exit 1 | ||
80 | ;; | ||
81 | esac | ||
82 | |||
83 | exit 0 | ||