diff options
Diffstat (limited to 'applets')
-rw-r--r-- | applets/busybox.c | 222 | ||||
-rwxr-xr-x | applets/busybox.mkll | 16 | ||||
-rwxr-xr-x | applets/busybox.sh | 5 |
3 files changed, 134 insertions, 109 deletions
diff --git a/applets/busybox.c b/applets/busybox.c index 9aa46eaae..7582647d5 100644 --- a/applets/busybox.c +++ b/applets/busybox.c | |||
@@ -34,282 +34,304 @@ int atexit(void (*__func) (void)) | |||
34 | void *__libc_stack_end; | 34 | void *__libc_stack_end; |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | |||
38 | static const struct Applet applets[] = { | 37 | static const struct Applet applets[] = { |
39 | 38 | ||
40 | #ifdef BB_BASENAME //usr/bin/basename | 39 | #ifdef BB_BASENAME //usr/bin/basename |
41 | {"basename", basename_main}, | 40 | {"basename", basename_main, _BB_DIR_USR_BIN}, |
42 | #endif | 41 | #endif |
43 | #ifdef BB_BUSYBOX //bin | 42 | #ifdef BB_BUSYBOX //bin |
44 | {"busybox", busybox_main}, | 43 | {"busybox", busybox_main, _BB_DIR_BIN}, |
45 | #endif | 44 | #endif |
46 | #ifdef BB_BLOCK_DEVICE //sbin | 45 | #ifdef BB_BLOCK_DEVICE //sbin |
47 | {"block_device", block_device_main}, | 46 | {"block_device", block_device_main, _BB_DIR_SBIN}, |
48 | #endif | 47 | #endif |
49 | #ifdef BB_CAT //bin | 48 | #ifdef BB_CAT //bin |
50 | {"cat", cat_main}, | 49 | {"cat", cat_main, _BB_DIR_BIN}, |
50 | #endif | ||
51 | #ifdef BB_CHMOD_CHOWN_CHGRP //bin | ||
52 | {"chmod", chmod_chown_chgrp_main, _BB_DIR_BIN}, | ||
53 | #endif | ||
54 | #ifdef BB_CHMOD_CHOWN_CHGRP //bin | ||
55 | {"chown", chmod_chown_chgrp_main, _BB_DIR_BIN}, | ||
51 | #endif | 56 | #endif |
52 | #ifdef BB_CHMOD_CHOWN_CHGRP //bin | 57 | #ifdef BB_CHMOD_CHOWN_CHGRP //bin |
53 | {"chmod", chmod_chown_chgrp_main}, | 58 | {"chgrp", chmod_chown_chgrp_main, _BB_DIR_BIN}, |
54 | {"chown", chmod_chown_chgrp_main}, | ||
55 | {"chgrp", chmod_chown_chgrp_main}, | ||
56 | #endif | 59 | #endif |
57 | #ifdef BB_CHROOT //sbin | 60 | #ifdef BB_CHROOT //sbin |
58 | {"chroot", chroot_main}, | 61 | {"chroot", chroot_main, _BB_DIR_SBIN}, |
59 | #endif | 62 | #endif |
60 | #ifdef BB_CLEAR //usr/bin | 63 | #ifdef BB_CLEAR //usr/bin |
61 | {"clear", clear_main}, | 64 | {"clear", clear_main, _BB_DIR_USR_BIN}, |
62 | #endif | 65 | #endif |
63 | #ifdef BB_CHVT //usr/bin | 66 | #ifdef BB_CHVT //usr/bin |
64 | {"chvt", chvt_main}, | 67 | {"chvt", chvt_main, _BB_DIR_USR_BIN}, |
65 | #endif | 68 | #endif |
66 | #ifdef BB_CP_MV //bin | 69 | #ifdef BB_CP_MV //bin |
67 | {"cp", cp_mv_main}, | 70 | {"cp", cp_mv_main, _BB_DIR_BIN}, |
68 | {"mv", cp_mv_main}, | 71 | #endif |
72 | #ifdef BB_CP_MV //bin | ||
73 | {"mv", cp_mv_main, _BB_DIR_BIN}, | ||
69 | #endif | 74 | #endif |
70 | #ifdef BB_DATE //bin | 75 | #ifdef BB_DATE //bin |
71 | {"date", date_main}, | 76 | {"date", date_main, _BB_DIR_BIN}, |
72 | #endif | 77 | #endif |
73 | #ifdef BB_DD //bin | 78 | #ifdef BB_DD //bin |
74 | {"dd", dd_main}, | 79 | {"dd", dd_main, _BB_DIR_BIN}, |
75 | #endif | 80 | #endif |
76 | #ifdef BB_DF //bin | 81 | #ifdef BB_DF //bin |
77 | {"df", df_main}, | 82 | {"df", df_main, _BB_DIR_BIN}, |
78 | #endif | 83 | #endif |
79 | #ifdef BB_DIRNAME //usr/bin | 84 | #ifdef BB_DIRNAME //usr/bin |
80 | {"dirname", dirname_main}, | 85 | {"dirname", dirname_main, _BB_DIR_USR_BIN}, |
81 | #endif | 86 | #endif |
82 | #ifdef BB_DMESG //bin | 87 | #ifdef BB_DMESG //bin |
83 | {"dmesg", dmesg_main}, | 88 | {"dmesg", dmesg_main, _BB_DIR_BIN}, |
84 | #endif | 89 | #endif |
85 | #ifdef BB_DU //bin | 90 | #ifdef BB_DU //bin |
86 | {"du", du_main}, | 91 | {"du", du_main, _BB_DIR_BIN}, |
87 | #endif | 92 | #endif |
88 | #ifdef BB_DUTMP //usr/sbin | 93 | #ifdef BB_DUTMP //usr/sbin |
89 | {"dutmp", dutmp_main}, | 94 | {"dutmp", dutmp_main, _BB_DIR_USR_SBIN}, |
95 | #endif | ||
96 | #ifdef BB_ECHO //bin | ||
97 | {"echo", echo_main, _BB_DIR_BIN}, | ||
90 | #endif | 98 | #endif |
91 | #ifdef BB_FBSET //usr/sbin | 99 | #ifdef BB_FBSET //usr/sbin |
92 | {"fbset", fbset_main}, | 100 | {"fbset", fbset_main, _BB_DIR_USR_SBIN}, |
93 | #endif | 101 | #endif |
94 | #ifdef BB_FDFLUSH //bin | 102 | #ifdef BB_FDFLUSH //bin |
95 | {"fdflush", fdflush_main}, | 103 | {"fdflush", fdflush_main, _BB_DIR_BIN}, |
96 | #endif | 104 | #endif |
97 | #ifdef BB_FIND //usr/bin | 105 | #ifdef BB_FIND //usr/bin |
98 | {"find", find_main}, | 106 | {"find", find_main, _BB_DIR_USR_BIN}, |
99 | #endif | 107 | #endif |
100 | #ifdef BB_FREE //usr/bin | 108 | #ifdef BB_FREE //usr/bin |
101 | {"free", free_main}, | 109 | {"free", free_main, _BB_DIR_USR_BIN}, |
102 | #endif | 110 | #endif |
103 | #ifdef BB_FREERAMDISK //sbin | 111 | #ifdef BB_FREERAMDISK //sbin |
104 | {"freeramdisk", freeramdisk_main}, | 112 | {"freeramdisk", freeramdisk_main, _BB_DIR_SBIN}, |
105 | #endif | 113 | #endif |
106 | #ifdef BB_DEALLOCVT //usr/bin | 114 | #ifdef BB_DEALLOCVT //usr/bin |
107 | {"deallocvt", deallocvt_main}, | 115 | {"deallocvt", deallocvt_main, _BB_DIR_USR_BIN}, |
108 | #endif | 116 | #endif |
109 | #ifdef BB_FSCK_MINIX //sbin | 117 | #ifdef BB_FSCK_MINIX //sbin |
110 | {"fsck.minix", fsck_minix_main}, | 118 | {"fsck.minix", fsck_minix_main, _BB_DIR_SBIN}, |
111 | #endif | 119 | #endif |
112 | #ifdef BB_MKFS_MINIX //sbin | 120 | #ifdef BB_MKFS_MINIX //sbin |
113 | {"mkfs.minix", mkfs_minix_main}, | 121 | {"mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN}, |
114 | #endif | 122 | #endif |
115 | #ifdef BB_GREP //bin | 123 | #ifdef BB_GREP //bin |
116 | {"grep", grep_main}, | 124 | {"grep", grep_main, _BB_DIR_BIN}, |
117 | #endif | 125 | #endif |
118 | #ifdef BB_HALT //sbin | 126 | #ifdef BB_HALT //sbin |
119 | {"halt", halt_main}, | 127 | {"halt", halt_main, _BB_DIR_SBIN}, |
120 | #endif | 128 | #endif |
121 | #ifdef BB_HEAD //bin | 129 | #ifdef BB_HEAD //bin |
122 | {"head", head_main}, | 130 | {"head", head_main, _BB_DIR_BIN}, |
123 | #endif | 131 | #endif |
124 | #ifdef BB_HOSTID //usr/bin | 132 | #ifdef BB_HOSTID //usr/bin |
125 | {"hostid", hostid_main}, | 133 | {"hostid", hostid_main, _BB_DIR_USR_BIN}, |
126 | #endif | 134 | #endif |
127 | #ifdef BB_HOSTNAME //bin | 135 | #ifdef BB_HOSTNAME //bin |
128 | {"hostname", hostname_main}, | 136 | {"hostname", hostname_main, _BB_DIR_BIN}, |
129 | #endif | 137 | #endif |
130 | #ifdef BB_INIT //sbin | 138 | #ifdef BB_INIT //sbin |
131 | {"init", init_main}, | 139 | {"init", init_main, _BB_DIR_SBIN}, |
132 | #endif | 140 | #endif |
133 | #ifdef BB_INSMOD //sbin | 141 | #ifdef BB_INSMOD //sbin |
134 | {"insmod", insmod_main}, | 142 | {"insmod", insmod_main, _BB_DIR_SBIN}, |
135 | #endif | 143 | #endif |
136 | #ifdef BB_FEATURE_LINUXRC // | 144 | #ifdef BB_FEATURE_LINUXRC // |
137 | {"linuxrc", init_main}, | 145 | {"linuxrc", init_main, _BB_DIR_ROOT}, |
138 | #endif | 146 | #endif |
139 | #ifdef BB_KILL //bin | 147 | #ifdef BB_KILL //bin |
140 | {"kill", kill_main}, | 148 | {"kill", kill_main, _BB_DIR_BIN}, |
141 | #endif | 149 | #endif |
142 | #ifdef BB_KILLALL //usr/bin | 150 | #ifdef BB_KILLALL //usr/bin |
143 | {"killall", kill_main}, | 151 | {"killall", kill_main, _BB_DIR_USR_BIN}, |
144 | #endif | 152 | #endif |
145 | #ifdef BB_LENGTH //usr/bin | 153 | #ifdef BB_LENGTH //usr/bin |
146 | {"length", length_main}, | 154 | {"length", length_main, _BB_DIR_USR_BIN}, |
147 | #endif | 155 | #endif |
148 | #ifdef BB_LN //bin | 156 | #ifdef BB_LN //bin |
149 | {"ln", ln_main}, | 157 | {"ln", ln_main, _BB_DIR_BIN}, |
150 | #endif | 158 | #endif |
151 | #ifdef BB_LOADACM //usr/bin | 159 | #ifdef BB_LOADACM //usr/bin |
152 | {"loadacm", loadacm_main}, | 160 | {"loadacm", loadacm_main, _BB_DIR_USR_BIN}, |
153 | #endif | 161 | #endif |
154 | #ifdef BB_LOADFONT //usr/bin | 162 | #ifdef BB_LOADFONT //usr/bin |
155 | {"loadfont", loadfont_main}, | 163 | {"loadfont", loadfont_main, _BB_DIR_USR_BIN}, |
156 | #endif | 164 | #endif |
157 | #ifdef BB_LOADKMAP //sbin | 165 | #ifdef BB_LOADKMAP //sbin |
158 | {"loadkmap", loadkmap_main}, | 166 | {"loadkmap", loadkmap_main, _BB_DIR_SBIN}, |
159 | #endif | 167 | #endif |
160 | #ifdef BB_LS //bin | 168 | #ifdef BB_LS //bin |
161 | {"ls", ls_main}, | 169 | {"ls", ls_main, _BB_DIR_BIN}, |
162 | #endif | 170 | #endif |
163 | #ifdef BB_LSMOD //sbin | 171 | #ifdef BB_LSMOD //sbin |
164 | {"lsmod", lsmod_main}, | 172 | {"lsmod", lsmod_main, _BB_DIR_SBIN}, |
165 | #endif | 173 | #endif |
166 | #ifdef BB_MAKEDEVS //sbin | 174 | #ifdef BB_MAKEDEVS //sbin |
167 | {"makedevs", makedevs_main}, | 175 | {"makedevs", makedevs_main, _BB_DIR_SBIN}, |
168 | #endif | 176 | #endif |
169 | #ifdef BB_MATH //usr/bin | 177 | #ifdef BB_MATH //usr/bin |
170 | {"math", math_main}, | 178 | {"math", math_main, _BB_DIR_USR_BIN}, |
171 | #endif | 179 | #endif |
172 | #ifdef BB_MKDIR //bin | 180 | #ifdef BB_MKDIR //bin |
173 | {"mkdir", mkdir_main}, | 181 | {"mkdir", mkdir_main, _BB_DIR_BIN}, |
174 | #endif | 182 | #endif |
175 | #ifdef BB_MKFIFO //usr/bin | 183 | #ifdef BB_MKFIFO //usr/bin |
176 | {"mkfifo", mkfifo_main}, | 184 | {"mkfifo", mkfifo_main, _BB_DIR_USR_BIN}, |
177 | #endif | 185 | #endif |
178 | #ifdef BB_MKNOD //bin | 186 | #ifdef BB_MKNOD //bin |
179 | {"mknod", mknod_main}, | 187 | {"mknod", mknod_main, _BB_DIR_BIN}, |
180 | #endif | 188 | #endif |
181 | #ifdef BB_MKSWAP //sbin | 189 | #ifdef BB_MKSWAP //sbin |
182 | {"mkswap", mkswap_main}, | 190 | {"mkswap", mkswap_main, _BB_DIR_SBIN}, |
183 | #endif | 191 | #endif |
184 | #ifdef BB_MNC //usr/bin | 192 | #ifdef BB_MNC //usr/bin |
185 | {"mnc", mnc_main}, | 193 | {"mnc", mnc_main, _BB_DIR_USR_BIN}, |
186 | #endif | 194 | #endif |
187 | #ifdef BB_MORE //bin | 195 | #ifdef BB_MORE //bin |
188 | {"more", more_main}, | 196 | {"more", more_main, _BB_DIR_BIN}, |
189 | #endif | 197 | #endif |
190 | #ifdef BB_MOUNT //bin | 198 | #ifdef BB_MOUNT //bin |
191 | {"mount", mount_main}, | 199 | {"mount", mount_main, _BB_DIR_BIN}, |
192 | #endif | 200 | #endif |
193 | #ifdef BB_MT //bin | 201 | #ifdef BB_MT //bin |
194 | {"mt", mt_main}, | 202 | {"mt", mt_main, _BB_DIR_BIN}, |
195 | #endif | 203 | #endif |
196 | #ifdef BB_NSLOOKUP //usr/bin | 204 | #ifdef BB_NSLOOKUP //usr/bin |
197 | {"nslookup", nslookup_main}, | 205 | {"nslookup", nslookup_main, _BB_DIR_USR_BIN}, |
198 | #endif | 206 | #endif |
199 | #ifdef BB_PING //bin | 207 | #ifdef BB_PING //bin |
200 | {"ping", ping_main}, | 208 | {"ping", ping_main, _BB_DIR_BIN}, |
201 | #endif | 209 | #endif |
202 | #ifdef BB_POWEROFF //sbin | 210 | #ifdef BB_POWEROFF //sbin |
203 | {"poweroff", poweroff_main}, | 211 | {"poweroff", poweroff_main, _BB_DIR_SBIN}, |
204 | #endif | 212 | #endif |
205 | #ifdef BB_PRINTF //usr/bin | 213 | #ifdef BB_PRINTF //usr/bin |
206 | {"printf", printf_main}, | 214 | {"printf", printf_main, _BB_DIR_USR_BIN}, |
207 | #endif | 215 | #endif |
208 | #ifdef BB_PS //bin | 216 | #ifdef BB_PS //bin |
209 | {"ps", ps_main}, | 217 | {"ps", ps_main, _BB_DIR_BIN}, |
210 | #endif | 218 | #endif |
211 | #ifdef BB_PWD //bin | 219 | #ifdef BB_PWD //bin |
212 | {"pwd", pwd_main}, | 220 | {"pwd", pwd_main, _BB_DIR_BIN}, |
213 | #endif | 221 | #endif |
214 | #ifdef BB_REBOOT //sbin | 222 | #ifdef BB_REBOOT //sbin |
215 | {"reboot", reboot_main}, | 223 | {"reboot", reboot_main, _BB_DIR_SBIN}, |
216 | #endif | 224 | #endif |
217 | #ifdef BB_RM //bin | 225 | #ifdef BB_RM //bin |
218 | {"rm", rm_main}, | 226 | {"rm", rm_main, _BB_DIR_BIN}, |
219 | #endif | 227 | #endif |
220 | #ifdef BB_RMDIR //bin | 228 | #ifdef BB_RMDIR //bin |
221 | {"rmdir", rmdir_main}, | 229 | {"rmdir", rmdir_main, _BB_DIR_BIN}, |
222 | #endif | 230 | #endif |
223 | #ifdef BB_RMMOD //sbin | 231 | #ifdef BB_RMMOD //sbin |
224 | {"rmmod", rmmod_main}, | 232 | {"rmmod", rmmod_main, _BB_DIR_SBIN}, |
225 | #endif | 233 | #endif |
226 | #ifdef BB_SED //bin | 234 | #ifdef BB_SED //bin |
227 | {"sed", sed_main}, | 235 | {"sed", sed_main, _BB_DIR_BIN}, |
228 | #endif | 236 | #endif |
229 | #ifdef BB_SH //bin | 237 | #ifdef BB_SH //bin |
230 | {"sh", shell_main}, | 238 | {"sh", shell_main, _BB_DIR_BIN}, |
231 | #endif | 239 | #endif |
232 | #ifdef BB_SFDISK //sbin | 240 | #ifdef BB_SFDISK //sbin |
233 | {"fdisk", sfdisk_main}, | 241 | {"fdisk", sfdisk_main, _BB_DIR_SBIN}, |
234 | {"sfdisk", sfdisk_main}, | 242 | #ifdef BB_SFDISK //sbin |
243 | #endif | ||
244 | {"sfdisk", sfdisk_main, _BB_DIR_SBIN}, | ||
235 | #endif | 245 | #endif |
236 | #ifdef BB_SLEEP //bin | 246 | #ifdef BB_SLEEP //bin |
237 | {"sleep", sleep_main}, | 247 | {"sleep", sleep_main, _BB_DIR_BIN}, |
238 | #endif | 248 | #endif |
239 | #ifdef BB_SORT //bin | 249 | #ifdef BB_SORT //bin |
240 | {"sort", sort_main}, | 250 | {"sort", sort_main, _BB_DIR_BIN}, |
241 | #endif | 251 | #endif |
242 | #ifdef BB_SYNC //bin | 252 | #ifdef BB_SYNC //bin |
243 | {"sync", sync_main}, | 253 | {"sync", sync_main, _BB_DIR_BIN}, |
244 | #endif | 254 | #endif |
245 | #ifdef BB_SYSLOGD //sbin | 255 | #ifdef BB_SYSLOGD //sbin |
246 | {"syslogd", syslogd_main}, | 256 | {"syslogd", syslogd_main, _BB_DIR_SBIN}, |
247 | #endif | 257 | #endif |
248 | #ifdef BB_LOGGER //usr/bin | 258 | #ifdef BB_LOGGER //usr/bin |
249 | {"logger", logger_main}, | 259 | {"logger", logger_main, _BB_DIR_USR_BIN}, |
250 | #endif | 260 | #endif |
251 | #ifdef BB_LOGNAME //usr/bin | 261 | #ifdef BB_LOGNAME //usr/bin |
252 | {"logname", logname_main}, | 262 | {"logname", logname_main, _BB_DIR_USR_BIN}, |
263 | #endif | ||
264 | #ifdef BB_SWAPONOFF //sbin | ||
265 | {"swapon", swap_on_off_main, _BB_DIR_SBIN}, | ||
253 | #endif | 266 | #endif |
254 | #ifdef BB_SWAPONOFF //sbin | 267 | #ifdef BB_SWAPONOFF //sbin |
255 | {"swapon", swap_on_off_main}, | 268 | {"swapoff", swap_on_off_main, _BB_DIR_SBIN}, |
256 | {"swapoff", swap_on_off_main}, | ||
257 | #endif | 269 | #endif |
258 | #ifdef BB_TAIL //usr/bin | 270 | #ifdef BB_TAIL //usr/bin |
259 | {"tail", tail_main}, | 271 | {"tail", tail_main, _BB_DIR_USR_BIN}, |
260 | #endif | 272 | #endif |
261 | #ifdef BB_TAR //bin | 273 | #ifdef BB_TAR //bin |
262 | {"tar", tar_main}, | 274 | {"tar", tar_main, _BB_DIR_BIN}, |
263 | #endif | 275 | #endif |
264 | #ifdef BB_TELNET //usr/bin | 276 | #ifdef BB_TELNET //usr/bin |
265 | {"telnet", telnet_main}, | 277 | {"telnet", telnet_main, _BB_DIR_USR_BIN}, |
278 | #endif | ||
279 | #ifdef BB_TEST //usr/bin | ||
280 | {"[", test_main, _BB_DIR_USR_BIN}, | ||
281 | #endif | ||
282 | #ifdef BB_TEST //usr/bin | ||
283 | {"test", test_main, _BB_DIR_USR_BIN}, | ||
266 | #endif | 284 | #endif |
267 | #ifdef BB_TEE //bin | 285 | #ifdef BB_TEE //bin |
268 | {"tee", tee_main}, | 286 | {"tee", tee_main, _BB_DIR_BIN}, |
269 | #endif | 287 | #endif |
270 | #ifdef BB_TOUCH //usr/bin | 288 | #ifdef BB_TOUCH //usr/bin |
271 | {"touch", touch_main}, | 289 | {"touch", touch_main, _BB_DIR_USR_BIN}, |
272 | #endif | 290 | #endif |
273 | #ifdef BB_TR //usr/bin | 291 | #ifdef BB_TR //usr/bin |
274 | {"tr", tr_main}, | 292 | {"tr", tr_main, _BB_DIR_USR_BIN}, |
275 | #endif | 293 | #endif |
276 | #ifdef BB_TRUE_FALSE //bin | 294 | #ifdef BB_TRUE_FALSE //bin |
277 | {"true", true_main}, | 295 | {"true", true_main, _BB_DIR_BIN}, |
278 | {"false", false_main}, | 296 | #endif |
297 | #ifdef BB_TRUE_FALSE //bin | ||
298 | {"false", false_main, _BB_DIR_BIN}, | ||
279 | #endif | 299 | #endif |
280 | #ifdef BB_TTY //usr/bin | 300 | #ifdef BB_TTY //usr/bin |
281 | {"tty", tty_main}, | 301 | {"tty", tty_main, _BB_DIR_USR_BIN}, |
282 | #endif | 302 | #endif |
283 | #ifdef BB_UMOUNT //bin | 303 | #ifdef BB_UMOUNT //bin |
284 | {"umount", umount_main}, | 304 | {"umount", umount_main, _BB_DIR_BIN}, |
285 | #endif | 305 | #endif |
286 | #ifdef BB_UNAME //bin | 306 | #ifdef BB_UNAME //bin |
287 | {"uname", uname_main}, | 307 | {"uname", uname_main, _BB_DIR_BIN}, |
288 | #endif | 308 | #endif |
289 | #ifdef BB_UPTIME //usr/bin | 309 | #ifdef BB_UPTIME //usr/bin |
290 | {"uptime", uptime_main}, | 310 | {"uptime", uptime_main, _BB_DIR_USR_BIN}, |
291 | #endif | 311 | #endif |
292 | #ifdef BB_UNIQ //bin | 312 | #ifdef BB_UNIQ //bin |
293 | {"uniq", uniq_main}, | 313 | {"uniq", uniq_main, _BB_DIR_BIN}, |
294 | #endif | 314 | #endif |
295 | #ifdef BB_UPDATE //sbin | 315 | #ifdef BB_UPDATE //sbin |
296 | {"update", update_main}, | 316 | {"update", update_main, _BB_DIR_SBIN}, |
297 | #endif | 317 | #endif |
298 | #ifdef BB_WC //usr/bin | 318 | #ifdef BB_WC //usr/bin |
299 | {"wc", wc_main}, | 319 | {"wc", wc_main, _BB_DIR_USR_BIN}, |
300 | #endif | 320 | #endif |
301 | #ifdef BB_WHOAMI //usr/bin | 321 | #ifdef BB_WHOAMI //usr/bin |
302 | {"whoami", whoami_main}, | 322 | {"whoami", whoami_main, _BB_DIR_USR_BIN}, |
303 | #endif | 323 | #endif |
304 | #ifdef BB_YES //usr/bin | 324 | #ifdef BB_YES //usr/bin |
305 | {"yes", yes_main}, | 325 | {"yes", yes_main, _BB_DIR_USR_BIN}, |
326 | #endif | ||
327 | #ifdef BB_GUNZIP //bin | ||
328 | {"zcat", gunzip_main, _BB_DIR_BIN}, | ||
306 | #endif | 329 | #endif |
307 | #ifdef BB_GUNZIP //bin | 330 | #ifdef BB_GUNZIP //bin |
308 | {"zcat", gunzip_main}, | 331 | {"gunzip", gunzip_main, _BB_DIR_BIN}, |
309 | {"gunzip", gunzip_main}, | ||
310 | #endif | 332 | #endif |
311 | #ifdef BB_GZIP //bin | 333 | #ifdef BB_GZIP //bin |
312 | {"gzip", gzip_main}, | 334 | {"gzip", gzip_main, _BB_DIR_BIN}, |
313 | #endif | 335 | #endif |
314 | {0} | 336 | {0} |
315 | }; | 337 | }; |
@@ -318,11 +340,11 @@ static const struct Applet applets[] = { | |||
318 | 340 | ||
319 | int main(int argc, char **argv) | 341 | int main(int argc, char **argv) |
320 | { | 342 | { |
321 | char *s = argv[0]; | 343 | char *s; |
322 | char *name = argv[0]; | 344 | char *name; |
323 | const struct Applet *a = applets; | 345 | const struct Applet *a = applets; |
324 | 346 | ||
325 | while (*s != '\0') { | 347 | for (s = name = argv[0]; *s != '\0';) { |
326 | if (*s++ == '/') | 348 | if (*s++ == '/') |
327 | name = s; | 349 | name = s; |
328 | } | 350 | } |
diff --git a/applets/busybox.mkll b/applets/busybox.mkll index c4420f50d..fa1bff209 100755 --- a/applets/busybox.mkll +++ b/applets/busybox.mkll | |||
@@ -4,12 +4,16 @@ | |||
4 | DF="busybox.def.h" | 4 | DF="busybox.def.h" |
5 | MF="busybox.c" | 5 | MF="busybox.c" |
6 | 6 | ||
7 | LIST="$(sed -n '/^#define/{s/^#define //p;}' $DF)" | 7 | LIST="$(sed -n '/^#define/{s/^#define BB_FEATURE_.*//g;s/^#define //p;}' $DF)" |
8 | 8 | ||
9 | for def in ${LIST}; do | 9 | for def in ${LIST}; do |
10 | i=`sed -n 's/^#ifdef \<'$def'\>.*\/\/\(.*$\)/\/\1\//gp' $MF` | 10 | i=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*\(_BB_DIR_[A-Z_]*\).*$/\2\/\1/gp; }' $MF` |
11 | j=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*/\1/gp; }' $MF` | 11 | for j in $i; do |
12 | for k in $j; do | 12 | if [ -z $j ] ; then |
13 | echo $i$k | 13 | continue; |
14 | done | 14 | fi; |
15 | echo $j | sed -e 's/_BB_DIR_ROOT//g;s/_BB_DIR_BIN/\/bin/g;' \ | ||
16 | -e 's/_BB_DIR_SBIN/\/sbin/g;s/_BB_DIR_USR_BIN/\/usr\/bin/g;' \ | ||
17 | -e 's/_BB_DIR_USR_SBIN/\/usr\/sbin/g;' | ||
18 | done; | ||
15 | done | 19 | done |
diff --git a/applets/busybox.sh b/applets/busybox.sh index cab248f11..304ac87e7 100755 --- a/applets/busybox.sh +++ b/applets/busybox.sh | |||
@@ -1,4 +1,3 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | ls -1 `sed -n '/^#define/{s/.*BB_// ; s/$/.c/p; }' busybox.def.h | \ | 2 | sed -n -e 's/^#define.*BB_FEATURE.*$//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;' \ |
3 | tr [:upper:] [:lower:]` 2> /dev/null | sed -e 's/\.c$/\.o/g' | 3 | -e '/^#define/{s/.*bb_//;s/$/.o/p;}' busybox.def.h |
4 | |||