Fixes to usage text; updated busybox.spec

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2009-10-02 11:37:17 +02:00
parent 88a37689a7
commit 26ff18b424
4 changed files with 158 additions and 82 deletions

View File

@ -133,7 +133,7 @@ docs/BusyBox.txt: docs/busybox.pod
docs/BusyBox.1: docs/busybox.pod docs/BusyBox.1: docs/busybox.pod
$(disp_doc) $(disp_doc)
$(Q)-mkdir -p docs $(Q)-mkdir -p docs
$(Q)-pod2man --center=BusyBox --release="version $(VERSION)" $< > $@ $(Q)-pod2man --center=BusyBox --release="version $(KERNELVERSION)" $< > $@
docs/BusyBox.html: docs/busybox.net/BusyBox.html docs/BusyBox.html: docs/busybox.net/BusyBox.html
$(disp_doc) $(disp_doc)

View File

@ -1,44 +1,120 @@
%define name busybox Summary: Statically linked binary providing simplified versions of system commands
%define epoch 0 Name: busybox
%define version 0.61.pre Version: 1.15.1
%define release %(date -I | sed -e 's/-/_/g') Release: 1%{?dist}
%define serial 1 Epoch: 1
License: GPLv2
Group: System Environment/Shells
Source: http://www.busybox.net/downloads/%{name}-%{version}.tar.bz2
Source1: busybox-static.config
Source2: busybox-petitboot.config
Source3: http://www.uclibc.org/downloads/uClibc-0.9.30.1.tar.bz2
Source4: uClibc.config
Patch16: busybox-1.10.1-hwclock.patch
# patch to avoid conflicts with getline() from stdio.h, already present in upstream VCS
Patch22: uClibc-0.9.30.1-getline.patch
Obsoletes: busybox-anaconda
URL: http://www.busybox.net
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libselinux-devel >= 1.27.7-2
BuildRequires: libsepol-devel
BuildRequires: libselinux-static
BuildRequires: libsepol-static
BuildRequires: glibc-static
Name: %{name} %define debug_package %{nil}
#Epoch: %{epoch}
Version: %{version}
Release: %{release}
Serial: %{serial}
Copyright: GPL
Group: System/Utilities
Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary.
URL: http://busybox.net/
Source: ftp://busybox.net/busybox/%{name}-%{version}.tar.gz
Buildroot: /var/tmp/%{name}-%{version}
Packager : Erik Andersen <andersen@codepoet.org>
%Description %package petitboot
BusyBox combines tiny versions of many common UNIX utilities into a single Group: System Environment/Shells
small executable. It provides minimalist replacements for most of the utilities Summary: Version of busybox configured for use with petitboot
you usually find in fileutils, shellutils, findutils, textutils, grep, gzip,
tar, etc. BusyBox provides a fairly complete POSIX environment for any small
or emdedded system. The utilities in BusyBox generally have fewer options then
their full featured GNU cousins; however, the options that are provided behave
very much like their GNU counterparts.
%Prep %description
%setup -q -n %{name}-%{version} Busybox is a single binary which includes versions of a large number
of system commands, including a shell. This package can be very
useful for recovering from certain types of system failures,
particularly those involving broken shared libraries.
%Build %description petitboot
make Busybox is a single binary which includes versions of a large number
of system commands, including a shell. The version contained in this
package is a minimal configuration intended for use with the Petitboot
bootloader used on PlayStation 3. The busybox package provides a binary
better suited to normal use.
%Install %prep
%setup -q -a3
%patch16 -b .ia64 -p1
cat %{SOURCE4} >uClibc-0.9.30.1/.config1
%patch22 -b .getline -p1
%build
# create static busybox - the executable is kept as busybox-static
# We use uclibc instead of system glibc, uclibc is several times
# smaller, this is important for static build.
# Build uclibc first.
cd uClibc-0.9.30.1
# fixme:
mkdir kernel-include
cp -a /usr/include/asm kernel-include
cp -a /usr/include/asm-generic kernel-include
cp -a /usr/include/linux kernel-include
# uclibc can't be built on ppc64,s390,ia64, we set $arch to "" in this case
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.*//'`
echo "TARGET_$arch=y" >.config
echo "TARGET_ARCH=\"$arch\"" >>.config
cat .config1 >>.config
if test "$arch"; then yes "" | make oldconfig; fi
if test "$arch"; then cat .config; fi
if test "$arch"; then make V=1; fi
if test "$arch"; then make install; fi
if test "$arch"; then make install_kernel_headers; fi
cd ..
# we are back in busybox-NN.MM dir now
cp %{SOURCE1} .config
# set all new options to defaults
yes "" | make oldconfig
# gcc needs to be convinced to use neither system headers, nor libs,
# nor startfiles (i.e. crtXXX.o files)
if test "$arch"; then \
mv .config .config1 && \
grep -v ^CONFIG_SELINUX .config1 >.config && \
yes "" | make oldconfig && \
cat .config && \
make V=1 \
EXTRA_CFLAGS="-isystem uClibc-0.9.30.1/installed/include" \
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"; \
else \
cat .config && \
make V=1 CC="gcc $RPM_OPT_FLAGS"; \
fi
cp busybox busybox.static
# create busybox optimized for petitboot
make clean
# copy new configuration file
cp %{SOURCE2} .config
# set all new options to defaults
yes "" | make oldconfig
make V=1 CC="%__cc $RPM_OPT_FLAGS"
cp busybox busybox.petitboot
%install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
make CONFIG_PREFIX=$RPM_BUILD_ROOT install mkdir -p $RPM_BUILD_ROOT/sbin
install -m 755 busybox.static $RPM_BUILD_ROOT/sbin/busybox
install -m 755 busybox.petitboot $RPM_BUILD_ROOT/sbin/busybox.petitboot
%Clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%Files %files
%defattr(-,root,root) %defattr(-,root,root,-)
/ %doc LICENSE docs/busybox.net/*.html
/sbin/busybox
%files petitboot
%defattr(-,root,root,-)
%doc LICENSE
/sbin/busybox.petitboot
%changelog

View File

@ -48,7 +48,7 @@
"\n -h DIR Home directory" \ "\n -h DIR Home directory" \
"\n -g GECOS GECOS field" \ "\n -g GECOS GECOS field" \
"\n -s SHELL Login shell" \ "\n -s SHELL Login shell" \
"\n -G GROUP Add user to existing group" \ "\n -G GRP Add user to existing group" \
"\n -S Create a system user" \ "\n -S Create a system user" \
"\n -D Do not assign a password" \ "\n -D Do not assign a password" \
"\n -H Do not create home directory" \ "\n -H Do not create home directory" \
@ -689,7 +689,7 @@
"\n -D FMT Use FMT for -d TIME conversion" \ "\n -D FMT Use FMT for -d TIME conversion" \
) \ ) \
"\n" \ "\n" \
"\nRecognized formats for TIME:" \ "\nRecognized TIME formats:" \
"\n hh:mm[:ss]" \ "\n hh:mm[:ss]" \
"\n [YYYY.]MM.DD-hh:mm[:ss]" \ "\n [YYYY.]MM.DD-hh:mm[:ss]" \
"\n YYYY-MM-DD hh:mm[:ss]" \ "\n YYYY-MM-DD hh:mm[:ss]" \
@ -1189,12 +1189,12 @@
#define blkid_trivial_usage \ #define blkid_trivial_usage \
"" ""
#define blkid_full_usage "\n\n" \ #define blkid_full_usage "\n\n" \
"Print UUIDs of all filesystems." "Print UUIDs of all filesystems"
#define findfs_trivial_usage \ #define findfs_trivial_usage \
"LABEL=label or UUID=uuid" "LABEL=label or UUID=uuid"
#define findfs_full_usage "\n\n" \ #define findfs_full_usage "\n\n" \
"Find a filesystem device based on a label or UUID." "Find a filesystem device based on a label or UUID"
#define findfs_example_usage \ #define findfs_example_usage \
"$ findfs LABEL=MyDevice" "$ findfs LABEL=MyDevice"
@ -3145,22 +3145,22 @@
#define nmeter_full_usage "\n\n" \ #define nmeter_full_usage "\n\n" \
"Monitor system in real time\n\n" \ "Monitor system in real time\n\n" \
"Format specifiers:\n" \ "Format specifiers:\n" \
"%Nc or %[cN] Monitor CPU. N - bar size, default 10\n" \ " %Nc or %[cN] Monitor CPU. N - bar size, default 10\n" \
" (displays: S:system U:user N:niced D:iowait I:irq i:softirq)\n" \ " (displays: S:system U:user N:niced D:iowait I:irq i:softirq)\n" \
"%[niface] Monitor network interface 'iface'\n" \ " %[niface] Monitor network interface 'iface'\n" \
"%m Monitor allocated memory\n" \ " %m Monitor allocated memory\n" \
"%[mf] Monitor free memory\n" \ " %[mf] Monitor free memory\n" \
"%[mt] Monitor total memory\n" \ " %[mt] Monitor total memory\n" \
"%s Monitor allocated swap\n" \ " %s Monitor allocated swap\n" \
"%f Monitor number of used file descriptors\n" \ " %f Monitor number of used file descriptors\n" \
"%Ni Monitor total/specific IRQ rate\n" \ " %Ni Monitor total/specific IRQ rate\n" \
"%x Monitor context switch rate\n" \ " %x Monitor context switch rate\n" \
"%p Monitor forks\n" \ " %p Monitor forks\n" \
"%[pn] Monitor # of processes\n" \ " %[pn] Monitor # of processes\n" \
"%b Monitor block io\n" \ " %b Monitor block io\n" \
"%Nt Show time (with N decimal points)\n" \ " %Nt Show time (with N decimal points)\n" \
"%Nd Milliseconds between updates (default:1000)\n" \ " %Nd Milliseconds between updates (default:1000)\n" \
"%r Print <cr> instead of <lf> at EOL" \ " %r Print <cr> instead of <lf> at EOL" \
#define nmeter_example_usage \ #define nmeter_example_usage \
"nmeter '%250d%t %20c int %i bio %b mem %m forks%p'" "nmeter '%250d%t %20c int %i bio %b mem %m forks%p'"
@ -4493,35 +4493,35 @@
#define tcpsvd_full_usage "\n\n" \ #define tcpsvd_full_usage "\n\n" \
"Create TCP socket, bind to IP:PORT and listen\n" \ "Create TCP socket, bind to IP:PORT and listen\n" \
"for incoming connection. Run PROG for each connection.\n" \ "for incoming connection. Run PROG for each connection.\n" \
"\nIP IP to listen on. '0' = all" \ "\n IP IP to listen on. '0' = all" \
"\nPORT Port to listen on" \ "\n PORT Port to listen on" \
"\nPROG [ARGS] Program to run" \ "\n PROG [ARGS] Program to run" \
"\n-l NAME Local hostname (else looks up local hostname in DNS)" \ "\n -l NAME Local hostname (else looks up local hostname in DNS)" \
"\n-u USER[:GROUP] Change to user/group after bind" \ "\n -u USER[:GRP] Change to user/group after bind" \
"\n-c N Handle up to N connections simultaneously" \ "\n -c N Handle up to N connections simultaneously" \
"\n-b N Allow a backlog of approximately N TCP SYNs" \ "\n -b N Allow a backlog of approximately N TCP SYNs" \
"\n-C N[:MSG] Allow only up to N connections from the same IP" \ "\n -C N[:MSG] Allow only up to N connections from the same IP" \
"\n New connections from this IP address are closed" \ "\n New connections from this IP address are closed" \
"\n immediately. MSG is written to the peer before close" \ "\n immediately. MSG is written to the peer before close" \
"\n-h Look up peer's hostname" \ "\n -h Look up peer's hostname" \
"\n-E Do not set up environment variables" \ "\n -E Do not set up environment variables" \
"\n-v Verbose" \ "\n -v Verbose" \
#define udpsvd_trivial_usage \ #define udpsvd_trivial_usage \
"[-hEv] [-c N] [-u USER] [-l NAME] IP PORT PROG" "[-hEv] [-c N] [-u USER] [-l NAME] IP PORT PROG"
#define udpsvd_full_usage "\n\n" \ #define udpsvd_full_usage "\n\n" \
"Create UDP socket, bind to IP:PORT and wait\n" \ "Create UDP socket, bind to IP:PORT and wait\n" \
"for incoming packets. Run PROG for each packet,\n" \ "for incoming packets. Run PROG for each packet,\n" \
"redirecting all further packets with same peer ip:port to it\n" \ "redirecting all further packets with same peer ip:port to it.\n" \
"\nIP IP to listen on. '0' = all" \ "\n IP IP to listen on. '0' = all" \
"\nPORT Port to listen on" \ "\n PORT Port to listen on" \
"\nPROG [ARGS] Program to run" \ "\n PROG [ARGS] Program to run" \
"\n-l NAME Local hostname (else looks up local hostname in DNS)" \ "\n -l NAME Local hostname (else looks up local hostname in DNS)" \
"\n-u USER[:GROUP] Change to user/group after bind" \ "\n -u USER[:GRP] Change to user/group after bind" \
"\n-c N Handle up to N connections simultaneously" \ "\n -c N Handle up to N connections simultaneously" \
"\n-h Look up peer's hostname" \ "\n -h Look up peer's hostname" \
"\n-E Do not set up environment variables" \ "\n -E Do not set up environment variables" \
"\n-v Verbose" \ "\n -v Verbose" \
#define tftp_trivial_usage \ #define tftp_trivial_usage \
"[OPTIONS] HOST [PORT]" "[OPTIONS] HOST [PORT]"