diff options
-rw-r--r-- | Makefile.custom | 2 | ||||
-rw-r--r-- | docs/busybox_footer.pod | 8 | ||||
-rw-r--r-- | examples/busybox.spec | 156 | ||||
-rw-r--r-- | include/usage.h | 84 |
4 files changed, 163 insertions, 87 deletions
diff --git a/Makefile.custom b/Makefile.custom index b0ef05627..fb9ec671c 100644 --- a/Makefile.custom +++ b/Makefile.custom | |||
@@ -133,7 +133,7 @@ docs/BusyBox.txt: docs/busybox.pod | |||
133 | docs/BusyBox.1: docs/busybox.pod | 133 | docs/BusyBox.1: docs/busybox.pod |
134 | $(disp_doc) | 134 | $(disp_doc) |
135 | $(Q)-mkdir -p docs | 135 | $(Q)-mkdir -p docs |
136 | $(Q)-pod2man --center=BusyBox --release="version $(VERSION)" $< > $@ | 136 | $(Q)-pod2man --center=BusyBox --release="version $(KERNELVERSION)" $< > $@ |
137 | 137 | ||
138 | docs/BusyBox.html: docs/busybox.net/BusyBox.html | 138 | docs/BusyBox.html: docs/busybox.net/BusyBox.html |
139 | $(disp_doc) | 139 | $(disp_doc) |
diff --git a/docs/busybox_footer.pod b/docs/busybox_footer.pod index faf7d9f3f..5ed937991 100644 --- a/docs/busybox_footer.pod +++ b/docs/busybox_footer.pod | |||
@@ -39,7 +39,7 @@ incorrect, please send in an update. | |||
39 | =for html <br> | 39 | =for html <br> |
40 | 40 | ||
41 | Emanuele Aina <emanuele.aina@tiscali.it> | 41 | Emanuele Aina <emanuele.aina@tiscali.it> |
42 | run-parts | 42 | run-parts |
43 | 43 | ||
44 | =for html <br> | 44 | =for html <br> |
45 | 45 | ||
@@ -97,7 +97,7 @@ Dave Cinege <dcinege@psychosis.com> | |||
97 | 97 | ||
98 | Jordan Crouse <jordan@cosmicpenguin.net> | 98 | Jordan Crouse <jordan@cosmicpenguin.net> |
99 | 99 | ||
100 | ipcalc | 100 | ipcalc |
101 | 101 | ||
102 | =for html <br> | 102 | =for html <br> |
103 | 103 | ||
@@ -146,7 +146,7 @@ Matt Kraai <kraai@alumni.cmu.edu> | |||
146 | 146 | ||
147 | Stephan Linz <linz@li-pro.net> | 147 | Stephan Linz <linz@li-pro.net> |
148 | 148 | ||
149 | ipcalc, Red Hat equivalence | 149 | ipcalc, Red Hat equivalence |
150 | 150 | ||
151 | =for html <br> | 151 | =for html <br> |
152 | 152 | ||
@@ -250,7 +250,7 @@ Enrique Zanardi <ezanardi@ull.es> | |||
250 | 250 | ||
251 | Tito Ragusa <farmatito@tiscali.it> | 251 | Tito Ragusa <farmatito@tiscali.it> |
252 | 252 | ||
253 | devfsd and size optimizations in strings, openvt and deallocvt. | 253 | devfsd and size optimizations in strings, openvt and deallocvt. |
254 | 254 | ||
255 | =cut | 255 | =cut |
256 | 256 | ||
diff --git a/examples/busybox.spec b/examples/busybox.spec index 494eed941..27d005140 100644 --- a/examples/busybox.spec +++ b/examples/busybox.spec | |||
@@ -1,44 +1,120 @@ | |||
1 | %define name busybox | 1 | Summary: Statically linked binary providing simplified versions of system commands |
2 | %define epoch 0 | 2 | Name: busybox |
3 | %define version 0.61.pre | 3 | Version: 1.15.1 |
4 | %define release %(date -I | sed -e 's/-/_/g') | 4 | Release: 1%{?dist} |
5 | %define serial 1 | 5 | Epoch: 1 |
6 | 6 | License: GPLv2 | |
7 | Name: %{name} | 7 | Group: System Environment/Shells |
8 | #Epoch: %{epoch} | 8 | Source: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2 |
9 | Version: %{version} | 9 | Source1: busybox-static.config |
10 | Release: %{release} | 10 | Source2: busybox-petitboot.config |
11 | Serial: %{serial} | 11 | Source3: http://www.uclibc.org/downloads/uClibc-0.9.30.1.tar.bz2 |
12 | Copyright: GPL | 12 | Source4: uClibc.config |
13 | Group: System/Utilities | 13 | Patch16: busybox-1.10.1-hwclock.patch |
14 | Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary. | 14 | # patch to avoid conflicts with getline() from stdio.h, already present in upstream VCS |
15 | URL: http://busybox.net/ | 15 | Patch22: uClibc-0.9.30.1-getline.patch |
16 | Source: ftp://busybox.net/busybox/%{name}-%{version}.tar.gz | 16 | Obsoletes: busybox-anaconda |
17 | Buildroot: /var/tmp/%{name}-%{version} | 17 | URL: http://www.busybox.net |
18 | Packager : Erik Andersen <andersen@codepoet.org> | 18 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
19 | 19 | BuildRequires: libselinux-devel >= 1.27.7-2 | |
20 | %Description | 20 | BuildRequires: libsepol-devel |
21 | BusyBox combines tiny versions of many common UNIX utilities into a single | 21 | BuildRequires: libselinux-static |
22 | small executable. It provides minimalist replacements for most of the utilities | 22 | BuildRequires: libsepol-static |
23 | you usually find in fileutils, shellutils, findutils, textutils, grep, gzip, | 23 | BuildRequires: glibc-static |
24 | tar, etc. BusyBox provides a fairly complete POSIX environment for any small | 24 | |
25 | or emdedded system. The utilities in BusyBox generally have fewer options then | 25 | %define debug_package %{nil} |
26 | their full featured GNU cousins; however, the options that are provided behave | 26 | |
27 | very much like their GNU counterparts. | 27 | %package petitboot |
28 | 28 | Group: System Environment/Shells | |
29 | %Prep | 29 | Summary: Version of busybox configured for use with petitboot |
30 | %setup -q -n %{name}-%{version} | 30 | |
31 | 31 | %description | |
32 | %Build | 32 | Busybox is a single binary which includes versions of a large number |
33 | make | 33 | of system commands, including a shell. This package can be very |
34 | 34 | useful for recovering from certain types of system failures, | |
35 | %Install | 35 | particularly those involving broken shared libraries. |
36 | |||
37 | %description petitboot | ||
38 | Busybox is a single binary which includes versions of a large number | ||
39 | of system commands, including a shell. The version contained in this | ||
40 | package is a minimal configuration intended for use with the Petitboot | ||
41 | bootloader used on PlayStation 3. The busybox package provides a binary | ||
42 | better suited to normal use. | ||
43 | |||
44 | %prep | ||
45 | %setup -q -a3 | ||
46 | %patch16 -b .ia64 -p1 | ||
47 | cat %{SOURCE4} >uClibc-0.9.30.1/.config1 | ||
48 | %patch22 -b .getline -p1 | ||
49 | |||
50 | %build | ||
51 | # create static busybox - the executable is kept as busybox-static | ||
52 | # We use uclibc instead of system glibc, uclibc is several times | ||
53 | # smaller, this is important for static build. | ||
54 | # Build uclibc first. | ||
55 | cd uClibc-0.9.30.1 | ||
56 | # fixme: | ||
57 | mkdir kernel-include | ||
58 | cp -a /usr/include/asm kernel-include | ||
59 | cp -a /usr/include/asm-generic kernel-include | ||
60 | cp -a /usr/include/linux kernel-include | ||
61 | # uclibc can't be built on ppc64,s390,ia64, we set $arch to "" in this case | ||
62 | arch=`uname -m | sed -e 's/i.86/i386/' -e 's/ppc/powerpc/' -e 's/ppc64//' -e 's/powerpc64//' -e 's/ia64//' -e 's/s390.*//'` | ||
63 | echo "TARGET_$arch=y" >.config | ||
64 | echo "TARGET_ARCH=\"$arch\"" >>.config | ||
65 | cat .config1 >>.config | ||
66 | if test "$arch"; then yes "" | make oldconfig; fi | ||
67 | if test "$arch"; then cat .config; fi | ||
68 | if test "$arch"; then make V=1; fi | ||
69 | if test "$arch"; then make install; fi | ||
70 | if test "$arch"; then make install_kernel_headers; fi | ||
71 | cd .. | ||
72 | # we are back in busybox-NN.MM dir now | ||
73 | cp %{SOURCE1} .config | ||
74 | # set all new options to defaults | ||
75 | yes "" | make oldconfig | ||
76 | # gcc needs to be convinced to use neither system headers, nor libs, | ||
77 | # nor startfiles (i.e. crtXXX.o files) | ||
78 | if test "$arch"; then \ | ||
79 | mv .config .config1 && \ | ||
80 | grep -v ^CONFIG_SELINUX .config1 >.config && \ | ||
81 | yes "" | make oldconfig && \ | ||
82 | cat .config && \ | ||
83 | make V=1 \ | ||
84 | EXTRA_CFLAGS="-isystem uClibc-0.9.30.1/installed/include" \ | ||
85 | CFLAGS_busybox="-static -nostartfiles -LuClibc-0.9.30.1/installed/lib uClibc-0.9.30.1/installed/lib/crt1.o uClibc-0.9.30.1/installed/lib/crti.o uClibc-0.9.30.1/installed/lib/crtn.o"; \ | ||
86 | else \ | ||
87 | cat .config && \ | ||
88 | make V=1 CC="gcc $RPM_OPT_FLAGS"; \ | ||
89 | fi | ||
90 | cp busybox busybox.static | ||
91 | |||
92 | # create busybox optimized for petitboot | ||
93 | make clean | ||
94 | # copy new configuration file | ||
95 | cp %{SOURCE2} .config | ||
96 | # set all new options to defaults | ||
97 | yes "" | make oldconfig | ||
98 | make V=1 CC="%__cc $RPM_OPT_FLAGS" | ||
99 | cp busybox busybox.petitboot | ||
100 | |||
101 | %install | ||
36 | rm -rf $RPM_BUILD_ROOT | 102 | rm -rf $RPM_BUILD_ROOT |
37 | make CONFIG_PREFIX=$RPM_BUILD_ROOT install | 103 | mkdir -p $RPM_BUILD_ROOT/sbin |
104 | install -m 755 busybox.static $RPM_BUILD_ROOT/sbin/busybox | ||
105 | install -m 755 busybox.petitboot $RPM_BUILD_ROOT/sbin/busybox.petitboot | ||
38 | 106 | ||
39 | %Clean | 107 | %clean |
40 | rm -rf $RPM_BUILD_ROOT | 108 | rm -rf $RPM_BUILD_ROOT |
41 | 109 | ||
42 | %Files | 110 | %files |
43 | %defattr(-,root,root) | 111 | %defattr(-,root,root,-) |
44 | / | 112 | %doc LICENSE docs/busybox.net/*.html |
113 | /sbin/busybox | ||
114 | |||
115 | %files petitboot | ||
116 | %defattr(-,root,root,-) | ||
117 | %doc LICENSE | ||
118 | /sbin/busybox.petitboot | ||
119 | |||
120 | %changelog | ||
diff --git a/include/usage.h b/include/usage.h index c7013de22..42d8b9bcd 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -48,7 +48,7 @@ | |||
48 | "\n -h DIR Home directory" \ | 48 | "\n -h DIR Home directory" \ |
49 | "\n -g GECOS GECOS field" \ | 49 | "\n -g GECOS GECOS field" \ |
50 | "\n -s SHELL Login shell" \ | 50 | "\n -s SHELL Login shell" \ |
51 | "\n -G GROUP Add user to existing group" \ | 51 | "\n -G GRP Add user to existing group" \ |
52 | "\n -S Create a system user" \ | 52 | "\n -S Create a system user" \ |
53 | "\n -D Do not assign a password" \ | 53 | "\n -D Do not assign a password" \ |
54 | "\n -H Do not create home directory" \ | 54 | "\n -H Do not create home directory" \ |
@@ -689,7 +689,7 @@ | |||
689 | "\n -D FMT Use FMT for -d TIME conversion" \ | 689 | "\n -D FMT Use FMT for -d TIME conversion" \ |
690 | ) \ | 690 | ) \ |
691 | "\n" \ | 691 | "\n" \ |
692 | "\nRecognized formats for TIME:" \ | 692 | "\nRecognized TIME formats:" \ |
693 | "\n hh:mm[:ss]" \ | 693 | "\n hh:mm[:ss]" \ |
694 | "\n [YYYY.]MM.DD-hh:mm[:ss]" \ | 694 | "\n [YYYY.]MM.DD-hh:mm[:ss]" \ |
695 | "\n YYYY-MM-DD hh:mm[:ss]" \ | 695 | "\n YYYY-MM-DD hh:mm[:ss]" \ |
@@ -1189,12 +1189,12 @@ | |||
1189 | #define blkid_trivial_usage \ | 1189 | #define blkid_trivial_usage \ |
1190 | "" | 1190 | "" |
1191 | #define blkid_full_usage "\n\n" \ | 1191 | #define blkid_full_usage "\n\n" \ |
1192 | "Print UUIDs of all filesystems." | 1192 | "Print UUIDs of all filesystems" |
1193 | 1193 | ||
1194 | #define findfs_trivial_usage \ | 1194 | #define findfs_trivial_usage \ |
1195 | "LABEL=label or UUID=uuid" | 1195 | "LABEL=label or UUID=uuid" |
1196 | #define findfs_full_usage "\n\n" \ | 1196 | #define findfs_full_usage "\n\n" \ |
1197 | "Find a filesystem device based on a label or UUID." | 1197 | "Find a filesystem device based on a label or UUID" |
1198 | #define findfs_example_usage \ | 1198 | #define findfs_example_usage \ |
1199 | "$ findfs LABEL=MyDevice" | 1199 | "$ findfs LABEL=MyDevice" |
1200 | 1200 | ||
@@ -3145,22 +3145,22 @@ | |||
3145 | #define nmeter_full_usage "\n\n" \ | 3145 | #define nmeter_full_usage "\n\n" \ |
3146 | "Monitor system in real time\n\n" \ | 3146 | "Monitor system in real time\n\n" \ |
3147 | "Format specifiers:\n" \ | 3147 | "Format specifiers:\n" \ |
3148 | "%Nc or %[cN] Monitor CPU. N - bar size, default 10\n" \ | 3148 | " %Nc or %[cN] Monitor CPU. N - bar size, default 10\n" \ |
3149 | " (displays: S:system U:user N:niced D:iowait I:irq i:softirq)\n" \ | 3149 | " (displays: S:system U:user N:niced D:iowait I:irq i:softirq)\n" \ |
3150 | "%[niface] Monitor network interface 'iface'\n" \ | 3150 | " %[niface] Monitor network interface 'iface'\n" \ |
3151 | "%m Monitor allocated memory\n" \ | 3151 | " %m Monitor allocated memory\n" \ |
3152 | "%[mf] Monitor free memory\n" \ | 3152 | " %[mf] Monitor free memory\n" \ |
3153 | "%[mt] Monitor total memory\n" \ | 3153 | " %[mt] Monitor total memory\n" \ |
3154 | "%s Monitor allocated swap\n" \ | 3154 | " %s Monitor allocated swap\n" \ |
3155 | "%f Monitor number of used file descriptors\n" \ | 3155 | " %f Monitor number of used file descriptors\n" \ |
3156 | "%Ni Monitor total/specific IRQ rate\n" \ | 3156 | " %Ni Monitor total/specific IRQ rate\n" \ |
3157 | "%x Monitor context switch rate\n" \ | 3157 | " %x Monitor context switch rate\n" \ |
3158 | "%p Monitor forks\n" \ | 3158 | " %p Monitor forks\n" \ |
3159 | "%[pn] Monitor # of processes\n" \ | 3159 | " %[pn] Monitor # of processes\n" \ |
3160 | "%b Monitor block io\n" \ | 3160 | " %b Monitor block io\n" \ |
3161 | "%Nt Show time (with N decimal points)\n" \ | 3161 | " %Nt Show time (with N decimal points)\n" \ |
3162 | "%Nd Milliseconds between updates (default:1000)\n" \ | 3162 | " %Nd Milliseconds between updates (default:1000)\n" \ |
3163 | "%r Print <cr> instead of <lf> at EOL" \ | 3163 | " %r Print <cr> instead of <lf> at EOL" \ |
3164 | 3164 | ||
3165 | #define nmeter_example_usage \ | 3165 | #define nmeter_example_usage \ |
3166 | "nmeter '%250d%t %20c int %i bio %b mem %m forks%p'" | 3166 | "nmeter '%250d%t %20c int %i bio %b mem %m forks%p'" |
@@ -4493,35 +4493,35 @@ | |||
4493 | #define tcpsvd_full_usage "\n\n" \ | 4493 | #define tcpsvd_full_usage "\n\n" \ |
4494 | "Create TCP socket, bind to IP:PORT and listen\n" \ | 4494 | "Create TCP socket, bind to IP:PORT and listen\n" \ |
4495 | "for incoming connection. Run PROG for each connection.\n" \ | 4495 | "for incoming connection. Run PROG for each connection.\n" \ |
4496 | "\nIP IP to listen on. '0' = all" \ | 4496 | "\n IP IP to listen on. '0' = all" \ |
4497 | "\nPORT Port to listen on" \ | 4497 | "\n PORT Port to listen on" \ |
4498 | "\nPROG [ARGS] Program to run" \ | 4498 | "\n PROG [ARGS] Program to run" \ |
4499 | "\n-l NAME Local hostname (else looks up local hostname in DNS)" \ | 4499 | "\n -l NAME Local hostname (else looks up local hostname in DNS)" \ |
4500 | "\n-u USER[:GROUP] Change to user/group after bind" \ | 4500 | "\n -u USER[:GRP] Change to user/group after bind" \ |
4501 | "\n-c N Handle up to N connections simultaneously" \ | 4501 | "\n -c N Handle up to N connections simultaneously" \ |
4502 | "\n-b N Allow a backlog of approximately N TCP SYNs" \ | 4502 | "\n -b N Allow a backlog of approximately N TCP SYNs" \ |
4503 | "\n-C N[:MSG] Allow only up to N connections from the same IP" \ | 4503 | "\n -C N[:MSG] Allow only up to N connections from the same IP" \ |
4504 | "\n New connections from this IP address are closed" \ | 4504 | "\n New connections from this IP address are closed" \ |
4505 | "\n immediately. MSG is written to the peer before close" \ | 4505 | "\n immediately. MSG is written to the peer before close" \ |
4506 | "\n-h Look up peer's hostname" \ | 4506 | "\n -h Look up peer's hostname" \ |
4507 | "\n-E Do not set up environment variables" \ | 4507 | "\n -E Do not set up environment variables" \ |
4508 | "\n-v Verbose" \ | 4508 | "\n -v Verbose" \ |
4509 | 4509 | ||
4510 | #define udpsvd_trivial_usage \ | 4510 | #define udpsvd_trivial_usage \ |
4511 | "[-hEv] [-c N] [-u USER] [-l NAME] IP PORT PROG" | 4511 | "[-hEv] [-c N] [-u USER] [-l NAME] IP PORT PROG" |
4512 | #define udpsvd_full_usage "\n\n" \ | 4512 | #define udpsvd_full_usage "\n\n" \ |
4513 | "Create UDP socket, bind to IP:PORT and wait\n" \ | 4513 | "Create UDP socket, bind to IP:PORT and wait\n" \ |
4514 | "for incoming packets. Run PROG for each packet,\n" \ | 4514 | "for incoming packets. Run PROG for each packet,\n" \ |
4515 | "redirecting all further packets with same peer ip:port to it\n" \ | 4515 | "redirecting all further packets with same peer ip:port to it.\n" \ |
4516 | "\nIP IP to listen on. '0' = all" \ | 4516 | "\n IP IP to listen on. '0' = all" \ |
4517 | "\nPORT Port to listen on" \ | 4517 | "\n PORT Port to listen on" \ |
4518 | "\nPROG [ARGS] Program to run" \ | 4518 | "\n PROG [ARGS] Program to run" \ |
4519 | "\n-l NAME Local hostname (else looks up local hostname in DNS)" \ | 4519 | "\n -l NAME Local hostname (else looks up local hostname in DNS)" \ |
4520 | "\n-u USER[:GROUP] Change to user/group after bind" \ | 4520 | "\n -u USER[:GRP] Change to user/group after bind" \ |
4521 | "\n-c N Handle up to N connections simultaneously" \ | 4521 | "\n -c N Handle up to N connections simultaneously" \ |
4522 | "\n-h Look up peer's hostname" \ | 4522 | "\n -h Look up peer's hostname" \ |
4523 | "\n-E Do not set up environment variables" \ | 4523 | "\n -E Do not set up environment variables" \ |
4524 | "\n-v Verbose" \ | 4524 | "\n -v Verbose" \ |
4525 | 4525 | ||
4526 | #define tftp_trivial_usage \ | 4526 | #define tftp_trivial_usage \ |
4527 | "[OPTIONS] HOST [PORT]" | 4527 | "[OPTIONS] HOST [PORT]" |