$ make defconfig
$ make
$ ./busybox pwd
/home/beyes/tools/busybox-1.18.3
$ ./busybox ls /
bin etc lost+found opt sbin sys var
boot home media proc selinux tmp
dev lib mnt root srv usr
$ make menuconfig
$ make
$ make install
beyes@linux-kd1q:~/tools/busybox-1.18.3> ll _install/
total 12
drwxr-xr-x 2 beyes users 4096 2011-02-28 11:00 bin
lrwxrwxrwx 1 beyes users 11 2011-02-28 11:00 linuxrc -> bin/busybox
drwxr-xr-x 2 beyes users 4096 2011-02-28 11:00 sbin
drwxr-xr-x 4 beyes users 4096 2011-02-28 11:01 usr
$ make PREFIX=/tmp/busybox insall
beyes@linux-kd1q:~/tools/busybox-1.18.3> ./busybox wget --help
BusyBox v1.18.3 (2011-02-28 10:58:22 EST) multi-call binary.
Usage: wget [-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document FILE]
[--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
[--no-check-certificate] [-U|--user-agent AGENT][-T SEC] URL
Retrieve files via HTTP or FTP
Options:
-s Spider mode - only check file existence
-c Continue retrieval of aborted transfer
-q Quiet
-P DIR Save to DIR (default .)
-T SEC Network read timeout is SEC seconds
-O FILE Save to FILE ('-' for stdout)
-U STR Use STR for User-Agent header
-Y Use proxy ('on' or 'off')
#include "busybox.h"
int hellobbox_main (int argc, char **argv)
{
int i;
printf ("hello busybox, arg list belowing:\n");
for (i = 0; i < argc; i++) {
printf ("arg[%d] : %s\n", i, argv[i]);
}
return (0);
}
config HELLOBBOX
bool "hellobbox"
default n
help
This is a test command
lib-$(CONFIG_HELLOBBOX) += hellobbox.o
IF_HELLOBBOX(APPLET(hellobbox, _BB_DIR_BIN, _BB_SUID_DROP))
#define hellobbox_trivial_usage "None"
#define hellobbox_full_usage "None"
beyes@linux-kd1q:~/tools/busybox-1.18.3/_install> ls bin/ |grep hello
hellobbox
beyes@linux-kd1q:~/tools/busybox-1.18.3> ./busybox hellobbox are you ok
hello busybox, arg list belowing:
arg[0] : hellobbox
arg[1] : are
arg[2] : you
arg[3] : ok
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |