aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-core/toybox/toybox/0001-Match-paths-with-busybox.patch
blob: 9eb965d326b7e20ad087846aefaf77ecf5a88ece (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
From 9b37b45067677563dc8daa73d73a015c20ad6222 Mon Sep 17 00:00:00 2001
From: Paul Barker <paul@paulbarker.me.uk>
Date: Mon, 18 Aug 2014 12:18:16 +0000
Subject: [PATCH] Match paths with busybox

To ensure that toybox can be installed alongside busybox without confusing
update-alternatives, the paths of the links installed by toybox should match
those installed by busybox. This is accomplished by changing the flags of a few
tools within toybox.

v3:
    - Forward ported from v0.5.0 to v0.5.2

v2:
    - Forward ported from v0.4.9 to v0.5.0
    - Move new 'mount' command

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>

Upstream-status: Inappropriate
    (specific to update-alternatives use in OpenEmbedded)

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
---
 toys/lsb/mount.c        | 2 +-
 toys/lsb/pidof.c        | 2 +-
 toys/other/chvt.c       | 2 +-
 toys/other/ifconfig.c   | 2 +-
 toys/other/insmod.c     | 2 +-
 toys/other/lsmod.c      | 2 +-
 toys/other/netcat.c     | 2 +-
 toys/other/pivot_root.c | 2 +-
 toys/other/readlink.c   | 2 +-
 toys/other/reboot.c     | 6 +++---
 toys/other/rfkill.c     | 2 +-
 toys/other/rmmod.c      | 2 +-
 toys/other/swapoff.c    | 2 +-
 toys/other/swapon.c     | 2 +-
 toys/other/sysctl.c     | 2 +-
 toys/posix/cut.c        | 2 +-
 toys/posix/df.c         | 2 +-
 toys/posix/head.c       | 2 +-
 toys/posix/id.c         | 6 +++---
 toys/posix/mkfifo.c     | 2 +-
 toys/posix/renice.c     | 2 +-
 toys/posix/tail.c       | 2 +-
 toys/posix/tee.c        | 2 +-
 toys/posix/uniq.c       | 2 +-
 toys/posix/who.c        | 2 +-
 25 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/toys/lsb/mount.c b/toys/lsb/mount.c
index c334681..b076ca1 100644
--- a/toys/lsb/mount.c
+++ b/toys/lsb/mount.c
@@ -6,7 +6,7 @@
  * Note: -hV is bad spec, haven't implemented -FsLU yet
  * no mtab (/proc/mounts does it) so -n is NOP.
 
-USE_MOUNT(NEWTOY(mount, "?O:afnrvwt:o*[-rw]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT))
+USE_MOUNT(NEWTOY(mount, "?O:afnrvwt:o*[-rw]", TOYFLAG_BIN|TOYFLAG_STAYROOT))
 //USE_NFSMOUNT(NEWTOY(nfsmount, "?<2>2", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT))
 
 config MOUNT
diff --git a/toys/lsb/pidof.c b/toys/lsb/pidof.c
index 51b742f..a8fc8ef 100644
--- a/toys/lsb/pidof.c
+++ b/toys/lsb/pidof.c
@@ -5,7 +5,7 @@
  *
  * http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/pidof.html
 
-USE_PIDOF(NEWTOY(pidof, "<1so:", TOYFLAG_USR|TOYFLAG_BIN))
+USE_PIDOF(NEWTOY(pidof, "<1so:", TOYFLAG_BIN))
 
 config PIDOF
   bool "pidof"
diff --git a/toys/other/chvt.c b/toys/other/chvt.c
index 6544265..a93327f 100644
--- a/toys/other/chvt.c
+++ b/toys/other/chvt.c
@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2008 David Anders <danders@amltd.com>
 
-USE_CHVT(NEWTOY(chvt, "<1", TOYFLAG_USR|TOYFLAG_SBIN))
+USE_CHVT(NEWTOY(chvt, "<1", TOYFLAG_USR|TOYFLAG_BIN))
 
 config CHVT
   bool "chvt"
diff --git a/toys/other/ifconfig.c b/toys/other/ifconfig.c
index 8db3ff0..445799d 100644
--- a/toys/other/ifconfig.c
+++ b/toys/other/ifconfig.c
@@ -6,7 +6,7 @@
  *
  * Not in SUSv4.
 
-USE_IFCONFIG(NEWTOY(ifconfig, "^?a", TOYFLAG_BIN))
+USE_IFCONFIG(NEWTOY(ifconfig, "^?a", TOYFLAG_SBIN))
 
 config IFCONFIG
   bool "ifconfig"
diff --git a/toys/other/insmod.c b/toys/other/insmod.c
index 81721a3..cb222a5 100644
--- a/toys/other/insmod.c
+++ b/toys/other/insmod.c
@@ -2,7 +2,7 @@
  *
  * Copyright 2012 Elie De Brauwer <eliedebrauwer@gmail.com>
 
-USE_INSMOD(NEWTOY(insmod, "<1", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
+USE_INSMOD(NEWTOY(insmod, "<1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
 
 config INSMOD
   bool "insmod"
diff --git a/toys/other/lsmod.c b/toys/other/lsmod.c
index b8f5d82..4d16048 100644
--- a/toys/other/lsmod.c
+++ b/toys/other/lsmod.c
@@ -2,7 +2,7 @@
  *
  * Copyright 2012 Elie De Brauwer <eliedebrauwer@gmail.com>
 
-USE_LSMOD(NEWTOY(lsmod, NULL, TOYFLAG_BIN))
+USE_LSMOD(NEWTOY(lsmod, NULL, TOYFLAG_SBIN))
 
 config LSMOD
   bool "lsmod"
diff --git a/toys/other/netcat.c b/toys/other/netcat.c
index d27aa88..0fd26f7 100644
--- a/toys/other/netcat.c
+++ b/toys/other/netcat.c
@@ -4,7 +4,7 @@
  *
  * TODO: udp, ipv6, genericize for telnet/microcom/tail-f
 
-USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_BIN))
+USE_NETCAT(OLDTOY(nc, netcat, TOYFLAG_USR|TOYFLAG_BIN))
 USE_NETCAT(NEWTOY(netcat, USE_NETCAT_LISTEN("^tlL")"w#p#s:q#f:", TOYFLAG_BIN))
 
 config NETCAT
diff --git a/toys/other/pivot_root.c b/toys/other/pivot_root.c
index 9a1f56c..7748032 100644
--- a/toys/other/pivot_root.c
+++ b/toys/other/pivot_root.c
@@ -2,7 +2,7 @@
  *
  * Copyright 2012 Rob Landley <rob@landley.net>
 
-USE_PIVOT_ROOT(NEWTOY(pivot_root, "<2>2", TOYFLAG_USR|TOYFLAG_BIN))
+USE_PIVOT_ROOT(NEWTOY(pivot_root, "<2>2", TOYFLAG_SBIN))
 
 config PIVOT_ROOT
   bool "pivot_root"
diff --git a/toys/other/readlink.c b/toys/other/readlink.c
index 1c33362..fecd1ef 100644
--- a/toys/other/readlink.c
+++ b/toys/other/readlink.c
@@ -2,7 +2,7 @@
  *
  * Copyright 2007 Rob Landley <rob@landley.net>
 
-USE_READLINK(NEWTOY(readlink, "<1>1fenq[-fe]", TOYFLAG_BIN))
+USE_READLINK(NEWTOY(readlink, "<1>1fenq[-fe]", TOYFLAG_USR|TOYFLAG_BIN))
 
 config READLINK
   bool "readlink"
diff --git a/toys/other/reboot.c b/toys/other/reboot.c
index 8baa4d8..a135888 100644
--- a/toys/other/reboot.c
+++ b/toys/other/reboot.c
@@ -2,9 +2,9 @@
  *
  * Copyright 2013 Elie De Brauwer <eliedebrauwer@gmail.com>
 
-USE_REBOOT(NEWTOY(reboot, "n", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
-USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_BIN|TOYFLAG_NEEDROOT))
-USE_REBOOT(OLDTOY(poweroff, reboot, TOYFLAG_BIN|TOYFLAG_NEEDROOT))
+USE_REBOOT(NEWTOY(reboot, "n", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
+USE_REBOOT(OLDTOY(halt, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
+USE_REBOOT(OLDTOY(poweroff, reboot, TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
 
 config REBOOT
   bool "reboot"
diff --git a/toys/other/rfkill.c b/toys/other/rfkill.c
index af3efe1..7527ec7 100644
--- a/toys/other/rfkill.c
+++ b/toys/other/rfkill.c
@@ -5,7 +5,7 @@
  *
  * No Standard
 
-USE_RFKILL(NEWTOY(rfkill, "<1>2", TOYFLAG_SBIN))
+USE_RFKILL(NEWTOY(rfkill, "<1>2", TOYFLAG_USR|TOYFLAG_SBIN))
 
 config RFKILL
   bool "rfkill"
diff --git a/toys/other/rmmod.c b/toys/other/rmmod.c
index b789acc..10c134c 100644
--- a/toys/other/rmmod.c
+++ b/toys/other/rmmod.c
@@ -2,7 +2,7 @@
  *
  * Copyright 2012 Elie De Brauwer <eliedebrauwer@gmail.com>
 
-USE_RMMOD(NEWTOY(rmmod, "<1wf", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
+USE_RMMOD(NEWTOY(rmmod, "<1wf", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
 
 config RMMOD
   bool "rmmod"
diff --git a/toys/other/swapoff.c b/toys/other/swapoff.c
index b89e915..fb17130 100644
--- a/toys/other/swapoff.c
+++ b/toys/other/swapoff.c
@@ -2,7 +2,7 @@
  *
  * Copyright 2012 Elie De Brauwer <eliedebrauwer@gmail.com>
 
-USE_SWAPOFF(NEWTOY(swapoff, "<1>1", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
+USE_SWAPOFF(NEWTOY(swapoff, "<1>1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
 
 config SWAPOFF
   bool "swapoff"
diff --git a/toys/other/swapon.c b/toys/other/swapon.c
index 49f1249..838d382 100644
--- a/toys/other/swapon.c
+++ b/toys/other/swapon.c
@@ -2,7 +2,7 @@
  *
  * Copyright 2012 Elie De Brauwer <eliedebrauwer@gmail.com>
 
-USE_SWAPON(NEWTOY(swapon, "<1>1p#<0>32767", TOYFLAG_BIN|TOYFLAG_NEEDROOT))
+USE_SWAPON(NEWTOY(swapon, "<1>1p#<0>32767", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
 
 config SWAPON
   bool "swapon"
diff --git a/toys/other/sysctl.c b/toys/other/sysctl.c
index 8e57ca1..0c6c640 100644
--- a/toys/other/sysctl.c
+++ b/toys/other/sysctl.c
@@ -5,7 +5,7 @@
  *
  * No Standard
  
-USE_SYSCTL(NEWTOY(sysctl, "^neNqwpaA[!ap][!aq][!aw][+aA]", TOYFLAG_USR|TOYFLAG_BIN))
+USE_SYSCTL(NEWTOY(sysctl, "^neNqwpaA[!ap][!aq][!aw][+aA]", TOYFLAG_SBIN))
 
 config SYSCTL
   bool "sysctl"
diff --git a/toys/posix/cut.c b/toys/posix/cut.c
index 7f10c5e..1ab3ce8 100644
--- a/toys/posix/cut.c
+++ b/toys/posix/cut.c
@@ -5,7 +5,7 @@
  *
  * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cut.html 
 
-USE_CUT(NEWTOY(cut, "b:|c:|f:|d:sn[!cbf]", TOYFLAG_BIN))
+USE_CUT(NEWTOY(cut, "b:|c:|f:|d:sn[!cbf]", TOYFLAG_USR|TOYFLAG_BIN))
 
 config CUT
   bool "cut"
diff --git a/toys/posix/df.c b/toys/posix/df.c
index 141e8e5..5d37b45 100644
--- a/toys/posix/df.c
+++ b/toys/posix/df.c
@@ -4,7 +4,7 @@
  *
  * See http://opengroup.org/onlinepubs/9699919799/utilities/df.html
 
-USE_DF(NEWTOY(df, "Pkt*a[-Pk]", TOYFLAG_USR|TOYFLAG_SBIN))
+USE_DF(NEWTOY(df, "Pkt*a[-Pk]", TOYFLAG_BIN))
 
 config DF
   bool "df"
diff --git a/toys/posix/head.c b/toys/posix/head.c
index e8517d4..3ac4373 100644
--- a/toys/posix/head.c
+++ b/toys/posix/head.c
@@ -4,7 +4,7 @@
  *
  * See http://opengroup.org/onlinepubs/9699919799/utilities/head.html
 
-USE_HEAD(NEWTOY(head, "n#<0=10", TOYFLAG_BIN))
+USE_HEAD(NEWTOY(head, "n#<0=10", TOYFLAG_USR|TOYFLAG_BIN))
 
 config HEAD
   bool "head"
diff --git a/toys/posix/id.c b/toys/posix/id.c
index 353aa04..7ab489e 100644
--- a/toys/posix/id.c
+++ b/toys/posix/id.c
@@ -6,10 +6,10 @@
  *
  * See http://opengroup.org/onlinepubs/9699919799/utilities/id.html
 
-USE_ID(NEWTOY(id, ">1"USE_ID_SELINUX("Z")"nGgru[!"USE_ID_SELINUX("Z")"Ggu]", TOYFLAG_BIN))
+USE_ID(NEWTOY(id, ">1"USE_ID_SELINUX("Z")"nGgru[!"USE_ID_SELINUX("Z")"Ggu]", TOYFLAG_USR|TOYFLAG_BIN))
 USE_GROUPS(NEWTOY(groups, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-USE_LOGNAME(NEWTOY(logname, ">0", TOYFLAG_BIN))
-USE_WHOAMI(OLDTOY(whoami, logname, TOYFLAG_BIN))
+USE_LOGNAME(NEWTOY(logname, ">0", TOYFLAG_USR|TOYFLAG_BIN))
+USE_WHOAMI(OLDTOY(whoami, logname, TOYFLAG_USR|TOYFLAG_BIN))
 
 config ID
   bool "id"
diff --git a/toys/posix/mkfifo.c b/toys/posix/mkfifo.c
index 15fab70..4e0fca3 100644
--- a/toys/posix/mkfifo.c
+++ b/toys/posix/mkfifo.c
@@ -4,7 +4,7 @@
  *
  * See http://opengroup.org/onlinepubs/9699919799/utilities/mkfifo.html
 
-USE_MKFIFO(NEWTOY(mkfifo, "<1m:", TOYFLAG_BIN))
+USE_MKFIFO(NEWTOY(mkfifo, "<1m:", TOYFLAG_USR|TOYFLAG_BIN))
 
 config MKFIFO
   bool "mkfifo"
diff --git a/toys/posix/renice.c b/toys/posix/renice.c
index 8c20644..489eb13 100644
--- a/toys/posix/renice.c
+++ b/toys/posix/renice.c
@@ -4,7 +4,7 @@
  *
  * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/renice.html
 
-USE_RENICE(NEWTOY(renice, "<1gpun#|", TOYFLAG_BIN))
+USE_RENICE(NEWTOY(renice, "<1gpun#|", TOYFLAG_USR|TOYFLAG_BIN))
 
 config RENICE
   bool "renice"
diff --git a/toys/posix/tail.c b/toys/posix/tail.c
index e92c044..ba1d311 100644
--- a/toys/posix/tail.c
+++ b/toys/posix/tail.c
@@ -4,7 +4,7 @@
  *
  * See http://opengroup.org/onlinepubs/9699919799/utilities/tail.html
 
-USE_TAIL(NEWTOY(tail, "fc-n-[-cn]", TOYFLAG_BIN))
+USE_TAIL(NEWTOY(tail, "fc-n-[-cn]", TOYFLAG_USR|TOYFLAG_BIN))
 
 config TAIL
   bool "tail"
diff --git a/toys/posix/tee.c b/toys/posix/tee.c
index 0388510..5574088 100644
--- a/toys/posix/tee.c
+++ b/toys/posix/tee.c
@@ -4,7 +4,7 @@
  *
  * See http://opengroup.org/onlinepubs/9699919799/utilities/tee.html
 
-USE_TEE(NEWTOY(tee, "ia", TOYFLAG_BIN))
+USE_TEE(NEWTOY(tee, "ia", TOYFLAG_USR|TOYFLAG_BIN))
 
 config TEE
   bool "tee"
diff --git a/toys/posix/uniq.c b/toys/posix/uniq.c
index 3cfdb94..c127cfe 100644
--- a/toys/posix/uniq.c
+++ b/toys/posix/uniq.c
@@ -4,7 +4,7 @@
  *
  * See http://opengroup.org/onlinepubs/9699919799/utilities/uniq.html
 
-USE_UNIQ(NEWTOY(uniq, "f#s#w#zicdu", TOYFLAG_BIN))
+USE_UNIQ(NEWTOY(uniq, "f#s#w#zicdu", TOYFLAG_USR|TOYFLAG_BIN))
 
 config UNIQ
   bool "uniq"
diff --git a/toys/posix/who.c b/toys/posix/who.c
index 876a562..414cdfc 100644
--- a/toys/posix/who.c
+++ b/toys/posix/who.c
@@ -9,7 +9,7 @@
  * Posix says to support many options (-abdHlmpqrstTu) but this
  * isn't aimed at minicomputers with modem pools.
 
-USE_WHO(NEWTOY(who, "a", TOYFLAG_BIN))
+USE_WHO(NEWTOY(who, "a", TOYFLAG_USR|TOYFLAG_BIN))
 
 config WHO
   bool "who"
-- 
1.8.1.2