Merge lp:~e7appew/ubuntu/wily/usb-modeswitch/yakkety-fix into lp:ubuntu/wily/usb-modeswitch
- Wily (15.10)
- yakkety-fix
- Merge into wily
Proposed by
Carlos Maddela
Status: | Merged | ||||
---|---|---|---|---|---|
Merge reported by: | Robie Basak | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~e7appew/ubuntu/wily/usb-modeswitch/yakkety-fix | ||||
Merge into: | lp:ubuntu/wily/usb-modeswitch | ||||
Diff against target: |
502 lines (+87/-196) 14 files modified
.pc/03_use_udev_specifics.patch/usb_modeswitch.sh (+0/-98) .pc/05_upstart_systemd_runtime_detection.patch/usb_modeswitch.sh (+11/-5) .pc/06_set_TMPDIR_in_run.patch/usb_modeswitch.sh (+12/-6) .pc/applied-patches (+0/-1) .pc/redirect_dispatcher_output.patch/usb_modeswitch.sh (+12/-6) .pc/systemd_service_name.patch/usb_modeswitch.sh (+12/-6) debian/changelog (+8/-0) debian/patches/03_use_udev_specifics.patch (+0/-43) debian/patches/05_upstart_systemd_runtime_detection.patch (+6/-6) debian/patches/06_set_TMPDIR_in_run.patch (+2/-2) debian/patches/redirect_dispatcher_output.patch (+8/-10) debian/patches/series (+0/-1) debian/patches/systemd_service_name.patch (+4/-6) usb_modeswitch.sh (+12/-6) |
||||
To merge this branch: | bzr merge lp:~e7appew/ubuntu/wily/usb-modeswitch/yakkety-fix | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu branches | Pending | ||
Review via email: mp+310146@code.launchpad.net |
Commit message
Description of the change
Cherry-pick commit 10a62408 from Debian unstable to resolve incompatibility with systemd (>= 230-1~) (LP: #1639607).
To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed file '.pc/03_use_udev_specifics.patch/usb_modeswitch.sh' |
2 | --- .pc/03_use_udev_specifics.patch/usb_modeswitch.sh 2015-07-20 12:12:31 +0000 |
3 | +++ .pc/03_use_udev_specifics.patch/usb_modeswitch.sh 1970-01-01 00:00:00 +0000 |
4 | @@ -1,98 +0,0 @@ |
5 | -#!/bin/sh |
6 | -# part of usb_modeswitch 2.2.5 |
7 | -device_in() |
8 | -{ |
9 | - if [ ! -e /var/lib/usb_modeswitch/$1 ]; then |
10 | - return 0 |
11 | - fi |
12 | - while read line |
13 | - do |
14 | - if [ $(expr "$line" : "$2:$3") != 0 ]; then |
15 | - return 1 |
16 | - fi |
17 | - done </var/lib/usb_modeswitch/$1 |
18 | - if [ $(expr "$line" : "$2:$3") != 0 ]; then |
19 | - return 1 |
20 | - fi |
21 | - return 0 |
22 | -} |
23 | - |
24 | -if [ $(expr "$1" : "--.*") ]; then |
25 | - p_id=$4 |
26 | - if [ -z $p_id ]; then |
27 | - prod=$5 |
28 | - if [ -z $prod ]; then |
29 | - prod=$3 |
30 | - fi |
31 | - prod=${prod%/*} |
32 | - v_id=0x${prod%/*} |
33 | - p_id=0x${prod#*/} |
34 | - if [ "$v_id" = "0x" ]; then |
35 | - v_id="0" |
36 | - p_id="0" |
37 | - fi |
38 | - v_id="$(printf %04x $(($v_id)))" |
39 | - p_id="$(printf %04x $(($p_id)))" |
40 | - else |
41 | - v_id=$3 |
42 | - fi |
43 | -fi |
44 | -PATH=/sbin:/usr/sbin:$PATH |
45 | -case "$1" in |
46 | - --driver-bind) |
47 | - ( |
48 | - dir=$(ls -d /sys$2/ttyUSB* 2>/dev/null) |
49 | - sleep 1 |
50 | - if [ ! -z "$dir" ]; then |
51 | - exit 0 |
52 | - fi |
53 | - set +e |
54 | - device_in "bind_list" $v_id $p_id |
55 | - if [ "$?" = "1" ]; then |
56 | - id_attr="/sys/bus/usb-serial/drivers/option1/new_id" |
57 | - if [ ! -e "$id_attr" ]; then |
58 | - modprobe option 2>/dev/null || true |
59 | - fi |
60 | - if [ -e "$id_attr" ]; then |
61 | - echo "$v_id $p_id ff" > $id_attr |
62 | - else |
63 | - modprobe -r usbserial 2>/dev/null |
64 | - modprobe usbserial "vendor=0x$v_id" "product=0x$p_id" 2>/dev/null |
65 | - fi |
66 | - fi |
67 | - ) & |
68 | - exit 0 |
69 | - ;; |
70 | - --symlink-name) |
71 | - device_in "link_list" $v_id $p_id |
72 | - if [ "$?" = "1" ]; then |
73 | - if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
74 | - exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
75 | - fi |
76 | - fi |
77 | - exit 0 |
78 | - ;; |
79 | -esac |
80 | -( |
81 | -IFS='/' read -r p1 p2 <<EOF |
82 | -$1 |
83 | -EOF |
84 | -PATH=/bin:/sbin:/usr/bin:/usr/sbin |
85 | -count=20 |
86 | -while [ $count != 0 ]; do |
87 | - if [ ! -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
88 | - sleep 1 |
89 | - count=$(($count - 1)) |
90 | - else |
91 | - if [ -e "/etc/systemd/system/usb_modeswitch@.service" ]; then |
92 | - exec systemctl --no-block start usb_modeswitch@$p1'_'$p2.service |
93 | - elif [ -e "/etc/init/usb-modeswitch-upstart.conf" ]; then |
94 | - exec initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1 |
95 | - else |
96 | - exec usb_modeswitch_dispatcher --switch-mode $1 & |
97 | - fi |
98 | - exit 0 |
99 | - fi |
100 | -done |
101 | -) & |
102 | -exit 0 |
103 | |
104 | === modified file '.pc/05_upstart_systemd_runtime_detection.patch/usb_modeswitch.sh' |
105 | --- .pc/05_upstart_systemd_runtime_detection.patch/usb_modeswitch.sh 2015-07-20 12:12:31 +0000 |
106 | +++ .pc/05_upstart_systemd_runtime_detection.patch/usb_modeswitch.sh 2016-11-06 19:41:38 +0000 |
107 | @@ -66,9 +66,9 @@ |
108 | --symlink-name) |
109 | device_in "link_list" $v_id $p_id |
110 | if [ "$?" = "1" ]; then |
111 | - . /lib/udev/hotplug.functions |
112 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
113 | - exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
114 | + if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
115 | + exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
116 | + fi |
117 | fi |
118 | exit 0 |
119 | ;; |
120 | @@ -78,8 +78,12 @@ |
121 | $1 |
122 | EOF |
123 | PATH=/bin:/sbin:/usr/bin:/usr/sbin |
124 | - . /lib/udev/hotplug.functions |
125 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
126 | +count=20 |
127 | +while [ $count != 0 ]; do |
128 | + if [ ! -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
129 | + sleep 1 |
130 | + count=$(($count - 1)) |
131 | + else |
132 | if [ -e "/etc/systemd/system/usb_modeswitch@.service" ]; then |
133 | exec systemctl --no-block start usb_modeswitch@$p1'_'$p2.service |
134 | elif [ -e "/etc/init/usb-modeswitch-upstart.conf" ]; then |
135 | @@ -88,5 +92,7 @@ |
136 | exec usb_modeswitch_dispatcher --switch-mode $1 & |
137 | fi |
138 | exit 0 |
139 | + fi |
140 | +done |
141 | ) & |
142 | exit 0 |
143 | |
144 | === modified file '.pc/06_set_TMPDIR_in_run.patch/usb_modeswitch.sh' |
145 | --- .pc/06_set_TMPDIR_in_run.patch/usb_modeswitch.sh 2015-07-20 12:12:31 +0000 |
146 | +++ .pc/06_set_TMPDIR_in_run.patch/usb_modeswitch.sh 2016-11-06 19:41:38 +0000 |
147 | @@ -66,9 +66,9 @@ |
148 | --symlink-name) |
149 | device_in "link_list" $v_id $p_id |
150 | if [ "$?" = "1" ]; then |
151 | - . /lib/udev/hotplug.functions |
152 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
153 | - exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
154 | + if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
155 | + exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
156 | + fi |
157 | fi |
158 | exit 0 |
159 | ;; |
160 | @@ -78,15 +78,21 @@ |
161 | $1 |
162 | EOF |
163 | PATH=/bin:/sbin:/usr/bin:/usr/sbin |
164 | - . /lib/udev/hotplug.functions |
165 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
166 | +count=20 |
167 | +while [ $count != 0 ]; do |
168 | + if [ ! -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
169 | + sleep 1 |
170 | + count=$(($count - 1)) |
171 | + else |
172 | if [ -d "/run/systemd/system/" ]; then # Test if systemd is running |
173 | exec systemctl --no-block start usb_modeswitch@$p1'_'$p2.service |
174 | - elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
175 | + elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
176 | exec initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1 |
177 | else |
178 | exec usb_modeswitch_dispatcher --switch-mode $1 & |
179 | fi |
180 | exit 0 |
181 | + fi |
182 | +done |
183 | ) & |
184 | exit 0 |
185 | |
186 | === modified file '.pc/applied-patches' |
187 | --- .pc/applied-patches 2015-10-02 16:52:27 +0000 |
188 | +++ .pc/applied-patches 2016-11-06 19:41:38 +0000 |
189 | @@ -1,4 +1,3 @@ |
190 | -03_use_udev_specifics.patch |
191 | 04_use_system_libjim.patch |
192 | 05_upstart_systemd_runtime_detection.patch |
193 | 06_set_TMPDIR_in_run.patch |
194 | |
195 | === modified file '.pc/redirect_dispatcher_output.patch/usb_modeswitch.sh' |
196 | --- .pc/redirect_dispatcher_output.patch/usb_modeswitch.sh 2015-10-02 16:52:27 +0000 |
197 | +++ .pc/redirect_dispatcher_output.patch/usb_modeswitch.sh 2016-11-06 19:41:38 +0000 |
198 | @@ -66,9 +66,9 @@ |
199 | --symlink-name) |
200 | device_in "link_list" $v_id $p_id |
201 | if [ "$?" = "1" ]; then |
202 | - . /lib/udev/hotplug.functions |
203 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
204 | - exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
205 | + if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
206 | + exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
207 | + fi |
208 | fi |
209 | exit 0 |
210 | ;; |
211 | @@ -78,16 +78,22 @@ |
212 | $1 |
213 | EOF |
214 | PATH=/bin:/sbin:/usr/bin:/usr/sbin |
215 | - . /lib/udev/hotplug.functions |
216 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
217 | +count=20 |
218 | +while [ $count != 0 ]; do |
219 | + if [ ! -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
220 | + sleep 1 |
221 | + count=$(($count - 1)) |
222 | + else |
223 | if [ -d "/run/systemd/system/" ]; then # Test if systemd is running |
224 | exec systemctl --no-block start usb_modeswitch@$p1'_'$p2.service |
225 | - elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
226 | + elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
227 | exec initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1 |
228 | else |
229 | export TMPDIR=/run |
230 | exec usb_modeswitch_dispatcher --switch-mode $1 & |
231 | fi |
232 | exit 0 |
233 | + fi |
234 | +done |
235 | ) & |
236 | exit 0 |
237 | |
238 | === modified file '.pc/systemd_service_name.patch/usb_modeswitch.sh' |
239 | --- .pc/systemd_service_name.patch/usb_modeswitch.sh 2015-10-02 16:52:27 +0000 |
240 | +++ .pc/systemd_service_name.patch/usb_modeswitch.sh 2016-11-06 19:41:38 +0000 |
241 | @@ -66,9 +66,9 @@ |
242 | --symlink-name) |
243 | device_in "link_list" $v_id $p_id |
244 | if [ "$?" = "1" ]; then |
245 | - . /lib/udev/hotplug.functions |
246 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
247 | - exec usb_modeswitch_dispatcher $1 $2 >>/dev/null 2>&1 |
248 | + if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
249 | + exec usb_modeswitch_dispatcher $1 $2 >>/dev/null 2>&1 |
250 | + fi |
251 | fi |
252 | exit 0 |
253 | ;; |
254 | @@ -78,16 +78,22 @@ |
255 | $1 |
256 | EOF |
257 | PATH=/bin:/sbin:/usr/bin:/usr/sbin |
258 | - . /lib/udev/hotplug.functions |
259 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
260 | +count=20 |
261 | +while [ $count != 0 ]; do |
262 | + if [ ! -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
263 | + sleep 1 |
264 | + count=$(($count - 1)) |
265 | + else |
266 | if [ -d "/run/systemd/system/" ]; then # Test if systemd is running |
267 | exec systemctl --no-block start usb_modeswitch@$p1'_'$p2.service |
268 | - elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
269 | + elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
270 | exec initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1 |
271 | else |
272 | export TMPDIR=/run |
273 | exec usb_modeswitch_dispatcher --switch-mode $1 >>/dev/null 2>&1 & |
274 | fi |
275 | exit 0 |
276 | + fi |
277 | +done |
278 | ) & |
279 | exit 0 |
280 | |
281 | === modified file 'debian/changelog' |
282 | --- debian/changelog 2015-10-02 16:52:27 +0000 |
283 | +++ debian/changelog 2016-11-06 19:41:38 +0000 |
284 | @@ -1,3 +1,11 @@ |
285 | +usb-modeswitch (2.2.5+repack0-1ubuntu2) yakkety; urgency=high |
286 | + |
287 | + * Cherry-pick commit 10a62408 from Debian unstable to resolve |
288 | + incompatibility with systemd (>= 230-1~) (LP: #1639607). |
289 | + * Refresh and apply all patches. |
290 | + |
291 | + -- Carlos Maddela <e7appew@gmail.com> Mon, 07 Nov 2016 05:19:05 +1100 |
292 | + |
293 | usb-modeswitch (2.2.5+repack0-1ubuntu1) wily; urgency=medium |
294 | |
295 | * Merge from Debian unstable, remaining changes: (LP: #1498805) |
296 | |
297 | === removed file 'debian/patches/03_use_udev_specifics.patch' |
298 | --- debian/patches/03_use_udev_specifics.patch 2015-10-02 16:52:27 +0000 |
299 | +++ debian/patches/03_use_udev_specifics.patch 1970-01-01 00:00:00 +0000 |
300 | @@ -1,43 +0,0 @@ |
301 | -Description: Use udev-in-Debian specific tools for the waiting script |
302 | - This is inspired from alsa-utils' |
303 | -Author: Didier Raboud <odyx@debian.org> |
304 | -Origin: vendor |
305 | -Last-Update: 2013-09-17 |
306 | ---- a/usb_modeswitch.sh |
307 | -+++ b/usb_modeswitch.sh |
308 | -@@ -66,9 +66,9 @@ |
309 | - --symlink-name) |
310 | - device_in "link_list" $v_id $p_id |
311 | - if [ "$?" = "1" ]; then |
312 | -- if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
313 | -- exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
314 | -- fi |
315 | -+ . /lib/udev/hotplug.functions |
316 | -+ wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
317 | -+ exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
318 | - fi |
319 | - exit 0 |
320 | - ;; |
321 | -@@ -78,12 +78,8 @@ |
322 | - $1 |
323 | - EOF |
324 | - PATH=/bin:/sbin:/usr/bin:/usr/sbin |
325 | --count=20 |
326 | --while [ $count != 0 ]; do |
327 | -- if [ ! -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
328 | -- sleep 1 |
329 | -- count=$(($count - 1)) |
330 | -- else |
331 | -+ . /lib/udev/hotplug.functions |
332 | -+ wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
333 | - if [ -e "/etc/systemd/system/usb_modeswitch@.service" ]; then |
334 | - exec systemctl --no-block start usb_modeswitch@$p1'_'$p2.service |
335 | - elif [ -e "/etc/init/usb-modeswitch-upstart.conf" ]; then |
336 | -@@ -92,7 +88,5 @@ |
337 | - exec usb_modeswitch_dispatcher --switch-mode $1 & |
338 | - fi |
339 | - exit 0 |
340 | -- fi |
341 | --done |
342 | - ) & |
343 | - exit 0 |
344 | |
345 | === modified file 'debian/patches/05_upstart_systemd_runtime_detection.patch' |
346 | --- debian/patches/05_upstart_systemd_runtime_detection.patch 2015-07-20 12:12:31 +0000 |
347 | +++ debian/patches/05_upstart_systemd_runtime_detection.patch 2016-11-06 19:41:38 +0000 |
348 | @@ -3,18 +3,18 @@ |
349 | Author: Didier Raboud <odyx@debian.org> |
350 | Origin: vendor |
351 | Bug-Debian: http://bugs.debian.org/725394 |
352 | -Last-Update: 2013-10-07 |
353 | +Last-Update: 2016-01-13 |
354 | --- a/usb_modeswitch.sh |
355 | +++ b/usb_modeswitch.sh |
356 | -@@ -80,9 +80,9 @@ |
357 | - PATH=/bin:/sbin:/usr/bin:/usr/sbin |
358 | - . /lib/udev/hotplug.functions |
359 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
360 | +@@ -84,9 +84,9 @@ |
361 | + sleep 1 |
362 | + count=$(($count - 1)) |
363 | + else |
364 | - if [ -e "/etc/systemd/system/usb_modeswitch@.service" ]; then |
365 | + if [ -d "/run/systemd/system/" ]; then # Test if systemd is running |
366 | exec systemctl --no-block start usb_modeswitch@$p1'_'$p2.service |
367 | - elif [ -e "/etc/init/usb-modeswitch-upstart.conf" ]; then |
368 | -+ elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
369 | ++ elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
370 | exec initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1 |
371 | else |
372 | exec usb_modeswitch_dispatcher --switch-mode $1 & |
373 | |
374 | === modified file 'debian/patches/06_set_TMPDIR_in_run.patch' |
375 | --- debian/patches/06_set_TMPDIR_in_run.patch 2015-07-20 12:12:31 +0000 |
376 | +++ debian/patches/06_set_TMPDIR_in_run.patch 2016-11-06 19:41:38 +0000 |
377 | @@ -9,8 +9,8 @@ |
378 | end script |
379 | --- a/usb_modeswitch.sh |
380 | +++ b/usb_modeswitch.sh |
381 | -@@ -85,6 +85,7 @@ |
382 | - elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
383 | +@@ -89,6 +89,7 @@ |
384 | + elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
385 | exec initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1 |
386 | else |
387 | + export TMPDIR=/run |
388 | |
389 | === modified file 'debian/patches/redirect_dispatcher_output.patch' |
390 | --- debian/patches/redirect_dispatcher_output.patch 2015-10-02 16:52:27 +0000 |
391 | +++ debian/patches/redirect_dispatcher_output.patch 2016-11-06 19:41:38 +0000 |
392 | @@ -8,20 +8,18 @@ |
393 | usb_modeswitch.sh | 4 ++-- |
394 | 1 file changed, 2 insertions(+), 2 deletions(-) |
395 | |
396 | -Index: b/usb_modeswitch.sh |
397 | -=================================================================== |
398 | --- a/usb_modeswitch.sh |
399 | +++ b/usb_modeswitch.sh |
400 | -@@ -68,7 +68,7 @@ case "$1" in |
401 | +@@ -67,7 +67,7 @@ case "$1" in |
402 | + device_in "link_list" $v_id $p_id |
403 | if [ "$?" = "1" ]; then |
404 | - . /lib/udev/hotplug.functions |
405 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
406 | -- exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
407 | -+ exec usb_modeswitch_dispatcher $1 $2 >>/dev/null 2>&1 |
408 | + if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
409 | +- exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null |
410 | ++ exec usb_modeswitch_dispatcher $1 $2 >>/dev/null 2>&1 |
411 | + fi |
412 | fi |
413 | exit 0 |
414 | - ;; |
415 | -@@ -87,7 +87,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin |
416 | +@@ -90,7 +90,7 @@ while [ $count != 0 ]; do |
417 | exec initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1 |
418 | else |
419 | export TMPDIR=/run |
420 | @@ -29,4 +27,4 @@ |
421 | + exec usb_modeswitch_dispatcher --switch-mode $1 >>/dev/null 2>&1 & |
422 | fi |
423 | exit 0 |
424 | - ) & |
425 | + fi |
426 | |
427 | === modified file 'debian/patches/series' |
428 | --- debian/patches/series 2015-10-02 16:52:27 +0000 |
429 | +++ debian/patches/series 2016-11-06 19:41:38 +0000 |
430 | @@ -1,4 +1,3 @@ |
431 | -03_use_udev_specifics.patch |
432 | 04_use_system_libjim.patch |
433 | 05_upstart_systemd_runtime_detection.patch |
434 | 06_set_TMPDIR_in_run.patch |
435 | |
436 | === modified file 'debian/patches/systemd_service_name.patch' |
437 | --- debian/patches/systemd_service_name.patch 2015-10-02 16:52:27 +0000 |
438 | +++ debian/patches/systemd_service_name.patch 2016-11-06 19:41:38 +0000 |
439 | @@ -8,16 +8,14 @@ |
440 | usb_modeswitch.sh | 2 +- |
441 | 1 file changed, 1 insertion(+), 1 deletion(-) |
442 | |
443 | -Index: b/usb_modeswitch.sh |
444 | -=================================================================== |
445 | --- a/usb_modeswitch.sh |
446 | +++ b/usb_modeswitch.sh |
447 | -@@ -81,7 +81,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin |
448 | - . /lib/udev/hotplug.functions |
449 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
450 | +@@ -85,7 +85,7 @@ while [ $count != 0 ]; do |
451 | + count=$(($count - 1)) |
452 | + else |
453 | if [ -d "/run/systemd/system/" ]; then # Test if systemd is running |
454 | - exec systemctl --no-block start usb_modeswitch@$p1'_'$p2.service |
455 | + exec systemctl --no-block start usb_modeswitch@${p1:+${p1}_}$p2.service |
456 | - elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
457 | + elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
458 | exec initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1 |
459 | else |
460 | |
461 | === modified file 'usb_modeswitch.sh' |
462 | --- usb_modeswitch.sh 2015-10-02 16:52:27 +0000 |
463 | +++ usb_modeswitch.sh 2016-11-06 19:41:38 +0000 |
464 | @@ -66,9 +66,9 @@ |
465 | --symlink-name) |
466 | device_in "link_list" $v_id $p_id |
467 | if [ "$?" = "1" ]; then |
468 | - . /lib/udev/hotplug.functions |
469 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
470 | - exec usb_modeswitch_dispatcher $1 $2 >>/dev/null 2>&1 |
471 | + if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
472 | + exec usb_modeswitch_dispatcher $1 $2 >>/dev/null 2>&1 |
473 | + fi |
474 | fi |
475 | exit 0 |
476 | ;; |
477 | @@ -78,16 +78,22 @@ |
478 | $1 |
479 | EOF |
480 | PATH=/bin:/sbin:/usr/bin:/usr/sbin |
481 | - . /lib/udev/hotplug.functions |
482 | - wait_for_file /usr/sbin/usb_modeswitch_dispatcher |
483 | +count=20 |
484 | +while [ $count != 0 ]; do |
485 | + if [ ! -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then |
486 | + sleep 1 |
487 | + count=$(($count - 1)) |
488 | + else |
489 | if [ -d "/run/systemd/system/" ]; then # Test if systemd is running |
490 | exec systemctl --no-block start usb_modeswitch@${p1:+${p1}_}$p2.service |
491 | - elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
492 | + elif [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then # Test if upstart is running |
493 | exec initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1 |
494 | else |
495 | export TMPDIR=/run |
496 | exec usb_modeswitch_dispatcher --switch-mode $1 >>/dev/null 2>&1 & |
497 | fi |
498 | exit 0 |
499 | + fi |
500 | +done |
501 | ) & |
502 | exit 0 |
Looks like this has landed (according to bug 1639607) so marking this MP as Merged.