Compare commits

...
272 Commits
Author SHA1 Message Date
Denis Vlasenko 15c0b72584 Apply post 1.13.1 patches, bump to 1.13.2 2008-12-31 03:33:50 +00:00
Denis Vlasenko ccdc13d306 bump version to 1.13.1 2008-11-29 06:50:05 +00:00
Denis Vlasenko ab310e1b1c apply post-1.13.0 patches 2008-11-29 06:49:36 +00:00
Denis Vlasenko 1cd1012a90 Bump version to 1.13.0 2008-11-09 17:29:07 +00:00
Denis Vlasenko 095f5b1c1c update "maximum nommu" config 2008-11-09 16:12:38 +00:00
Denis Vlasenko 62e0dc2b51 update random config tester 2008-11-09 16:08:31 +00:00
Denis Vlasenko 44f96d39e1 randomconfig fixes 2008-11-09 02:23:42 +00:00
Denis Vlasenko 6d0443557c telnetd: set SO_KEEPALIVE, users report it's useful. +20 bytes. 2008-11-09 00:44:40 +00:00
Denis Vlasenko 3fa36e2350 *: a bit of code shrink
function                                             old     new   delta
stop_handler                                          41      38      -3
sulogin_main                                         508     504      -4
got_cont                                               4       -      -4
cont_handler                                          11       -     -11
startservice                                         309     297     -12
processorstart                                       423     409     -14
tcpudpsvd_main                                      1861    1843     -18
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 0/5 up/down: 0/-66)             Total: -66 bytes
2008-11-09 00:15:11 +00:00
Denis Vlasenko 73cc54388d move documentation to docs/ 2008-11-08 22:31:19 +00:00
Denis Vlasenko 4febd91326 kbd_mode: s/ioctl/xioctl. also saves 12 bytes 2008-11-08 21:42:14 +00:00
Denis Vlasenko dc70069a46 kbd_mode: support -C TTY option
function                                             old     new   delta
packed_usage                                       25334   25361     +27
kbd_mode_main                                        146     173     +27
2008-11-08 21:39:06 +00:00
Denis Vlasenko 2a8329e0e9 build system: remove '-Wl,' when we pass flags to ld. 2008-11-08 20:36:32 +00:00
Denis Vlasenko 30e1ab691c libbb: add a TODO to support new SHA-based encrypted passwords 2008-11-07 13:36:46 +00:00
Denis Vlasenko 2ec94a7ee8 login: fix /etc/nologin handling (should prohibit non-root LOGINS,
not running login by non-root). minor code shrink.

function                                             old     new   delta
login_main                                          1669    1602     -67
2008-11-07 12:59:31 +00:00
Denis Vlasenko b0150d299f telnetd: handle emacs M-DEL and IAC-NOP (putty keepalive)
by Jim Cathey (jcathey AT ciena.com)

function                                             old     new   delta
telnetd_main                                        1314    1364     +50
2008-11-07 01:58:21 +00:00
Denis Vlasenko 4f7d90f1c7 defconfig: explain what we aim it to be 2008-11-07 01:32:11 +00:00
Denis Vlasenko 694b514148 login: fix /etc/nologin support
build system: fix config warnings ("Overlong line")

function                                             old     new   delta
login_main                                          1735    1774     +39
__libc_tcdrain                                         -      23     +23
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 62/0)               Total: 62 bytes
2008-11-07 01:12:16 +00:00
Denis Vlasenko 239d06bd47 add mailutils/* 2008-11-06 23:42:42 +00:00
Denis Vlasenko b9d572a273 total overhaul of mail applets. again. Vladimir as usual. 2008-11-06 23:41:38 +00:00
Denis Vlasenko f10bc3964f correction in comment 2008-11-06 23:28:42 +00:00
Denis Vlasenko f068b3e9f4 sv: make default service dir configurable (Vladimir wants it) 2008-11-06 23:07:42 +00:00
Denis Vlasenko 3854c5ddf4 runsvdir: alternative methon of supporting runsvdir-as-init. +66 bytes.
*: s/int/pid_t where appropriate
2008-11-06 22:39:57 +00:00
Denis Vlasenko 70e8f49f71 basename: fix error code. again. deja vu feeling... 2008-11-06 15:13:33 +00:00
Denis Vlasenko fc66892abd *: remove superfluous casts. no code changes 2008-11-06 02:32:31 +00:00
Denis Vlasenko 35a064b67f build system: tidying up CONFIG_xxx names (suggested by Rob) 2008-11-06 00:49:59 +00:00
Denis Vlasenko 202ac504e1 *: code shrink by adding a wrapper around very common tcsetattr(0, TCSANOW, xx) op
function                                             old     new   delta
tcsetattr_stdin_TCSANOW                                -      14     +14
set_sane_term                                        116     113      -3
top_main                                            1277    1273      -4
make_new_session                                     421     415      -6
rawmode                                              133     126      -7
reset_term                                            18      10      -8
die                                                   43      35      -8
cookmode                                              62      54      -8
vlock_main                                           425     415     -10
read_line_input                                     3165    3155     -10
bb_askpass                                           357     347     -10
fsck_minix_main                                     3079    3065     -14
getty_main                                          2375    2332     -43
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/12 up/down: 14/-131)         Total: -117 bytes
2008-11-05 13:20:58 +00:00
Denis Vlasenko 905ed8730f add serial HOWTO doc 2008-11-05 12:19:39 +00:00
Denis Vlasenko 4cb576ea98 inetd: fix a case when we have zero services 2008-11-05 11:36:22 +00:00
Bernhard Reutner-Fischer a643816fe3 - commentary typo fix (tito) 2008-11-05 08:18:16 +00:00
Bernhard Reutner-Fischer 6559100021 - fix typo in print_user() (tito) 2008-11-05 08:15:13 +00:00
Denis Vlasenko 391ffa19d1 nslookup: tiny shrink (-5 bytes); add comment about res_init
inet_common: cosmetics, no code changes
2008-11-04 21:44:28 +00:00
Denis Vlasenko c51457ca5b less: fix pasting into search line ('/' cmd) -
it was mishandled because pasting "types" very fast
 and read_key eats many chars. +30 bytes.
2008-11-02 00:55:41 +00:00
Denis Vlasenko 3c385cd706 lineedit: fix bug 5824: Since version 23530 with lineedit.c,
"fdisk" & "ed" can't work any more
2008-11-02 00:41:05 +00:00
Denis Vlasenko 9b0f6e1142 add comment, no code changes 2008-11-01 13:40:32 +00:00
Denis Vlasenko 1a9e9bdd93 gunzip: restore mtime. approx +80 bytes of code
rpm: make code more robust
lsmod: small code shrink
2008-11-01 12:54:56 +00:00
Denis Vlasenko 5a89763fb7 tftpd: show help if stdin is not a socket 2008-11-01 00:22:24 +00:00
Denis Vlasenko 44d5dcebc6 iplink: accept shorthands for "address" keyword here:
"ip link set address 00:11:22:33:44:55"
ifupdown: use "addr" instead of "address"
2008-11-01 00:10:51 +00:00
Denis Vlasenko 64974793b9 less: fix newly-introduced case of less spinning forever
on pty's closed etc
2008-10-31 03:04:55 +00:00
Denis Vlasenko 028eab61bc runsvdir: if we have PID == 1, SIGHUP should make small pause,
not 1 minute one
2008-10-31 02:37:18 +00:00
Denis Vlasenko bb26db49b1 modprobe: fix a segfault when modprobe is called with no arguments at all
function                                             old     new   delta
modprobe_main                                        559     535     -24
2008-10-31 02:04:28 +00:00
Denis Vlasenko b9b344aa44 kill[all[5]]: accept -s SIG too. kill_main: +29 bytes
by Steve Bennett (steveb AT workware.net.au)
2008-10-31 00:30:48 +00:00
Denis Vlasenko f34cfff2f0 setup_environment: cd $HOME regardless of clear_env value. 2008-10-30 23:58:19 +00:00
Denis Vlasenko 91f8f82bfb tftpd: be less cryptic in help text 2008-10-30 23:42:37 +00:00
Denis Vlasenko 6b38e18247 dc: support for bases 2 and 8, by Nate Case (ncase AT xes-inc.com)
function                                             old     new   delta
print_base                                            87     176     +89
set_output_base                                       81      95     +14
static.bases                                           -       5      +5
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 108/0)             Total: 108 bytes
2008-10-30 23:25:50 +00:00
Bernhard Reutner-Fischer 470dc1d7e2 - minor shrinkage (~-60) 2008-10-30 17:42:49 +00:00
Bernhard Reutner-Fischer e29186687b - support ip link set eth1 address 00:11:22:33:44:55
and not only the shorthand "addr". Thanks to ncopa for noticing
2008-10-30 16:45:55 +00:00
Denis Vlasenko 31d58e58d2 randomconfig fixes 2008-10-29 13:16:28 +00:00
Denis Vlasenko 1fe7887659 another small defconfig update 2008-10-29 12:25:39 +00:00
Denis Vlasenko b15a6f2489 update defconfig 2008-10-29 12:18:10 +00:00
Denis Vlasenko cf696850f3 runsvdir: kill another global 2008-10-29 12:07:34 +00:00
Denis Vlasenko 6a2c2cf6f3 runsvdir: fx a recent vda's buglet (was pausing even if not signaled).
stop spawning children immediately if signaled. Kill one global.
2008-10-29 12:04:45 +00:00
Denis Vlasenko e7368f16fa id: better wording in comments, no code changes 2008-10-29 10:30:54 +00:00
Denis Vlasenko 58f3c2e01e runsvdir: shrink (by Vladimir) 2008-10-29 03:45:33 +00:00
Denis Vlasenko 9657596dd6 runsvdir: do not exit if we are pid 1. 2008-10-29 03:42:44 +00:00
Denis Vlasenko 40fdcbb270 more whitespace fixes 2008-10-29 01:20:13 +00:00
Denis Vlasenko 9504e444b8 whitespace fixes, no code changes 2008-10-29 01:19:15 +00:00
Denis Vlasenko c3a9dc8ac5 vi: fix uninitialized last_search_pattern (bug 5794) 2008-10-29 00:58:04 +00:00
Denis Vlasenko 34e68c8b42 id: coreutils compat by Tito + test script 2008-10-29 00:27:31 +00:00
Bernhard Reutner-Fischer d498850e02 - typo in documentation 2008-10-27 21:30:39 +00:00
Denis Vlasenko 6214941a3a ash: add testcase for bug 5304 2008-10-27 14:33:03 +00:00
Denis Vlasenko be54d6bc60 ash: fix "while kill -0 $child; do true; done" looping forever. 2008-10-27 14:25:52 +00:00
Denis Vlasenko 7ff85c53f1 udhcp: simplify SO_BINDTODEVICE call 2008-10-27 12:56:58 +00:00
Denis Vlasenko de5f645dff ls: trim help text 2008-10-27 12:37:22 +00:00
Denis Vlasenko 59f502b36f ping: trivial code shrink
function                                             old     new   delta
ping6_main                                            31      30      -1
ping_main                                            405     370     -35
2008-10-27 11:54:45 +00:00
Denis Vlasenko c503dde01a cpio: emit TRAILER even when hard links were found.
by Pascal Bellard (pascal.bellard AT ads-lu.com)
2008-10-26 19:55:20 +00:00
Denis Vlasenko 6b9d6c7544 devmem: fixlet in cleanup code 2008-10-26 19:07:43 +00:00
Denis Vlasenko 043246560f devmem: make it more script-friendly; don't do any reads
and output nothing if writing was requested. -100 bytes
2008-10-26 17:26:55 +00:00
Denis Vlasenko e1ef89abad less: correctly wrap lines with tabs 2008-10-26 16:30:09 +00:00
Denis Vlasenko c94fa5651a devmem: new applet 2008-10-26 11:08:14 +00:00
Denis Vlasenko f3dcd3c30a less: FEATURE_LESS_LINENUMS depends on FEATURE_LESS_DASHCMD 2008-10-26 00:24:38 +00:00
Denis Vlasenko 7462b21dbe read_key is actually written by Rob, add him to copyright notice 2008-10-26 00:19:33 +00:00
Denis Vlasenko 7b32e8f0bf less: disable _ command, it's useless bloat 2008-10-26 00:15:36 +00:00
Denis Vlasenko bdd2d8f178 read_key: add comments how Shift and Meta keys looks like.
no code changes
2008-10-25 23:59:41 +00:00
Denis Vlasenko 5f6aaf39cf less: reuse former vi's key reading code. Improve SIGWINCH handling.
function                                             old     new   delta
less_main                                           2056    2097     +41
getch_nowait                                         248     273     +25
read_key                                             310     321     +11
static.esccmds                                        61      69      +8
count_lines                                           72      74      +2
less_gets                                            166     142     -24
less_getch                                           172      43    -129
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 6/5 up/down: 91/-170)           Total: -79 bytes
   text    data     bss     dec     hex filename
2008-10-25 23:27:29 +00:00
Denis Vlasenko 39b0135c59 libbb: add forgotten file from previous commit :( 2008-10-25 23:23:32 +00:00
Denis Vlasenko 0112ff5203 vi: move key reading routine out of vi into llbbb
function                                             old     new   delta
read_key                                               -     310    +310
....
static.esccmds                                       170      61    -109
readit                                               286      60    -226
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 9/10 up/down: 349/-367)         Total: -18 bytes
2008-10-25 23:23:00 +00:00
Denis Vlasenko 73d702ee07 tar: fix typo in comment 2008-10-25 09:27:35 +00:00
Denis Vlasenko ebad0294c9 tar: fix bug 3844: non-root tar does not preserve perms 2008-10-24 23:47:38 +00:00
Denis Vlasenko 53c80f0972 less: add optional line number toggle and resizing on SIGWINCH. 2008-10-24 22:43:27 +00:00
Bernhard Reutner-Fischer aa2a1c000c - improve wording and fix alphabetical order 2008-10-24 19:48:47 +00:00
Denis Vlasenko e8efe81abf less: add less v.418 help text doc. No code changes. 2008-10-24 11:07:20 +00:00
Denis Vlasenko 2d5bd807c0 build system cleanup: rename FEATURE_AWK_MATH to FEATURE_AWK_LIBM;
disable parsing test applet.
2008-10-24 10:49:49 +00:00
Denis Vlasenko d908395eae less: experimental code to enable wrap/no-wrap
and adapting to resized xterm windows. disabled for now.
2008-10-24 10:42:21 +00:00
Denis Vlasenko 8f39b72aba less: more sane way of line numbering. Prepares for
wrap/unwrap and line numbers to be toggleable.
2008-10-23 22:02:30 +00:00
Bernhard Reutner-Fischer 2dfd295726 - give glob a chance
CROSS_COMPILE=~/foo-bar-baz would fail otherwise
  See http://www.uclibc.org/lists/buildroot/2008-October/011191.html
2008-10-23 13:49:21 +00:00
Bernhard Reutner-Fischer 01ea971610 - use sys/inotify.h 2008-10-21 17:26:10 +00:00
Denis Vlasenko 5cb54b5adc init: downgrade ENABLE_DEBUG_INIT to just a #define to prevent people
from selecting it in error. It has to be used ONLY for debugging
 init, never in production, as resulting init has serious differences.
2008-10-21 17:14:26 +00:00
Denis Vlasenko 37890e2f37 awk: fix typo in atan2 code. closes bug 5594. 2008-10-21 12:59:34 +00:00
Bernhard Reutner-Fischer 8fbd8ac8dd - fix ip route rejecting dotted quads as prefix
- adjust error message for wrong prefix not to mention address
  Previously e.g. ip route add 127.0.0.0/255.0.0.0 dev dummy0
  was rejected, saying
ip: an inet address is expected rather than "127.0.0.0/255.0.0.0"
 
function                                             old     new   delta
get_prefix_1                                         201     309    +108
get_prefix                                            55      73     +18
get_addr                                              55      73     +18
get_addr32                                            48      58     +10
get_addr_1                                           249     204     -45
.rodata                                           114569  114524     -45
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/2 up/down: 154/-90)            Total: 64 bytes
2008-10-21 12:42:45 +00:00
Denis Vlasenko 7effd7ae99 getopt: reinstate erroneously removed getopt() reset code. 2008-10-21 12:36:43 +00:00
Denis Vlasenko 4c9e9c4314 vi: handle chars 0x80, 0x81... correctly 2008-10-20 08:59:03 +00:00
Denis Vlasenko 078323010b dc: conditionalize parts which require libm 2008-10-20 08:43:10 +00:00
Denis Vlasenko b730474bda ash: fix NOEXEC mode - we were forgetting to pass environment!
env: promote to NOEXEC
hd: promote to NOEXEC, as hexdump is NOEXEC already
2008-10-20 08:15:51 +00:00
Denis Vlasenko d1660cb9ad ash: fix a bug in standalone mode (corrupted getopt() state) 2008-10-20 07:52:33 +00:00
Denis Vlasenko 802a7be54f add comment explaining previous change 2008-10-19 19:54:49 +00:00
Denis Vlasenko 582dff0514 volume identification: abolish /proc/partitions and /proc/cdroms
scanning. It does not catch volume managers and such.
Adding even more cruft is bad, so I decided to simply
scan /dev/* for any block devices. See how much better
it finds devices now:

# ./busybox_old blkid
/dev/sda1: LABEL="/boot" UUID="7931e231-dcb4-4b6d-9301-f7354ae24061"
/dev/dm-0: LABEL="Fedora-9-Live-x8" UUID="bb491e1e-1145-4f5b-b0ab-cbd2baf4f15a"
/dev/dm-1: UUID="edc2a920-ef83-437e-ba64-d3b6dc851267"
/dev/sdb1: UUID="6F84-ED0F"

# ./busybox blkid
/dev/sdb1: UUID="6F84-ED0F"
/dev/root: LABEL="Fedora-9-Live-x8" UUID="bb491e1e-1145-4f5b-b0ab-cbd2baf4f15a"
/dev/dm-1: UUID="edc2a920-ef83-437e-ba64-d3b6dc851267"
/dev/dm-0: LABEL="Fedora-9-Live-x8" UUID="bb491e1e-1145-4f5b-b0ab-cbd2baf4f15a"
/dev/sda1: LABEL="/boot" UUID="7931e231-dcb4-4b6d-9301-f7354ae24061"
/dev/mapper/VolGroup00-LogVol01: UUID="edc2a920-ef83-437e-ba64-d3b6dc851267"
/dev/mapper/VolGroup00-LogVol00: LABEL="Fedora-9-Live-x8" UUID="bb491e1e-1145-4f5b-b0ab-cbd2baf4f15a"

function                                             old     new   delta
static.drive_name_string                              12       -     -12
append_mount_options                                 205     190     -15
volume_id_open_node                                   37      18     -19
uuidcache_check_device                               485     257    -228
uuidcache_init                                       637      36    -601
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/4 up/down: 0/-875)           Total: -875 bytes
   text    data     bss     dec     hex filename
 792218     592    6648  799458   c32e2 busybox_old
 791260     592    6648  798500   c2f24 busybox_unstripped
2008-10-19 19:36:30 +00:00
Denis Vlasenko bff06fe02a blkid: vda forgot to svn add it again. vda is stupid 2008-10-19 17:47:31 +00:00
Rob Landley 4bdeaaf556 Comment and whitespace tweaks. 2008-10-19 04:21:21 +00:00
Denis Vlasenko e3742f4217 vi: explain why reading 4 chars is unsafe 2008-10-18 19:37:41 +00:00
Denis Vlasenko 3ab3d8a5cf libbb: do not reject floating point strings like ".15" 2008-10-18 19:18:51 +00:00
Denis Vlasenko f9dde919d6 mount: -o parm1 -o parm2 should accumulate 2008-10-18 19:15:57 +00:00
Denis Vlasenko 1dfeeeb651 vi: whitespace fix 2008-10-18 19:04:37 +00:00
Denis Vlasenko cf4dd07b28 cpio: fix regression in prev commit (harmless) 2008-10-17 14:11:04 +00:00
Denis Vlasenko d83676ec47 data_extract_all: do not complain if directory exists on mkdir
rpm/cpio: move "20653 blocks" printout from get_header_cpio to cpio_main -
rpm doesn't want to have that
2008-10-17 14:03:56 +00:00
Denis Vlasenko aa9eb1fc67 rpm: fix incompatibilities which prevented rpm -i foo.src.rpm
function                                             old     new   delta
fileaction_setowngrp                                  57      89     +32
2008-10-16 13:29:13 +00:00
Denis Vlasenko 8ef801b40c vi: a few trivial optimizations to keyboard reading code; bump timeout to 50s.
function                                             old     new   delta
edit_file                                            901     912     +11
count_lines                                           74      72      -2
readit                                               306     289     -17
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 11/-19)             Total: -8 bytes
2008-10-16 09:46:07 +00:00
Rob Landley 7960ea8918 Confirmed that on Linux the serial interrupt takes precedence over the timer
interrupt, so we don't need to worry about scheduler delays.  This means the
delay can be trimmed down to 25 miliseconds.  Add comment while at it.
2008-10-16 06:34:10 +00:00
Denis Vlasenko 8854b352f4 build system: dpkg needs .gz handling 2008-10-15 14:50:14 +00:00
Denis Vlasenko a9c3f7a19e sysctl: sysctl -a was still misbehaving, fix it 2008-10-15 13:50:24 +00:00
Denis Vlasenko 9299305756 return accidentally deleted "/* vi: set sw=4 ts=4: */" 2008-10-15 09:44:37 +00:00
Denis Vlasenko e915a1a410 sysctl: fix bug 3894 _for real_. 2008-10-15 09:43:35 +00:00
Denis Vlasenko 81944c9e92 sysctl: remove trivial comments. no code changes 2008-10-15 08:45:54 +00:00
Denis Vlasenko cfdb711a18 sysctl: remove special-cased reporting of EPERM,
common code path gives nearly the same message. -50 bytes
2008-10-15 08:29:17 +00:00
Denis Vlasenko 58cc52aa76 sysctl: fix bug 3894 (by Kryzhanovskyy Maksym)
function                                             old     new   delta
sysctl_dots_to_slashes                                 -      47     +47
sysctl_write_setting                                 310     298     -12
sysctl_read_setting                                  296     284     -12
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 47/-24)             Total: 23 bytes
2008-10-15 08:22:55 +00:00
Denis Vlasenko d44c1535ae vi: fix bizarre formatting. no code changes 2008-10-14 12:59:42 +00:00
Denis Vlasenko ddc8ae3003 hush: add TODO 2008-10-14 12:50:34 +00:00
Denis Vlasenko 371de4acf7 hush: next small step towards functions 2008-10-14 12:43:13 +00:00
Denis Vlasenko ded6ad34ed fix recurring "last_cmd overrun", fix [del] handling in insert mode 2008-10-14 12:26:30 +00:00
Denis Vlasenko 267e16c74a vi: trivial size optimization -65 bytes 2008-10-14 10:34:41 +00:00
Denis Vlasenko 25497c1d92 vi: reinstate timeout of 300 ms 2008-10-14 10:25:05 +00:00
Denis Vlasenko 5373fbcd11 vi: add comments to Rob's algorithm of reading and matching ESC sequences
(nice work btw!)
2008-10-14 10:09:56 +00:00
Rob Landley 5e38cd910a Escape sequences sent over serial links don't come in as a block, so poll
needs to pause a bit to make sure the next character has time to come in.
2008-10-14 08:44:09 +00:00
Rob Landley 988dd5549b Clean up editors/vi.c:readit() so it only does readahead when actually
parsing an escape sequence.  (This mitigates but doesn't fully fix the
the "cursoring around the file deletes data under qemu" bug, presumably due
to "\033[D" being treated as three separate characters.)
2008-10-14 01:42:33 +00:00
Denis Vlasenko f886fd2bc7 hush: fix NOMMU bug (analogous to preceding commit for MMU) 2008-10-13 12:36:05 +00:00
Denis Vlasenko d29084dd7d testcase for the last fix 2008-10-13 08:54:42 +00:00
Denis Vlasenko 22d10a0292 hush: fix trashing of environment by local env vars:
a=a; a=b cmd; - a was unset!
  +57 bytes

function                                             old     new   delta
add_string_to_strings                                  -     110    +110
putenv_all                                             -      27     +27
run_list                                            2086    2111     +25
free_strings                                           -       7      +7
free_pipe                                            210     208      -2
add_malloced_string_to_strings                       110       -    -110
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 1/1 up/down: 169/-112)           Total: 57 bytes
2008-10-13 08:53:43 +00:00
Denis Vlasenko 1e19afd38a blkid: new applet. We almost had everything needed for it already
function                                             old     new   delta
display_uuid_cache                                     -      89     +89
blkid_main                                             -       8      +8
applet_names                                        1871    1877      +6
applet_main                                         1140    1144      +4
applet_nameofs                                       570     572      +2
packed_usage                                       24737   24735      -2
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 3/1 up/down: 109/-2)            Total: 107 bytes
2008-10-12 11:20:08 +00:00
Denis Vlasenko d5e305944a findfs: fix LUKS and FAT detection routines; do not exit if corrupted
FAT fs makes us try to seek past volume

function                                             old     new   delta
volume_id_get_buffer                                 301     327     +26
volume_id_probe_luks                                  79      82      +3
get_attr_volume_id                                    73      65      -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 29/-8)              Total: 21 bytes
2008-10-12 11:17:49 +00:00
Denis Vlasenko cdd1f732bc zcip: code size optimizations, improved help text and comments
function                                             old     new   delta
packed_usage                                       24750   24787     +37
run                                                  658     655      -3
pick                                                  40      34      -6
arp                                                  186     177      -9
zcip_main                                           1402    1356     -46
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/4 up/down: 37/-64)            Total: -27 bytes
2008-10-10 11:28:39 +00:00
Denis Vlasenko afd7a8d744 hush: fix environment and memory leaks, add tests for them
function                                             old     new   delta
add_malloced_string_to_strings                         -     110    +110
run_list                                            1999    2086     +87
free_strings_and_unsetenv                              -      87     +87
hush_version_str                                       -      18     +18
pseudo_exec_argv                                     139     146      +7
static.version_str                                    17       -     -17
free_pipe                                            237     210     -27
done_word                                            790     642    -148
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 2/2 up/down: 309/-192)          Total: 117 bytes
2008-10-09 16:29:44 +00:00
Denis Vlasenko 07e05c100f unzip: remove example of a file we now can handle 2008-10-09 13:52:30 +00:00
Denis Vlasenko c373527e4f hush: preparatory work for implementing functions 2008-10-09 12:58:26 +00:00
Denis Vlasenko 9af22c7626 hush: massive renaming of ill-named structures and fields
hush: error out on constructs like:
 $ abc(def) - was working as if it was (abcdef)
 $ case b in abc(a|(b) echo YES; esac - was ignoring 'abc' and extra '('
2008-10-09 12:54:58 +00:00
Bernhard Reutner-Fischer 578de8644c - route metric support (Natanael Copa)
Adds about 75b
2008-10-07 17:00:58 +00:00
Bernhard Reutner-Fischer 2239f81941 - add some anchors 2008-10-07 16:05:03 +00:00
Denis Vlasenko 834dee785d ash: support &> redirection (bashism). ~90 bytes of code 2008-10-07 09:18:30 +00:00
Denis Vlasenko 176d49d4f7 ash: some beautification work, no code changes 2008-10-06 09:51:47 +00:00
Denis Vlasenko 559691a3bf ash: implement ">&file" bashism. ~100 bytes. 2008-10-05 18:39:31 +00:00
Denis Vlasenko 93d0776a96 watchdog: WDIOC_SETTIMEOUT accepts seconds, not milliseconds
klogd: handle many lines at once, by Steve Bennett (steveb AT workware.net.au)
2008-10-04 16:40:17 +00:00
Bernhard Reutner-Fischer c2d5a27b62 - wrap overlong line 2008-10-02 13:30:31 +00:00
Denis Vlasenko f60719cd49 grep: fix 'echo aaa | grep -o a' + ENABLE_EXTRA_COMPAT case
by Natanael Copa
2008-09-30 22:37:29 +00:00
Denis Vlasenko df6b3ad6ba inetd: use config parser. by Vladimir
function                                             old     new   delta
reread_config_file                                  1092    2154   +1062
next_line                                             98      33     -65
next_word                                            197      57    -140
parse_one_line                                      1202       -   -1202
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/2 up/down: 1062/-1407)       Total: -345 bytes
2008-09-30 01:22:25 +00:00
Denis Vlasenko 58680706d7 route: fix for 64-bit BE machines by Seonghun Lim (wariua AT gmail.com) 2008-09-28 23:39:18 +00:00
Denis Vlasenko 22eb410d66 website: announce 1.12.1 and 1.11.3 2008-09-28 18:33:02 +00:00
Denis Vlasenko 27e1501cb2 scripts/randomtest[.loop]: add scripts for randomconfig testing 2008-09-28 17:19:02 +00:00
Denis Vlasenko 651d49a2ce showkey: suppress gcc warning 2008-09-28 16:44:28 +00:00
Denis Vlasenko 2b2d977057 sendmail: update by Vladimir 2008-09-28 13:50:57 +00:00
Denis Vlasenko 6826441a02 remove redundant NULL check 2008-09-27 23:39:55 +00:00
Denis Vlasenko bb04506dc8 more style fixes, no code changes 2008-09-27 14:06:06 +00:00
Denis Vlasenko d6855d1b50 style fixes, no code changes 2008-09-27 14:03:25 +00:00
Denis Vlasenko bed22a01fb sendmail: compat update by Vladimir
function                                             old     new   delta
sendgetmail_main                                    1889    2091    +202
putchar_unlocked                                       -      43     +43
putchar                                                -      43     +43
packed_usage                                       24868   24910     +42
smtp_checkp                                          102     111      +9
uuencode                                             235     227      -8
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 3/1 up/down: 339/-8)            Total: 331 bytes
2008-09-27 14:01:22 +00:00
Denis Vlasenko 682ad3045c lineedit: fix problems with empty commands in history 2008-09-27 01:28:56 +00:00
Denis Vlasenko 75897ea6d5 start_stop_daemon: accept (and ignore) -R <param> 2008-09-27 01:05:13 +00:00
Denis Vlasenko 739e30fbc3 udhcp: add inline docs; small code shrink
function                                             old     new   delta
send_packet                                          103      87     -16
udhcpc_main                                         2359    2323     -36
2008-09-26 23:45:20 +00:00
Denis Vlasenko 7d9399e8dc udhcpc: fixlet for previous commit 2008-09-26 22:21:03 +00:00
Denis Vlasenko c321b51dc6 udhcp: added some FIXMEs; code shrink. -49 bytes 2008-09-26 16:29:12 +00:00
Bernhard Reutner-Fischer 1a89133caf Markus Heidelberg writes:
* document --nicelevel in Config.in
* usage: --verbose is the fancy option, not --quiet
2008-09-26 15:14:56 +00:00
Bernhard Reutner-Fischer 48a6773b3a - add less -I to be able to search case-insensitively
+17b, but the helptext is quite elaborate, thus:
function                                             old     new   delta
.rodata                                           118995  119032     +37
packed_usage                                       24731   24767     +36
regex_process                                        284     300     +16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 89/0)               Total: 89 bytes
2008-09-26 14:10:17 +00:00
Bernhard Reutner-Fischer fd3552dff9 - commentary typo fix 2008-09-26 11:23:22 +00:00
Denis Vlasenko bfc93a3caf nmeter: 4k buffers are too small for /proc files,
make them dynamically sized with 16k upper limit. +75 bytes
2008-09-26 11:12:09 +00:00
Denis Vlasenko ee5dce3365 libpwdgrp: make it coexist with <pwd.h>, <grp.h> and <shadow.h>.
allows to get rid of hacks in libbb.h (extra declaration of setgroups -
 now it comes from grp.h as intended).
2008-09-26 10:35:55 +00:00
Denis Vlasenko f1980f67d3 dhcp: add FAST_FUNC as appropriate. -160 bytes. 2008-09-26 09:34:59 +00:00
Denis Vlasenko cdb0b652dd dhcpc: treat "discover...select...discover..." loop the same way
as "discover...discover...discover..."
2008-09-26 09:34:15 +00:00
Denis Vlasenko b46d5f9a93 fix usage text - s/USE_GETOPT_LONG/USE_FEATURE_xxxLONG_OPTIONS/
by Markus Heidelberg (markus.heidelberg AT web.de)
2008-09-25 21:06:24 +00:00
Bernhard Reutner-Fischer 97516fc3a6 - add dpkg -l <packagepattern> (Peter Korsgaard) 2008-09-25 12:18:49 +00:00
Bernhard Reutner-Fischer 6c4dadefb6 - update my name. No obj-code changes ;) 2008-09-25 12:13:34 +00:00
Bernhard Reutner-Fischer a46d2b1d2d - improve helptext 2008-09-25 11:50:13 +00:00
Denis Vlasenko c8842213f5 top: fix "top -d 1" (bug 5144) 2008-09-25 11:42:10 +00:00
Denis Vlasenko 42cc6bab16 top: don't lie in help screen about "-d 1" being valid 2008-09-25 11:17:10 +00:00
Denis Vlasenko 35840ab204 top: fixes to prev commit: '1' should toggle SMP view too;
"cpu ..." line should be parsed unconditionally
top: do not truncate loadavg string. More info -> better
2008-09-25 11:11:37 +00:00
Bernhard Reutner-Fischer 864329d674 - fix compilation on OSF/1 2008-09-25 10:55:05 +00:00
Denis Vlasenko 17e7f04c8d top: optional SMP support by Vineet Gupta (vineetg76 AT gmail.com) 2008-09-25 10:48:06 +00:00
Denis Vlasenko e0bcba18eb df: unsigned long needs %lu 2008-09-25 10:41:15 +00:00
Denis Vlasenko ea7c9b3366 whitespace fixes 2008-09-25 10:39:10 +00:00
Denis Vlasenko cac0f5b7e5 return setgroups() decl to libbb, it is needed if we use libpwdgrp. 2008-09-25 10:20:46 +00:00
Mike Frysinger f6cad924b1 we dont provide setgroups() replacement, so dont provide the prototype either ... especially since it conflicts on some systems (like Darwin) 2008-09-25 00:41:49 +00:00
Denis Vlasenko 923a79a769 runsvdir: conditionalize "log in argiment" (mis)feature. By Vladimir.
with:
runsv                                                139     141      +2
runsvdir_main                                       1583    1513     -70

 without:
warn2_cannot                                          14      27     +13
runsv                                                139     141      +2
warnx                                                 28      16     -12
warn3x                                                23       -     -23
runsvdir_main                                       1583    1125    -458
2008-09-22 21:34:24 +00:00
Denis Vlasenko 30cfdf90ce crontab: do not destroy STDIN_FILENO, editor may need it (crontab -e)
vi: deal with EOF/error on stdin and with input NULs

function                                             old     new   delta
crontab_main                                         623     642     +19
edit_file                                            901     906      +5
readit                                               331     318     -13
2008-09-21 15:29:29 +00:00
Denis Vlasenko 006e8628fc unzip: handle "central directory"
needed for OpenOffice, gmail attachment .zips etc
 conditional on CONFIG_DESKTOP

function                                             old     new   delta
unzip_main                                          1643    1939    +296
find_cds_offset                                        -     173    +173
unzip_skip                                            11      16      +5
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 474/0)             Total: 474 bytes
2008-09-21 01:01:46 +00:00
Denis Vlasenko eef6077d7e setfont: use ioctl(KDFONTOP), it honours -C tty 2008-09-20 18:14:13 +00:00
Denis Vlasenko b8d1a4cd5f init: set stderr to NONBLOCK
*: s/setenv(a,b,1)/xsetenv(a,b)/

function                                             old     new   delta
init_main                                            856     895     +39
message                                              146     144      -2
crond_main                                          1418    1416      -2
run                                                  661     658      -3
zcip_main                                           1409    1403      -6
edit_file                                            910     901      -9
environment                                           20       -     -20
2008-09-20 16:28:59 +00:00
Denis Vlasenko b61dc1c1ce webpage: add "RD129 embedded board from ELPA" to product page
split it into "projects" (software) and "products" (hardware) parts
2008-09-20 15:16:50 +00:00
Denis Vlasenko 3728bc5a3d website: add a product using bbox - EMTEC MovieCube R700 2008-09-20 13:28:45 +00:00
Denis Vlasenko 248b4a77e7 libbb: document that we maybe will want to understand \e someday
(no code changes)
2008-09-19 23:43:59 +00:00
Denis Vlasenko 9ac706b7a6 grep: yet another fixlet for EXTRA_COMPAT 2008-09-19 21:32:51 +00:00
Denis Vlasenko c110b7d61f grep: fix EXTRA_COMPAT grep to honor -E and -i 2008-09-19 21:29:21 +00:00
Denis Vlasenko 72fa70af4c setfont: small fixes from Vladimir 2008-09-18 01:01:02 +00:00
Denis Vlasenko 2228426512 id: fix "id <user>" case. Requires getgrouplist().
function                                             old     new   delta
getgrouplist_internal                                  -     200    +200
id_main                                              462     539     +77
bb_internal_getgrouplist                               -      67     +67
bb__parsespent                                       119     117      -2
bb_internal_initgroups                               213      58    -155
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/2 up/down: 344/-157)          Total: 187 bytes
2008-09-18 00:56:24 +00:00
Denis Vlasenko 28f5619e84 slattach: preserve speed in non-raw mode. +39 bytes.
by Matthieu CASTET (matthieu.castet AT parrot.com)
2008-09-16 21:27:59 +00:00
Denis Vlasenko 53f219ebbe setfont: support -m and -C, support -m TEXTUAL_MAP (by Vladimir)
build system: fixlet for echo applet config

function                                             old     new   delta
setfont_main                                         157     387    +230
ctoi                                                   -      75     +75
packed_usage                                       24921   24950     +29
2008-09-16 19:35:42 +00:00
Denis Vlasenko a1e16c9298 man: do not use default if /etc/man.conf has different MANPATH
do not warn if /etc/man.conf does not exist
2008-09-14 21:30:35 +00:00
Denis Vlasenko e357d2ae68 man: use default MANPATH of "/usr/man"; do not search paths twice 2008-09-14 21:26:55 +00:00
Denis Vlasenko 7c9c1bb616 modprobe-small: trivial SEGV fix 2008-09-14 20:33:03 +00:00
Denis Vlasenko 0d602e9386 id: unsigned long is excessive for option bitmask 2008-09-14 19:31:36 +00:00
Denis Vlasenko 2bc5c033dc setfont: add comments/TODOs, no code changes 2008-09-13 18:27:32 +00:00
Denis Vlasenko ba1315d0fb modutils/*: rewrite by Timo Teras <timo.teras AT iki.fi>
- a lot faster (linear algorithmic complexity, smaller memory foot print)
- a lot smaller (the old code was overly complicated)
- loading of aliases is now module-init-tools compliant
- blacklisting is done correctly (-b option added)
- module argument quoting done right
- depmod now correctly generates modules.symbols and modules.alias

add/remove: 16/21 grow/shrink: 4/6 up/down: 6930/-9316 Total: -2386 bytes
   text    data     bss     dec     hex filename
 806039     592    6680  813311   c68ff busybox_old
 803498     592    6676  810766   c5f0e busybox_unstripped
2008-09-13 14:59:38 +00:00
Denis Vlasenko 4f3209b9d4 id: code shrink
function                                             old     new   delta
id_main                                              494     462     -32
2008-09-13 12:51:10 +00:00
Bernhard Reutner-Fischer 0ee1cb0084 - implement id -G (Tito Ragusa) 2008-09-12 09:58:11 +00:00
Paul Mundt 70de57f60a Kill off bogus #error's for big endian SH targets, these work fine. 2008-09-12 09:19:40 +00:00
Denis Vlasenko 08ea11ab07 runsvd: shrink by Vladimir
*: use unified trivial signal handler

function                                             old     new   delta
record_signo                                           -      10     +10
process_stdin                                        433     443     +10
bbunpack                                             383     391      +8
wc_main                                              598     605      +7
conescape                                            293     296      +3
nmeter_main                                          670     672      +2
fallbackSort                                        1717    1719      +2
bb_got_signal                                          -       1      +1
microcom_main                                        713     712      -1
signalled                                              2       -      -2
pack_gzip                                           1661    1659      -2
evalvar                                             1376    1374      -2
compare_keys                                         737     735      -2
parse_command                                       1460    1456      -4
expand                                              1748    1744      -4
s_term                                                37      29      -8
s_hangup                                               8       -      -8
fgotsig                                               10       -     -10
find_pair                                            187     169     -18
signal_handler                                       190     170     -20
runsvdir_main                                       1701    1583    -118
------------------------------------------------------------------------------
(add/remove: 2/3 grow/shrink: 6/10 up/down: 43/-199)         Total: -156 bytes
2008-09-11 19:51:11 +00:00
Denis Vlasenko 9725daa03a halt: reinstate -w even if !FEATURE_WTMP; beautify code in halt.c 2008-09-11 09:54:23 +00:00
Denis Vlasenko 8d89bed840 watchdog: add -T option
function                                             old     new   delta
 watchdog_main                                        159     219     +60
mdev: support match by major,minor. See bug 4714.
 +100 bytes.
2008-09-07 23:22:08 +00:00
Denis Vlasenko ee9deb863e ifenslave: on uclibc at least, net/if.h + linux/if_bonding.h dont coexist 2008-09-06 14:52:28 +00:00
Denis Vlasenko ee34ebe966 ifenslave: wants net/if.h 2008-09-06 14:42:27 +00:00
Denis Vlasenko 9f9c1935fa install: shrink -D code. By Bernhard.
function                                             old     new   delta
install_main                                         726     707     -19
2008-09-06 14:35:08 +00:00
Denis Vlasenko 1c781cc8ff modprobe-small: make insmod command line compatible
function                                             old     new   delta
modprobe_main                                        326     435    +109
moderror                                               -      52     +52
process_module                                       577     530     -47
2008-09-06 14:14:01 +00:00
Bernhard Reutner-Fischer 4acb1b0793 - commentary typo fix 2008-09-05 11:46:43 +00:00
Denis Vlasenko 665eaff3b1 awk: add a comment 2008-09-05 04:59:02 +00:00
Bernhard Reutner-Fischer fd6b5ad137 - uncomment tc for now 2008-09-04 16:16:47 +00:00
Bernhard Reutner-Fischer 0901c51518 - add WIP stub for tc.
Printing worked at some point. Modify/Delete needs some refacturing.
2008-09-04 13:22:58 +00:00
Bernhard Reutner-Fischer 161931efa5 - mention that we ignore -v, -b, -c 2008-09-04 09:33:23 +00:00
Denis Vlasenko d4b719878f kbd_mode: fix non-ASCII letters in comments
install: support -D
2008-09-03 21:54:46 +00:00
Denis Vlasenko a2e1eea189 awk: improve nadling of negative numbers in bitwise ops;
fix handling of octal costants. add test for it

function                                             old     new   delta
getvar_i_int                                           -      93     +93
my_strtod                                              -      84     +84
qrealloc                                              33      36      +3
getvar_i                                              99      95      -4
next_token                                           979     919     -60
evaluate                                            6359    5627    -732
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/3 up/down: 180/-796)         Total: -616 bytes
2008-09-02 09:00:23 +00:00
Bernhard Reutner-Fischer b424930e4e - pass "Accept:" and "Accept-Language:" header to CGI scripts (Alina Friedrichsen)
Alina writes:
With this patch the BusyBox httpd pass the "Accept:" and
"Accept-Language:" header by the environment variables to the
CGI-Script, so this can make Content Negotiation to deliver the page in
the language, which was selected by the user in the browser settings,
and/or serve the XHTML page with the right MIME-Type
application/xhtml+xml to user agents which support it und text/html
which don't.

(Needed e.g. for OpenWrt LuCI.)

Signed-off-by: Alina Friedrichsen <x-alina at gmx dot net>
2008-09-01 15:30:49 +00:00
Bernhard Reutner-Fischer 2bdc99f600 - remove excess whitespace (Vladimir Dronnikov) 2008-09-01 15:26:12 +00:00
Bernhard Reutner-Fischer d93179fd5b - halt's -w depends on FEATURE_WTMP (Vladimir Dronnikov) 2008-09-01 15:24:52 +00:00
Bernhard Reutner-Fischer d129d7c3cd - add ether-wake to the hardcoded(argh!) list of APPLET_ODDNAME 2008-09-01 15:23:04 +00:00
Denis Vlasenko 04e458d435 insmod: fix detection of open failure 2008-08-31 21:56:48 +00:00
Denis Vlasenko 1045d00462 build system: fix "Possible unintended interpolation of @host"
message
2008-08-31 21:29:35 +00:00
Denis Vlasenko 66496d75a7 build system: echo and test features may be enabled
even if these applets are enabled as ash builtins only
testsuite: add some awk tests
2008-08-29 08:37:07 +00:00
Denis Vlasenko 7cbcd1cbf4 awk: bitwise ops cast oprands and results to unsigned long,
not signed. closes 4774.
2008-08-28 23:16:58 +00:00
Denis Vlasenko 996a61475a awk: support hex constants 2008-08-28 22:59:23 +00:00
Denis Vlasenko d66aa3c701 df: add support for more options, add some coreutils 6.10 compat.
by Bernhard Reutner-Fischer

function                                             old     new   delta
df_main                                              664     795    +131
packed_usage                                       24812   24862     +50
make_human_readable_str                              213     262     +49
static.ignored_mounts                                  -       8      +8
static.unit_chars                                      -       7      +7
static.zero_and_units                                  6       -      -6
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 3/0 up/down: 245/-6)            Total: 239 bytes
2008-08-28 22:42:52 +00:00
Denis Vlasenko 3b80cac953 insmod: mix xmalloc with xrealloc_vector more carefully 2008-08-28 21:38:10 +00:00
Bernhard Reutner-Fischer 1ebdaccd6d - forgot to pass in the HOST_EXTRACFLAGS 2008-08-28 14:29:54 +00:00
Denis Vlasenko 18c93029fd insmod: shrink
function                                             old     new   delta
obj_allocate_commons                                 488     462     -26
insmod_main                                         3830    3714    -116
2008-08-27 22:29:43 +00:00
Denis Vlasenko 8f0e342803 cksum: respect CONFIG_LFS=y. Adds 36 bytes in this case. 2008-08-27 21:31:23 +00:00
Bernhard Reutner-Fischer f3d1e213fe - pull check-lxdialog from linux-2.6.26 2008-08-27 07:39:57 +00:00
Denis Vlasenko b522d6931d trylink: make messages less confusing 2008-08-26 20:09:08 +00:00
Denis Vlasenko 279ca69727 modprobe-small: support "blacklist" keyword in /etc/modules/<modulename> 2008-08-26 01:32:33 +00:00
Denis Vlasenko c4e4b6b936 reinstate sponsor's links 2008-08-25 22:03:41 +00:00
Denis Vlasenko b66d16a2e6 fbset: fix mode matching code: original code may trigger false positive.
E.g. fbset -n '16bit'
 succeeded at 'mode "640x480 16bit"' and that is wrong.
 Also parser is rewritten. By Vladimir.

function                                             old     new   delta
static.syncs                                           -      20     +20
g_options                                              4       -      -4
g_cmdoptions                                         432     385     -47
fbset_main                                          1842    1642    -200
2008-08-24 16:25:40 +00:00
Denis Vlasenko 5770715588 ping: SO_RCVBUF must be bigger than packet size,
otherwise large ping packets might fail to be received.
2008-08-24 00:02:18 +00:00
Denis Vlasenko 15f2fdb2b9 hexdump: fix SEGV in hexdump -e "" 2008-08-23 23:15:48 +00:00
Denis Vlasenko 7fe21c69cd setarch: do not try to use non-existent data in argv[] 2008-08-23 23:15:17 +00:00
Denis Vlasenko 6cd36bc2da tweak web page 2008-08-22 11:16:52 +00:00
Bernhard Reutner-Fischer 9ff245f6a0 - move some older news to the news archive (the main page was once again over 30kib big) 2008-08-22 08:45:01 +00:00
Bernhard Reutner-Fischer 7d0d3e265b - reformat help text 2008-08-22 08:25:26 +00:00
Denis Vlasenko 657341762a Announce 1.11.2 2008-08-21 22:10:47 +00:00
Bernhard Reutner-Fischer a28a05b96a - print the documentation per default 2008-08-21 21:15:28 +00:00
Bernhard Reutner-Fischer 99ecc46d93 - document rmdir args 2008-08-21 20:52:55 +00:00
Bernhard Reutner-Fischer 6375853cd8 - document rmmod -w and -f arguments 2008-08-21 20:18:55 +00:00
Denis Vlasenko e82da4dfee fix xargs -e help text 2008-08-21 19:59:30 +00:00
Bernhard Reutner-Fischer c397792ab3 - tweak markup. No relevant changes 2008-08-21 16:08:06 +00:00
Bernhard Reutner-Fischer bc8bc59e69 - cleanup urls 2008-08-21 14:37:14 +00:00
Bernhard Reutner-Fischer 3b0161d045 - fix typo 2008-08-21 14:14:36 +00:00
Bernhard Reutner-Fischer f2d4a65be8 - fix markup 2008-08-21 14:10:55 +00:00
Bernhard Reutner-Fischer eae3846e87 - do not advertise the standalone udhcpd. It is actively maintained in busybox only. 2008-08-21 14:08:44 +00:00
Bernhard Reutner-Fischer e0fe65b68f - fix markup 2008-08-21 14:00:25 +00:00
Bernhard Reutner-Fischer 8eeaa747c8 - add doc-clean target 2008-08-21 13:47:20 +00:00
Bernhard Reutner-Fischer 6887e77c32 - add note about CONFIG_CROSS_COMPILER_PREFIX while cleanup up markup. 2008-08-21 13:37:47 +00:00
Bernhard Reutner-Fischer 20a55b7bff - fix typo of mine 2008-08-21 13:32:14 +00:00
Bernhard Reutner-Fischer f0d0811c05 - improve documentation a bit 2008-08-21 13:22:44 +00:00
Bernhard Reutner-Fischer b5d701d737 - some more nitpicks 2008-08-21 12:52:45 +00:00
Bernhard Reutner-Fischer beea4b8021 - some more markup fixes 2008-08-21 12:42:39 +00:00
Bernhard Reutner-Fischer 0fa539457b - fix typo 2008-08-21 12:27:42 +00:00
Denis Vlasenko b91168a74c more of pointless beautifuing on the web page 2008-08-21 12:24:02 +00:00
Denis Vlasenko f9dba6e226 trim webpage text a bit 2008-08-21 12:07:38 +00:00
Bernhard Reutner-Fischer 557f9c4b31 - drop outdated paragraph (which additionally contained some mistyped html-like junk) 2008-08-21 11:54:23 +00:00
Bernhard Reutner-Fischer 5f52150536 - misc. minor tweaks 2008-08-21 11:52:12 +00:00
Bernhard Reutner-Fischer beb6ea47c3 - point people to the current stable branch 2008-08-21 11:43:36 +00:00
Bernhard Reutner-Fischer 78c41b2dc5 - tweak markup 2008-08-21 11:38:22 +00:00
Denis Vlasenko 14a79381d0 more cosmetic fixes on the website 2008-08-21 11:36:24 +00:00
Denis Vlasenko 68cef20f5d cosmetic fixes on the webpage 2008-08-21 11:34:57 +00:00
Bernhard Reutner-Fischer b22fbfefc8 - tweak markup 2008-08-21 11:34:46 +00:00
Bernhard Reutner-Fischer a0420aba1c - bump copyright year 2008-08-21 11:23:42 +00:00
Bernhard Reutner-Fischer 158f1d4ea6 - fix markup 2008-08-21 11:19:52 +00:00
Bernhard Reutner-Fischer 8c8601cfbc - fix some wrong markup.
sed -i -e 's, href=\([^"][^>]*\)>, href="\1">,g' *.html
  The proper way to specify an attribute is to quote the val: theattrib="val"
2008-08-21 10:54:55 +00:00
Bernhard Reutner-Fischer 040feada1e - correct release date for 1.12.0 and fix a few typos 2008-08-21 10:35:26 +00:00
Denis Vlasenko c1b39edee1 announce 1.12.0 2008-08-21 10:19:28 +00:00
Denis Vlasenko 2a7031bb12 Bump version to 1.13.0.svn 2008-08-20 23:30:42 +00:00
267 changed files with 14130 additions and 10674 deletions

No files matched your search

+1 -1
View File
@@ -166,7 +166,7 @@ Paul Fox <pgf@foxharp.boston.ma.us>
Roberto A. Foglietta <me@roberto.foglietta.name>
port: dnsd
Bernhard Fischer <rep.nop@aon.at>
Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
misc
Mike Frysinger <vapier@gentoo.org>
+26 -20
View File
@@ -155,15 +155,17 @@ config FEATURE_SUID
default n
help
With this option you can install the busybox binary belonging
to root with the suid bit set, and it'll and it'll automatically drop
to root with the suid bit set, and it will automatically drop
priviledges for applets that don't need root access.
If you're really paranoid and don't want to do this, build two
If you are really paranoid and don't want to do this, build two
busybox binaries with different applets in them (and the appropriate
symlinks pointing to each binary), and only set the suid bit on the
one that needs it. The applets currently marked to need the suid bit
are login, passwd, su, ping, traceroute, crontab, dnsd, ipcrm, ipcs,
and vlock.
are:
crontab, dnsd, findfs, ipcrm, ipcs, login, passwd, ping, su,
traceroute, vlock.
config FEATURE_SUID_CONFIG
bool "Runtime SUID/SGID configuration via /etc/busybox.conf"
@@ -254,18 +256,18 @@ config BUSYBOX_EXEC_PATH
# These are auto-selected by other options
config FEATURE_SYSLOG
bool "Support for logging to syslog"
bool #No description makes it a hidden option
default n
help
This option is auto-selected when you select any applet which may
send its output to syslog. You do not need to select it manually.
#help
# This option is auto-selected when you select any applet which may
# send its output to syslog. You do not need to select it manually.
config FEATURE_HAVE_RPC
bool "RPC support"
bool #No description makes it a hidden option
default n
help
This is automatically selected if any of enabled applets need it.
You do not need to select it manually.
#help
# This is automatically selected if any of enabled applets need it.
# You do not need to select it manually.
endmenu
@@ -402,9 +404,12 @@ config CROSS_COMPILER_PREFIX
help
If you want to build BusyBox with a cross compiler, then you
will need to set this to the cross-compiler prefix, for example,
"i386-uclibc-". Note that CROSS_COMPILE environment variable
or "make CROSS_COMPILE=xxx ..." will override this selection.
For native build leave it empty.
"i386-uclibc-".
Note that CROSS_COMPILE environment variable or
"make CROSS_COMPILE=xxx ..." will override this selection.
Native builds leave this empty.
endmenu
@@ -491,8 +496,8 @@ config INCLUDE_SUSv2
will be supported in head, tail, and fold. (Note: should
affect renice too.)
config PARSE
bool "Uniform config file parser debugging applet: parse"
### config PARSE
### bool "Uniform config file parser debugging applet: parse"
endmenu
@@ -590,9 +595,10 @@ source modutils/Config.in
source util-linux/Config.in
source miscutils/Config.in
source networking/Config.in
source printutils/Config.in
source mailutils/Config.in
source procps/Config.in
source shell/Config.in
source sysklogd/Config.in
source runit/Config.in
source selinux/Config.in
source printutils/Config.in
source shell/Config.in
source sysklogd/Config.in
+10 -3
View File
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 12
SUBLEVEL = 0
PATCHLEVEL = 13
SUBLEVEL = 2
EXTRAVERSION =
NAME = Unnamed
@@ -456,6 +456,7 @@ libs-y := \
libbb/ \
libpwdgrp/ \
loginutils/ \
mailutils/ \
miscutils/ \
modutils/ \
networking/ \
@@ -505,7 +506,7 @@ endif
# command line.
# This allow a user to issue only 'make' to build a kernel including modules
# Defaults busybox but it is usually overridden in the arch makefile
all: busybox
all: busybox doc
-include $(srctree)/arch/$(ARCH)/Makefile
@@ -966,6 +967,12 @@ clean: archclean $(clean-dirs)
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
-type f -print | xargs rm -f
PHONY += doc-clean
doc-clean: rm-files := docs/busybox.pod \
docs/BusyBox.html docs/BusyBox.1 docs/BusyBox.txt
doc-clean:
$(call cmd,rmfiles)
# mrproper - Delete all generated files, including .config
#
mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
+4
View File
@@ -105,6 +105,10 @@ bigdata: busybox_unstripped
.PHONY: doc
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
# FIXME: Doesn't belong here
disp_doc = \
@$(if $(quiet),echo " DOC $(@F)")
docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
$(srctree)/include/usage.h \
$(srctree)/docs/busybox_footer.pod \
+1
View File
@@ -6,6 +6,7 @@ help:
@echo 'Cleaning:'
@echo ' clean - delete temporary files created by build'
@echo ' distclean - delete all non-source files (including .config)'
@echo ' doc-clean - delete all generated documentation'
@echo
@echo 'Build:'
@echo ' all - Executable and documentation'
+1 -1
View File
@@ -99,7 +99,7 @@ Rob Landley suggested these:
This one's open to everybody, but I'll wind up doing it...
Bernhard Fischer <busybox@busybox.net> suggests to look at these:
Bernhard Reutner-Fischer <busybox@busybox.net> suggests to look at these:
New debug options:
-Wlarger-than-127
Cleanup any big users
+92 -72
View File
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.12.0.svn
# Wed Aug 20 00:24:07 2008
# Busybox version: 1.13.0.svn
# Sun Nov 9 17:09:13 2008
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -13,8 +13,8 @@ CONFIG_HAVE_DOT_CONFIG=y
# General Configuration
#
CONFIG_DESKTOP=y
# CONFIG_EXTRA_COMPAT is not set
CONFIG_FEATURE_ASSUME_UNICODE=y
CONFIG_EXTRA_COMPAT=y
# CONFIG_FEATURE_ASSUME_UNICODE is not set
CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
@@ -58,7 +58,6 @@ CONFIG_NO_DEBUG_LIB=y
# CONFIG_DMALLOC is not set
# CONFIG_EFENCE is not set
CONFIG_INCLUDE_SUSv2=y
# CONFIG_PARSE is not set
#
# Installation Options
@@ -153,7 +152,7 @@ CONFIG_DD=y
CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
CONFIG_FEATURE_DD_IBS_OBS=y
CONFIG_DF=y
CONFIG_FEATURE_DF_INODE=y
CONFIG_FEATURE_DF_FANCY=y
CONFIG_DIRNAME=y
CONFIG_DOS2UNIX=y
CONFIG_UNIX2DOS=y
@@ -283,6 +282,8 @@ CONFIG_FEATURE_RESIZE_PRINT=y
CONFIG_SETCONSOLE=y
CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y
CONFIG_SETFONT=y
CONFIG_FEATURE_SETFONT_TEXTUAL_MAP=y
CONFIG_DEFAULT_SETFONT_DIR=""
CONFIG_SETKEYCODES=y
CONFIG_SETLOGCONS=y
CONFIG_SHOWKEY=y
@@ -304,7 +305,7 @@ CONFIG_WHICH=y
# Editors
#
CONFIG_AWK=y
CONFIG_FEATURE_AWK_MATH=y
CONFIG_FEATURE_AWK_LIBM=y
CONFIG_CMP=y
CONFIG_DIFF=y
CONFIG_FEATURE_DIFF_BINARY=y
@@ -367,7 +368,6 @@ CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
# Init Utilities
#
CONFIG_INIT=y
# CONFIG_DEBUG_INIT is not set
CONFIG_FEATURE_USE_INITTAB=y
CONFIG_FEATURE_KILL_REMOVED=y
CONFIG_FEATURE_KILL_DELAY=1
@@ -422,35 +422,36 @@ CONFIG_LSATTR=y
#
# Linux Module Utilities
#
CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
CONFIG_MODPROBE_SMALL=y
CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y
CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y
# CONFIG_DEPMOD is not set
# CONFIG_FEATURE_DEPMOD_PRUNE_FANCY is not set
# CONFIG_FEATURE_DEPMOD_ALIAS is not set
# CONFIG_INSMOD is not set
# CONFIG_RMMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
# CONFIG_MODPROBE is not set
# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
# CONFIG_DEPMOD is not set
#
# Options common to multiple modutils
#
# CONFIG_FEATURE_2_4_MODULES is not set
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
# CONFIG_RMMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
# CONFIG_MODPROBE is not set
# CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS is not set
# CONFIG_FEATURE_MODPROBE_FANCY_ALIAS is not set
# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
# CONFIG_FEATURE_2_4_MODULES is not set
# CONFIG_FEATURE_2_6_MODULES is not set
CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
# CONFIG_FEATURE_QUERY_MODULE_INTERFACE is not set
# CONFIG_FEATURE_MODUTILS_ALIAS is not set
# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
#
# Linux System Utilities
#
CONFIG_BLKID=y
CONFIG_DMESG=y
CONFIG_FEATURE_DMESG_PRETTY=y
CONFIG_FBSET=y
@@ -555,15 +556,17 @@ CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y
CONFIG_FEATURE_CHAT_CLR_ABORT=y
CONFIG_CHRT=y
CONFIG_CROND=y
CONFIG_DEBUG_CROND_OPTION=y
CONFIG_FEATURE_CROND_D=y
CONFIG_FEATURE_CROND_CALL_SENDMAIL=y
CONFIG_CRONTAB=y
CONFIG_DC=y
CONFIG_FEATURE_DC_LIBM=y
# CONFIG_DEVFSD is not set
# CONFIG_DEVFSD_MODLOAD is not set
# CONFIG_DEVFSD_FG_NP is not set
# CONFIG_DEVFSD_VERBOSE is not set
# CONFIG_FEATURE_DEVFS is not set
CONFIG_DEVMEM=y
CONFIG_EJECT=y
CONFIG_FEATURE_EJECT_SCSI=y
CONFIG_FBSPLASH=y
@@ -575,9 +578,11 @@ CONFIG_LESS=y
CONFIG_FEATURE_LESS_MAXLINES=9999999
CONFIG_FEATURE_LESS_BRACKETS=y
CONFIG_FEATURE_LESS_FLAGS=y
CONFIG_FEATURE_LESS_FLAGCS=y
CONFIG_FEATURE_LESS_DASHCMD=y
CONFIG_FEATURE_LESS_MARKS=y
CONFIG_FEATURE_LESS_REGEXP=y
CONFIG_FEATURE_LESS_LINENUMS=y
CONFIG_FEATURE_LESS_WINCH=y
CONFIG_HDPARM=y
CONFIG_FEATURE_HDPARM_GET_IDENTITY=y
CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y
@@ -689,8 +694,6 @@ CONFIG_PING6=y
CONFIG_FEATURE_FANCY_PING=y
CONFIG_PSCAN=y
CONFIG_ROUTE=y
CONFIG_SENDMAIL=y
CONFIG_FETCHMAIL=y
CONFIG_SLATTACH=y
CONFIG_TELNET=y
CONFIG_FEATURE_TELNET_TTYPE=y
@@ -702,7 +705,7 @@ CONFIG_TFTPD=y
CONFIG_FEATURE_TFTP_GET=y
CONFIG_FEATURE_TFTP_PUT=y
CONFIG_FEATURE_TFTP_BLOCKSIZE=y
CONFIG_DEBUG_TFTP=y
CONFIG_TFTP_DEBUG=y
CONFIG_TRACEROUTE=y
CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE=y
@@ -715,9 +718,9 @@ CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases"
CONFIG_APP_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
CONFIG_FEATURE_UDHCP_PORT=y
CONFIG_FEATURE_UDHCP_DEBUG=y
CONFIG_FEATURE_RFC3397=y
CONFIG_DHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_UDHCP_DEBUG=y
CONFIG_FEATURE_UDHCP_RFC3397=y
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
CONFIG_VCONFIG=y
CONFIG_WGET=y
@@ -728,6 +731,26 @@ CONFIG_ZCIP=y
CONFIG_TCPSVD=y
CONFIG_UDPSVD=y
#
# Print Utilities
#
CONFIG_LPD=y
CONFIG_LPR=y
CONFIG_LPQ=y
#
# Mail Utilities
#
CONFIG_MAKEMIME=y
CONFIG_FEATURE_MIME_CHARSET="us-ascii"
CONFIG_POPMAILDIR=y
CONFIG_FEATURE_POPMAILDIR_DELIVERY=y
CONFIG_REFORMIME=y
CONFIG_FEATURE_REFORMIME_COMPAT=y
CONFIG_SENDMAIL=y
CONFIG_FEATURE_SENDMAIL_MAILX=y
CONFIG_FEATURE_SENDMAIL_MAILXX=y
#
# Process Utilities
#
@@ -751,18 +774,54 @@ CONFIG_BB_SYSCTL=y
CONFIG_TOP=y
CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
CONFIG_FEATURE_TOP_SMP_CPU=y
CONFIG_FEATURE_TOP_DECIMALS=y
CONFIG_FEATURE_TOP_SMP_PROCESS=y
CONFIG_FEATURE_TOPMEM=y
CONFIG_UPTIME=y
CONFIG_WATCH=y
#
# Runit Utilities
#
CONFIG_RUNSV=y
CONFIG_RUNSVDIR=y
CONFIG_FEATURE_RUNSVDIR_LOG=y
CONFIG_SV=y
CONFIG_SV_DEFAULT_SERVICE_DIR="/var/service"
CONFIG_SVLOGD=y
CONFIG_CHPST=y
CONFIG_SETUIDGID=y
CONFIG_ENVUIDGID=y
CONFIG_ENVDIR=y
CONFIG_SOFTLIMIT=y
#
# SELinux Utilities
#
CONFIG_CHCON=y
CONFIG_FEATURE_CHCON_LONG_OPTIONS=y
CONFIG_GETENFORCE=y
CONFIG_GETSEBOOL=y
CONFIG_LOAD_POLICY=y
CONFIG_MATCHPATHCON=y
CONFIG_RESTORECON=y
CONFIG_RUNCON=y
CONFIG_FEATURE_RUNCON_LONG_OPTIONS=y
CONFIG_SELINUXENABLED=y
CONFIG_SETENFORCE=y
CONFIG_SETFILES=y
CONFIG_FEATURE_SETFILES_CHECK_OPTION=y
CONFIG_SETSEBOOL=y
CONFIG_SESTATUS=y
#
# Shells
#
# CONFIG_FEATURE_SH_IS_ASH is not set
# CONFIG_FEATURE_SH_IS_HUSH is not set
CONFIG_FEATURE_SH_IS_HUSH=y
# CONFIG_FEATURE_SH_IS_MSH is not set
CONFIG_FEATURE_SH_IS_NONE=y
# CONFIG_FEATURE_SH_IS_NONE is not set
# CONFIG_ASH is not set
# CONFIG_ASH_BASH_COMPAT is not set
# CONFIG_ASH_JOB_CONTROL is not set
@@ -812,42 +871,3 @@ CONFIG_LOGREAD=y
CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
CONFIG_KLOGD=y
CONFIG_LOGGER=y
#
# Runit Utilities
#
CONFIG_RUNSV=y
CONFIG_RUNSVDIR=y
CONFIG_SV=y
CONFIG_SVLOGD=y
CONFIG_CHPST=y
CONFIG_SETUIDGID=y
CONFIG_ENVUIDGID=y
CONFIG_ENVDIR=y
CONFIG_SOFTLIMIT=y
#
# Selinux Utilities
#
CONFIG_CHCON=y
CONFIG_FEATURE_CHCON_LONG_OPTIONS=y
CONFIG_GETENFORCE=y
CONFIG_GETSEBOOL=y
CONFIG_LOAD_POLICY=y
CONFIG_MATCHPATHCON=y
CONFIG_RESTORECON=y
CONFIG_RUNCON=y
CONFIG_FEATURE_RUNCON_LONG_OPTIONS=y
CONFIG_SELINUXENABLED=y
CONFIG_SETENFORCE=y
CONFIG_SETFILES=y
CONFIG_FEATURE_SETFILES_CHECK_OPTION=y
CONFIG_SETSEBOOL=y
CONFIG_SESTATUS=y
#
# Print Utilities
#
CONFIG_LPD=y
CONFIG_LPR=y
CONFIG_LPQ=y
+1 -1
View File
@@ -17,7 +17,7 @@ echo 'static const char packed_usage[] ALIGN1 = {'
## Breaks on big-endian systems!
## # Extra effort to avoid using "od -t x1": -t is not available
## # in non-CONFIG_DESKTOPed busybox od
##
##
## "$loc/usage" | bzip2 -1 | od -v -x \
## | $SED -e 's/^[^ ]*//' \
## | $SED -e 's/ //g' \
+3 -2
View File
@@ -113,6 +113,7 @@ config FEATURE_CPIO_O
config DPKG
bool "dpkg"
default n
select FEATURE_SEAMLESS_GZ
help
dpkg is a medium-level tool to install, build, remove and manage
Debian packages.
@@ -123,9 +124,9 @@ config DPKG
config DPKG_DEB
bool "dpkg_deb"
default n
select FEATURE_SEAMLESS_GZ
help
dpkg-deb packs, unpacks and provides information about Debian
archives.
dpkg-deb unpacks and provides information about Debian archives.
This implementation of dpkg-deb cannot pack archives.
+24 -8
View File
@@ -30,13 +30,14 @@ int open_to_or_warn(int to_fd, const char *filename, int flags, int mode)
int FAST_FUNC bbunpack(char **argv,
char* (*make_new_name)(char *filename),
USE_DESKTOP(long long) int (*unpacker)(void)
USE_DESKTOP(long long) int (*unpacker)(unpack_info_t *info)
)
{
struct stat stat_buf;
USE_DESKTOP(long long) int status;
char *filename, *new_name;
smallint exitcode = 0;
unpack_info_t info;
do {
/* NB: new_name is *maybe* malloc'ed! */
@@ -92,14 +93,29 @@ int FAST_FUNC bbunpack(char **argv,
"use -f to force it");
}
status = unpacker();
/* memset(&info, 0, sizeof(info)); */
info.mtime = 0; /* so far it has one member only */
status = unpacker(&info);
if (status < 0)
exitcode = 1;
if (filename) {
char *del = new_name;
if (status >= 0) {
/* TODO: restore user/group/times here? */
/* TODO: restore other things? */
if (info.mtime) {
struct utimbuf times;
times.actime = info.mtime;
times.modtime = info.mtime;
/* Close first.
* On some systems calling utime
* then closing resets the mtime. */
close(STDOUT_FILENO);
/* Ignoring errors */
utime(new_name, &times);
}
/* Delete _compressed_ file */
del = filename;
/* restore extension (unless tgz -> tar case) */
@@ -159,7 +175,7 @@ char* make_new_name_bunzip2(char *filename)
}
static
USE_DESKTOP(long long) int unpack_bunzip2(void)
USE_DESKTOP(long long) int unpack_bunzip2(unpack_info_t *info UNUSED_PARAM)
{
return unpack_bz2_stream_prime(STDIN_FILENO, STDOUT_FILENO);
}
@@ -235,7 +251,7 @@ char* make_new_name_gunzip(char *filename)
}
static
USE_DESKTOP(long long) int unpack_gunzip(void)
USE_DESKTOP(long long) int unpack_gunzip(unpack_info_t *info)
{
USE_DESKTOP(long long) int status = -1;
@@ -247,7 +263,7 @@ USE_DESKTOP(long long) int unpack_gunzip(void)
if (ENABLE_FEATURE_SEAMLESS_Z && magic2 == 0x9d) {
status = unpack_Z_stream(STDIN_FILENO, STDOUT_FILENO);
} else if (magic2 == 0x8b) {
status = unpack_gz_stream(STDIN_FILENO, STDOUT_FILENO);
status = unpack_gz_stream_with_info(STDIN_FILENO, STDOUT_FILENO, info);
} else {
goto bad_magic;
}
@@ -309,7 +325,7 @@ char* make_new_name_unlzma(char *filename)
}
static
USE_DESKTOP(long long) int unpack_unlzma(void)
USE_DESKTOP(long long) int unpack_unlzma(unpack_info_t *info UNUSED_PARAM)
{
return unpack_lzma_stream(STDIN_FILENO, STDOUT_FILENO);
}
@@ -344,7 +360,7 @@ char* make_new_name_uncompress(char *filename)
}
static
USE_DESKTOP(long long) int unpack_uncompress(void)
USE_DESKTOP(long long) int unpack_uncompress(unpack_info_t *info UNUSED_PARAM)
{
USE_DESKTOP(long long) int status = -1;
+2 -1
View File
@@ -8,6 +8,7 @@
*/
#include "libbb.h"
#include "unarchive.h"
#define CONFIG_BZIP2_FEATURE_SPEED 1
@@ -101,7 +102,7 @@ USE_DESKTOP(long long) int bz_write(bz_stream *strm, void* rbuf, ssize_t rlen, v
}
static
USE_DESKTOP(long long) int compressStream(void)
USE_DESKTOP(long long) int compressStream(unpack_info_t *info UNUSED_PARAM)
{
USE_DESKTOP(long long) int total;
ssize_t count;
+8 -2
View File
@@ -30,6 +30,7 @@ static off_t cpio_pad4(off_t size)
* It's ok to exit instead of return. */
static int cpio_o(void)
{
static const char trailer[] ALIGN1 = "TRAILER!!!";
struct name_s {
struct name_s *next;
char name[1];
@@ -119,7 +120,7 @@ static int cpio_o(void)
} else {
/* If no (more) hardlinks to output,
* output "trailer" entry */
name = "TRAILER!!!";
name = trailer;
/* st.st_size == 0 is a must, but for uniformity
* in the output, we zero out everything */
memset(&st, 0, sizeof(st));
@@ -167,7 +168,7 @@ static int cpio_o(void)
}
if (!line) {
if (links)
if (name != trailer)
goto next_link;
/* TODO: GNU cpio pads trailer to 512 bytes, do we want that? */
return EXIT_SUCCESS;
@@ -341,8 +342,13 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
argv++;
}
/* see get_header_cpio */
archive_handle->ah_priv[2] = (void*) ~(ptrdiff_t)0;
while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
continue;
if (archive_handle->ah_priv[2] != (void*) ~(ptrdiff_t)0)
printf("%lu blocks\n", (unsigned long)(ptrdiff_t)(archive_handle->ah_priv[2]));
return EXIT_SUCCESS;
}
+6 -2
View File
@@ -25,6 +25,7 @@
*/
#include "libbb.h"
#include <fnmatch.h>
#include "unarchive.h"
/* note: if you vary hash_prime sizes be aware,
@@ -1293,7 +1294,7 @@ static void free_array(char **array)
* the status_hashtable to retrieve the info. This results in smaller code than
* scanning the status file. The resulting list, however, is unsorted.
*/
static void list_packages(void)
static void list_packages(const char *pattern)
{
int i;
@@ -1314,6 +1315,9 @@ static void list_packages(void)
name_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->name];
vers_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->version];
if (pattern && fnmatch(pattern, name_str, 0))
continue;
/* get abbreviation for status field 1 */
s1 = stat_str[0] == 'i' ? 'i' : 'r';
@@ -1626,7 +1630,7 @@ int dpkg_main(int argc UNUSED_PARAM, char **argv)
/* if the list action was given print the installed packages and exit */
if (opt & OPT_list_installed) {
list_packages();
list_packages(argv[0]);
return EXIT_SUCCESS;
}
+2 -1
View File
@@ -40,6 +40,7 @@ aa: 85.1% -- replaced with aa.gz
*/
#include "libbb.h"
#include "unarchive.h"
/* ===========================================================================
@@ -2014,7 +2015,7 @@ char* make_new_name_gzip(char *filename)
}
static
USE_DESKTOP(long long) int pack_gzip(void)
USE_DESKTOP(long long) int pack_gzip(unpack_info_t *info UNUSED_PARAM)
{
struct stat s;
+3 -1
View File
@@ -77,7 +77,9 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
}
case S_IFDIR:
res = mkdir(file_header->name, file_header->mode);
if ((res == -1) && (errno != EISDIR)
if ((res == -1)
&& (errno != EISDIR) /* btw, Linux doesn't return this */
&& (errno != EEXIST)
&& !(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)
) {
bb_perror_msg("cannot make dir %s", file_header->name);
+19 -7
View File
@@ -1108,18 +1108,21 @@ static uint32_t buffer_read_le_u32(STATE_PARAM_ONLY)
return res;
}
static int check_header_gzip(STATE_PARAM_ONLY)
static int check_header_gzip(STATE_PARAM unpack_info_t *info)
{
union {
unsigned char raw[8];
struct {
uint8_t gz_method;
uint8_t flags;
//uint32_t mtime; - unused fields
//uint8_t xtra_flags;
//uint8_t os_flags;
} formatted; /* packed */
uint32_t mtime;
uint8_t xtra_flags_UNUSED;
uint8_t os_flags_UNUSED;
} __attribute__((packed)) formatted;
} header;
struct BUG_header {
char BUG_header[sizeof(header) == 8 ? 1 : -1];
};
/*
* Rewind bytebuffer. We use the beginning because the header has 8
@@ -1167,6 +1170,9 @@ static int check_header_gzip(STATE_PARAM_ONLY)
}
}
if (info)
info->mtime = SWAP_LE32(header.formatted.mtime);
/* Read the header checksum */
if (header.formatted.flags & 0x02) {
if (!top_up(PASS_STATE 2))
@@ -1177,7 +1183,7 @@ static int check_header_gzip(STATE_PARAM_ONLY)
}
USE_DESKTOP(long long) int FAST_FUNC
unpack_gz_stream(int in, int out)
unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
{
uint32_t v32;
USE_DESKTOP(long long) int n;
@@ -1192,7 +1198,7 @@ unpack_gz_stream(int in, int out)
gunzip_src_fd = in;
again:
if (!check_header_gzip(PASS_STATE_ONLY)) {
if (!check_header_gzip(PASS_STATE info)) {
bb_error_msg("corrupted data");
n = -1;
goto ret;
@@ -1239,3 +1245,9 @@ unpack_gz_stream(int in, int out)
DEALLOC_STATE;
return n;
}
USE_DESKTOP(long long) int FAST_FUNC
unpack_gz_stream(int in, int out)
{
return unpack_gz_stream_with_info(in, out, NULL);
}
+2 -1
View File
@@ -27,6 +27,7 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
#define hardlinks_to_create (*(hardlinks_t **)(&archive_handle->ah_priv[0]))
#define created_hardlinks (*(hardlinks_t **)(&archive_handle->ah_priv[1]))
#define block_count (archive_handle->ah_priv[2])
// if (!archive_handle->ah_priv_inited) {
// archive_handle->ah_priv_inited = 1;
// hardlinks_to_create = NULL;
@@ -76,7 +77,7 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
if (strcmp(file_header->name, "TRAILER!!!") == 0) {
/* Always round up. ">> 9" divides by 512 */
printf("%"OFF_FMT"u blocks\n", (archive_handle->offset + 511) >> 9);
block_count = (void*)(ptrdiff_t) ((archive_handle->offset + 511) >> 9);
goto create_hardlinks;
}
+20 -10
View File
@@ -115,8 +115,8 @@ int rpm_main(int argc, char **argv)
}
}
argv += optind;
argc -= optind;
if (!argc) bb_show_usage();
//argc -= optind;
if (!argv[0]) bb_show_usage();
while (*argv) {
rpm_fd = xopen(*argv++, O_RDONLY);
@@ -202,7 +202,12 @@ static void extract_cpio_gz(int fd)
archive_handle->seek = seek_by_read;
//archive_handle->action_header = header_list;
archive_handle->action_data = data_extract_all;
archive_handle->ah_flags = ARCHIVE_PRESERVE_DATE | ARCHIVE_CREATE_LEADING_DIRS;
archive_handle->ah_flags = ARCHIVE_PRESERVE_DATE | ARCHIVE_CREATE_LEADING_DIRS
/* compat: overwrite existing files.
* try "rpm -i foo.src.rpm" few times in a row -
* standard rpm will not complain.
* (TODO? real rpm creates "file;1234" and then renames it) */
| ARCHIVE_EXTRACT_UNCONDITIONAL;
archive_handle->src_fd = fd;
/*archive_handle->offset = 0; - init_handle() did it */
@@ -246,7 +251,7 @@ static void extract_cpio_gz(int fd)
static rpm_index **rpm_gettags(int fd, int *num_tags)
{
/* We should never need mode than 200, and realloc later */
rpm_index **tags = xzalloc(200 * sizeof(struct rpmtag *));
rpm_index **tags = xzalloc(200 * sizeof(tags[0]));
int pass, tagindex = 0;
xlseek(fd, 96, SEEK_CUR); /* Seek past the unused lead */
@@ -260,6 +265,9 @@ static rpm_index **rpm_gettags(int fd, int *num_tags)
uint32_t entries; /* Number of entries in header (4 bytes) */
uint32_t size; /* Size of store (4 bytes) */
} header;
struct BUG_header {
char BUG_header[sizeof(header) == 16 ? 1 : -1];
};
rpm_index *tmpindex;
int storepos;
@@ -273,8 +281,8 @@ static rpm_index **rpm_gettags(int fd, int *num_tags)
storepos = xlseek(fd,0,SEEK_CUR) + header.entries * 16;
while (header.entries--) {
tmpindex = tags[tagindex++] = xmalloc(sizeof(rpm_index));
xread(fd, tmpindex, sizeof(rpm_index));
tmpindex = tags[tagindex++] = xmalloc(sizeof(*tmpindex));
xread(fd, tmpindex, sizeof(*tmpindex));
tmpindex->tag = ntohl(tmpindex->tag);
tmpindex->type = ntohl(tmpindex->type);
tmpindex->count = ntohl(tmpindex->count);
@@ -287,7 +295,7 @@ static rpm_index **rpm_gettags(int fd, int *num_tags)
if (pass == 0)
xlseek(fd, (8 - (xlseek(fd,0,SEEK_CUR) % 8)) % 8, SEEK_CUR);
}
tags = xrealloc(tags, tagindex * sizeof(struct rpmtag *)); /* realloc tags to save space */
tags = xrealloc(tags, tagindex * sizeof(tags[0])); /* realloc tags to save space */
*num_tags = tagindex;
return tags; /* All done, leave the file at the start of the gzipped cpio archive */
}
@@ -378,9 +386,11 @@ static void fileaction_dobackup(char *filename, int fileref)
static void fileaction_setowngrp(char *filename, int fileref)
{
int uid, gid;
uid = xuname2uid(rpm_getstr(TAG_FILEUSERNAME, fileref));
gid = xgroup2gid(rpm_getstr(TAG_FILEGROUPNAME, fileref));
/* real rpm warns: "user foo does not exist - using <you>" */
struct passwd *pw = getpwnam(rpm_getstr(TAG_FILEUSERNAME, fileref));
int uid = pw ? pw->pw_uid : getuid(); /* or euid? */
struct group *gr = getgrnam(rpm_getstr(TAG_FILEGROUPNAME, fileref));
int gid = gr ? gr->gr_gid : getgid();
chown(filename, uid, gid);
}
+4
View File
@@ -818,6 +818,10 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
| ARCHIVE_PRESERVE_DATE
| ARCHIVE_EXTRACT_UNCONDITIONAL;
/* Apparently only root's tar preserves perms (see bug 3844) */
if (getuid() != 0)
tar_handle->ah_flags |= ARCHIVE_NOPRESERVE_PERM;
/* Prepend '-' to the first argument if required */
opt_complementary = "--:" // first arg is options
"tt:vv:" // count -t,-v
+196 -47
View File
@@ -16,12 +16,7 @@
*/
/* TODO
* Endian issues
* Zip64 + other methods
* Improve handling of zip format, ie.
* - deferred CRC, comp. & uncomp. lengths (zip header flags bit 3)
* - unix file permissions, etc.
* - central directory
*/
#include "libbb.h"
@@ -31,12 +26,12 @@ enum {
#if BB_BIG_ENDIAN
ZIP_FILEHEADER_MAGIC = 0x504b0304,
ZIP_CDS_MAGIC = 0x504b0102,
ZIP_CDS_END_MAGIC = 0x504b0506,
ZIP_CDE_MAGIC = 0x504b0506,
ZIP_DD_MAGIC = 0x504b0708,
#else
ZIP_FILEHEADER_MAGIC = 0x04034b50,
ZIP_CDS_MAGIC = 0x02014b50,
ZIP_CDS_END_MAGIC = 0x06054b50,
ZIP_CDE_MAGIC = 0x06054b50,
ZIP_DD_MAGIC = 0x08074b50,
#endif
};
@@ -46,16 +41,16 @@ enum {
typedef union {
uint8_t raw[ZIP_HEADER_LEN];
struct {
uint16_t version; /* 0-1 */
uint16_t flags; /* 2-3 */
uint16_t method; /* 4-5 */
uint16_t modtime; /* 6-7 */
uint16_t moddate; /* 8-9 */
uint32_t crc32 PACKED; /* 10-13 */
uint32_t cmpsize PACKED; /* 14-17 */
uint32_t ucmpsize PACKED; /* 18-21 */
uint16_t filename_len; /* 22-23 */
uint16_t extra_len; /* 24-25 */
uint16_t version; /* 0-1 */
uint16_t flags; /* 2-3 */
uint16_t method; /* 4-5 */
uint16_t modtime; /* 6-7 */
uint16_t moddate; /* 8-9 */
uint32_t crc32 PACKED; /* 10-13 */
uint32_t cmpsize PACKED; /* 14-17 */
uint32_t ucmpsize PACKED; /* 18-21 */
uint16_t filename_len; /* 22-23 */
uint16_t extra_len; /* 24-25 */
} formatted PACKED;
} zip_header_t; /* PACKED - gcc 4.2.1 doesn't like it (spews warning) */
@@ -65,11 +60,11 @@ typedef union {
*/
struct BUG_zip_header_must_be_26_bytes {
char BUG_zip_header_must_be_26_bytes[
offsetof(zip_header_t, formatted.extra_len) + 2 ==
ZIP_HEADER_LEN ? 1 : -1];
offsetof(zip_header_t, formatted.extra_len) + 2
== ZIP_HEADER_LEN ? 1 : -1];
};
#define FIX_ENDIANNESS(zip_header) do { \
#define FIX_ENDIANNESS_ZIP(zip_header) do { \
(zip_header).formatted.version = SWAP_LE16((zip_header).formatted.version ); \
(zip_header).formatted.flags = SWAP_LE16((zip_header).formatted.flags ); \
(zip_header).formatted.method = SWAP_LE16((zip_header).formatted.method ); \
@@ -82,9 +77,138 @@ struct BUG_zip_header_must_be_26_bytes {
(zip_header).formatted.extra_len = SWAP_LE16((zip_header).formatted.extra_len ); \
} while (0)
static void unzip_skip(int fd, off_t skip)
#define CDS_HEADER_LEN 42
typedef union {
uint8_t raw[CDS_HEADER_LEN];
struct {
/* uint32_t signature; 50 4b 01 02 */
uint16_t version_made_by; /* 0-1 */
uint16_t version_needed; /* 2-3 */
uint16_t cds_flags; /* 4-5 */
uint16_t method; /* 6-7 */
uint16_t mtime; /* 8-9 */
uint16_t mdate; /* 10-11 */
uint32_t crc32; /* 12-15 */
uint32_t cmpsize; /* 16-19 */
uint32_t ucmpsize; /* 20-23 */
uint16_t file_name_length; /* 24-25 */
uint16_t extra_field_length; /* 26-27 */
uint16_t file_comment_length; /* 28-29 */
uint16_t disk_number_start; /* 30-31 */
uint16_t internal_file_attributes; /* 32-33 */
uint32_t external_file_attributes PACKED; /* 34-37 */
uint32_t relative_offset_of_local_header PACKED; /* 38-41 */
} formatted PACKED;
} cds_header_t;
struct BUG_cds_header_must_be_42_bytes {
char BUG_cds_header_must_be_42_bytes[
offsetof(cds_header_t, formatted.relative_offset_of_local_header) + 4
== CDS_HEADER_LEN ? 1 : -1];
};
#define FIX_ENDIANNESS_CDS(cds_header) do { \
(cds_header).formatted.crc32 = SWAP_LE32((cds_header).formatted.crc32 ); \
(cds_header).formatted.cmpsize = SWAP_LE32((cds_header).formatted.cmpsize ); \
(cds_header).formatted.ucmpsize = SWAP_LE32((cds_header).formatted.ucmpsize ); \
(cds_header).formatted.file_name_length = SWAP_LE16((cds_header).formatted.file_name_length); \
(cds_header).formatted.extra_field_length = SWAP_LE16((cds_header).formatted.extra_field_length); \
(cds_header).formatted.file_comment_length = SWAP_LE16((cds_header).formatted.file_comment_length); \
} while (0)
#define CDE_HEADER_LEN 16
typedef union {
uint8_t raw[CDE_HEADER_LEN];
struct {
/* uint32_t signature; 50 4b 05 06 */
uint16_t this_disk_no;
uint16_t disk_with_cds_no;
uint16_t cds_entries_on_this_disk;
uint16_t cds_entries_total;
uint32_t cds_size;
uint32_t cds_offset;
/* uint16_t file_comment_length; */
/* .ZIP file comment (variable size) */
} formatted PACKED;
} cde_header_t;
struct BUG_cde_header_must_be_16_bytes {
char BUG_cde_header_must_be_16_bytes[
sizeof(cde_header_t) == CDE_HEADER_LEN ? 1 : -1];
};
#define FIX_ENDIANNESS_CDE(cde_header) do { \
(cde_header).formatted.cds_offset = SWAP_LE16((cde_header).formatted.cds_offset); \
} while (0)
enum { zip_fd = 3 };
#if ENABLE_DESKTOP
/* NB: does not preserve file position! */
static uint32_t find_cds_offset(void)
{
bb_copyfd_exact_size(fd, -1, skip);
unsigned char buf[1024];
cde_header_t cde_header;
unsigned char *p;
off_t end;
end = xlseek(zip_fd, 0, SEEK_END);
if (end < 1024)
end = 1024;
end -= 1024;
xlseek(zip_fd, end, SEEK_SET);
full_read(zip_fd, buf, 1024);
p = buf;
while (p <= buf + 1024 - CDE_HEADER_LEN - 4) {
if (*p != 'P') {
p++;
continue;
}
if (*++p != 'K')
continue;
if (*++p != 5)
continue;
if (*++p != 6)
continue;
/* we found CDE! */
memcpy(cde_header.raw, p + 1, CDE_HEADER_LEN);
FIX_ENDIANNESS_CDE(cde_header);
return cde_header.formatted.cds_offset;
}
bb_error_msg_and_die("can't find file table");
};
static uint32_t read_next_cds(int count_m1, uint32_t cds_offset, cds_header_t *cds_ptr)
{
off_t org;
org = xlseek(zip_fd, 0, SEEK_CUR);
if (!cds_offset)
cds_offset = find_cds_offset();
while (count_m1-- >= 0) {
xlseek(zip_fd, cds_offset + 4, SEEK_SET);
xread(zip_fd, cds_ptr->raw, CDS_HEADER_LEN);
FIX_ENDIANNESS_CDS(*cds_ptr);
cds_offset += 4 + CDS_HEADER_LEN
+ cds_ptr->formatted.file_name_length
+ cds_ptr->formatted.extra_field_length
+ cds_ptr->formatted.file_comment_length;
}
xlseek(zip_fd, org, SEEK_SET);
return cds_offset;
};
#endif
static void unzip_skip(off_t skip)
{
bb_copyfd_exact_size(zip_fd, -1, skip);
}
static void unzip_create_leading_dirs(const char *fn)
@@ -97,17 +221,17 @@ static void unzip_create_leading_dirs(const char *fn)
free(name);
}
static void unzip_extract(zip_header_t *zip_header, int src_fd, int dst_fd)
static void unzip_extract(zip_header_t *zip_header, int dst_fd)
{
if (zip_header->formatted.method == 0) {
/* Method 0 - stored (not compressed) */
off_t size = zip_header->formatted.ucmpsize;
if (size)
bb_copyfd_exact_size(src_fd, dst_fd, size);
bb_copyfd_exact_size(zip_fd, dst_fd, size);
} else {
/* Method 8 - inflate */
inflate_unzip_result res;
if (inflate_unzip(&res, zip_header->formatted.cmpsize, src_fd, dst_fd) < 0)
if (inflate_unzip(&res, zip_header->formatted.cmpsize, zip_fd, dst_fd) < 0)
bb_error_msg_and_die("inflate error");
/* Validate decompression - crc */
if (zip_header->formatted.crc32 != (res.crc ^ 0xffffffffL)) {
@@ -131,9 +255,12 @@ int unzip_main(int argc, char **argv)
smallint verbose = 1;
smallint listing = 0;
smallint overwrite = O_PROMPT;
#if ENABLE_DESKTOP
uint32_t cds_offset;
unsigned cds_entries;
#endif
unsigned total_size;
unsigned total_entries;
int src_fd = -1;
int dst_fd = -1;
char *src_fn = NULL;
char *dst_fn = NULL;
@@ -221,13 +348,14 @@ int unzip_main(int argc, char **argv)
/* Open input file */
if (LONE_DASH(src_fn)) {
src_fd = STDIN_FILENO;
xdup2(STDIN_FILENO, zip_fd);
/* Cannot use prompt mode since zip data is arriving on STDIN */
if (overwrite == O_PROMPT)
overwrite = O_NEVER;
} else {
static const char extn[][5] = {"", ".zip", ".ZIP"};
int orig_src_fn_len = strlen(src_fn);
int src_fd = -1;
for (i = 0; (i < 3) && (src_fd == -1); i++) {
strcpy(src_fn + orig_src_fn_len, extn[i]);
@@ -237,6 +365,7 @@ int unzip_main(int argc, char **argv)
src_fn[orig_src_fn_len] = '\0';
bb_error_msg_and_die("can't open %s, %s.zip, %s.ZIP", src_fn, src_fn, src_fn);
}
xmove_fd(src_fd, zip_fd);
}
/* Change dir if necessary */
@@ -253,37 +382,63 @@ int unzip_main(int argc, char **argv)
total_size = 0;
total_entries = 0;
#if ENABLE_DESKTOP
cds_entries = 0;
cds_offset = 0;
#endif
while (1) {
uint32_t magic;
/* Check magic number */
xread(src_fd, &magic, 4);
xread(zip_fd, &magic, 4);
/* Central directory? It's at the end, so exit */
if (magic == ZIP_CDS_MAGIC)
break;
#if ENABLE_DESKTOP
/* Data descriptor? It was a streaming file, go on */
if (magic == ZIP_DD_MAGIC) {
/* skip over duplicate crc32, cmpsize and ucmpsize */
unzip_skip(3 * 4);
continue;
}
#endif
if (magic != ZIP_FILEHEADER_MAGIC)
bb_error_msg_and_die("invalid zip magic %08X", (int)magic);
/* Read the file header */
xread(src_fd, zip_header.raw, ZIP_HEADER_LEN);
FIX_ENDIANNESS(zip_header);
xread(zip_fd, zip_header.raw, ZIP_HEADER_LEN);
FIX_ENDIANNESS_ZIP(zip_header);
if ((zip_header.formatted.method != 0) && (zip_header.formatted.method != 8)) {
bb_error_msg_and_die("unsupported method %d", zip_header.formatted.method);
}
if (zip_header.formatted.flags & (0x0008|0x0001)) {
#if !ENABLE_DESKTOP
if (zip_header.formatted.flags & 0x0009) {
bb_error_msg_and_die("zip flags 1 and 8 are not supported");
}
#else
if (zip_header.formatted.flags & 0x0001) {
/* 0x0001 - encrypted */
bb_error_msg_and_die("zip flag 1 (encryption) is not supported");
}
if (zip_header.formatted.flags & 0x0008) {
cds_header_t cds_header;
/* 0x0008 - streaming. [u]cmpsize can be reliably gotten
* only from Central Directory. See unzip_doc.txt */
bb_error_msg_and_die("zip flags 8 and 1 are not supported");
cds_offset = read_next_cds(total_entries - cds_entries, cds_offset, &cds_header);
cds_entries = total_entries + 1;
zip_header.formatted.crc32 = cds_header.formatted.crc32;
zip_header.formatted.cmpsize = cds_header.formatted.cmpsize;
zip_header.formatted.ucmpsize = cds_header.formatted.ucmpsize;
}
#endif
/* Read filename */
free(dst_fn);
dst_fn = xzalloc(zip_header.formatted.filename_len + 1);
xread(src_fd, dst_fn, zip_header.formatted.filename_len);
xread(zip_fd, dst_fn, zip_header.formatted.filename_len);
/* Skip extra header bytes */
unzip_skip(src_fd, zip_header.formatted.extra_len);
unzip_skip(zip_header.formatted.extra_len);
/* Filter zip entries */
if (find_list_entry(zreject, dst_fn)
@@ -304,7 +459,6 @@ int unzip_main(int argc, char **argv)
(dostime & 0x000007e0) >> 5,
dst_fn);
total_size += zip_header.formatted.ucmpsize;
total_entries++;
} else {
/* short listing -- filenames only */
puts(dst_fn);
@@ -315,7 +469,7 @@ int unzip_main(int argc, char **argv)
} else if (last_char_is(dst_fn, '/')) { /* Extract directory */
if (stat(dst_fn, &stat_buf) == -1) {
if (errno != ENOENT) {
bb_perror_msg_and_die("cannot stat '%s'", dst_fn);
bb_perror_msg_and_die("can't stat '%s'", dst_fn);
}
if (verbose) {
printf(" creating: %s\n", dst_fn);
@@ -335,7 +489,7 @@ int unzip_main(int argc, char **argv)
check_file:
if (stat(dst_fn, &stat_buf) == -1) { /* File does not exist */
if (errno != ENOENT) {
bb_perror_msg_and_die("cannot stat '%s'", dst_fn);
bb_perror_msg_and_die("can't stat '%s'", dst_fn);
}
i = 'y';
} else { /* File already exists */
@@ -347,7 +501,7 @@ int unzip_main(int argc, char **argv)
} else {
printf("replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", dst_fn);
if (!fgets(key_buf, sizeof(key_buf), stdin)) {
bb_perror_msg_and_die("cannot read input");
bb_perror_msg_and_die("can't read input");
}
i = key_buf[0];
}
@@ -368,7 +522,7 @@ int unzip_main(int argc, char **argv)
if (verbose) {
printf(" inflating: %s\n", dst_fn);
}
unzip_extract(&zip_header, src_fd, dst_fd);
unzip_extract(&zip_header, dst_fd);
if (dst_fd != STDOUT_FILENO) {
/* closing STDOUT is potentially bad for future business */
close(dst_fd);
@@ -379,14 +533,14 @@ int unzip_main(int argc, char **argv)
overwrite = O_NEVER;
case 'n':
/* Skip entry data */
unzip_skip(src_fd, zip_header.formatted.cmpsize);
unzip_skip(zip_header.formatted.cmpsize);
break;
case 'r':
/* Prompt for new name */
printf("new name: ");
if (!fgets(key_buf, sizeof(key_buf), stdin)) {
bb_perror_msg_and_die("cannot read input");
bb_perror_msg_and_die("can't read input");
}
free(dst_fn);
dst_fn = xstrdup(key_buf);
@@ -398,12 +552,7 @@ int unzip_main(int argc, char **argv)
goto check_file;
}
// Looks like bug (data descriptor cannot be identified this way)
// /* Data descriptor section */
// if (zip_header.formatted.flags & 4) {
// /* skip over duplicate crc, compressed size and uncompressed size */
// unzip_skip(src_fd, 12);
// }
total_entries++;
}
if (listing && verbose) {
Binary file not shown.
+15
View File
@@ -101,6 +101,21 @@ config SETFONT
help
Allows to load console screen map. Useful for i18n.
config FEATURE_SETFONT_TEXTUAL_MAP
bool "Support reading textual screen maps"
default n
depends on SETFONT
help
Support reading textual screen maps.
config DEFAULT_SETFONT_DIR
string "Default directory for console-tools files"
default ""
depends on SETFONT
help
Directory to use if setfont's params are simple filenames
(not /path/to/file or ./file). Default is "" (no default directory).
config SETKEYCODES
bool "setkeycodes"
default n
+11 -10
View File
@@ -2,37 +2,37 @@
/*
* Mini kbd_mode implementation for busybox
*
* Copyright (C) 2007 Loïc Grenié <loic.grenie@gmail.com>
* Copyright (C) 2007 Loic Grenie <loic.grenie@gmail.com>
* written using Andries Brouwer <aeb@cwi.nl>'s kbd_mode from
* console-utils v0.2.3, licensed under GNU GPLv2
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
*/
#include "libbb.h"
#include <linux/kd.h>
int kbd_mode_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int kbd_mode_main(int argc UNUSED_PARAM, char **argv)
{
int fd;
unsigned opt;
enum {
SCANCODE = (1 << 0),
ASCII = (1 << 1),
MEDIUMRAW = (1 << 2),
UNICODE = (1 << 3)
UNICODE = (1 << 3),
};
static const char KD_xxx[] ALIGN1 = "saku";
opt = getopt32(argv, KD_xxx);
fd = get_console_fd_or_die();
int fd;
unsigned opt;
const char *tty_name = CURRENT_TTY;
opt = getopt32(argv, "sakuC:", &tty_name);
fd = xopen(tty_name, O_NONBLOCK);
opt &= 0xf; /* clear -C bit, see (*) */
if (!opt) { /* print current setting */
const char *mode = "unknown";
int m;
ioctl(fd, KDGKBMODE, &m);
xioctl(fd, KDGKBMODE, &m);
if (m == K_RAW)
mode = "raw (scancode)";
else if (m == K_XLATE)
@@ -43,6 +43,7 @@ int kbd_mode_main(int argc UNUSED_PARAM, char **argv)
mode = "Unicode (UTF-8)";
printf("The keyboard is in %s mode\n", mode);
} else {
/* here we depend on specific bits assigned to options (*) */
opt = opt & UNICODE ? 3 : opt >> 1;
/* double cast prevents warnings about widening conversion */
xioctl(fd, KDSKBMODE, (void*)(ptrdiff_t)opt);
+185 -11
View File
@@ -10,6 +10,28 @@
#include "libbb.h"
#include <sys/kd.h>
#ifndef KDFONTOP
#define KDFONTOP 0x4B72
struct console_font_op {
unsigned op; /* KD_FONT_OP_* */
unsigned flags; /* KD_FONT_FLAG_* */
unsigned width, height;
unsigned charcount;
unsigned char *data; /* font data with height fixed to 32 */
};
#define KD_FONT_OP_SET 0 /* Set font */
#define KD_FONT_OP_GET 1 /* Get font */
#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default,
data points to name / NULL */
#define KD_FONT_OP_COPY 3 /* Copy from another console */
#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface */
#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't call adjust_height() */
/* (Used internally for PIO_FONT support) */
#endif /* KDFONTOP */
enum {
PSF_MAGIC1 = 0x36,
PSF_MAGIC2 = 0x04,
@@ -17,7 +39,7 @@ enum {
PSF_MODE512 = 0x01,
PSF_MODEHASTAB = 0x02,
PSF_MAXMODE = 0x03,
PSF_SEPARATOR = 0xFFFF
PSF_SEPARATOR = 0xffff
};
struct psf_header {
@@ -40,6 +62,28 @@ static void do_loadfont(int fd, unsigned char *inbuf, int unit, int fontsize)
for (i = 0; i < fontsize; i++)
memcpy(buf + (32 * i), inbuf + (unit * i), unit);
{ /* KDFONTOP */
struct console_font_op cfo;
cfo.op = KD_FONT_OP_SET;
cfo.flags = 0;
cfo.width = 8;
cfo.height = unit;
cfo.charcount = fontsize;
cfo.data = (void*)buf;
#if 0
if (!ioctl_or_perror(fd, KDFONTOP, &cfo, "KDFONTOP ioctl failed (will try PIO_FONTX)"))
goto ret; /* success */
#else
xioctl(fd, KDFONTOP, &cfo);
#endif
}
#if 0
/* These ones do not honour -C tty (they set font on current tty regardless)
* On x86, this distinction is visible on framebuffer consoles
* (regular character consoles may have only one shared font anyway)
*/
#if defined(PIO_FONTX) && !defined(__sparc__)
{
struct consolefontdesc cfd;
@@ -49,11 +93,12 @@ static void do_loadfont(int fd, unsigned char *inbuf, int unit, int fontsize)
cfd.chardata = buf;
if (!ioctl_or_perror(fd, PIO_FONTX, &cfd, "PIO_FONTX ioctl failed (will try PIO_FONT)"))
goto ret; /* success */
goto ret; /* success */
}
#endif
xioctl(fd, PIO_FONT, buf);
ret:
#endif /* 0 */
free(buf);
}
@@ -155,7 +200,7 @@ int loadfont_main(int argc UNUSED_PARAM, char **argv)
* just read the entire file.
*/
len = 32*1024; // can't be larger
psfhdr = (struct psf_header *) xmalloc_read(STDIN_FILENO, &len);
psfhdr = xmalloc_read(STDIN_FILENO, &len);
// xmalloc_open_zipped_read_close(filename, &len);
if (!psfhdr)
bb_perror_msg_and_die("error reading input font");
@@ -166,30 +211,159 @@ int loadfont_main(int argc UNUSED_PARAM, char **argv)
#endif
#if ENABLE_SETFONT
/*
kbd-1.12:
setfont [-O font+umap.orig] [-o font.orig] [-om cmap.orig]
[-ou umap.orig] [-N] [font.new ...] [-m cmap] [-u umap] [-C console]
[-hNN] [-v] [-V]
-h NN Override font height
-o file
Save previous font in file
-O file
Save previous font and Unicode map in file
-om file
Store console map in file
-ou file
Save previous Unicode map in file
-m file
Load console map or Unicode console map from file
-u file
Load Unicode table describing the font from file
Example:
# cp866
0x00-0x7f idem
#
0x80 U+0410 # CYRILLIC CAPITAL LETTER A
0x81 U+0411 # CYRILLIC CAPITAL LETTER BE
0x82 U+0412 # CYRILLIC CAPITAL LETTER VE
-C console
Set the font for the indicated console
-v Verbose
-V Version
*/
#if ENABLE_FEATURE_SETFONT_TEXTUAL_MAP
static int ctoi(char *s)
{
if (s[0] == '\'' && s[1] != '\0' && s[2] == '\'' && s[3] == '\0')
return s[1];
// U+ means 0x
if (s[0] == 'U' && s[1] == '+') {
s[0] = '0';
s[1] = 'x';
}
if (!isdigit(s[0]))
return -1;
return xstrtoul(s, 0);
}
#endif
int setfont_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int setfont_main(int argc UNUSED_PARAM, char **argv)
{
size_t len;
unsigned opts;
int fd;
struct psf_header *psfhdr;
char *mapfilename;
int fd;
const char *tty_name = CURRENT_TTY;
opt_complementary = "=1";
getopt32(argv, "m:", &mapfilename);
opts = getopt32(argv, "m:C:", &mapfilename, &tty_name);
argv += optind;
fd = xopen(tty_name, O_NONBLOCK);
if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not ""
if (*argv[0] != '/') {
// goto default fonts location. don't die if doesn't exist
chdir(CONFIG_DEFAULT_SETFONT_DIR "/consolefonts");
}
}
// load font
len = 32*1024; // can't be larger
psfhdr = (struct psf_header *) xmalloc_open_zipped_read_close(*argv, &len);
fd = get_console_fd_or_die();
psfhdr = xmalloc_open_zipped_read_close(*argv, &len);
if (!psfhdr)
bb_simple_perror_msg_and_die(*argv);
do_load(fd, psfhdr, len);
// load the screen map, if any
if (option_mask32 & 1) { // -m
void *map = xmalloc_open_zipped_read_close(mapfilename, &len);
if (len == E_TABSZ || len == 2*E_TABSZ) {
xioctl(fd, (len == 2*E_TABSZ) ? PIO_UNISCRNMAP : PIO_SCRNMAP, map);
if (opts & 1) { // -m
unsigned mode = PIO_SCRNMAP;
void *map;
if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not ""
if (mapfilename[0] != '/') {
// goto default keymaps location
chdir(CONFIG_DEFAULT_SETFONT_DIR "/consoletrans");
}
}
// fetch keymap
map = xmalloc_open_zipped_read_close(mapfilename, &len);
if (!map)
bb_simple_perror_msg_and_die(mapfilename);
// file size is 256 or 512 bytes? -> assume binary map
if (len == E_TABSZ || len == 2*E_TABSZ) {
if (len == 2*E_TABSZ)
mode = PIO_UNISCRNMAP;
}
#if ENABLE_FEATURE_SETFONT_TEXTUAL_MAP
// assume textual Unicode console maps:
// 0x00 U+0000 # NULL (NUL)
// 0x01 U+0001 # START OF HEADING (SOH)
// 0x02 U+0002 # START OF TEXT (STX)
// 0x03 U+0003 # END OF TEXT (ETX)
else {
int i;
char *token[2];
parser_t *parser;
if (ENABLE_FEATURE_CLEAN_UP)
free(map);
map = xmalloc(E_TABSZ * sizeof(unsigned short));
#define unicodes ((unsigned short *)map)
// fill vanilla map
for (i = 0; i < E_TABSZ; i++)
unicodes[i] = 0xf000 + i;
parser = config_open(mapfilename);
while (config_read(parser, token, 2, 2, "# \t", PARSE_NORMAL | PARSE_MIN_DIE)) {
// parse code/value pair
int a = ctoi(token[0]);
int b = ctoi(token[1]);
if (a < 0 || a >= E_TABSZ
|| b < 0 || b > 65535
) {
bb_error_msg_and_die("map format");
}
// patch map
unicodes[a] = b;
// unicode character is met?
if (b > 255)
mode = PIO_UNISCRNMAP;
}
if (ENABLE_FEATURE_CLEAN_UP)
config_close(parser);
if (mode != PIO_UNISCRNMAP) {
#define asciis ((unsigned char *)map)
for (i = 0; i < E_TABSZ; i++)
asciis[i] = unicodes[i];
#undef asciis
}
#undef unicodes
}
#endif // ENABLE_FEATURE_SETFONT_TEXTUAL_MAP
// do set screen map
xioctl(fd, mode, map);
if (ENABLE_FEATURE_CLEAN_UP)
free(map);
}
return EXIT_SUCCESS;
+6 -4
View File
@@ -5,9 +5,7 @@
* Copyright (C) 1998 Enrique Zanardi <ezanardi@ull.es>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
*/
#include "libbb.h"
#define BINARY_KEYMAP_MAGIC "bkeymap"
@@ -31,11 +29,15 @@ int loadkmap_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
struct kbentry ke;
int i, j, fd;
uint16_t ibuff[NR_KEYS];
/* const char *tty_name = CURRENT_TTY; */
RESERVE_CONFIG_BUFFER(flags,MAX_NR_KEYMAPS);
/* bb_warn_ignoring_args(argc>=2);*/
/* bb_warn_ignoring_args(argc >= 2); */
fd = get_console_fd_or_die();
/* or maybe:
opt = getopt32(argv, "C:", &tty_name);
fd = xopen(tty_name, O_NONBLOCK);
*/
xread(STDIN_FILENO, flags, 7);
if (strncmp(flags, BINARY_KEYMAP_MAGIC, 7))
+1 -1
View File
@@ -2,7 +2,7 @@
/*
* resize - set terminal width and height.
*
* Copyright 2006 Bernhard Fischer
* Copyright 2006 Bernhard Reutner-Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+1 -1
View File
@@ -3,7 +3,7 @@
* setconsole.c - redirect system console output
*
* Copyright (C) 2004,2005 Enrik Berkhan <Enrik.Berkhan@inka.de>
* Copyright (C) 2008 Bernhard Fischer
* Copyright (C) 2008 Bernhard Reutner-Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+5 -5
View File
@@ -50,7 +50,7 @@ static void signal_handler(int signo)
{
// restore keyboard and console settings
xset1(STDIN_FILENO, &tio0, "stdin");
xioctl(STDIN_FILENO, KDSKBMODE, (void *)kbmode);
xioctl(STDIN_FILENO, KDSKBMODE, (void *)(ptrdiff_t)kbmode);
// alarmed? -> exit 0
exit(SIGALRM == signo);
}
@@ -72,9 +72,9 @@ int showkey_main(int argc UNUSED_PARAM, char **argv)
// get keyboard settings
xioctl(STDIN_FILENO, KDGKBMODE, &kbmode);
printf("kb mode was %s\n\nPress any keys. Program terminates %s\n\n",
kbmode == K_RAW ? "RAW" :
(kbmode == K_XLATE ? "XLATE" :
(kbmode == K_MEDIUMRAW ? "MEDIUMRAW" :
kbmode == K_RAW ? "RAW" :
(kbmode == K_XLATE ? "XLATE" :
(kbmode == K_MEDIUMRAW ? "MEDIUMRAW" :
(kbmode == K_UNICODE ? "UNICODE" : "?UNKNOWN?")))
, (option_mask32 & OPT_a) ? "when CTRL+D pressed" : "10s after last keypress"
);
@@ -95,7 +95,7 @@ int showkey_main(int argc UNUSED_PARAM, char **argv)
// we should exit on any signal
bb_signals(BB_FATAL_SIGS, signal_handler);
// set raw keyboard mode
xioctl(STDIN_FILENO, KDSKBMODE, (void *)((option_mask32 & OPT_k) ? K_MEDIUMRAW : K_RAW));
xioctl(STDIN_FILENO, KDSKBMODE, (void *)(ptrdiff_t)((option_mask32 & OPT_k) ? K_MEDIUMRAW : K_RAW));
// read and show scancodes
while (1) {
+5 -5
View File
@@ -136,12 +136,12 @@ config DF
df reports the amount of disk space used and available
on filesystems.
config FEATURE_DF_INODE
bool "Enable -i (inode information)"
config FEATURE_DF_FANCY
bool "Enable -a, -i, -B"
default n
depends on DF
help
This option enables support for df -i.
This option enables -a, -i and -B.
config DIRNAME
bool "dirname"
@@ -189,7 +189,7 @@ config ECHO
config FEATURE_FANCY_ECHO
bool "Enable echo options (-n and -e)"
default y
depends on ECHO
depends on ECHO || ASH_BUILTIN_ECHO
help
This adds options (-n and -e) to echo.
@@ -649,7 +649,7 @@ config TEST
config FEATURE_TEST_64
bool "Extend test to 64 bit"
default n
depends on TEST
depends on TEST || ASH_BUILTIN_TEST
help
Enable 64-bit support in test.
+2 -1
View File
@@ -48,5 +48,6 @@ int basename_main(int argc, char **argv)
/* puts(s) will do, but we can do without stdio this way: */
s[m++] = '\n';
return full_write(STDOUT_FILENO, s, m) == (ssize_t)m;
/* NB: != is correct here: */
return full_write(STDOUT_FILENO, s, m) != (ssize_t)m;
}
+13 -5
View File
@@ -13,7 +13,7 @@ int cksum_main(int argc UNUSED_PARAM, char **argv)
{
uint32_t *crc32_table = crc32_filltable(NULL, 1);
uint32_t crc;
long length, filesize;
off_t length, filesize;
int bytes_read;
uint8_t *cp;
@@ -44,11 +44,19 @@ int cksum_main(int argc UNUSED_PARAM, char **argv)
filesize = length;
for (; length; length >>= 8)
crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ length) & 0xff];
crc ^= 0xffffffffL;
while (length) {
crc = (crc << 8) ^ crc32_table[(uint8_t)(crc >> 24) ^ (uint8_t)length];
/* must ensure that shift is unsigned! */
if (sizeof(length) <= sizeof(unsigned))
length = (unsigned)length >> 8;
else if (sizeof(length) <= sizeof(unsigned long))
length = (unsigned long)length >> 8;
else
length = (unsigned long long)length >> 8;
}
crc = ~crc;
printf((*argv ? "%" PRIu32 " %li %s\n" : "%" PRIu32 " %li\n"),
printf((*argv ? "%"PRIu32" %"OFF_FMT"i %s\n" : "%"PRIu32" %"OFF_FMT"i\n"),
crc, filesize, *argv);
} while (*argv && *++argv);
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Mark Whitley <markw@codepoet.org>
* debloated by Bernhard Fischer
* debloated by Bernhard Reutner-Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+1 -1
View File
@@ -5,7 +5,7 @@
* by Matthew Grant <grantma@anathoth.gen.nz>
*
* iso-format handling added by Robert Griebl <griebl@gmx.de>
* bugfixes and cleanup by Bernhard Fischer
* bugfixes and cleanup by Bernhard Reutner-Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+59 -36
View File
@@ -8,7 +8,7 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
/* BB_AUDIT SUSv3 _NOT_ compliant -- options -P and -t missing. Also blocksize. */
/* BB_AUDIT SUSv3 _NOT_ compliant -- option -t missing. */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/df.html */
/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
@@ -16,6 +16,10 @@
* Size reduction. Removed floating point dependency. Added error checking
* on output. Output stats on 0-sized filesystems if specifically listed on
* the command line. Properly round *-blocks, Used, and Available quantities.
*
* Aug 28, 2008 Bernhard Reutner-Fischer
*
* Implement -P and -B; better coreutils compat; cleanup
*/
#include <mntent.h>
@@ -34,51 +38,73 @@ int df_main(int argc, char **argv)
{
unsigned long blocks_used;
unsigned blocks_percent_used;
#if ENABLE_FEATURE_HUMAN_READABLE
unsigned df_disp_hr = 1024;
#endif
unsigned long df_disp_hr = 1024;
int status = EXIT_SUCCESS;
unsigned opt;
FILE *mount_table;
struct mntent *mount_entry;
struct statfs s;
/* default display is kilobytes */
const char *disp_units_hdr = "1k-blocks";
static const char ignored_mounts[] ALIGN1 =
"rootfs\0";
enum {
OPT_ALL = (1 << 0),
OPT_INODE = (ENABLE_FEATURE_HUMAN_READABLE ? (1 << 4) : (1 << 2))
* ENABLE_FEATURE_DF_INODE
OPT_KILO = (1 << 0),
OPT_POSIX = (1 << 1),
OPT_ALL = (1 << 2) * ENABLE_FEATURE_DF_FANCY,
OPT_INODE = (1 << 3) * ENABLE_FEATURE_DF_FANCY,
OPT_BSIZE = (1 << 4) * ENABLE_FEATURE_DF_FANCY,
OPT_HUMAN = (1 << 5) * ENABLE_FEATURE_HUMAN_READABLE,
OPT_MEGA = (1 << 6) * ENABLE_FEATURE_HUMAN_READABLE,
};
const char *disp_units_hdr = NULL;
char *chp;
#if ENABLE_FEATURE_HUMAN_READABLE
opt_complementary = "h-km:k-hm:m-hk";
opt = getopt32(argv, "ahmk" USE_FEATURE_DF_INODE("i"));
if (opt & (1 << 1)) { // -h
#if ENABLE_FEATURE_HUMAN_READABLE && ENABLE_FEATURE_DF_FANCY
opt_complementary = "k-mB:m-Bk:B-km";
#elif ENABLE_FEATURE_HUMAN_READABLE
opt_complementary = "k-m:m-k";
#endif
opt = getopt32(argv, "kP"
USE_FEATURE_DF_FANCY("aiB:")
USE_FEATURE_HUMAN_READABLE("hm")
USE_FEATURE_DF_FANCY(, &chp));
if (opt & OPT_MEGA)
df_disp_hr = 1024*1024;
if (opt & OPT_BSIZE)
df_disp_hr = xatoul_range(chp, 1, ULONG_MAX); /* disallow 0 */
/* From the manpage of df from coreutils-6.10:
Disk space is shown in 1K blocks by default, unless the environment
variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used.
*/
if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */
df_disp_hr = 512;
if (opt & OPT_HUMAN) {
df_disp_hr = 0;
disp_units_hdr = " Size";
}
if (opt & (1 << 2)) { // -m
df_disp_hr = 1024*1024;
disp_units_hdr = "1M-blocks";
}
if (opt & OPT_INODE) {
if (opt & OPT_INODE)
disp_units_hdr = " Inodes";
}
#else
opt = getopt32(argv, "ak" USE_FEATURE_DF_INODE("i"));
#endif
printf("Filesystem %-15sUsed Available Use%% Mounted on\n",
disp_units_hdr);
if (disp_units_hdr == NULL) {
#if ENABLE_FEATURE_HUMAN_READABLE
disp_units_hdr = xasprintf("%s-blocks",
make_human_readable_str(df_disp_hr, 0, !!(opt & OPT_POSIX)));
#else
disp_units_hdr = xasprintf("%lu-blocks", df_disp_hr);
#endif
}
printf("Filesystem %-15sUsed Available %s Mounted on\n",
disp_units_hdr, (opt & OPT_POSIX) ? "Capacity" : "Use%");
mount_table = NULL;
argv += optind;
if (optind >= argc) {
mount_table = setmntent(bb_path_mtab_file, "r");
if (!mount_table) {
if (!mount_table)
bb_perror_msg_and_die(bb_path_mtab_file);
}
}
while (1) {
@@ -93,9 +119,8 @@ int df_main(int argc, char **argv)
}
} else {
mount_point = *argv++;
if (!mount_point) {
if (!mount_point)
break;
}
mount_entry = find_mount_point(mount_point, bb_path_mtab_file);
if (!mount_entry) {
bb_error_msg("%s: can't find mount point", mount_point);
@@ -118,10 +143,9 @@ int df_main(int argc, char **argv)
s.f_blocks = s.f_files;
s.f_bavail = s.f_bfree = s.f_ffree;
s.f_bsize = 1;
#if ENABLE_FEATURE_HUMAN_READABLE
if (df_disp_hr)
df_disp_hr = 1;
#endif
}
blocks_used = s.f_blocks - s.f_bfree;
blocks_percent_used = 0;
@@ -131,11 +155,10 @@ int df_main(int argc, char **argv)
) / (blocks_used + s.f_bavail);
}
#ifdef WHY_IT_SHOULD_BE_HIDDEN
if (strcmp(device, "rootfs") == 0) {
/* GNU coreutils 6.10 skip certain mounts, try to be compatible. */
if (index_in_strings(device, ignored_mounts) != -1)
continue;
}
#endif
#ifdef WHY_WE_DO_IT_FOR_DEV_ROOT_ONLY
/* ... and also this is the only user of find_block_device */
if (strcmp(device, "/dev/root") == 0) {
@@ -164,12 +187,12 @@ int df_main(int argc, char **argv)
#else
printf(" %9lu %9lu %9lu %3u%% %s\n",
kscale(s.f_blocks, s.f_bsize),
kscale(s.f_blocks-s.f_bfree, s.f_bsize),
kscale(s.f_blocks - s.f_bfree, s.f_bsize),
kscale(s.f_bavail, s.f_bsize),
blocks_percent_used, mount_point);
#endif
}
}
fflush_stdout_and_exit(status);
return status;
}
+2 -2
View File
@@ -29,6 +29,8 @@
* - use xfunc_error_retval
*/
/* This is a NOEXEC applet. Be very careful! */
#include "libbb.h"
#if ENABLE_FEATURE_ENV_LONG_OPTIONS
@@ -119,5 +121,3 @@ int env_main(int argc UNUSED_PARAM, char **argv)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+177 -83
View File
@@ -3,124 +3,218 @@
* Mini id implementation for busybox
*
* Copyright (C) 2000 by Randolph Chung <tausq@debian.org>
* Copyright (C) 2008 by Tito Ragusa <farmatito@tiscali.it>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
/* BB_AUDIT SUSv3 _NOT_ compliant -- option -G is not currently supported. */
/* Hacked by Tito Ragusa (C) 2004 to handle usernames of whatever length and to
* be more similar to GNU id.
/* BB_AUDIT SUSv3 compliant. */
/* Hacked by Tito Ragusa (C) 2004 to handle usernames of whatever
* length and to be more similar to GNU id.
* -Z option support: by Yuichi Nakamura <ynakam@hitachisoft.jp>
* Added -G option Tito Ragusa (C) 2008 for SUSv3.
*/
#include "libbb.h"
#define PRINT_REAL 1
#define NAME_NOT_NUMBER 2
#define JUST_USER 4
#define JUST_GROUP 8
#if ENABLE_SELINUX
#define JUST_CONTEXT 16
#if !ENABLE_USE_BB_PWD_GRP
#if defined(__UCLIBC_MAJOR__) && (__UCLIBC_MAJOR__ == 0)
#if (__UCLIBC_MINOR__ < 9) || (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 30)
#error "Sorry, you need at least uClibc version 0.9.30 for id applet to build"
#endif
#endif
#endif
static int printf_full(unsigned int id, const char *arg, const char prefix)
{
const char *fmt = "%cid=%u";
int status = EXIT_FAILURE;
enum {
PRINT_REAL = (1 << 0),
NAME_NOT_NUMBER = (1 << 1),
JUST_USER = (1 << 2),
JUST_GROUP = (1 << 3),
JUST_ALL_GROUPS = (1 << 4),
#if ENABLE_SELINUX
JUST_CONTEXT = (1 << 5),
#endif
};
if (arg) {
fmt = "%cid=%u(%s)";
status = EXIT_SUCCESS;
static int print_common(unsigned id,
char* FAST_FUNC bb_getXXXid(char *name, int bufsize, long uid),
const char *prefix)
{
const char *name = bb_getXXXid(NULL, 0, id);
if (prefix) {
printf("%s", prefix);
}
printf(fmt, prefix, id, arg);
return status;
if (!(option_mask32 & NAME_NOT_NUMBER) || !name) {
printf("%u", id);
}
if (!option_mask32 || (option_mask32 & NAME_NOT_NUMBER)) {
if (name) {
printf(option_mask32 ? "%s" : "(%s)", name);
} else {
/* Don't set error status flag in default mode */
if (option_mask32) {
if (ENABLE_DESKTOP)
bb_error_msg("unknown ID %u", id);
return EXIT_FAILURE;
}
}
}
return EXIT_SUCCESS;
}
static int print_group(gid_t id, const char *prefix)
{
return print_common(id, bb_getgrgid, prefix);
}
static int print_user(uid_t id, const char *prefix)
{
return print_common(id, bb_getpwuid, prefix);
}
/* On error set *n < 0 and return >= 0
* If *n is too small, update it and return < 0
* (ok to trash groups[] in both cases)
* Otherwise fill in groups[] and return >= 0
*/
static int get_groups(const char *username, gid_t rgid, gid_t *groups, int *n)
{
int m;
if (username) {
/* If the user is a member of more than
* *n groups, then -1 is returned. Otherwise >= 0.
* (and no defined way of detecting errors?!) */
m = getgrouplist(username, rgid, groups, n);
/* I guess *n < 0 might indicate error. Anyway,
* malloc'ing -1 bytes won't be good, so: */
//if (*n < 0)
// return 0;
//return m;
//commented out here, happens below anyway
} else {
/* On error -1 is returned, which ends up in *n */
int nn = getgroups(*n, groups);
/* 0: nn <= *n, groups[] was big enough; -1 otherwise */
m = - (nn > *n);
*n = nn;
}
if (*n < 0)
return 0; /* error, don't return < 0! */
return m;
}
int id_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int id_main(int argc UNUSED_PARAM, char **argv)
{
struct passwd *p;
uid_t uid;
gid_t gid;
unsigned long flags;
short status;
uid_t ruid;
gid_t rgid;
uid_t euid;
gid_t egid;
unsigned opt;
int i;
int status = EXIT_SUCCESS;
const char *prefix;
const char *username;
#if ENABLE_SELINUX
security_context_t scontext;
security_context_t scontext = NULL;
#endif
/* Don't allow -n -r -nr -ug -rug -nug -rnug */
/* Don't allow -n -r -nr -ug -rug -nug -rnug -uZ -gZ -GZ*/
/* Don't allow more than one username */
opt_complementary = "?1:u--g:g--u:r?ug:n?ug" USE_SELINUX(":u--Z:Z--u:g--Z:Z--g");
flags = getopt32(argv, "rnug" USE_SELINUX("Z"));
opt_complementary = "?1:u--g:g--u:G--u:u--G:g--G:G--g:r?ugG:n?ugG"
USE_SELINUX(":u--Z:Z--u:g--Z:Z--g:G--Z:Z--G");
opt = getopt32(argv, "rnugG" USE_SELINUX("Z"));
/* This values could be overwritten later */
uid = geteuid();
gid = getegid();
if (flags & PRINT_REAL) {
uid = getuid();
gid = getgid();
username = argv[optind];
if (username) {
struct passwd *p = getpwnam(username);
if (!p)
bb_error_msg_and_die("unknown user %s", username);
euid = ruid = p->pw_uid;
egid = rgid = p->pw_gid;
} else {
egid = getegid();
rgid = getgid();
euid = geteuid();
ruid = getuid();
}
/* JUST_ALL_GROUPS ignores -r PRINT_REAL flag even if man page for */
/* id says: print the real ID instead of the effective ID, with -ugG */
/* in fact in this case egid is always printed if egid != rgid */
if (!opt || (opt & JUST_ALL_GROUPS)) {
gid_t *groups;
int n;
if (argv[optind]) {
p = getpwnam(argv[optind]);
/* xuname2uid is needed because it exits on failure */
uid = xuname2uid(argv[optind]);
gid = p->pw_gid;
/* in this case PRINT_REAL is the same */
}
if (flags & (JUST_GROUP | JUST_USER USE_SELINUX(| JUST_CONTEXT))) {
/* JUST_GROUP and JUST_USER are mutually exclusive */
if (flags & NAME_NOT_NUMBER) {
/* bb_getXXXid(-1) exit on failure, puts cannot segfault */
puts((flags & JUST_USER) ? bb_getpwuid(NULL, -1, uid) : bb_getgrgid(NULL, -1, gid));
if (!opt) {
/* Default Mode */
status |= print_user(ruid, "uid=");
status |= print_group(rgid, " gid=");
if (euid != ruid)
status |= print_user(euid, " euid=");
if (egid != rgid)
status |= print_group(egid, " egid=");
} else {
if (flags & JUST_USER) {
printf("%u\n", uid);
}
if (flags & JUST_GROUP) {
printf("%u\n", gid);
}
/* JUST_ALL_GROUPS */
status |= print_group(rgid, NULL);
if (egid != rgid)
status |= print_group(egid, " ");
}
/* We are supplying largish buffer, trying
* to not run get_groups() twice. That might be slow
* ("user database in remote SQL server" case) */
groups = xmalloc(64 * sizeof(gid_t));
n = 64;
if (get_groups(username, rgid, groups, &n) < 0) {
/* Need bigger buffer after all */
groups = xrealloc(groups, n * sizeof(gid_t));
get_groups(username, rgid, groups, &n);
}
if (n > 0) {
/* Print the list */
prefix = " groups=";
for (i = 0; i < n; i++) {
if (opt && (groups[i] == rgid || groups[i] == egid))
continue;
status |= print_group(groups[i], opt ? " " : prefix);
prefix = ",";
}
} else if (n < 0) { /* error in get_groups() */
if (!ENABLE_DESKTOP)
bb_error_msg_and_die("cannot get groups");
else
return EXIT_FAILURE;
}
if (ENABLE_FEATURE_CLEAN_UP)
free(groups);
#if ENABLE_SELINUX
if (flags & JUST_CONTEXT) {
selinux_or_die();
if (argc - optind == 1) {
bb_error_msg_and_die("user name can't be passed with -Z");
}
if (getcon(&scontext)) {
bb_error_msg_and_die("can't get process context");
}
puts(scontext);
if (is_selinux_enabled()) {
if (getcon(&scontext) == 0)
printf(" context=%s", scontext);
}
#endif
/* exit */
fflush_stdout_and_exit(EXIT_SUCCESS);
} else if (opt & PRINT_REAL) {
euid = ruid;
egid = rgid;
}
/* Print full info like GNU id */
/* bb_getpwuid(0) doesn't exit on failure (returns NULL) */
status = printf_full(uid, bb_getpwuid(NULL, 0, uid), 'u');
bb_putchar(' ');
status |= printf_full(gid, bb_getgrgid(NULL, 0, gid), 'g');
if (opt & JUST_USER)
status |= print_user(euid, NULL);
else if (opt & JUST_GROUP)
status |= print_group(egid, NULL);
#if ENABLE_SELINUX
if (is_selinux_enabled()) {
security_context_t mysid;
const char *context;
context = "unknown";
getcon(&mysid);
if (mysid) {
context = alloca(strlen(mysid) + 1);
strcpy((char*)context, mysid);
freecon(mysid);
else if (opt & JUST_CONTEXT) {
selinux_or_die();
if (username || getcon(&scontext)) {
bb_error_msg_and_die("can't get process context%s",
username ? " for a different user" : "");
}
printf(" context=%s", context);
fputs(scontext, stdout);
}
/* freecon(NULL) seems to be harmless */
if (ENABLE_FEATURE_CLEAN_UP)
freecon(scontext);
#endif
bb_putchar('\n');
fflush_stdout_and_exit(status);
}
+244
View File
@@ -0,0 +1,244 @@
#!/bin/bash
# Test script for busybox id vs. coreutils id.
# Needs root privileges for some tests.
cp /usr/bin/id .
BUSYBOX=./busybox
ID=./id
LIST=`awk -F: '{ printf "%s\n", $1 }' /etc/passwd`
FLAG_USER_EXISTS="no"
TEST_USER="f583ca884c1d93458fb61ed137ff44f6"
echo "test 1: id [options] nousername"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
echo "test 2: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
if test "$i" = "$TEST_USER"; then
FLAG_USER_EXISTS="yes"
fi
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
if test $FLAG_USER_EXISTS = "yes"; then
echo "test 3,4,5,6,7,8,9,10,11,12 skipped because test user $TEST_USER already exists"
rm -f foo bar
exit 1
fi
adduser -s /bin/true -g "" -H -D "$TEST_USER" || exit 1
chown $TEST_USER.$TEST_USER $BUSYBOX
chmod u+s $BUSYBOX 2>&1 /dev/null
chown $TEST_USER.$TEST_USER $ID
chmod u+s $ID 2>&1 /dev/null
echo "test 3 setuid, existing user: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
#done
done
echo "test 4 setuid, existing user: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
chown $TEST_USER.$TEST_USER $BUSYBOX
chmod g+s $BUSYBOX 2>&1 /dev/null
chown $TEST_USER.$TEST_USER $ID
chmod g+s $ID 2>&1 /dev/null
echo "test 5 setgid, existing user: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
#done
done
echo "test 6 setgid, existing user: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
chown $TEST_USER.$TEST_USER $BUSYBOX
chmod u+s,g+s $BUSYBOX 2>&1 /dev/null
chown $TEST_USER.$TEST_USER $ID
chmod u+s,g+s $ID 2>&1 /dev/null
echo "test 7 setuid, setgid, existing user: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
#done
done
echo "test 8 setuid, setgid, existing user: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
deluser $TEST_USER || exit 1
echo "test 9 setuid, setgid, not existing user: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
echo "test 10 setuid, setgid, not existing user: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
chown .root $BUSYBOX 2>&1 /dev/null
chown .root $ID 2>&1 /dev/null
chmod g+s $BUSYBOX 2>&1 /dev/null
chmod g+s $ID 2>&1 /dev/null
echo "test 11 setgid, not existing group: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
#done
done
echo "test 12 setgid, not existing group: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
chown root.root $BUSYBOX 2>&1 /dev/null
chown root.root $ID 2>&1 /dev/null
rm -f $ID
rm -f foo bar
+34 -27
View File
@@ -4,9 +4,6 @@
* SELinux support: by Yuichi Nakamura <ynakam@hitachisoft.jp>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
* TODO: -d option, need a way of recursively making directories and changing
* owner/group, will probably modify bb_make_directory(...)
*/
#include "libbb.h"
@@ -53,7 +50,8 @@ static void setdefaultfilecon(const char *path)
if (lsetfilecon(path, scontext) < 0) {
if (errno != ENOTSUP) {
bb_perror_msg("warning: failed to change context of %s to %s", path, scontext);
bb_perror_msg("warning: failed to change context"
" of %s to %s", path, scontext);
}
}
@@ -75,7 +73,7 @@ int install_main(int argc, char **argv)
const char *uid_str;
const char *mode_str;
int copy_flags = FILEUTILS_DEREFERENCE | FILEUTILS_FORCE;
int flags;
int opts;
int min_args = 1;
int ret = EXIT_SUCCESS;
int isdir = 0;
@@ -87,15 +85,16 @@ int install_main(int argc, char **argv)
OPT_c = 1 << 0,
OPT_v = 1 << 1,
OPT_b = 1 << 2,
OPT_DIRECTORY = 1 << 3,
OPT_PRESERVE_TIME = 1 << 4,
OPT_STRIP = 1 << 5,
OPT_GROUP = 1 << 6,
OPT_MODE = 1 << 7,
OPT_OWNER = 1 << 8,
OPT_MKDIR_LEADING = 1 << 3,
OPT_DIRECTORY = 1 << 4,
OPT_PRESERVE_TIME = 1 << 5,
OPT_STRIP = 1 << 6,
OPT_GROUP = 1 << 7,
OPT_MODE = 1 << 8,
OPT_OWNER = 1 << 9,
#if ENABLE_SELINUX
OPT_SET_SECURITY_CONTEXT = 1 << 9,
OPT_PRESERVE_SECURITY_CONTEXT = 1 << 10,
OPT_SET_SECURITY_CONTEXT = 1 << 10,
OPT_PRESERVE_SECURITY_CONTEXT = 1 << 11,
#endif
};
@@ -106,37 +105,38 @@ int install_main(int argc, char **argv)
/* -c exists for backwards compatibility, it's needed */
/* -v is ignored ("print name of each created directory") */
/* -b is ignored ("make a backup of each existing destination file") */
flags = getopt32(argv, "cvb" "dpsg:m:o:" USE_SELINUX("Z:"),
opts = getopt32(argv, "cvb" "Ddpsg:m:o:" USE_SELINUX("Z:"),
&gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext));
argc -= optind;
argv += optind;
#if ENABLE_SELINUX
if (flags & (OPT_PRESERVE_SECURITY_CONTEXT|OPT_SET_SECURITY_CONTEXT)) {
if (opts & (OPT_PRESERVE_SECURITY_CONTEXT|OPT_SET_SECURITY_CONTEXT)) {
selinux_or_die();
use_default_selinux_context = 0;
if (flags & OPT_PRESERVE_SECURITY_CONTEXT) {
if (opts & OPT_PRESERVE_SECURITY_CONTEXT) {
copy_flags |= FILEUTILS_PRESERVE_SECURITY_CONTEXT;
}
if (flags & OPT_SET_SECURITY_CONTEXT) {
if (opts & OPT_SET_SECURITY_CONTEXT) {
setfscreatecon_or_die(scontext);
copy_flags |= FILEUTILS_SET_SECURITY_CONTEXT;
}
}
#endif
/* preserve access and modification time, this is GNU behaviour, BSD only preserves modification time */
if (flags & OPT_PRESERVE_TIME) {
/* preserve access and modification time, this is GNU behaviour,
* BSD only preserves modification time */
if (opts & OPT_PRESERVE_TIME) {
copy_flags |= FILEUTILS_PRESERVE_STATUS;
}
mode = 0666;
if (flags & OPT_MODE)
if (opts & OPT_MODE)
bb_parse_mode(mode_str, &mode);
uid = (flags & OPT_OWNER) ? get_ug_id(uid_str, xuname2uid) : getuid();
gid = (flags & OPT_GROUP) ? get_ug_id(gid_str, xgroup2gid) : getgid();
uid = (opts & OPT_OWNER) ? get_ug_id(uid_str, xuname2uid) : getuid();
gid = (opts & OPT_GROUP) ? get_ug_id(gid_str, xgroup2gid) : getgid();
last = argv[argc - 1];
if (!(flags & OPT_DIRECTORY)) {
if (!(opts & OPT_DIRECTORY)) {
argv[argc - 1] = NULL;
min_args++;
@@ -149,7 +149,7 @@ int install_main(int argc, char **argv)
while ((arg = *argv++) != NULL) {
char *dest = last;
if (flags & OPT_DIRECTORY) {
if (opts & OPT_DIRECTORY) {
dest = arg;
/* GNU coreutils 6.9 does not set uid:gid
* on intermediate created directories
@@ -159,6 +159,13 @@ int install_main(int argc, char **argv)
goto next;
}
} else {
if (opts & OPT_MKDIR_LEADING) {
char *ddir = xstrdup(dest);
bb_make_directory(dirname(ddir), 0755, FILEUTILS_RECUR);
/* errors are not checked. copy_file
* will fail if dir is not created. */
free(ddir);
}
if (isdir)
dest = concat_path_file(last, basename(arg));
if (copy_file(arg, dest, copy_flags)) {
@@ -169,7 +176,7 @@ int install_main(int argc, char **argv)
}
/* Set the file mode */
if ((flags & OPT_MODE) && chmod(dest, mode) == -1) {
if ((opts & OPT_MODE) && chmod(dest, mode) == -1) {
bb_perror_msg("can't change %s of %s", "permissions", dest);
ret = EXIT_FAILURE;
}
@@ -178,13 +185,13 @@ int install_main(int argc, char **argv)
setdefaultfilecon(dest);
#endif
/* Set the user and group id */
if ((flags & (OPT_OWNER|OPT_GROUP))
if ((opts & (OPT_OWNER|OPT_GROUP))
&& lchown(dest, uid, gid) == -1
) {
bb_perror_msg("can't change %s of %s", "ownership", dest);
ret = EXIT_FAILURE;
}
if (flags & OPT_STRIP) {
if (opts & OPT_STRIP) {
char *args[3];
args[0] = (char*)"strip";
args[1] = dest;
+1 -1
View File
@@ -5,7 +5,7 @@
* http://www.opengroup.org/onlinepubs/007904975/utilities/nohup.html
*
* Copyright 2006 Rob Landley <rob@landley.net>
* Copyright 2006 Bernhard Fischer
* Copyright 2006 Bernhard Reutner-Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+8 -1
View File
@@ -359,8 +359,15 @@ int printf_main(int argc UNUSED_PARAM, char **argv)
* We will mimic coreutils. */
if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2])
argv++;
if (!argv[1])
if (!argv[1]) {
if (ENABLE_ASH_BUILTIN_PRINTF
&& applet_name[0] != 'p'
) {
bb_error_msg("usage: printf FORMAT [ARGUMENT...]");
return 2; /* bash compat */
}
bb_show_usage();
}
format = argv[1];
argv2 = argv + 2;
+1 -1
View File
@@ -1,7 +1,7 @@
/* vi: set sw=4 ts=4: */
/*
* split - split a file into pieces
* Copyright (c) 2007 Bernhard Fischer
* Copyright (c) 2007 Bernhard Reutner-Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* modified by Herbert Xu to be used as built-in in ash.
* modified by Erik Andersen <andersen@codepoet.org> to be used
* in busybox.
* modified by Bernhard Fischer to be useable (i.e. a bit less bloaty).
* modified by Bernhard Reutner-Fischer to be useable (i.e. a bit less bloaty).
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
+1
View File
@@ -64,6 +64,7 @@ config FEATURE_START_STOP_DAEMON_FANCY
Support additional arguments.
-o|--oknodo ignored since we exit with 0 anyway
-v|--verbose
-N|--nicelevel N
config FEATURE_START_STOP_DAEMON_LONG_OPTIONS
bool "Enable long options"
+1 -1
View File
@@ -2,7 +2,7 @@
/*
* Mini run-parts implementation for busybox
*
* Copyright (C) 2007 Bernhard Fischer
* Copyright (C) 2007 Bernhard Reutner-Fischer
*
* Based on a older version that was in busybox which was 1k big..
* Copyright (C) 2001 by Emanuele Aina <emanuele.aina@tiscali.it>
+4 -4
View File
@@ -349,11 +349,11 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
opt_complementary = "K:S:K--S:S--K:m?p:K?xpun:S?xa"
USE_FEATURE_START_STOP_DAEMON_FANCY("q-v");
opt = getopt32(argv, "KSbqtma:n:s:u:c:x:p:"
USE_FEATURE_START_STOP_DAEMON_FANCY("ovN:"),
// USE_FEATURE_START_STOP_DAEMON_FANCY("ovN:R:"),
USE_FEATURE_START_STOP_DAEMON_FANCY("ovN:R:"),
&startas, &cmdname, &signame, &userspec, &chuid, &execname, &pidfile
USE_FEATURE_START_STOP_DAEMON_FANCY(,&opt_N)
// USE_FEATURE_START_STOP_DAEMON_FANCY(,&retry_arg)
/* We accept and ignore -R <param> / --retry <param> */
USE_FEATURE_START_STOP_DAEMON_FANCY(,NULL)
);
if (opt & OPT_s) {
@@ -428,7 +428,7 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
write_pidfile(pidfile);
}
if (opt & OPT_c) {
struct bb_uidgid_t ugid;
struct bb_uidgid_t ugid = { -1, -1 };
parse_chown_usergroup_or_die(&ugid, chuid);
if (ugid.gid != (gid_t) -1) xsetgid(ugid.gid);
if (ugid.uid != (uid_t) -1) xsetuid(ugid.uid);
+424
View File
@@ -0,0 +1,424 @@
Downloaded from http://www.lafn.org/~dave/linux/Serial-Programming-HOWTO.txt
Seems to be somewhat old, but contains useful bits for getty.c hacking
============================================================================
The Linux Serial Programming HOWTO, Part 1 of 2
By Vernon C. Hoxie
v2.0 10 September 1999
This document describes how to program communications with devices
over a serial port on a Linux box.
______________________________________________________________________
Table of Contents
1. Copyright
2. Introduction
3. Opening
4. Commands
5. Changing Baud Rates
6. Additional Control Calls
6.1 Sending a "break".
6.2 Hardware flow control.
6.3 Flushing I/O buffers.
7. Modem control
8. Process Groups
8.1 Sessions
8.2 Process Groups
8.3 Controlling Terminal
8.3.1 Get the foreground group process id.
8.3.2 Set the foreground process group id of a terminal.
8.3.3 Get process group id.
9. Lockfiles
10. Additional Information
11. Feedback
______________________________________________________________________
1. Copyright
The Linux Serial-Programming-HOWTO is copyright (C) 1997 by Vernon
Hoxie. Linux HOWTO documents may be reproduced and distributed in
whole or in part, in any medium physical or electronic, as long as
this copyright notice is retained on all copies. Commercial
redistribution is allowed and encouraged; however, the author would
like to be notified of any such distributions.
All translations, derivative works, or aggregate works incorporating
this Linux HOWTO document must be covered under this copyright notice.
That is, you may not produce a derivative work from this HOWTO and
impose additional restrictions on its distribution.
This version is a complete rewrite of the previous Serial-Programming-
HOWTO by Peter H. Baumann, <mailto:Peter.Baumann@dlr.de>
2. Introduction
This HOWTO will attempt to give hints about how to write a program
which needs to access a serial port. Its principal focus will be on
the Linux implementation and what the meaning of the various library
functions available.
Someone asked about which of several sequences of operations was
right. There is no absolute right way to accomplish an outcome. The
options available are too numerous. If your sequences produces the
desired results, then that is the right way for you. Another
programmer may select another set of options and get the same results.
His method is right for him.
Neither of these methods may operate properly with some other
implementation of UNIX. It is strange that many of the concepts which
were implemented in the SYSV version have been dumped. Because UNIX
was developed by AT&T and much code has been generated on those
concepts, the AT&T version should be the standard to which others
should emulate.
Now the standard is POSIX.
It was once stated that the popularity of UNIX and C was that they
were created by programmers for programmers. Not by scholars who
insist on purity of style in deference to results and simplicity of
use. Not by committees with people who have diverse personal or
proprietary agenda. Now ANSI and POSIX have strayed from those
original clear and simply concepts.
3. Opening
The various serial devices are opened just as any other file.
Although, the fopen(3) command may be used, the plain open(2) is
preferred. This call returns the file descriptor which is required
for the various commands that configure the interface.
Open(2) has the format:
#include <fcntl.h>
int open(char *path, int flags, [int mode]);
In addition to the obvious O_RDWR, O_WRONLY and O_RDONLY, two
additional flags are available. These are O_NONBLOCK and O_NOCTTY.
Other flags listed in the open(2) manual page are not applicable to
serial devices.
Normally, a serial device opens in "blocking" mode. This means that
the open() will not return until the Carrier Detect line from the port
is active, e.g. modem, is active. When opened with the O_NONBLOCK
flag set, the open() will return immediately regardless of the status
of the DCD line. The "blocking" mode also affects the read() call.
The fcntl(2) command can be used to change the O_NONBLOCK flag anytime
after the device has been opened.
The device driver and the data passing through it are controlled
according to settings in the struct termios. This structure is
defined in "/usr/include/termios.h". In the Linux tree, further
reference is made to "/usr/include/asm/termbits.h".
In blocking mode, a read(2) will block until data is available or a
signal is received. It is still subject to state of the ICANON flag.
When the termios.c_lflag ICANON bit is set, input data is collected
into strings until a NL, EOF or EOL character is received. You can
define these in the termios.c_cc[] array. Also, ERASE and KILL
characters will operate on the incoming data before it is delivered to
the user.
In non-canonical mode, incoming data is quanitified by use of the
c_cc[VMIN and c_cc[VTIME] values in termios.c_cc[].
Some programmers use the select() call to detect the completion of a
read(). This is not the best way of checking for incoming data.
Select() is part of the SOCKETS scheme and too complex for most
applications.
A full explanation of the fields of the termios structure is contained
in termios(7) of the Users Manual. A version is included in Part 2 of
this HOWTO document.
4. Commands
Changes to the struct termios are made by retrieving the current
settings, making the desired changes and transmitting the modified
structure back to the kernel.
The historic means of communicating with the kernel was by use of the
ioctl(fd, COMMAND, arg) system call. Then the purists in the
computer industry decided that this was not genetically consistent.
Their argument was that the argument changed its stripes. Sometimes
it was an int, sometimes it was a pointer to int and other times it
was a pointer to struct termios. Then there were those times it was
empty or NULL. These variations are dependent upon the COMMAND.
As a alternative, the tc* series of functions were concocted.
These are:
int tcgetattr(int filedes, struct termios *termios_p);
int tcsetattr(int filedes, int optional_actions,
const struct termios *termios_p);
instead of:
int ioctl(int filedes, int command,
struct termios *termios_p);
where command is TCGETS or one of TCSETS, TCSETSW or TCSETSF.
The TCSETS command is comparable to the TCSANOW optional_action for
the tc* version. These direct the kernel to adopt the changes
immediately. Other pairs are:
command optional_action Meaning
TCSETSW TCSADRAIN Change after all output has drained.
TCSETSF TCSAFLUSH Change after all output has drained
then discard any input characters
not read.
Since the return code from either the ioctl(2) or the tcsetattr(2)
commands only indicate that the command was processed by the kernel.
These do not indicate whether or not the changes were actually
accomplished. Either of these commands should be followed by a call
to:
ioctl(fd, TCGETS, &new_termios);
or:
tcgetattr(fd, &new_termios);
A user function which makes changes to the termios structure should
define two struct termios variables. One of these variables should
contain the desired configuration. The other should contain a copy of
the kernels version. Then after the desired configuration has been
sent to the kernel, another call should be made to retrieve the
kernels version. Then the two compared.
Here is an example of how to add RTS/CTS flow control:
struct termios my_termios;
struct termios new_termios;
tcgetattr(fd, &my_termios);
my_termios.c_flag |= CRTSCTS;
tcsetattr(fd, TCSANOW, &my_termios);
tcgetattr(fd, &new_termios);
if (memcmp(my_termios, new_termios,
sizeof(my_termios)) != 0) {
/* do some error handling */
}
5. Changing Baud Rates
With Linux, the baud rate can be changed using a technique similar to
add/delete RTS/CTS.
struct termios my_termios;
struct termios new_termios;
tcgetattr(fd, &my_termios);
my_termios.c_flag &= ~CBAUD;
my_termios.c_flag |= B19200;
tcsetattr(fd, TCSANOW, &my_termios);
tcgetattr(fd, &new_termios);
if (memcmp(my_termios, new_termios,
sizeof(my_termios)) != 0) {
/* do some error handling */
}
POSIX adds another method. They define:
speed_t cfgetispeed(const struct termios *termios_p);
speed_t cfgetospeed(const struct termios *termios_p);
library calls to extract the current input or output speed from the
struct termios pointed to with *termio_p. This is a variable defined
in the calling process. In practice, the data contained in this
termios, should be obtained by the tcgetattr() call or an ioctl() call
using the TCGETS command.
The companion library calls are:
int cfsetispeed(struct termios *termios_p, speed_t speed);
int cfsetospeed(struct termios *termios_p, speed_t speed);
which are used to change the value of the baud rate in the locally
defined *termios_p. Following either of these calls, either a call to
tcsetattr() or ioctl() with one of TCSETS, TCSETSW or TCSETSF as the
command to transmit the change to the kernel.
The cf* commands are preferred for portability. Some weird Unices use
a considerably different format of termios.
Most implementations of Linux use only the input speed for both input
and output. These functions are defined in the application program by
reference to <termios.h>. In reality, they are in
/usr/include/asm/termbits.h.
6. Additional Control Calls
6.1. Sending a "break".
int ioctl(fd, TCSBRK, int arg);
int tcsendbreak(fd, int arg);
Send a break: Here the action differs between the conventional
ioctl() call and the POSIX call. For the conventional call, an arg of
'0' sets the break control line of the UART for 0.25 seconds. For the
POSIX command, the break line is set for arg times 0.1 seconds.
6.2. Hardware flow control.
int ioctl(fd, TCXONC, int action);
int tcflow(fd, int action);
The action flags are:
o TCOOFF 0 suspend output
o TCOON 1 restart output
o TCIOFF 2 transmit STOP character to suspend input
o TCION 3 transmit START character to restart input
6.3. Flushing I/O buffers.
int ioctl(fd, TCFLSH, queue_selector);
int tcflush(fd, queue_selector);
The queue_selector flags are:
o TCIFLUSH 0 flush any data not yet read from the input buffer
o TCOFLUSH 1 flush any data written to the output buffer but not
yet transmitted
o TCIOFLUSH 2 flush both buffers
7. Modem control
The hardware modem control lines can be monitored or modified by the
ioctl(2) system call. A set of comparable tc* calls apparently do not
exist. The form of this call is:
int ioctl(fd, COMMAND, (int *)flags);
The COMMANDS and their action are:
o TIOCMBIS turn on control lines depending upon which bits are set
in flags.
o TIOCMBIC turn off control lines depending upon which bits are
unset in flags.
o TIOCMGET the appropriate bits are set in flags according to the
current status
o TIOCMSET the state of the UART is changed according to which bits
are set/unset in 'flags'
The bit pattern of flags refer to the following control lines:
o TIOCM_LE Line enable
o TIOCM_DTR Data Terminal Ready
o TIOCM_RTS Request to send
o TIOCM_ST Secondary transmit
o TIOCM_SR Secondary receive
o TIOCM_CTS Clear to send
o TIOCM_CAR Carrier detect
o TIOCM_RNG Ring
o TIOCM_DSR Data set ready
It should be noted that some of these bits are controlled by the modem
and the UART cannot change them but their status can be sensed by
TIOCMGET. Also, most Personal Computers do not provide hardware for
secondary transmit and receive.
There are also a pair of ioctl() to monitor these lines. They are
undocumented as far as I have learned. The commands are TIOCMIWAIT
and TCIOGICOUNT. They also differ between versions of the Linux
kernel.
See the lines.c file in my "serial_suite" for an example of how these
can be used see <ftp://scicom.alphacd.com/pub/linux/serial_suite>
8. Process Groups
8.1. Sessions
8.2. Process Groups
Any newly created process inherits the Process Group of its creator.
The Process Group leader has the same PID as PGID.
8.3. Controlling Terminal
There are a series of ioctl(2) and tc*(2) calls which can be used to
monitor or to change the process group to which the device is
attached.
8.3.1. Get the foreground group process id.
If there is no foreground group, a number not representing an existing
process group is returned. On error, a -1 is returned and errno is
set.
int ioctl(fd, TIOCGPGRP, (pid_t *)pid);
int tcgetpgrp(fd, (pid_t *)pid);
8.3.2. Set the foreground process group id of a terminal.
The fd must be the controlling terminal and be associated with the
session of the calling process.
int ioctl(fd, TIOCSPGRP, (pid_t *)pid);
int tcsetpgrp(fd, (pid_t *)pid);
8.3.3. Get process group id.
int ioctl(fd, TIOCGPGRP, &(pid_t)pid);
int tcgetpgrp(fd, &(pid_t)pid);
9. Lockfiles
Any process which accesses a serial device should first check for the
existence of lock file for the desired device. If such a lock lock
file exists, this means that the device may be in use by another
process.
Check my "libdevlocks-x.x.tgz" at
<ftp://scicom.alphacdc.com/pub/linux> for an example of how these lock
files should be utilized.
10. Additional Information
Check out my "serial_suite.tgz" for more information about programming
the serial ports at <mailto:vern@zebra.alphacdc.com>. There some
examples and some blurbs about setting up modems and comments about
some general considerations.
11. Feedback
Please send me any corrections, questions, comments, suggestions, or
additional material. I would like to improve this HOWTO! Tell me
exactly what you don't understand, or what could be clearer. You can
reach me at <mailto:vern@zebra.alphacdc.com> via email. Please
include the version number of the Serial-Programming-HOWTO when
writing.
+4
View File
@@ -1,4 +1,5 @@
#!/usr/bin/perl -w
# vi: set sw=4 ts=4:
use strict;
use Getopt::Long;
@@ -36,6 +37,7 @@ sub beautify {
s/"\s*$//;
s/%/%%/g;
s/\$/\\\$/g;
s/\@/\\\@/g;
eval qq[ sprintf(qq{$_}) ]
} @line
);
@@ -48,11 +50,13 @@ sub pod_for_usage {
my $usage = shift;
# Sigh. Fixup the known odd-name applets.
# Perhaps we can use some of APPLET_ODDNAME from include/applets.h ?
$name =~ s/dpkg_deb/dpkg-deb/g;
$name =~ s/fsck_minix/fsck.minix/g;
$name =~ s/mkfs_minix/mkfs.minix/g;
$name =~ s/run_parts/run-parts/g;
$name =~ s/start_stop_daemon/start-stop-daemon/g;
$name =~ s/ether_wake/ether-wake/g;
# make options bold
my $trivial = $usage->{trivial};
+45 -42
View File
@@ -16,7 +16,7 @@ have additions to this FAQ document, we would love to add them,
<li><a href="#arch">Which architectures does BusyBox run on?</a></li>
<li><a href="#libc">Which C libraries are supported?</a></li>
<li><a href="#commercial">Can I include BusyBox as part of the software on my device?</a></li>
<li><a href="#external">Where can I find other small utilities since busybox does not include the features I want?</a></li></li>
<li><a href="#external">Where can I find other small utilities since busybox does not include the features I want?</a></li>
<li><a href="#demanding">I demand that you to add &lt;favorite feature&gt; right now! How come you don't answer all my questions on the mailing list instantly? I demand that you help me with all of my problems <em>Right Now</em>!</a></li>
<li><a href="#helpme">I need help with BusyBox! What should I do?</a></li>
<li><a href="#contracts">I need you to add &lt;favorite feature&gt;! Are the BusyBox developers willing to be paid in order to fix bugs or add in &lt;favorite feature&gt;? Are you willing to provide support contracts?</a></li>
@@ -40,25 +40,26 @@ have additions to this FAQ document, we would love to add them,
<ol>
<li><a href="#goals">What are the goals of busybox?</a></li>
<li><a href="#design">What is the design of busybox?</a></li>
<li><a href="#source">How is the source code organized?</a></li>
<ul>
<li><a href="#source">How is the source code organized?</a>
<ul>
<li><a href="#source_applets">The applet directories.</a></li>
<li><a href="#source_libbb">The busybox shared library (libbb)</a></li>
</ul>
</ul>
</li>
<li><a href="#optimize">I want to make busybox even smaller, how do I go about it?</a></li>
<li><a href="#adding">Adding an applet to busybox</a></li>
<li><a href="#standards">What standards does busybox adhere to?</a></li>
<li><a href="#portability">Portability.</a></li>
<li><a href="#tips">Tips and tricks.</a></li>
<ul>
<li><a href="#tips">Tips and tricks.</a>
<ul>
<li><a href="#tips_encrypted_passwords">Encrypted Passwords</a></li>
<li><a href="#tips_vfork">Fork and vfork</a></li>
<li><a href="#tips_short_read">Short reads and writes</a></li>
<li><a href="#tips_memory">Memory used by relocatable code, PIC, and static linking.</a></li>
<li><a href="#tips_kernel_headers">Including Linux kernel headers.</a></li>
</ul>
<li><a href="#who">Who are the BusyBox developers?</a></li>
</ul>
</ul>
</li>
<li><a href="#who">Who are the BusyBox developers?</a></li>
</ol>
@@ -179,12 +180,19 @@ within each applet. More build coverage testing.</p></li>
during compilation. Only gcc and related binutils executables
are prefixed with $(CROSS_COMPILE) in the makefiles.
CROSS_COMPILE can be set on the command line:
</p>
<pre>
make CROSS_COMPILE=arm-linux-uclibcgnueabi-
</pre>
<p>
Alternatively CROSS_COMPILE can be set in the environment.
Default value for CROSS_COMPILE is not to prefix executables.
</p>
<p>
To store the cross-compiler in your .config, set the variable
CONFIG_CROSS_COMPILER_PREFIX accordingly in menuconfig or by
editing the .config file.
</p>
<hr />
<h2><a name="build_system">How do I build a BusyBox-based system?</a></h2>
@@ -207,7 +215,7 @@ within each applet. More build coverage testing.</p></li>
</p>
<p>
To learn how to build a working Linux system entirely from source code,
the place to go is the <a href="http://www.linuxfromscratch.org">Linux
the place to go is the <a href="http://www.linuxfromscratch.org/">Linux
From Scratch</a> project. They have an entire book of step-by-step
instructions you can
<a href="http://www.linuxfromscratch.org/lfs/view/stable/">read online</a>
@@ -222,7 +230,7 @@ within each applet. More build coverage testing.</p></li>
<p>
If you want an automated yet customizable system builder which produces
a BusyBox and uClibc based system, try
<a href="http://buildroot.uclibc.org">buildroot</a>, which is
<a href="http://buildroot.uclibc.org/">buildroot</a>, which is
another project by the maintainer of the uClibc (Erik Andersen).
Download the tarball, extract it, unset CC, make.
For more instructions, see the website.
@@ -308,9 +316,10 @@ within each applet. More build coverage testing.</p></li>
BusyBox mailing list at busybox@busybox.net.</p>
<p> In addition to the mailing list, Erik Andersen (andersee), Manuel Nova
(mjn3), Rob Landley (landley), Mike Frysinger (SpanKY), Bernhard Fischer
(blindvt), and other long-time BusyBox developers are known to hang out
on the uClibc IRC channel: #uclibc on irc.freenode.net. There is a
(mjn3), Rob Landley (landley), Mike Frysinger (SpanKY),
Bernhard Reutner-Fischer (blindvt), and other long-time BusyBox developers
are known to hang out on the uClibc IRC channel: #uclibc on
irc.freenode.net. There is a
<a href="http://ibot.Rikers.org/%23uclibc/">web archive of
daily logs of the #uclibc IRC channel</a> going back to 2002.
</p>
@@ -339,16 +348,6 @@ within each applet. More build coverage testing.</p></li>
maintainer and ask them to recommend someone.
</p>
<p> If you prefer to deal with an organization rather than an individual, Rob
Landley (the current BusyBox maintainer) works for
<a http://www.timesys.com>TimeSys</a>, and Eric Andersen (the previous
busybox maintainer and current uClibc maintainer) owns
<a href="http://codepoet-consulting.com/">CodePoet Consulting</a>. Both
companies offer support contracts and handle new development, and there
are plenty of other companies that do the same.
</p>
<hr />
<h1>Troubleshooting</h1>
@@ -358,7 +357,7 @@ within each applet. More build coverage testing.</p></li>
<p>
If you simply need help with using or configuring BusyBox, please submit a
detailed description of your problem to the BusyBox mailing list at <a
href="mailto:busybox@busybox.net"> busybox@busybox.net</a>.
href="mailto:busybox@busybox.net">busybox@busybox.net</a>.
Please do not send email to individual developers asking
for private help unless you are planning on paying for consulting services.
When we answer questions on the BusyBox mailing list, it helps everyone,
@@ -386,7 +385,7 @@ within each applet. More build coverage testing.</p></li>
</p>
<hr />
<h2><a name="backporting">I'm using an ancient version from the dawn of time and something's broken. Can you backport fixes for free?</h2>
<h2><a name="backporting">I'm using an ancient version from the dawn of time and something's broken. Can you backport fixes for free?</a></h2>
<p>Variants of this one get asked a lot.</p>
@@ -395,7 +394,7 @@ and we're happy to respond to our users' needs. But if you're coming to the
list for free tech support we're going to ask you to upgrade to a current
version before we try to diagnose your problem.</p>
<p>If you're building BusyBox 0.50 with uClibc 0.9.19 and gcc 0.9.26 there's a
<p>If you're building BusyBox 0.50 with uClibc 0.9.19 and gcc 1.27 there's a
fairly large chance that whatever problem you're seeing has already been fixed.
To get that fix, all you have to do is upgrade to a newer version. If you
don't at least _try_ that, you're wasting our time.</p>
@@ -509,7 +508,7 @@ int main(int argc, char *argv)
<h2><a name="tz">How do I change the time zone in busybox?</a></h2>
<p>Busybox has nothing to do with the timezone. Please consult your libc
documentation. (<a href='http://google.com/search?q=uclibc+glibc+timezone'>http://google.com/search?q=uclibc+glibc+timezone</a>).</p>
documentation. (<a href="http://google.com/search?q=uclibc+glibc+timezone">http://google.com/search?q=uclibc+glibc+timezone</a>).</p>
<hr />
<h1>Development</h1>
@@ -785,9 +784,9 @@ successor to ibcs2: <a href="http://www.telly.org/86open/">the 86open
project</a>. That project disbanded in 1999 with the endorsement of an
existing standard: Linux ELF binaries. Since then, the major players at the
time (such as <a
href=http://www-03.ibm.com/servers/aix/products/aixos/linux/index.html>AIX</a>, <a
href=http://www.sun.com/software/solaris/ds/linux_interop.jsp#3>Solaris</a>, and
<a href=http://www.onlamp.com/pub/a/bsd/2000/03/17/linuxapps.html>FreeBSD</a>)
href="http://www-03.ibm.com/servers/aix/products/aixos/linux/index.html">AIX</a>, <a
href="http://www.sun.com/software/solaris/ds/linux_interop.jsp#3">Solaris</a>, and
<a href="http://www.onlamp.com/pub/a/bsd/2000/03/17/linuxapps.html">FreeBSD</a>)
have all either grown Linux support or folded.</p>
<p>The major exceptions are newcomer MacOS X, some embedded environments
@@ -810,7 +809,7 @@ file is at least worth a look. Special-case code in the body of an applet is
something we're trying to avoid.</p>
<hr />
<h2><a name="tips" />Programming tips and tricks.</a></h2>
<h2><a name="tips">Programming tips and tricks.</a></h2>
<p>Various things busybox uses that aren't particularly well documented
elsewhere.</p>
@@ -1048,7 +1047,8 @@ to measure).</p>
<hr />
<h2><a name="tips_kernel_headers"></a>Including kernel headers</h2>
<p>The "linux" or "asm" directories of /usr/include contain Linux kernel
<p>The &quot;linux&quot; or &quot;asm&quot; directories of /usr/include
contain Linux kernel
headers, so that the C library can talk directly to the Linux kernel. In
a perfect world, applications shouldn't include these headers directly, but
we don't live in a perfect world.</p>
@@ -1058,7 +1058,7 @@ we don't live in a perfect world.</p>
Attempts to cut and paste the information into a local busybox header file
proved incredibly painful, because portions of the loop_info structure vary by
architecture, namely the type __kernel_dev_t has different sizes on alpha,
arm, x86, and so on. Meaning we either #include <linux/posix_types.h> or
arm, x86, and so on. Meaning we either #include &lt;linux/posix_types.h&gt; or
we hardwire #ifdefs to check what platform we're building on and define this
type appropriately for every single hardware architecture supported by
Linux, which is simply unworkable.</p>
@@ -1066,7 +1066,8 @@ Linux, which is simply unworkable.</p>
<p>This is aside from the fact that the relevant type defined in
posix_types.h was renamed to __kernel_old_dev_t during the 2.5 series, so
to cut and paste the structure into our header we have to #include
<linux/version.h> to figure out which name to use. (What we actually do is
&lt;linux/version.h&gt; to figure out which name to use. (What we actually
do is
check if we're building on 2.6, and if so just use the new 64 bit structure
instead to avoid the rename entirely.) But we still need the version
check, since 2.4 didn't have the 64 bit structure.</p>
@@ -1075,8 +1076,9 @@ check, since 2.4 didn't have the 64 bit structure.</p>
out a clean way to do all this. There isn't one. The losetup in the
util-linux package from kernel.org isn't doing it cleanly either, they just
hide the ugliness by nesting #include files. Their mount/loop.h
#includes "my_dev_t.h", which #includes <linux/posix_types.h> and
<linux/version.h> just like we do. There simply is no alternative.</p>
#includes &quot;my_dev_t.h&quot;, which #includes &lt;linux/posix_types.h&gt;
and &lt;linux/version.h&gt; just like we do. There simply is no alternative.
</p>
<p>Just because directly #including kernel headers is sometimes
unavoidable doesn't me we should include them when there's a better
@@ -1087,18 +1089,18 @@ is not a better way.</p>
<h2><a name="who">Who are the BusyBox developers?</a></h2>
<p>The following login accounts currently exist on busybox.net. (I.E. these
people can commit <a href="http://busybox.net/downloads/patches">patches</a>
people can commit <a href="http://busybox.net/downloads/patches/">patches</a>
into subversion for the BusyBox, uClibc, and buildroot projects.)</p>
<pre>
aldot :Bernhard Fischer
aldot :Bernhard Reutner-Fischer
andersen :Erik Andersen - uClibc and BuildRoot maintainer.
bug1 :Glenn McGrath
davidm :David McCullough
gkajmowi :Garrett Kajmowicz - uClibc++ maintainer
jbglaw :Jan-Benedict Glaw
jocke :Joakim Tjernlund
landley :Rob Landley - BusyBox maintainer
landley :Rob Landley
lethal :Paul Mundt
mjn3 :Manuel Novoa III
osuadmin :osuadmin
@@ -1113,11 +1115,12 @@ solar :Ned Ludd
timr :Tim Riker
tobiasa :Tobias Anderberg
vapier :Mike Frysinger
vda :Denys Vlasenko - BusyBox maintainer
</pre>
<p>The following accounts used to exist on busybox.net, but don't anymore so
I can't ask /etc/passwd for their names. Rob Wentworth <robwen@gmail.com>
asked Google and recovered the names:</p>
I can't ask /etc/passwd for their names. Rob Wentworth
&lt;robwen at gmail.com&gt; asked Google and recovered the names:</p>
<pre>
aaronl :Aaron Lehmann
+1 -1
View File
@@ -18,7 +18,7 @@ nodes in /dev, a few configuration files in /etc, and a Linux kernel.</p>
<p>BusyBox is maintained by
<a href="mailto:vda.linux@googlemail.com">Denys Vlasenko</a>,
and licensed under the <a href="/license.html">GNU GENERAL PUBLIC LICENSE</a>
and licensed under the <a href="license.html">GNU GENERAL PUBLIC LICENSE</a>
version 2.</p>
<!--#include file="footer.html" -->
+16 -16
View File
@@ -14,29 +14,29 @@ Also there are patches on top of latest bug fix release.
<p>
Latest releases and patch directories for each branch:
<br>
<a href=http://busybox.net/downloads/busybox-1.10.1.tar.bz2>1.10.1</a>,
<a href=http://busybox.net/downloads/fixes-1.10.1/>patches</a>,
<a href="http://busybox.net/downloads/busybox-1.10.1.tar.bz2">1.10.1</a>,
<a href="http://busybox.net/downloads/fixes-1.10.1/">patches</a>,
<br>
<a href=http://busybox.net/downloads/busybox-1.9.2.tar.bz2>1.9.2</a>,
<a href=http://busybox.net/downloads/fixes-1.9.2/>patches</a>,
<a href="http://busybox.net/downloads/busybox-1.9.2.tar.bz2">1.9.2</a>,
<a href="http://busybox.net/downloads/fixes-1.9.2/">patches</a>,
<br>
<a href=http://busybox.net/downloads/busybox-1.8.3.tar.bz2>1.8.3</a>,
<a href=http://busybox.net/downloads/fixes-1.8.3/>patches</a>,
<a href="http://busybox.net/downloads/busybox-1.8.3.tar.bz2">1.8.3</a>,
<a href="http://busybox.net/downloads/fixes-1.8.3/">patches</a>,
<br>
<a href=http://busybox.net/downloads/busybox-1.7.5.tar.bz2>1.7.5</a>,
<a href=http://busybox.net/downloads/fixes-1.7.5/>patches</a>,
<a href="http://busybox.net/downloads/busybox-1.7.5.tar.bz2">1.7.5</a>,
<a href="http://busybox.net/downloads/fixes-1.7.5/">patches</a>,
<br>
<a href=http://busybox.net/downloads/busybox-1.6.2.tar.bz2>1.6.2</a>,
<a href=http://busybox.net/downloads/fixes-1.6.2/>patches</a>,
<a href="http://busybox.net/downloads/busybox-1.6.2.tar.bz2">1.6.2</a>,
<a href="http://busybox.net/downloads/fixes-1.6.2/">patches</a>,
<br>
<a href=http://busybox.net/downloads/busybox-1.5.2.tar.bz2>1.5.2</a>,
<a href=http://busybox.net/downloads/fixes-1.5.2/>patches</a>,
<a href="http://busybox.net/downloads/busybox-1.5.2.tar.bz2">1.5.2</a>,
<a href="http://busybox.net/downloads/fixes-1.5.2/">patches</a>,
<br>
<a href=http://busybox.net/downloads/busybox-1.4.2.tar.bz2>1.4.2</a>,
<a href=http://busybox.net/downloads/fixes-1.4.2/>patches</a>,
<a href="http://busybox.net/downloads/busybox-1.4.2.tar.bz2">1.4.2</a>,
<a href="http://busybox.net/downloads/fixes-1.4.2/">patches</a>,
<br>
<a href=http://busybox.net/downloads/busybox-1.3.2.tar.bz2>1.3.2</a>,
<a href=http://busybox.net/downloads/fixes-1.3.2/>patches</a>.
<a href="http://busybox.net/downloads/busybox-1.3.2.tar.bz2">1.3.2</a>,
<a href="http://busybox.net/downloads/fixes-1.3.2/">patches</a>.
<p>
You can also obtain <a href="downloads/snapshots/">Daily Snapshots</a> of
+1 -1
View File
@@ -5,7 +5,7 @@
<p> If you found a regression or severe bug in busybox, and you have a patch
for it, and you want to see it added to "hot fixes", please rediff your
patch against corresponding unmodified busybox source and send it to
<a href=mailto:busybox@busybox.net>the mailing list</a>.
<a href="mailto:busybox@busybox.net">the mailing list</a>.
</p>
<br>
+12 -8
View File
@@ -11,35 +11,39 @@
<table width="100%">
<tr>
<td width="60%">
<font face="arial, helvetica, sans-serif" size="-1">
<a href="/copyright.txt">Copyright &copy; 1999-2005 Erik Andersen</a>
<font face="arial, helvetica, sans-serif" size="-1">
<!--div style="font-family: arial, helvetica, sans-serif; font-size: 80%;" -->
<a href="/copyright.txt">Copyright &copy; 1999-2008 Erik Andersen</a>
<br>
Mail all comments, insults, suggestions and bribes to
<br>
Denys Vlasenko <a href="mailto:vda.linux@googlemail.com">vda.linux@googlemail.com</a><br>
</font>
<!--/div-->
</td>
<td>
<a href="http://www.vim.org/"><img border=0 width=88 height=31
<a href="http://www.vim.org/"><img border="0"
width="88" height="31"
src="images/written.in.vi.png"
alt="This site created with the vi editor"></a>
alt="This site created with the vi editor" /></a>
</td>
<td>
<a href="http://osuosl.org/"><img border=0 width=114 height=63
<a href="http://osuosl.org/"><img border="0"
width="114" height="63"
src="images/osuosl.png"
alt="This site is kindly hosted by OSL"></a>
alt="This site is kindly hosted by OSL" /></a>
</td>
<!--
<td>
<a href="http://validator.w3.org/check?uri=referer"><img
border="0" height="31" width="88"
src="images/valid-html401.png"
alt="Valid HTML"></a>
alt="Valid HTML" /></a>
</td>
-->
</TR>
</tr>
</table>
</body>
+15 -26
View File
@@ -8,6 +8,8 @@
body {
background-color: #DEE2DE;
color: #000000;
font-family: lucida, helvetica, arial;
font-size: 100%;
}
:link { color: #660000 }
:visited { color: #660000 }
@@ -18,14 +20,9 @@
</head>
<body>
<basefont face="lucida, helvetica, arial" size="3">
<!--basefont face="lucida, helvetica, arial" size="3"-->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<div class="c3">
@@ -36,13 +33,13 @@
</table>
</div>
<a href="/"><IMG SRC="images/busybox1.png" alt="BusyBox" border="0"></a><BR>
<a href="/"><img src="images/busybox1.png" alt="BusyBox" border="0" /></a><br>
</td>
</tr>
<tr>
<td valign="TOP">
<td valign="top">
<b>About</b>
<ul>
<li><a href="about.html">About BusyBox</a></li>
@@ -77,26 +74,18 @@
</ul>
<p><b>Developer Pages</b>
<ul>
<li><a href="http://busybox.net/~landley">Rob</a></li>
<li><a href="http://busybox.net/~aldot">Bernhard</a></li>
<li><a href="http://busybox.net/~vda">Denys</a>
<br>- <a href=http://busybox.net/~vda/resume/denys_vlasenko.htm>resume</a>
<br>- <a href=http://busybox.net/~vda/mboot/>mboot</a>
<br>- <a href=http://busybox.net/~vda/linld/>linld</a>
<br>- <a href=http://busybox.net/~vda/init_vs_runsv.html>init must die</a>
<br>- <a href=http://busybox.net/~vda/no_ifup.txt>no ifup</a>
<br>- <a href=http://busybox.net/~vda/unscd/>unscd</a>
<li><a href="http://busybox.net/~landley/">Rob</a></li>
<li><a href="http://busybox.net/~aldot/">Bernhard</a></li>
<li><a href="http://busybox.net/~vda/">Denys</a>
<br>- <a href="http://busybox.net/~vda/resume/denys_vlasenko.htm">resume</a>
<br>- <a href="http://busybox.net/~vda/mboot/">mboot</a>
<br>- <a href="http://busybox.net/~vda/linld/">linld</a>
<br>- <a href="http://busybox.net/~vda/init_vs_runsv.html">init must die</a>
<br>- <a href="http://busybox.net/~vda/no_ifup.txt">no ifup</a>
<br>- <a href="http://busybox.net/~vda/unscd/">unscd</a>
</li>
</ul>
<!--
<a href="http://validator.w3.org/check/referer"><img
src="/images/vh40.gif" height=31 width=88
align=left border=0 alt="Valid HTML 4.0!"></a>
-->
</td>
<td Valign="TOP">
<td valign="top">
+16 -14
View File
@@ -1,7 +1,7 @@
<!--#include file="header.html" -->
<p>
<h3>BusyBox is licensed under the GNU General Public License, version 2</h3>
<h3><a name="license">BusyBox is licensed under the GNU General Public License, version 2</a></h3>
<p>BusyBox is licensed under <a href="http://www.gnu.org/licenses/gpl.html#SEC1">the
GNU General Public License</a> version 2, which is often abbreviated as GPLv2.
@@ -11,7 +11,7 @@ familiar with it by now.)</p>
<p>A complete copy of the license text is included in the file LICENSE in
the BusyBox source code.</p>
<p><a href="/products.html">Anyone thinking of shipping BusyBox as part of a
<p><a href="products.html">Anyone thinking of shipping BusyBox as part of a
product</a> should be familiar with the licensing terms under which they are
allowed to use and distribute BusyBox. Read the full test of the GPL (either
through the above link, or in the file LICENSE in the busybox tarball), and
@@ -25,17 +25,18 @@ you violate the license terms, and thus infringe on the copyrights of BusyBox.
(This requirement applies whether or not you modified BusyBox; either way the
license terms still apply to you.) Read the license text for the details.</p>
<h3>A note on GPL versions</h3>
<h3><a name="version">A note on GPL versions</a></h3>
<p>Version 2 of the GPL is the only version of the GPL which current versions
of BusyBox may be distributed under. New code added to the tree is licensed
GPL version 2, and the project's license is GPL version 2.</p>
<p>Older versions of BusyBox (versions 1.2.2 and earlier, up through about svn
16112) included variants of the recommended "GPL version 2 or (at your option)
later versions" boilerplate permission grant. Ancient versions of BusyBox
16112) included variants of the recommended
&quot;GPL version 2 or (at your option) later versions&quot; boilerplate
permission grant. Ancient versions of BusyBox
(before svn 49) did not specify any version at all, and section 9 of GPLv2
(the most recent version at the time) says those old versions may be
(the most recent version at that time) says those old versions may be
redistributed under any version of GPL (including the obsolete V1). This was
conceptually similar to a dual license, except that the different licenses were
different versions of the GPL.</p>
@@ -43,7 +44,8 @@ different versions of the GPL.</p>
<p>However, BusyBox has apparently always contained chunks of code that were
licensed under GPL version 2 only. Examples include applets written by Linus
Torvalds (util-linux/mkfs_minix.c and util_linux/mkswap.c) which stated they
"may be redistributed as per the Linux copyright" (which Linus clarified in the
&quot;may be redistributed as per the Linux copyright&quot; (which Linus
clarified in the
2.4.0-pre8 release announcement in 2000 was GPLv2 only), and Linux kernel code
copied into libbb/loop.c (after Linus's announcement). There are probably
more, because all we used to check was that the code was GPL, not which
@@ -59,18 +61,18 @@ versions such as release 1.2.2 or SVN 16112, and do your own homework to
identify and remove any code that can't be licensed under the GPL version you
want to use. New development is all GPLv2.</p>
<h3>License enforcement</h3>
<h3><a name="enforce">License enforcement</a></h3>
<p>BusyBox's copyrights are enforced by the <a
href="http://www.softwarefreedom.org">Software Freedom Law Center</a>
href="http://www.softwarefreedom.org/">Software Freedom Law Center</a>
(you can contact them at gpl@busybox.net), which
"accepts primary responsibility for enforcement of US copyrights on the
&quot;accepts primary responsibility for enforcement of US copyrights on the
software... and coordinates international copyright enforcement efforts for
such works as necessary." If you distribute BusyBox in a way that doesn't
such works as necessary.&quot; If you distribute BusyBox in a way that doesn't
comply with the terms of the license BusyBox is distributed under, expect to
hear from these guys. Their entire reason for existing is to do pro-bono
legal work for free/open source software projects. (We used to list people who
violate the BusyBox license in <a href="/shame.html">The Hall of Shame</a>,
violate the BusyBox license in <a href="shame.html">The Hall of Shame</a>,
but these days we find it much more effective to hand them over to the
lawyers.)</p>
@@ -82,13 +84,13 @@ don't want monetary awards, injunctions, or to generate bad PR for a company,
unless that's the only way to get somebody that repeatedly ignores us to comply
with the license on our code.</p>
<h3>A Good Example</h3>
<h3><a name="good">A Good Example</a></h3>
<p>These days, <a href="http://www.linksys.com/">Linksys</a> is
doing a good job at complying with the GPL, they get to be an
example of how to do things right. Please take a moment and
check out what they do with
<a href="http://www.linksys.com/servlet/Satellite?c=L_Content_C1&childpagename=US%2FLayout&cid=1115416836002&pagename=Linksys%2FCommon%2FVisitorWrapper">
<a href="http://www.linksys.com/servlet/Satellite?c=L_Content_C1&amp;childpagename=US%2FLayout&amp;cid=1115416836002&amp;pagename=Linksys%2FCommon%2FVisitorWrapper">
distributing the firmware for their WRT54G Router.</a>
Following their example would be a fine way to ensure that you
have also fulfilled your licensing obligations.</p>
+2 -2
View File
@@ -4,12 +4,12 @@
<br><a href="http://uclibc.org/">uClibc.org</a>
<br><a href="http://cxx.uclibc.org/">uClibc++</a>
<br><a href="http://udhcp.busybox.net/">udhcp</a>
<!--br><a href="http://udhcp.busybox.net/">udhcp</a -->
<br><a href="http://buildroot.uclibc.org/">buildroot</a>
<br><a href="http://www.scratchbox.org/">Scratchbox</a>
<br><a href="http://openembedded.org/">OpenEmbedded</a>
<br><a href="http://www.ucdot.org/">uCdot</a>
<br><a href="http://www.linuxdevices.com">LinuxDevices</a>
<br><a href="http://www.linuxdevices.com/">LinuxDevices</a>
<br><a href="http://slashdot.org/">Slashdot</a>
<br><a href="http://freshmeat.net/">Freshmeat</a>
<br><a href="http://linuxtoday.com/">Linux Today</a>
+185 -272
View File
@@ -1,301 +1,214 @@
<!--#include file="header.html" -->
<ul>
<li><b>12 July 2008 -- BusyBox 1.11.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.11.1.tar.bz2>BusyBox 1.11.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.11.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.11.x branch. It contains fixes for awk,
bunzip2, cpio, ifupdown, ip, man, start-stop-daemon, uname and vi.
</p>
<li><b>11 July 2008 -- HOWTO is updated</b>
<p>
<a href=http://busybox.net/~vda/HOWTO/i486-linux-uclibc/HOWTO.txt>
"How to build static busybox for i486-linux-uclibc"</a> is updated
and tested on a fresh Fedora 9 install. Please report if it doesn't
work for you.
<li>
<p>We want to thank the following companies which are providing support for the BusyBox project:
<ul>
<li>AOE media, a <a href="http://www.aoemedia.com/typo3-development.html">
TYPO3 development agency</a> contributes financially.</li>
<li><a href="http://www.analog.com/en/">Analog Devices, Inc.</a> provided
a <a href="http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start">
Blackfin development board</a> free of charge.
<a href="http://www.analog.com/blackfin">Blackfin</a>
is a NOMMU processor, and its availability for testing is invaluable.
If you are an embedded device developer,
please note that Analog Devices has entire Linux distribution available
for download for this board. Visit
<a href="http://blackfin.uclinux.org/">http://blackfin.uclinux.org/</a>
for more information.
</li>
</ul>
</p>
</li>
<li><b>25 June 2008 -- BusyBox 1.11.0 (unstable), BusyBox 1.10.4 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.11.0.tar.bz2>BusyBox 1.11.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.11.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.10.4.tar.bz2>BusyBox 1.10.4</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.4/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>Sizes of busybox-1.10.4 and busybox-1.11.0 (with equivalent config, static uclibc build):<pre>
<li><b>28 September 2008 -- BusyBox 1.12.1 (stable), BusyBox 1.11.3 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.12.1.tar.bz2">BusyBox 1.12.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_12_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.12.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.11.3.tar.bz2">BusyBox 1.11.3</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.11.3/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>
Bugfix-only releases for 1.11.x and 1.12.x branches.
</p>
</li>
<li><b>21 August 2008 -- BusyBox 1.12.0 (unstable), BusyBox 1.11.2 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.12.0.tar.bz2">BusyBox 1.12.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_12_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.12.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.11.2.tar.bz2">BusyBox 1.11.2</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.11.2/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Sizes of busybox-1.11.2 and busybox-1.12.0 (with equivalent config, static uclibc build):<pre>
text data bss dec hex filename
800675 636 7080 808391 c55c7 busybox-1.10.4
798392 611 6900 805903 c4c0f busybox-1.11.0
829687 617 7052 837356 cc6ec busybox-1.11.2/busybox
822961 594 6832 830387 cabb3 busybox-1.12.0/busybox
</pre>
<p>New applets: inotify (Vladimir Dronnikov), man (Ivana Varekova),
fbsplash (Michele Sanges), depmod (Bernhard Fischer)
<p>New applets: rdev (Grant Erickson), setfont, showkey (both by Vladimir)
<p>Changes since previous release:
<p>Most significant changes since previous release (please report any regression):
<ul>
<li>build system: reinstate CONFIG_CROSS_COMPILE_PREFIX
<li>ash: optional bash compatibility features added; other fixes
<li>hush: lots and lots of fixes
<li>msh: fix the case where the file has exec bit but can't be run directly (runs "$SHELL file" instead)
<li>msh: fix exit codes when command is not found or can't be execed
<li>udhcpc: added workaround for buggy kernels
<li>mount: fix mishandling of proto=tcp/udp
<li>diff: make it work on non-seekable streams
<li>openvt: made more compatible with "standard" one
<li>mdev: fix block/char device detection
<li>ping: add -w, -W support (James Simmons)
<li>crond: add handling of "MAILTO=user" lines
<li>start-stop-daemon: make --exec follow symlinks (Joakim Tjernlund)
<li>date: make it accept ISO date format
<li>echo: fix echo -e -n "msg\n\0" (David Pinedo)
<li>httpd: fix several bugs triggered by relative path in -h DIR
<li>printf: fix printf -%s- foo, printf -- -%s- foo
<li>syslogd: do not error out on missing files to rotate
<li>ls: support Unicode in names
<li>ip: support for the LOWER_UP flag (Natanael Copa)
<li>mktemp: make argument optional (coreutil 6.12 compat)
<li>libiproute: fix option parsing, so that "ip -o link" works again
<li>other fixes and code size reductions in many applets
<li>ash: bash compat: "shift $BIGNUM" is equivalent to "shift 1"</li>
<li>ash: dont allow e.g. exec &lt;&amp;10 to attach to script's fd! </li>
<li>ash: fix a bug where redirection fds were not closed afterwards. optimize close+fcntl(DUPFD) into dup2</li>
<li>ash: fix segfault in "command -v"</li>
<li>ash: fix very weak $RANDOM generator</li>
<li>ash: prevent exec NN&gt;&amp;- from closing fd used for script reading</li>
<li>ash: teach ash about 123&gt;file. It could take only 0..9 before</li>
<li>hush: fix a case where "$@" must expand to no word at all</li>
<li>hush: fix mishandling of a'b'c=fff as assignments. They are not</li>
<li>hush: fix non-detection of builtins and applets in "v=break; ...; $v; ..." case</li>
<li>hush: fix "while false; ..." exitcode; add testsuites</li>
<li>hush: support "case...esac" statements (~350 bytes of code)</li>
<li>hush: support "break [N]" and "continue [N]" statements</li>
<li>hush: support "for if in do done then; do echo $if; done" case</li>
<li>hush: support "for v; do ... done" syntax (implied 'in "$@"')</li>
<li>hush: support $_NUMBERS variable names</li>
<li>libbb: unified config parser (by Vladimir). This change affected many applets</li>
</ul>
<p>Other changes:
<ul>
<li>libbb: dump: do not use uninitialized memory (closes bug 4364)</li>
<li>libbb: fix bb_strtol[l]'s check for "-" (closes bug 4174)</li>
<li>libbb: fix --help to not affect "test --help"</li>
<li>libbb: fix mishandling of "all argv are opts" in getopt32()</li>
<li>libbb: getopt32() should not ever touch argv[0] (even read)</li>
<li>libbb: introduce and use xrealloc_vector</li>
<li>libbb: [x]fopen_for_{read,write} introduced and used (by Vladimir)</li>
<li>lineedit: fix use-after-free</li>
<li>libunarchive: refactor handling of archived files. "tar f file.tar.lzma" now works too</li>
<li>bb_strtoXXX: close bug 4174 (potential use of buf[-1])</li>
<li>open_transformer: don't leak file descriptor</li>
<li>open_transformer: fix bug of calling exit instead of _exit</li>
<li>arp: without -H type, assume "ether" (closes bug 4564)</li>
<li>ar: reuse existing ar unpacking code</li>
<li>awk: fix a case with multiple -f options. Simplify -f file reading. </li>
<li>build system: introduce and use FAST_FUNC: regparm on i386, otherwise no-op</li>
<li>bunzip2: fix an uncompression error (by Rob Landley rob AT landley.net)</li>
<li>b[un]zip2, g[un]zip: unlink destination if -f is given (closes bug 3854)</li>
<li>comm: almost total rewrite</li>
<li>cpio: fix -m to actually work as expected (by Pascal Bellard)</li>
<li>cpio: internalize archive_xread_all_eof, add a few paranoia checks for corrupted cpio files</li>
<li>cpio: make long opts depend only on ENABLE_GETOPT_LONG</li>
<li>cpio: on unpack, limit filename length to 8k</li>
<li>cpio: support some long options</li>
<li>crond: use execlp instead of execl</li>
<li>cut: fix buffer overflow (closes bug 4544)</li>
<li>envdir: fix "envdir" (no params at all) and "envdir dir" cases</li>
<li>findfs: make it use setuid-ness of busybox binary</li>
<li>fsck: use getmntent_r instead of open-coded parsing (by Vladimir)</li>
<li>fuser: a bit of safety in scanf</li>
<li>grep: option to use GNU regex matching instead of POSIX one. This fixes problems with NULs in files being scanned, but costs +800 bytes</li>
<li>halt: signal init regardless of ENABLE_INIT</li>
<li>httpd: add homedir directive specially for (and by) Walter Harms wharms AT bfs.de</li>
<li>ifupdown: /etc/network/interfaces can have comments with leading blanks</li>
<li>ifupdown: fixes for custom MAC address (by Wade Berrier wberrier AT gmail.com)</li>
<li>ifupdown: fixes for shutdown of DHCP-managed interfaces (by Wade Berrier wberrier AT gmail.com)</li>
<li>inetd: do not trash errno in signal handlers; in CHLD handler, stop looping through services when pid is found</li>
<li>insmod: users report that "|| defined(__powerpc__)" is missing</li>
<li>install: do not chown intermediate directories with install -d (by Natanael Copa)</li>
<li>install: fix long option not taking params (closes bug 4584)</li>
<li>lpd,lpr: send/receive ACKs after filenames, not only after file bodies</li>
<li>ls: fix a bug where we may use uninintialized variable</li>
<li>man: add handling of "man links", by Ivana Varekova varekova AT redhat.com</li>
<li>man: fix a case when a full pathname to manpage is given</li>
<li>man: fix inverted cat/man bool variable</li>
<li>man: fix missed NULL termination of an array</li>
<li>man: mimic "no manual entry for 'bogus'" message and exitcode</li>
<li>man: support cat pages too (by Jason Curl jcurlnews AT arcor.de)</li>
<li>man: teach it to use .lzma if requested by .config</li>
<li>mdev: check for "/block/" substring for block dev detection</li>
<li>mdev: do not complain if mdev.conf does not exist</li>
<li>mdev: if device was moved at creation, at removal correctly remove it from moved location and also remove symlinks to it</li>
<li>mdev: support for serializing hotplug</li>
<li>mdev, init: use shared code for fd sanitization</li>
<li>mkdir: fix "uname 0222; mkdir -p foo/bar" case (by Doug Graham dgraham AT nortel.com)</li>
<li>modprobe: support for /etc/modprobe.d (by Timo Teras)</li>
<li>modprobe: use buffering line reads (fgets()) instead of reads()</li>
<li>modutils: optional modprobe-small (by Vladimir), 15kb smaller than standard one</li>
<li>mount: support for "-o mand" and "[no]relatime"</li>
<li>mount: support nfs mount option "nordiplus" (by Octavian Purdila opurdila AT ixiacom.com)</li>
<li>mount: support "relatime" / "norelatime"</li>
<li>mount: testsuite for "-o mand"</li>
<li>msh: fix "while... continue; ..." (closes bug 3884)</li>
<li>mv: fix a case when we move dangling symlink across mountpoints</li>
<li>netstat: optional -p support (by L. Gabriel Somlo somlo AT cmu.edu)</li>
<li>nmeter: fix read past the end of a buffer (closes bug 4594)</li>
<li>od, hexdump: fix bug where xrealloc may move pointer, leaving other pointers dangling (closes bug 4104)</li>
<li>pidof/killall: allow find_pid_by_name to find running processes started as scripts_with_name_longer_than_15_bytes.sh (closes bug 4054)</li>
<li>printf: do not print garbage on "%Ld" (closes bug 4214)</li>
<li>printf: fix %b, fix several bugs in %*.*, fix compat issues with aborting too early, support %zd; expand testsuite</li>
<li>printf: protect against bogus format specifiers (closes bug 4184)</li>
<li>sendmail: updates from Vladimir:</li>
<li>sendmail: do not discard all headers</li>
<li>sendmail: do not ignore CC; accept to: and cc: case-insensitively. +20 bytes</li>
<li>sendmail: fixed mail recipient address</li>
<li>sendmail: fixed SEGV if sender address is missed</li>
<li>sendmail: use HOSTNAME instead of HOST when no server is explicitly specified</li>
<li>sleep: if FANCY &amp;&amp; DESKTOP, support fractional seconds, minutes, hours and so on (coreutils compat)</li>
<li>ssd: CLOSE_EXTRA_FDS in MMU case too</li>
<li>ssd: do not stat -x EXECUTABLE, it is not needed anymore</li>
<li>ssd: fix -a without -x case</li>
<li>ssd: use $PATH</li>
<li>tar: fix handling of tarballs with symlinks with size field != 0</li>
<li>tar: handle autodetection for tiny .tar.gz files too, simplify autodetection</li>
<li>taskset: fix some careless code in both fancy and non-fancy cases. -5 bytes for fancy, +5 for non-fancy</li>
<li>tee: fix infinite looping on open error (echo asd | tee "")</li>
<li>tee: "-" is a name for stdout, handle it that way</li>
<li>telnetd: fix issue file printing</li>
<li>test: fix parser to prefer binop over unop, as coreutils does</li>
<li>testsuite: uniformly use $ECHO with -n -e</li>
<li>time: don't segfault with no arguments</li>
<li>touch: support -r REF_FILE if ENABLE_DESKTOP (needed for blackfin compile)</li>
<li>tr: fix "access past the end of a string" bug 4354</li>
<li>tr: fix "tr [=" case (closes bug 4374)</li>
<li>tr: fix yet another access past the end of a string (closes bug 4374)</li>
<li>unlzma: fix memory leak (by Pascal Bellard)</li>
<li>vi: fix reversed checks for underflow</li>
<li>vi: using array data after it fell out of scope is stupid</li>
<li>xargs: fix -e default to match newer GNU xargs, add SUS mandated -E (closes bug 4414)</li>
<li>other fixes and code size reductions in many applets</li>
</ul>
<p>
The email address gpl@busybox.net is the recommended way to contact
the Software Freedom Law Center to report BusyBox license violations.
</p>
<li><b>12 June 2008 -- Sponsors!</b>
<p>We want to thank the following companies which are providing support
for BusyBox project:
<ul>
<li>AOE media, a <a href=http://www.aoemedia.com/typo3-development.html>
TYPO3 development agency</a> contributes financially.
<p>
<li><a href=http://www.analog.com/en/>Analog Devices, Inc.</a> provided
a <a href=http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start>
Blackfin development board</a> free of charge.
<a href=http://www.analog.com/blackfin>Blackfin<a>
is a NOMMU processor, and its availability for testing is invaluable.
If you are an embedded device developer,
please note that Analog Devices has entire Linux distribution available
for download for this board. Visit
<a href=http://blackfin.uclinux.org/>http://blackfin.uclinux.org/</a>
for more information.
</ul>
</p>
<li><b>5 June 2008 -- BusyBox 1.10.3 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.10.3.tar.bz2>BusyBox 1.10.3</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.3/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<li><b>12 July 2008 -- BusyBox 1.11.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.11.1.tar.bz2">BusyBox 1.11.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.11.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for dnsd, fuser, hush,
ip, mdev and syslogd.
Bugfix-only release for 1.11.x branch. It contains fixes for awk,
bunzip2, cpio, ifupdown, ip, man, start-stop-daemon, uname and vi.
</p>
</li>
<li><b>8 May 2008 -- BusyBox 1.10.2 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.10.2.tar.bz2>BusyBox 1.10.2</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.2/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<li><b>11 July 2008 -- HOWTO is updated</b>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for echo, httpd, pidof,
start-stop-daemon, tar, taskset, tab completion in shells, build system.
<p>Please note that mdev was backported from current svn trunk. Please
report if you encounter any problems with it.
<a href="http://busybox.net/~vda/HOWTO/i486-linux-uclibc/HOWTO.txt">
"How to build static busybox for i486-linux-uclibc"</a> is updated
and tested on a fresh Fedora 9 install. Please report if it doesn't
work for you.
</p>
</li>
<li><b>19 April 2008 -- BusyBox 1.10.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.10.1.tar.bz2>BusyBox 1.10.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for
fuser, init, less, nameif, tail, taskset, tcpudp, top, udhcp.
<li><b>21 March 2008 -- BusyBox 1.10.0 (unstable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.10.0.tar.bz2>BusyBox 1.10.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>Sizes of busybox-1.9.2 and busybox-1.10.0 (with almost full config, static uclibc build):<pre>
text data bss dec hex filename
781405 679 7500 789584 c0c50 busybox-1.9.2
773551 640 7372 781563 becfb busybox-1.10.0
</pre>
<p>Top 10 stack users:<pre>
busybox-1.9.2: busybox-1.10.0:
echo_dg 4116 bb_full_fd_action 4112
bb_full_fd_action 4112 find_list_entry2 4096
discard_dg 4108 readlink_main 4096
discard_dg 4096 ipaddr_list_or_flush 3900
echo_stream 4096 iproute_list_or_flush 3680
discard_stream 4096 insmod_main 3152
find_list_entry2 4096 fallbackSort 2952
readlink_main 4096 do_iproute 2492
ipaddr_list_or_flush 3900 cal_main 2464
iproute_list_or_flush 3680 readhere 2308
</pre>
<p>New applets: brctl, chat (by Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;),
findfs, ifenslave (closes bug 115), lpd (by Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;),
lpr+lpq (by Walter Harms), script (by Pascal Bellard &lt;pascal.bellard AT ads-lu.com&gt;),
sendmail (Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;), tac, tftpd.
<p>Made NOMMU-compatible: crond, crontab, ifupdown, inetd, init, runsv, svlogd, tcpsvd, udpsvd.
<p>Changes since previous release:
<ul>
<li>globally: add -Wunused-parameter
<li>globally: add optimization barrier to all "G trick" locations
<li>adduser/addgroup: check username for invalid chars (by Tito &lt;farmatito AT tiscali.it&gt;)
<li>adduser: optional support for long options. Closes bug 2134
<li>ash: handle "A=1 A=2 B=$A; echo $B". Closes bug 947
<li>ash: make ash -c "if set -o barfoo 2&gt;/dev/null; then echo foo; else echo bar; fi" work. Closes bug 1142
<li>build system: don't use "gcc -o /dev/null", old gcc can delete /dev/null in this case
<li>build system: fixes for cross-compiling on an OS X host
<li>build system: make it do without "od -t"
<li>build system: pass CFLAGS to link stage too. Closes bug 1376
<li>build system: add CONFIG_NOMMU
<li>cp: add ENABLE_FEATURE_VERBOSE_CP_MESSAGE. Closes bug 1470
<li>crontab: almost complete rewrite
<li>dnsd: properly set _src_ IP:port on outgoing UDP packets
<li>dpkg: fix bug where existence check was reversed
<li>eject: add -s for SCSI- and USB-devices (Nico Erfurth)
<li>fdisk: fix a case where break was reached only for DOS labels
<li>fsck: don't kill pid -1! (Roy Marples &lt;roy at marples.name&gt;)
<li>fsck_minix: fix bug in map_block2: s/(blknr &gt;= 256 * 256)/(blknr &lt; 256 * 256)/
<li>fuser: substantial rewrite
<li>getopt: add support for "a+" specifier for nonnegative int parameters. By Vladimir Dronnikov &lt;dronnikov at gmail.com&gt;
<li>getty: don't try to detect parity on local lines (Joakim Tjernlund &lt;Joakim.Tjernlund at transmode.se&gt;)
<li>halt: write wtmp entry if wtmp support is enabled
<li>httpd: "HEAD" support. Closes bug 1530
<li>httpd: fix bug 2004: wrong argv when interpreter is invoked
<li>httpd: fix bug where we did chdir("") if CGI path had only one "/"
<li>httpd: fix for POST upload
<li>httpd: support for "I:index.xml" syntax (Peter Korsgaard &lt;jacmet AT uclibc.org&gt;)
<li>hush: fix a case where none of pipe members could be started because of fork failure
<li>hush: more correct handling of piping
<li>hush: reinstate `cmd` handling for NOMMU
<li>hush: report [v]fork failures
<li>hush: set CLOEXEC on script file being executed
<li>hush: try to add a bit more of vfork-friendliness
<li>inetd: make "udp nowait" work
<li>inetd: make inetd IPv6-capable
<li>init: add FEATURE_KILL_REMOVED (Eugene Bordenkircher &lt;eugebo AT gmail.com&gt;)
<li>init: allow last line of config file to be not terminated by "\n"
<li>init: do not die if "/dev/null" is missing
<li>init: fix bug 1111: restart actions were not splitting words
<li>init: wait for orphaned children too while waiting for sysinit-like processes (harald-tuxbox AT arcor.de)
<li>ip route: "ip route" was misbehaving (extra argv+1 ate 1st env var)
<li>last: do not go into endless loop on read error
<li>less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)
<li>less: "examine" command will not bomb out on bad file name now
<li>less: fix bug where backspace wasn't actually deleting chars
<li>less: make it a bit more resistant against status line corruption
<li>less: improve search when data is not supplied fast enough by stdin - now will try reading for 1-2 seconds before declaring that there is no match. This fixes a very common annoyance with long manpages
<li>less: update line input so that it doesn't interfere with screen update. Makes "man bash", [enter], [/], &lt;enter search pattern&gt;, [enter] more usable - manpage now draws even as you enter the pattern!
<li>libbb: filename completion matches dangling symlinks too
<li>libbb: fix getopt state corruption for NOFORK applets
<li>libbb: full_read/write now will report partial data counts prior to error
<li>libbb: intrduce and use safe_gethostname. By Tito &lt;farmatito AT tiscali.it&gt;
<li>libbb: introduce and use nonblock_safe_read(). Yay! Our shells are immune from this nasty O_NONBLOCK now!
<li>login,su: avoid clearing environment with some options, as was intended
<li>microcom: read more than 1 byte from device, if possible
<li>microcom: split -d (delay) option away from -t
<li>mktemp: support -p DIR (Timo Teras &lt;timo.teras at iki.fi&gt;)
<li>mount: #ifdef out MOUNT_LABEL code parts if it is not selected
<li>mount: add another mount helper call method
<li>mount: allow and ignore _netdev option
<li>mount: make -f work even without mtab support (Cristian Ionescu-Idbohrn &lt;cristian.ionescu-idbohrn at axis.com&gt;)
<li>mount: optional support for -vv verbosity
<li>mount: plug a hole where FEATURE_MOUNT_HELPERS could allow execution of arbitrary command
<li>mount: recognize "dirsync" (closes bug 835)
<li>mount: sanitize environment if called by non-root
<li>mount: support for mount by label. Closes bug 1143
<li>mount: with -vv -f, say what mount() calls we were going to make
<li>msh: create testsuite (based on hush one)
<li>msh: don't use floating point in "times" builtin
<li>msh: fix Ctrl-C handling with line editing
<li>msh: fix for bug 846 ("break" didn't work second time)
<li>msh: glob0/glob1/glob2/glob3 were just a sorting routine, removed
<li>msh: instead of fixing "ls | cd", "cd | ls" etc disallow builtins in pipes. They make no sense there anyway
<li>msh: stop trying to parse variables in "msh SCRIPT VAR=val param". They are passed as ordinary parameters
<li>netstat: print control chars as "^C" etc
<li>nmeter: fix bug where %[mf] behaves as %[mt]
<li>nohup: compat patch by Christoph Gysin &lt;mailinglist.cache at gmail.com&gt;
<li>od: handle /proc files (which have filesize 0) correctly
<li>patch: don't trash permissions of patched file
<li>ps: add conditional support for -o [e]time
<li>ps: fix COMMAND column adjustment; overflow in USER and VSZ columns
<li>reset: call "stty sane". Closes bug 1414
<li>rmdir: optional long options support for Debian users. By Roberto Gordo Saez &lt;roberto.gordo AT gmail.com&gt;
<li>run-parts: add --reverse
<li>script: correctly handle buffered "tail" of output
<li>sed: "n" command must reset "we had successful subst" flag. Closes bug 1214
<li>sort: -z outputs NUL terminated lines. Closes bug 1591
<li>stty: fix mishandling of control keywords (Ralf Friedl &lt;Ralf.Friedl AT online.de&gt;)
<li>switch_root: stop at first non-option. Closes bug 1425
<li>syslogd: avoid excessive time() system calls
<li>syslogd: don't die if remote host's IP cannot be resolved. Retry resolutions every two minutes instead
<li>syslogd: fix shmat error check
<li>syslogd: optional support for dropping dups. Closes bug 436
<li>syslogd: send "\n"-terminated messages over the network. Fully closes bug 1574
<li>syslogd: tighten up hostname handling
<li>tail: fix "tail -c 20 /dev/huge_disk" (was taking ages)
<li>tar: compat: handle tarballs with only one zero block at the end
<li>tar: autodetection of gz/bz2 compressed tarballs. Closes bug 992
<li>tar: real support for -p. By Natanael Copa &lt;natanael.copa at gmail.com&gt;
<li>tcpudp: narrow down time window where we have no wildcard socket
<li>telnetd: use login always, not "sometimes login, sometimes shell"
<li>test: fix mishandling of "test ! arg1 op arg2 more args"
<li>trylink: instead of build error, disable --gc-sections if GLIBC and STATIC are selected
<li>udhcp: make file paths configurable
<li>udhcp: optional support for non-standard DHCP ports
<li>udhcp: set correct op byte in the packet for DHCPDECLINE
<li>udhcpc: filter unwanted packets in kernel (Cristian Ionescu-Idbohrn &lt;cristian.ionescu-idbohrn AT axis.com&gt;)
<li>udhcpc: fix wrong options in decline and release packets (Jonas Danielsson &lt;jonas.danielsson AT axis.com&gt;)
<li>umount: do not complain several times about the same mountpoint
<li>umount: do not try to free loop device or erase mtab if remounted ro
<li>umount: instead of non-standard -D, use -d with opposite meaning. Closes bug 1604
<li>unlzma: shrink by Pascal Bellard &lt;pascal.bellard AT ads-lu.com&gt;
<li>unzip: do not try to read entire compressed stream at once (it can be huge)
<li>unzip: handle short reads correctly
<li>vi: many fixes
<li>zcip: don't chdir to root
<li>zcip: open ARP socket before openlog (else we can trash syslog socket)
</ul>
<li><b>Old News</b><p>
Click here to read <a href="oldnews.html">older news</a>
</p>
<li><b>21 March 2008 -- BusyBox old stable releases</b>
<p>
Bugfix-only releases for four past branches. Links to locations
for future hot patches are in parentheses.
<p>
<a href=http://busybox.net/downloads/busybox-1.9.2.tar.bz2>1.9.2</a>
(<a href=http://busybox.net/downloads/fixes-1.9.2/>patches</a>),
<a href=http://busybox.net/downloads/busybox-1.8.3.tar.bz2>1.8.3</a>
(<a href=http://busybox.net/downloads/fixes-1.8.3/>patches</a>),
<a href=http://busybox.net/downloads/busybox-1.7.5.tar.bz2>1.7.5</a>
(<a href=http://busybox.net/downloads/fixes-1.7.5/>patches</a>),
<a href=http://busybox.net/downloads/busybox-1.5.2.tar.bz2>1.5.2</a>
(<a href=http://busybox.net/downloads/fixes-1.5.2/>patches</a>).
<p>
<a href=http://busybox.net/fix.html>How to add a patch.</a>
</p>
<li><b>Old News</b><p>
<a href="/oldnews.html">Click here to read older news</a>
</p>
</li>
</li>
</ul>
+359 -84
View File
@@ -1,12 +1,293 @@
<!--#include file="header.html" -->
<h3>News archive</h3>
<ul>
<li><b>25 June 2008 -- BusyBox 1.11.0 (unstable), BusyBox 1.10.4 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.11.0.tar.bz2">BusyBox 1.11.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.11.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.10.4.tar.bz2">BusyBox 1.10.4</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.4/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Sizes of busybox-1.10.4 and busybox-1.11.0 (with equivalent config, static uclibc build):<pre>
text data bss dec hex filename
800675 636 7080 808391 c55c7 busybox-1.10.4
798392 611 6900 805903 c4c0f busybox-1.11.0
</pre>
<p>New applets: inotify (Vladimir Dronnikov), man (Ivana Varekova),
fbsplash (Michele Sanges), depmod (Bernhard Reutner-Fischer)
<p>Changes since previous release:
<ul>
<li>build system: reinstate CONFIG_CROSS_COMPILE_PREFIX</li>
<li>ash: optional bash compatibility features added; other fixes</li>
<li>hush: lots and lots of fixes</li>
<li>msh: fix the case where the file has exec bit but can't be run directly (runs "$SHELL file" instead)</li>
<li>msh: fix exit codes when command is not found or can't be execed</li>
<li>udhcpc: added workaround for buggy kernels</li>
<li>mount: fix mishandling of proto=tcp/udp</li>
<li>diff: make it work on non-seekable streams</li>
<li>openvt: made more compatible with "standard" one</li>
<li>mdev: fix block/char device detection</li>
<li>ping: add -w, -W support (James Simmons)</li>
<li>crond: add handling of "MAILTO=user" lines</li>
<li>start-stop-daemon: make --exec follow symlinks (Joakim Tjernlund)</li>
<li>date: make it accept ISO date format</li>
<li>echo: fix echo -e -n "msg\n\0" (David Pinedo)</li>
<li>httpd: fix several bugs triggered by relative path in -h DIR</li>
<li>printf: fix printf -%s- foo, printf -- -%s- foo</li>
<li>syslogd: do not error out on missing files to rotate</li>
<li>ls: support Unicode in names</li>
<li>ip: support for the LOWER_UP flag (Natanael Copa)</li>
<li>mktemp: make argument optional (coreutil 6.12 compat)</li>
<li>libiproute: fix option parsing, so that "ip -o link" works again</li>
<li>other fixes and code size reductions in many applets</li>
</ul>
<p>
The email address gpl@busybox.net is the recommended way to contact
the Software Freedom Law Center to report BusyBox license violations.
</p>
</li>
<li><b>12 June 2008 -- Sponsors!</b>
<p>We want to thank the following companies which are providing support
for the BusyBox project:
</p>
<ul>
<li>AOE media, a <a href="http://www.aoemedia.com/typo3-development.html">
TYPO3 development agency</a> contributes financially.</li>
<li><a href="http://www.analog.com/en/">Analog Devices, Inc.</a> provided
a <a href="http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start">
Blackfin development board</a> free of charge.
<a href="http://www.analog.com/blackfin">Blackfin</a>
is a NOMMU processor, and its availability for testing is invaluable.
If you are an embedded device developer,
please note that Analog Devices has entire Linux distribution available
for download for this board. Visit
<a href="http://blackfin.uclinux.org/">http://blackfin.uclinux.org/</a>
for more information.
</li>
</ul>
</li>
<li><b>5 June 2008 -- BusyBox 1.10.3 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.10.3.tar.bz2">BusyBox 1.10.3</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.3/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for dnsd, fuser, hush,
ip, mdev and syslogd.
</p>
</li>
<li><b>8 May 2008 -- BusyBox 1.10.2 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.10.2.tar.bz2">BusyBox 1.10.2</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.2/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for echo, httpd, pidof,
start-stop-daemon, tar, taskset, tab completion in shells, build system.
<p>Please note that mdev was backported from current svn trunk. Please
report if you encounter any problems with it.
</p>
</li>
<li><b>19 April 2008 -- BusyBox 1.10.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.10.1.tar.bz2">BusyBox 1.10.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for
fuser, init, less, nameif, tail, taskset, tcpudp, top, udhcp.
</li>
<li><b>21 March 2008 -- BusyBox 1.10.0 (unstable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.10.0.tar.bz2">BusyBox 1.10.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Sizes of busybox-1.9.2 and busybox-1.10.0 (with almost full config, static uclibc build):<pre>
text data bss dec hex filename
781405 679 7500 789584 c0c50 busybox-1.9.2
773551 640 7372 781563 becfb busybox-1.10.0
</pre>
<p>Top 10 stack users:<pre>
busybox-1.9.2: busybox-1.10.0:
echo_dg 4116 bb_full_fd_action 4112
bb_full_fd_action 4112 find_list_entry2 4096
discard_dg 4108 readlink_main 4096
discard_dg 4096 ipaddr_list_or_flush 3900
echo_stream 4096 iproute_list_or_flush 3680
discard_stream 4096 insmod_main 3152
find_list_entry2 4096 fallbackSort 2952
readlink_main 4096 do_iproute 2492
ipaddr_list_or_flush 3900 cal_main 2464
iproute_list_or_flush 3680 readhere 2308
</pre>
<p>New applets: brctl, chat (by Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;),
findfs, ifenslave (closes bug 115), lpd (by Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;),
lpr+lpq (by Walter Harms), script (by Pascal Bellard &lt;pascal.bellard AT ads-lu.com&gt;),
sendmail (Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;), tac, tftpd.
</p>
<p>Made NOMMU-compatible: crond, crontab, ifupdown, inetd, init, runsv, svlogd, tcpsvd, udpsvd.
</p>
<p>Changes since previous release:
</p>
<ul>
<li>globally: add -Wunused-parameter</li>
<li>globally: add optimization barrier to all "G trick" locations</li>
<li>adduser/addgroup: check username for invalid chars (by Tito &lt;farmatito AT tiscali.it&gt;)</li>
<li>adduser: optional support for long options. Closes bug 2134</li>
<li>ash: handle "A=1 A=2 B=$A; echo $B". Closes bug 947</li>
<li>ash: make ash -c "if set -o barfoo 2&gt;/dev/null; then echo foo; else echo bar; fi" work. Closes bug 1142</li>
<li>build system: don't use "gcc -o /dev/null", old gcc can delete /dev/null in this case</li>
<li>build system: fixes for cross-compiling on an OS X host</li>
<li>build system: make it do without "od -t"</li>
<li>build system: pass CFLAGS to link stage too. Closes bug 1376</li>
<li>build system: add CONFIG_NOMMU</li>
<li>cp: add ENABLE_FEATURE_VERBOSE_CP_MESSAGE. Closes bug 1470</li>
<li>crontab: almost complete rewrite</li>
<li>dnsd: properly set _src_ IP:port on outgoing UDP packets</li>
<li>dpkg: fix bug where existence check was reversed</li>
<li>eject: add -s for SCSI- and USB-devices (Nico Erfurth)</li>
<li>fdisk: fix a case where break was reached only for DOS labels</li>
<li>fsck: don't kill pid -1! (Roy Marples &lt;roy at marples.name&gt;)</li>
<li>fsck_minix: fix bug in map_block2: s/(blknr &gt;= 256 * 256)/(blknr &lt; 256 * 256)/</li>
<li>fuser: substantial rewrite</li>
<li>getopt: add support for "a+" specifier for nonnegative int parameters. By Vladimir Dronnikov &lt;dronnikov at gmail.com&gt;</li>
<li>getty: don't try to detect parity on local lines (Joakim Tjernlund &lt;Joakim.Tjernlund at transmode.se&gt;)</li>
<li>halt: write wtmp entry if wtmp support is enabled</li>
<li>httpd: "HEAD" support. Closes bug 1530</li>
<li>httpd: fix bug 2004: wrong argv when interpreter is invoked</li>
<li>httpd: fix bug where we did chdir("") if CGI path had only one "/"</li>
<li>httpd: fix for POST upload</li>
<li>httpd: support for "I:index.xml" syntax (Peter Korsgaard &lt;jacmet AT uclibc.org&gt;)</li>
<li>hush: fix a case where none of pipe members could be started because of fork failure</li>
<li>hush: more correct handling of piping</li>
<li>hush: reinstate `cmd` handling for NOMMU</li>
<li>hush: report [v]fork failures</li>
<li>hush: set CLOEXEC on script file being executed</li>
<li>hush: try to add a bit more of vfork-friendliness</li>
<li>inetd: make "udp nowait" work</li>
<li>inetd: make inetd IPv6-capable</li>
<li>init: add FEATURE_KILL_REMOVED (Eugene Bordenkircher &lt;eugebo AT gmail.com&gt;)</li>
<li>init: allow last line of config file to be not terminated by "\n"</li>
<li>init: do not die if "/dev/null" is missing</li>
<li>init: fix bug 1111: restart actions were not splitting words</li>
<li>init: wait for orphaned children too while waiting for sysinit-like processes (harald-tuxbox AT arcor.de)</li>
<li>ip route: "ip route" was misbehaving (extra argv+1 ate 1st env var)</li>
<li>last: do not go into endless loop on read error</li>
<li>less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)</li>
<li>less: "examine" command will not bomb out on bad file name now</li>
<li>less: fix bug where backspace wasn't actually deleting chars</li>
<li>less: make it a bit more resistant against status line corruption</li>
<li>less: improve search when data is not supplied fast enough by stdin - now will try reading for 1-2 seconds before declaring that there is no match. This fixes a very common annoyance with long manpages</li>
<li>less: update line input so that it doesn't interfere with screen update. Makes "man bash", [enter], [/], &lt;enter search pattern&gt;, [enter] more usable - manpage now draws even as you enter the pattern!</li>
<li>libbb: filename completion matches dangling symlinks too</li>
<li>libbb: fix getopt state corruption for NOFORK applets</li>
<li>libbb: full_read/write now will report partial data counts prior to error</li>
<li>libbb: intrduce and use safe_gethostname. By Tito &lt;farmatito AT tiscali.it&gt;</li>
<li>libbb: introduce and use nonblock_safe_read(). Yay! Our shells are immune from this nasty O_NONBLOCK now!</li>
<li>login,su: avoid clearing environment with some options, as was intended</li>
<li>microcom: read more than 1 byte from device, if possible</li>
<li>microcom: split -d (delay) option away from -t</li>
<li>mktemp: support -p DIR (Timo Teras &lt;timo.teras at iki.fi&gt;)</li>
<li>mount: #ifdef out MOUNT_LABEL code parts if it is not selected</li>
<li>mount: add another mount helper call method</li>
<li>mount: allow and ignore _netdev option</li>
<li>mount: make -f work even without mtab support (Cristian Ionescu-Idbohrn &lt;cristian.ionescu-idbohrn at axis.com&gt;)</li>
<li>mount: optional support for -vv verbosity</li>
<li>mount: plug a hole where FEATURE_MOUNT_HELPERS could allow execution of arbitrary command</li>
<li>mount: recognize "dirsync" (closes bug 835)</li>
<li>mount: sanitize environment if called by non-root</li>
<li>mount: support for mount by label. Closes bug 1143</li>
<li>mount: with -vv -f, say what mount() calls we were going to make</li>
<li>msh: create testsuite (based on hush one)</li>
<li>msh: don't use floating point in "times" builtin</li>
<li>msh: fix Ctrl-C handling with line editing</li>
<li>msh: fix for bug 846 ("break" didn't work second time)</li>
<li>msh: glob0/glob1/glob2/glob3 were just a sorting routine, removed</li>
<li>msh: instead of fixing "ls | cd", "cd | ls" etc disallow builtins in pipes. They make no sense there anyway</li>
<li>msh: stop trying to parse variables in "msh SCRIPT VAR=val param". They are passed as ordinary parameters</li>
<li>netstat: print control chars as "^C" etc</li>
<li>nmeter: fix bug where %[mf] behaves as %[mt]</li>
<li>nohup: compat patch by Christoph Gysin &lt;mailinglist.cache at gmail.com&gt;</li>
<li>od: handle /proc files (which have filesize 0) correctly</li>
<li>patch: don't trash permissions of patched file</li>
<li>ps: add conditional support for -o [e]time</li>
<li>ps: fix COMMAND column adjustment; overflow in USER and VSZ columns</li>
<li>reset: call "stty sane". Closes bug 1414</li>
<li>rmdir: optional long options support for Debian users. By Roberto Gordo Saez &lt;roberto.gordo AT gmail.com&gt;</li>
<li>run-parts: add --reverse</li>
<li>script: correctly handle buffered "tail" of output</li>
<li>sed: "n" command must reset "we had successful subst" flag. Closes bug 1214</li>
<li>sort: -z outputs NUL terminated lines. Closes bug 1591</li>
<li>stty: fix mishandling of control keywords (Ralf Friedl &lt;Ralf.Friedl AT online.de&gt;)</li>
<li>switch_root: stop at first non-option. Closes bug 1425</li>
<li>syslogd: avoid excessive time() system calls</li>
<li>syslogd: don't die if remote host's IP cannot be resolved. Retry resolutions every two minutes instead</li>
<li>syslogd: fix shmat error check</li>
<li>syslogd: optional support for dropping dups. Closes bug 436</li>
<li>syslogd: send "\n"-terminated messages over the network. Fully closes bug 1574</li>
<li>syslogd: tighten up hostname handling</li>
<li>tail: fix "tail -c 20 /dev/huge_disk" (was taking ages)</li>
<li>tar: compat: handle tarballs with only one zero block at the end</li>
<li>tar: autodetection of gz/bz2 compressed tarballs. Closes bug 992</li>
<li>tar: real support for -p. By Natanael Copa &lt;natanael.copa at gmail.com&gt;</li>
<li>tcpudp: narrow down time window where we have no wildcard socket</li>
<li>telnetd: use login always, not "sometimes login, sometimes shell"</li>
<li>test: fix mishandling of "test ! arg1 op arg2 more args"</li>
<li>trylink: instead of build error, disable --gc-sections if GLIBC and STATIC are selected</li>
<li>udhcp: make file paths configurable</li>
<li>udhcp: optional support for non-standard DHCP ports</li>
<li>udhcp: set correct op byte in the packet for DHCPDECLINE</li>
<li>udhcpc: filter unwanted packets in kernel (Cristian Ionescu-Idbohrn &lt;cristian.ionescu-idbohrn AT axis.com&gt;)</li>
<li>udhcpc: fix wrong options in decline and release packets (Jonas Danielsson &lt;jonas.danielsson AT axis.com&gt;)</li>
<li>umount: do not complain several times about the same mountpoint</li>
<li>umount: do not try to free loop device or erase mtab if remounted ro</li>
<li>umount: instead of non-standard -D, use -d with opposite meaning. Closes bug 1604</li>
<li>unlzma: shrink by Pascal Bellard &lt;pascal.bellard AT ads-lu.com&gt;</li>
<li>unzip: do not try to read entire compressed stream at once (it can be huge)</li>
<li>unzip: handle short reads correctly</li>
<li>vi: many fixes</li>
<li>zcip: don't chdir to root</li>
<li>zcip: open ARP socket before openlog (else we can trash syslog socket)</li>
</ul>
</li>
<li><b>21 March 2008 -- BusyBox old stable releases</b>
<p>
Bugfix-only releases for four past branches. Links to locations
for future hot patches are in parentheses.
<p>
<a href="http://busybox.net/downloads/busybox-1.9.2.tar.bz2">1.9.2</a>
(<a href="http://busybox.net/downloads/fixes-1.9.2/">patches</a>),
<a href="http://busybox.net/downloads/busybox-1.8.3.tar.bz2">1.8.3</a>
(<a href="http://busybox.net/downloads/fixes-1.8.3/">patches</a>),
<a href="http://busybox.net/downloads/busybox-1.7.5.tar.bz2">1.7.5</a>
(<a href="http://busybox.net/downloads/fixes-1.7.5/">patches</a>),
<a href="http://busybox.net/downloads/busybox-1.5.2.tar.bz2">1.5.2</a>
(<a href="http://busybox.net/downloads/fixes-1.5.2/">patches</a>).
<p>
<a href="http://busybox.net/fix.html">How to add a patch.</a>
</p>
<li><b>12 February 2008 -- BusyBox 1.9.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.9.1.tar.bz2>BusyBox 1.9.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_9_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.9.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.9.1.tar.bz2">BusyBox 1.9.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_9_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.9.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to fsck,
iproute, mdev, mkswap, msh, nameif, stty, test, zcip.</p>
@@ -16,10 +297,10 @@
</li>
<li><b>24 December 2007 -- BusyBox 1.9.0 (unstable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.9.0.tar.bz2>BusyBox 1.9.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_9_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.9.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.9.0.tar.bz2">BusyBox 1.9.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_9_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.9.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Sizes of busybox-1.8.2 and busybox-1.9.0 (with almost full config, static uclibc build):<pre>
text data bss dec hex filename
@@ -81,17 +362,17 @@ parse_prompt 4132 insmod_main 3152
<li>df: -i option (show inode info) (Pascal Bellard &lt;pascal.bellard at ads-lu.com&gt;)
<li>hexdump: -R option (Pascal Bellard &lt;pascal.bellard at ads-lu.com&gt;)
</ul>
</p>
</li>
<li><b>23 November 2007 -- BusyBox 1.8.2 (stable), BusyBox 1.7.4 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.8.2.tar.bz2>BusyBox 1.8.2</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.8.2/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.7.4.tar.bz2>BusyBox 1.7.4</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.4/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.8.2.tar.bz2">BusyBox 1.8.2</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.8.2/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.7.4.tar.bz2">BusyBox 1.7.4</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.4/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>These are bugfix-only releases.
1.8.2 contains fixes for inetd, lash, tar, tr, and build system.
@@ -99,19 +380,19 @@ parse_prompt 4132 insmod_main 3152
</li>
<li><b>9 November 2007 -- BusyBox 1.8.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.8.1.tar.bz2>BusyBox 1.8.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.8.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.8.1.tar.bz2">BusyBox 1.8.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.8.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to login (PAM), modprobe, syslogd, telnetd, unzip.</p>
</li>
<li><b>4 November 2007 -- BusyBox 1.8.0 (unstable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.8.0.tar.bz2>BusyBox 1.8.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.8.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.8.0.tar.bz2">BusyBox 1.8.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.8.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Note: this is probably the very last release with lash. It will be dropped. Please migrate to hush.
@@ -212,42 +493,40 @@ Equivalent .config, i386 uclibc static builds:
<li>watchdog: allow millisecond spec (-t 250ms)
<li>zcip: fix unaligned trap on ARM
</ul>
</p>
</li>
<li><b>4 November 2007 -- BusyBox 1.7.3 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.7.3.tar.bz2>BusyBox 1.7.3</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.3/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.7.3.tar.bz2">BusyBox 1.7.3</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.3/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to ash, httpd, inetd, iptun, logger, login, tail.</p>
</li>
<li><b>30 September 2007 -- BusyBox 1.7.2 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.7.2.tar.bz2>BusyBox 1.7.2</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.2/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.7.2.tar.bz2">BusyBox 1.7.2</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.2/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to install, find, login, httpd, runsvdir, chcon, setfiles, fdisk and line editing.</p>
</li>
<li><b>16 September 2007 -- BusyBox 1.7.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.7.1.tar.bz2>BusyBox 1.7.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.7.1.tar.bz2">BusyBox 1.7.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to cp, runsv, tar, busybox --install and build system.</p>
</li>
<li><b>24 August 2007 -- BusyBox 1.7.0 (unstable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.7.0.tar.bz2>BusyBox 1.7.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.7.0.tar.bz2">BusyBox 1.7.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Applets which had many changes since 1.6.x:
<p>httpd:
@@ -388,23 +667,22 @@ Same .config built against static uclibc:
<li>wget: lift 256 chars limitation on terminal width
<li>wget, zcip: use monotonic_sec instead of gettimeofday
</ul>
</p>
</li>
<li><b>30 June 2007 -- BusyBox 1.6.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.6.1.tar.bz2>BusyBox 1.6.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_6_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.6.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.6.1.tar.bz2">BusyBox 1.6.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_6_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.6.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to echo, hush, and wget.</p>
</li>
<li><b>1 June 2007 -- BusyBox 1.6.0 (unstable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.6.0.tar.bz2>BusyBox 1.6.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_6_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.6.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.6.0.tar.bz2">BusyBox 1.6.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_6_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.6.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Since this is a x.x.0 release, it probably does not deserve "stable"
label. Please help making 1.6.1 stable by testing 1.6.0.</p>
@@ -413,7 +691,7 @@ Same .config built against static uclibc:
report any such cases.</p>
<p>lash users please note: lash is going to be deprecated in busybox 1.7.0
and removed in the more distant future. Please migrate to hush.</p>
<p><a href=http://busybox.net/~vda/mem_usage-1.6.0.txt>Memory usage has decreased, but we can do better still</a></p>
<p><a href="http://busybox.net/~vda/mem_usage-1.6.0.txt">Memory usage has decreased, but we can do better still</a></p>
<p>Other changes since previous release:
<ul>
<li>NOFORK: audit small applets and mark some of them as NOFORK. Put big scary warnings in relevant places
@@ -511,22 +789,21 @@ Same .config built against static uclibc:
<li>xargs: shrink code, ~80 bytes; simplify word list management
<li>zcip: make it work on NOMMU (+ improve NOMMU support machinery)
</ul>
</p>
</li>
<li><b>20 May 2007 -- BusyBox 1.5.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.5.1.tar.bz2>BusyBox 1.5.1</a>.
(<a href=http://busybox.net/downloads/fixes-1.5.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.5.1.tar.bz2">BusyBox 1.5.1</a>.
(<a href="http://busybox.net/downloads/fixes-1.5.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to hdparm, hush, ifupdown, ps
and sed.</p>
</li>
<li><b>23 March 2007 -- BusyBox 1.5.0 (unstable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.5.0.tar.bz2>BusyBox 1.5.0</a>.
(<a href=http://busybox.net/downloads/fixes-1.5.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.5.0.tar.bz2">BusyBox 1.5.0</a>.
(<a href="http://busybox.net/downloads/fixes-1.5.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Since this is a x.x.0 release, it probably does not deserve "stable"
label. Please help making 1.5.1 stable by testing 1.5.0.</p>
@@ -560,11 +837,10 @@ Same .config built against static uclibc:
<li>Applets with code cleaned up: telnet, fdisk, fsck_minix, mkfs_minix,
syslogd, swapon, runsv, svlogd, klogd
</ul>
</p>
</li>
<li><b>18 March 2007 -- BusyBox 1.4.2 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.4.2.tar.bz2>BusyBox 1.4.2</a>.
<p><a href="http://busybox.net/downloads/busybox-1.4.2.tar.bz2">BusyBox 1.4.2</a>.
</p>
<p>This release includes only trivial fixes accumulated since 1.4.1.
@@ -572,16 +848,16 @@ Same .config built against static uclibc:
</li>
<li><b>25 January 2007 -- BusyBox 1.4.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.4.1.tar.bz2>BusyBox 1.4.1</a>.
(<a href=http://busybox.net/downloads/fixes-1.4.1/>patches</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.4.1.tar.bz2">BusyBox 1.4.1</a>.
(<a href="http://busybox.net/downloads/fixes-1.4.1/">patches</a>)</p>
<p>This release includes only trivial fixes accumulated since 1.4.0.
</p>
</li>
<li><b>20 January 2007 -- BusyBox 1.4.0 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.4.0.tar.bz2>BusyBox 1.4.0</a>.
(<a href=http://busybox.net/downloads/fixes-1.4.0/>patches</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.4.0.tar.bz2">BusyBox 1.4.0</a>.
(<a href="http://busybox.net/downloads/fixes-1.4.0/">patches</a>)</p>
<p>Since this is a x.x.0 release, it probably is a bit less "stable"
than usual.</p>
@@ -611,27 +887,26 @@ Same .config built against static uclibc:
<li>minor bugfixes to: passwd, date, tftp, start_stop_daemon, tar,
ps, ifupdown, time, su, stty, awk, ping[6], sort,...
</ul>
</p>
</li>
<li><b>20 January 2007 -- BusyBox 1.3.2 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.3.2.tar.bz2>BusyBox 1.3.2</a>.</p>
<p><a href="http://busybox.net/downloads/busybox-1.3.2.tar.bz2">BusyBox 1.3.2</a>.</p>
<p>This release includes only one trivial fix accumulated since 1.3.1
</p>
</li>
<li><b>27 December 2006 -- BusyBox 1.3.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.3.1.tar.bz2>BusyBox 1.3.1</a>.
(<a href=http://busybox.net/downloads/fixes-1.3.1/>patches</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.3.1.tar.bz2">BusyBox 1.3.1</a>.
(<a href="http://busybox.net/downloads/fixes-1.3.1/">patches</a>)</p>
<p>Closing 2006 with new release. It includes only trivial fixes accumulated since 1.3.0
</p>
</li>
<li><b>14 December 2006 -- BusyBox 1.3.0 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.3.0.tar.bz2>BusyBox 1.3.0</a>.
(<a href=http://busybox.net/downloads/fixes-1.3.0/>patches</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.3.0.tar.bz2">BusyBox 1.3.0</a>.
(<a href="http://busybox.net/downloads/fixes-1.3.0/">patches</a>)</p>
<p>This release has CONFIG_DESKTOP option which enables features
needed for busybox usage on desktop machine. For example, find, chmod
@@ -666,7 +941,7 @@ Same .config built against static uclibc:
</li>
<li><b>29 October 2006 -- BusyBox 1.2.2.1 (fix)</b>
<p><a href=http://busybox.net/downloads/busybox-1.2.2.1.tar.bz2>BusyBox 1.2.2.1</a>.</p>
<p><a href="http://busybox.net/downloads/busybox-1.2.2.1.tar.bz2">BusyBox 1.2.2.1</a>.</p>
<p>Added compile-time warning that static linking against glibc
produces buggy executables.
@@ -674,7 +949,7 @@ Same .config built against static uclibc:
<li><b>24 October 2006 -- BusyBox 1.2.2 (stable)</b>
<p>It's a bit overdue, but
<a href=http://busybox.net/downloads/busybox-1.2.2.tar.bz2>here is
<a href="http://busybox.net/downloads/busybox-1.2.2.tar.bz2">here is
BusyBox 1.2.2</a>.</p>
<p>This release has dozens of fixes backported from the ongoing development
@@ -693,9 +968,9 @@ Same .config built against static uclibc:
gzip to save memory, fix sulogin -tNNN, a help text tweak, several warning
fixes and build fixes, fixup dnsd a bit, and a partridge in a pear tree.</p>
<p>As <a href=http://lwn.net/Articles/202106/>Linux Weekly News noted</a>,
<p>As <a href="http://lwn.net/Articles/202106/">Linux Weekly News noted</a>,
this is my (Rob's) last release of BusyBox. The new maintainer is Denis
Vlasenko, I'm off to do <a href=http://landley.net/code>other things</a>.
Vlasenko, I'm off to do <a href="http://landley.net/code">other things</a>.
</p>
</li>
@@ -1058,7 +1333,7 @@ Same .config built against static uclibc:
<p>
People who rely on the <a href= "downloads/snapshots/">daily BusyBox snapshots</a>
People who rely on the <a href="downloads/snapshots/">daily BusyBox snapshots</a>
should be aware that snapshots of the old busybox 0.60.x
series are no longer available. Daily snapshots are now
only available for the BusyBox 1.0.0 series and now use
@@ -1260,7 +1535,7 @@ Same .config built against static uclibc:
If you have submitted patches, and they are not in this release
and I have not emailed you explaining why your patch was
rejected, it is safe to say that I have lost your patch. That
happens sometimes. Please do <B>NOT</b> send all your patches,
happens sometimes. Please do <b>NOT</b> send all your patches,
support questions, etc, directly to Erik. I get hundreds of
emails every day (which is why I end up losing patches
sometimes in the flood)... The busybox mailing list is the
@@ -1348,12 +1623,12 @@ Same .config built against static uclibc:
<li><b>6 March 2002 -- busybox.net now has mirrors!</b><p>
Busybox.net is now much more available, thanks to
the fine folks at <a href= "http://i-netinnovations.com/">http://i-netinnovations.com/</a>
the fine folks at <a href="http://i-netinnovations.com/">http://i-netinnovations.com/</a>
who are providing hosting for busybox.net and
uclibc.org. In addition, we now have two mirrors:
<a href= "http://busybox.linuxmagic.com/">http://busybox.linuxmagic.com/</a>
<a href="http://busybox.linuxmagic.com/">http://busybox.linuxmagic.com/</a>
in Canada and
<a href= "http://busybox.csservers.de/">http://busybox.csservers.de/</a>
<a href="http://busybox.csservers.de/">http://busybox.csservers.de/</a>
in Germany. I hope this makes things much more
accessible for everyone!
@@ -1461,7 +1736,7 @@ Click here to help buy busybox.net!
<input type="hidden" name="item_name" value="Support Busybox">
<input type="hidden" name="image_url" value="https://busybox.net/images/busybox2.jpg">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="images/donate.png" border="0" name="submit" alt="Make donation using PayPal">
<input type="image" src="images/donate.png" name="submit" alt="Make donation using PayPal">
</form>
</center>
<!-- End PayPal Logo -->
@@ -1595,7 +1870,7 @@ would be wonderful!
<br>
The illustrious Larry Doolittle has made a PostScript chart of the growth
of the Busybox tarball size over time. It is available for downloading /
viewing <a href= "busybox-growth.ps"> right here</a>.
viewing <a href="busybox-growth.ps"> right here</a>.
<p> (Note that while the number of applets in Busybox has increased, you
can still configure Busybox to be as small as you want by selectively
@@ -1641,7 +1916,7 @@ image</a>. Here's how you use it:
<ol>
<li> <a href= "downloads/busybox.floppy.img">
<li> <a href="downloads/busybox.floppy.img">
Download the image</a>
<li> dd it onto a floppy like so: <tt> dd if=busybox.floppy.img
+84 -90
View File
@@ -7,7 +7,7 @@ Do you use BusyBox? I'd love to know about it and
I'd be happy to link to you.
<p>
I know of the following products and/or projects that use BusyBox --
I know of the following projects that use BusyBox --
listed in the order I happen to add them to the web page:
<ul>
@@ -19,124 +19,121 @@ by the uClibc developers.
<li><a href="http://openwrt.org">OpenWrt</a> a Linux distribution for embedded
devices, based on buildroot.
<li><a href="http://www.pengutronix.de/software/ptxdist_en.html">PTXdist</a><br>another
configurable means for building your own busybox based system systems.
<li><a href="http://www.pengutronix.de/software/ptxdist_en.html">PTXdist</a>
<br>another configurable means for building your own busybox based systems.
</li><li><a href=
<li><a href=
"http://cvs.debian.org/boot-floppies/">
Debian installer (boot floppies) project</a>
</li><li><a href="http://redhat.com/">Red Hat installer</a>
<li><a href="http://redhat.com/">Red Hat installer</a>
</li><li><a href=
<li><a href=
"http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-current/source/rootdisks/">
Slackware Installer</a>
</li><li><a href="http://www.gentoo.org/">Gentoo Linux install/boot CDs</a>
</li><li><a href="http://www.mandriva.com/">The Mandriva installer</a>
<li><a href="http://www.gentoo.org/">Gentoo Linux install/boot CDs</a>
<li><a href="http://www.mandriva.com/">The Mandriva installer</a>
</li><li><a href="http://Leaf.SourceForge.net">Linux Embedded Appliance Firewall</a><br>The sucessor of the Linux Router Project, supporting all sorts of embedded Linux gateways, routers, wireless routers, and firewalls.
<li><a href="http://Leaf.SourceForge.net">Linux Embedded Appliance Firewall</a>
<br>The sucessor of the Linux Router Project, supporting all sorts
of embedded Linux gateways, routers, wireless routers, and firewalls.
</li><li><a href=
<li><a href=
"http://www.toms.net/rb/">tomsrtbt</a>
</li><li><a href="http://www.stormix.com/">Stormix
Installer</a>
<li><a href="http://www.stormix.com/">Stormix Installer</a>
</li><li><a href=
"http://www.emacinc.com/linux2_sbc.htm">EMAC Linux
2.0 SBC</a>
<li><a href="http://www.emacinc.com/linux2_sbc.htm">EMAC Linux 2.0 SBC</a>
</li><li><a href="http://www.trinux.org/">Trinux</a>
<li><a href="http://www.trinux.org/">Trinux</a>
</li><li><a href="http://oddas.sourceforge.net/">ODDAS
project</a>
<li><a href="http://oddas.sourceforge.net/">ODDAS project</a>
</li><li><a href="http://byld.sourceforge.net/">Build Your
Linux Disk</a>
<li><a href="http://byld.sourceforge.net/">Build Your Linux Disk</a>
</li><li><a href=
<li><a href=
"http://ibiblio.org/pub/Linux/system/recovery">Zdisk</a>
</li><li><a href="http://www.adtran.com">AdTran -
<li><a href="http://www.adtran.com">AdTran -
VPN/firewall VPN Linux Distribution</a>
</li><li><a href="http://mkcdrec.ota.be/">mkCDrec - make
CD-ROM recovery</a>
<li><a href="http://mkcdrec.ota.be/">mkCDrec - make CD-ROM recovery</a>
</li><li><a href=
"http://recycle.lbl.gov/~ldoolitt/bse/">Linux on
nanoEngine</a>
<li><a href="http://recycle.lbl.gov/~ldoolitt/bse/">Linux on nanoEngine</a>
</li><li><a href=
"http://www.zelow.no/floppyfw/">Floppyfw</a>
<li><a href="http://www.zelow.no/floppyfw/">Floppyfw</a>
</li><li><a href="http://www.ltsp.org/">Linux Terminal
Server Project</a>
<li><a href="http://www.ltsp.org/">Linux Terminal Server Project</a>
</li><li><a href="http://www.devil-linux.org/">Devil-Linux</a>
<li><a href="http://www.devil-linux.org/">Devil-Linux</a>
</li><li><a href="http://dutnux.sourceforge.net/">DutNux</a>
<li><a href="http://dutnux.sourceforge.net/">DutNux</a>
</li><li><a href="http://www.microwerks.net/~hugo/mindi/">Mindi</a>
<li><a href="http://www.microwerks.net/~hugo/mindi/">Mindi</a>
</li><li><a href="http://www.minimalinux.org/ttylinux/">ttylinux</a>
<li><a href="http://www.minimalinux.org/ttylinux/">ttylinux</a>
</li><li><a href="http://www.coyotelinux.com/">Coyote Linux</a>
<li><a href="http://www.coyotelinux.com/">Coyote Linux</a>
</li><li><a href="http://www.partimage.org/">Partition
Image</a>
<li><a href="http://www.partimage.org/">Partition Image</a>
</li><li><a href="http://www.fli4l.de/">fli4l the on(e)-disk-router</a>
<li><a href="http://www.fli4l.de/">fli4l the on(e)-disk-router</a>
</li><li><a href="http://tinfoilhat.cultists.net/">Tinfoil
Hat Linux</a>
<li><a href="http://tinfoilhat.cultists.net/">Tinfoil Hat Linux</a>
</li><li><a href="http://sourceforge.net/projects/gp32linux/">gp32linux</a>
</li><li><a href="http://familiar.handhelds.org/">Familiar Linux</a><br>A linux distribution for handheld computers
</li><li><a href="http://rescuecd.sourceforge.net/">Timo's Rescue CD Set</a>
</li><li><a href="http://sf.net/projects/netstation/">Netstation</a>
</li><li><a href="http://www.fiwix.org/">GNU/Fiwix Operating System</a>
</li><li><a href="http://www.softcraft.com/">Generations Linux</a>
</li><li><a href="http://systemimager.org/relatedprojects/">SystemImager / System Installation Suite</a>
</li><li><a href="http://www.bablokb.de/gendist/">GENDIST distribution generator</a>
</li><li><a href="http://diet-pc.sourceforge.net/">DIET-PC embedded Linux thin client distribution</a>
</li><li><a href="http://byzgl.sourceforge.net/">BYZantine Gnu/Linux</a>
</li><li><a href="http://dban.sourceforge.net/">Darik's Boot and Nuke</a>
</li><li><a href="http://www.timesys.com/">TimeSys real-time Linux</a>
</li><li><a href="http://movix.sf.net/">MoviX</a><br>Boots from CD and automatically plays every video file on the CD
</li><li><a href="http://katamaran.sourceforge.net">katamaran</a><br>Linux, X11, xfce windowmanager, based on BusyBox
</li><li><a href="http://www.sourceforge.net/projects/simplygnustep">Prometheus SimplyGNUstep</a>
</li><li><a href="http://www.renyi.hu/~ekho/lowlife/">lowlife</a><br>A documentation project on how to make your own uClibc-based systems and floppy.
</li><li><a href="http://metadistros.hispalinux.es/">Metadistros</a><br>a project to allow you easily make Live-CD distributions.
</li><li><a href="http://salvare.sourceforge.net/">Salvare</a><br>More Linux than tomsrtbt but less than Knoppix, aims to provide a useful workstation as well as a rescue disk.
</li><li><a href="http://www.stresslinux.org/">stresslinux</a><br>minimal linux distribution running from a bootable cdrom or via PXE.
</li><li><a href="http://thinstation.sourceforge.net/">thinstation</a><br>convert standard PCs into full-featured diskless thinclients.
</li><li><a href="http://www.uhulinux.hu/">UHU-Linux Hungary</a>
</li><li><a href="http://deep-water.berlios.de/">Deep-Water Linux</a>
</li><li><a href="http://www.freesco.org/">Freesco router</a>
</li><li><a href="http://Sentry.SourceForge.net/">Sentry Firewall CD</a>
<li><a href="http://sourceforge.net/projects/gp32linux/">gp32linux</a>
<li><a href="http://familiar.handhelds.org/">Familiar Linux</a><br>A linux distribution for handheld computers
<li><a href="http://rescuecd.sourceforge.net/">Timo's Rescue CD Set</a>
<li><a href="http://sf.net/projects/netstation/">Netstation</a>
<li><a href="http://www.fiwix.org/">GNU/Fiwix Operating System</a>
<li><a href="http://www.softcraft.com/">Generations Linux</a>
<li><a href="http://systemimager.org/relatedprojects/">SystemImager / System Installation Suite</a>
<li><a href="http://www.bablokb.de/gendist/">GENDIST distribution generator</a>
<li><a href="http://diet-pc.sourceforge.net/">DIET-PC embedded Linux thin client distribution</a>
<li><a href="http://byzgl.sourceforge.net/">BYZantine Gnu/Linux</a>
<li><a href="http://dban.sourceforge.net/">Darik's Boot and Nuke</a>
<li><a href="http://www.timesys.com/">TimeSys real-time Linux</a>
<li><a href="http://movix.sf.net/">MoviX</a><br>Boots from CD and automatically plays every video file on the CD
<li><a href="http://katamaran.sourceforge.net">katamaran</a><br>Linux, X11, xfce windowmanager, based on BusyBox
<li><a href="http://www.sourceforge.net/projects/simplygnustep">Prometheus SimplyGNUstep</a>
<li><a href="http://www.renyi.hu/~ekho/lowlife/">lowlife</a><br>A documentation project on how to make your own uClibc-based systems and floppy.
<li><a href="http://metadistros.hispalinux.es/">Metadistros</a><br>a project to allow you easily make Live-CD distributions.
<li><a href="http://salvare.sourceforge.net/">Salvare</a><br>More Linux than tomsrtbt but less than Knoppix, aims to provide a useful workstation as well as a rescue disk.
<li><a href="http://www.stresslinux.org/">stresslinux</a><br>minimal linux distribution running from a bootable cdrom or via PXE.
<li><a href="http://thinstation.sourceforge.net/">thinstation</a><br>convert standard PCs into full-featured diskless thinclients.
<li><a href="http://www.uhulinux.hu/">UHU-Linux Hungary</a>
<li><a href="http://deep-water.berlios.de/">Deep-Water Linux</a>
<li><a href="http://www.freesco.org/">Freesco router</a>
<li><a href="http://Sentry.SourceForge.net/">Sentry Firewall CD</a>
</ul>
<p>
And here are products that use BusyBox --
</li><li><a href="http://tuxscreen.net">Tuxscreen Linux Phone</a>
</li><li><a href="http://www.kerbango.com/">The Kerbango Internet Radio</a>
</li><li><a href="http://www.linuxmagic.com/vpn/">LinuxMagic VPN Firewall</a>
</li><li><a href="http://www.isilver-inc.com/">I-Silver Linux appliance servers</a>
</li><li><a href="http://zaurus.sourceforge.net/">Sharp Zaurus PDA</a>
</li><li><a href="http://www.cyclades.com/">Cyclades-TS and other Cyclades products</a>
</li><li><a href="http://www.linksys.com/products/product.asp?prid=508">Linksys WRT54G - Wireless-G Broadband Router</a>
</li><li><a href="http://www.dell.com/us/en/biz/topics/sbtopic_005_truemobile.htm">Dell TrueMobile 1184</a>
</li><li><a href="http://actiontec.com/products/modems/dual_pcmodem/dpm_overview.html">Actiontec Dual PC Modem</a>
</li><li><a href="http://www.kiss-technology.com/">Kiss DP Series DVD players</a>
</li><li><a href="http://www.netgear.com/products/prod_details.asp?prodID=170">NetGear WG602 wireless router</a>
<ul>
<li><a href="http://www.elpa.it/eng/rd129gb.html">RD129 embedded board from ELPA</a>
<li>EMTEC MovieCube R700 uses Busybox 1.1.3.
<li><a href="http://tuxscreen.net">Tuxscreen Linux Phone</a>
<li><a href="http://www.kerbango.com/">The Kerbango Internet Radio</a>
<li><a href="http://www.linuxmagic.com/vpn/">LinuxMagic VPN Firewall</a>
<li><a href="http://www.isilver-inc.com/">I-Silver Linux appliance servers</a>
<li><a href="http://zaurus.sourceforge.net/">Sharp Zaurus PDA</a>
<li><a href="http://www.cyclades.com/">Cyclades-TS and other Cyclades products</a>
<li><a href="http://www.linksys.com/products/product.asp?prid=508">Linksys WRT54G - Wireless-G Broadband Router</a>
<li><a href="http://www.dell.com/us/en/biz/topics/sbtopic_005_truemobile.htm">Dell TrueMobile 1184</a>
<li><a href="http://actiontec.com/products/modems/dual_pcmodem/dpm_overview.html">Actiontec Dual PC Modem</a>
<li><a href="http://www.kiss-technology.com/">Kiss DP Series DVD players</a>
<li><a href="http://www.netgear.com/products/prod_details.asp?prodID=170">NetGear WG602 wireless router</a>
<br>with sources <a href="http://www.netgear.com/support/support_details.asp?dnldID=453">here</a>
</li><li><a href="http://www.trendware.com/products/TEW-411BRP.htm">TRENDnet TEW-411BRP 802.11g Wireless AP/Router/Switch</a>
<li><a href="http://www.trendware.com/products/TEW-411BRP.htm">TRENDnet TEW-411BRP 802.11g Wireless AP/Router/Switch</a>
<br>Source for busybox and udhcp <a href="http://www.trendware.com/asp/download/fileinfo.asp?file_id=277&amp;B1=Search">here</a> though no kernel source is provided.
</li><li><a href="http://www.buffalo-technology.com/webcontent/products/wireless/wbr-g54.htm">Buffalo WBR-G54 wireless router</a>
</li><li><a href="http://www.asus.com/products/communication/wireless/wl-300g/overview.htm">ASUS WL-300g Wireless LAN Access Point</a>
<li><a href="http://www.buffalo-technology.com/webcontent/products/wireless/wbr-g54.htm">Buffalo WBR-G54 wireless router</a>
<li><a href="http://www.asus.com/products/communication/wireless/wl-300g/overview.htm">ASUS WL-300g Wireless LAN Access Point</a>
<br>with source<a href="http://www.asus.com.tw/support/download/item.aspx?ModelName=WL-300G">here</a>
</li><li><a href="http://catalog.belkin.com/IWCatProductPage.process?Merchant_Id=&amp;Section_Id=201522&amp;pcount=&amp;Product_Id=136493">Belkin 54g Wireless DSL/Cable Gateway Router</a>
<li><a href="http://catalog.belkin.com/IWCatProductPage.process?Merchant_Id=&amp;Section_Id=201522&amp;pcount=&amp;Product_Id=136493">Belkin 54g Wireless DSL/Cable Gateway Router</a>
<br>with source<a href="http://web.belkin.com/support/gpl.asp">here</a>
<li><a href="http://www.acronis.com/products/partitionexpert/">Acronis PartitionExpert 2003</a>
<br>includes a heavily modified BusyBox v0.60.5 with built in
@@ -144,27 +141,24 @@ Hat Linux</a>
uClibc 0.9.26, a heavily patched up linux kernel, etc. Source
can only be obtained <a href="http://www.acronis.com/files/gpl/linux.tar.bz2">here</a>
</li><li><a href="http://www.usr.com/">U.S. Robotics Sureconnect 4-port ADSL router</a><br>
<li><a href="http://www.usr.com/">U.S. Robotics Sureconnect 4-port ADSL router</a><br>
with source <a href="http://www.usr.com/support/s-gpl-code.asp">here</a>
</li><li><a href="http://www.actiontec.com/products/broadband/54mbps_wireless_gateway_1p/index.html">
<li><a href="http://www.actiontec.com/products/broadband/54mbps_wireless_gateway_1p/index.html">
ActionTec GT701-WG Wireless Gateway/DSL Modem</a>
with source <a href="http://128.121.226.214/gtproducts/index.html">here</a>
</li><li><a href="http://smartlinux.sourceforge.net/">S.M.A.R.T. Linux</a>
</li><li><a href="http://www.dlink.com/">DLink - Model GSL-G604T, DSL-300T, and possibly other models</a>
<li><a href="http://smartlinux.sourceforge.net/">S.M.A.R.T. Linux</a>
<li><a href="http://www.dlink.com/">DLink - Model GSL-G604T, DSL-300T, and possibly other models</a>
with source <a href="ftp://ftp.dlink.co.uk/dsl_routers_modems/">here,</a>
with source <a href="ftp://ftp.dlink.de/dsl-products/">and here,</a>
and quite possibly other places as well. You may need to dig down a bit
to find the source, but it does seem to be there.
</li><li><a href="http://www.siemens-mobile.de/cds/frontdoor/0,2241,de_de_0_42931_rArNrNrNrN,00.html">Siemens SE515 DSL router</a>
<li><a href="http://www.siemens-mobile.de/cds/frontdoor/0,2241,de_de_0_42931_rArNrNrNrN,00.html">Siemens SE515 DSL router</a>
with source <a href="http://now-portal.c-lab.de/projects/gigaset/">here, I think...</a>
with some details <a href="http://heinz.hippenstiel.org/familie/hp/hobby/gigaset_se515dsl.html">here.</a>
</li><li><a href="http://freeterm.spb.ru/frwt/">Free Remote Windows Terminal</a>
<li><a href="http://freeterm.spb.ru/frwt/">Free Remote Windows Terminal</a>
</li><li><a href="http://www.zyxel.com/">ZyXEL Routers</a>
<li><a href="http://www.zyxel.com/">ZyXEL Routers</a>
</li>
</ul>
<!--#include file="footer.html" -->
+9 -9
View File
@@ -12,35 +12,35 @@ project, consider these fine companies!</p>
OSU OSL kindly provides hosting for BusyBox and uClibc.
</li>
<li><a href="http://www.codepoet-consulting.com">Codepoet Consulting</a><br>
<li><a href="http://www.codepoet-consulting.com/">Codepoet Consulting</a><br>
Custom Linux, embedded Linux, BusyBox, and uClibc development.
</li>
<li><a href=http://www.laptopcomputers.org/>Laptop Computers</a> contributes
<li><a href="http://www.laptopcomputers.org/">Laptop Computers</a> contributes
financially.
</li>
<li>AOE media, a <a href=http://www.aoemedia.com/typo3-development.html>
<li>AOE media, a <a href="http://www.aoemedia.com/typo3-development.html">
TYPO3 development agency</a> contributes financially.
</li>
<li><a href=http://www.analog.com/en/>Analog Devices, Inc.</a> provided
a <a href=http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start>
<li><a href="http://www.analog.com/en/">Analog Devices, Inc.</a> provided
a <a href="http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start">
Blackfin development board</a> free of charge.
<a href=http://www.analog.com/blackfin>Blackfin<a>
<a href="http://www.analog.com/blackfin">Blackfin</a>
is a NOMMU processor, and its availability for testing is invaluable.
If you are an embedded device developer,
please note that Analog Devices has entire Linux distribution available
for download for this board. Visit
<a href=http://blackfin.uclinux.org/>http://blackfin.uclinux.org/</a>
<a href="http://blackfin.uclinux.org/">http://blackfin.uclinux.org/</a>
for more information.
</li>
<li><a href="http://www.timesys.com">TimeSys</a><br>
<li><a href="http://www.timesys.com/">TimeSys</a><br>
Embedded Linux development, cross-compilers, real-time, KGDB, tsrpm and cygwin.
</li>
<li><a href="http://www.penguru.net">Penguru Consulting</a><br>
<li><a href="http://www.penguru.net/">Penguru Consulting</a><br>
Custom development for embedded Linux systems and multimedia platforms.
</li>
+2 -2
View File
@@ -6,7 +6,7 @@
<h3>Patches</h3>
<p>You can <a href="/downloads/">download</a> fixes for particular releases
<p>You can <a href="downloads/">download</a> fixes for particular releases
of busybox, e.g. downloads/fixes-<em>major</em>-<em>minor</em>-<em>patch</em>/
<h3>Anonymous Subversion Access</h3>
@@ -20,7 +20,7 @@ svn co svn://busybox.net/trunk/busybox</pre>
<p>
The current <em>stable branch</em> can be obtained with
<pre>
svn co svn://busybox.net/branches/busybox_1_9_stable
svn co svn://busybox.net/branches/busybox_1_12_stable
</pre>
<p>
+11 -11
View File
@@ -9,7 +9,7 @@ dev mailing list.
<br><br>
<table border=1>
<table>
<tr>
<th>Feature</th>
<th>Utilities</th>
@@ -44,42 +44,42 @@ version of links</a>.</p>
<h3>SCRIPTING LANGUAGES</h3>
<p>Although busybox has built-in support for shell scripts, plenty of other
small scripting languages are available on the net. A few examples:</p>
<table border=1>
<table>
<tr>
<th><language></th>
<th><description></th>
<th>language</th>
<th>description</th>
</tr>
<tr>
<td> <a href=http://www.foo.be/docs/tpj/issues/vol5_3/tpj0503-0003.html>microperl</a> </td>
<td> <a href="http://www.foo.be/docs/tpj/issues/vol5_3/tpj0503-0003.html">microperl</a> </td>
<td> A small standalone perl interpreter that can be built from the perl source
s via "make -f Makefile.micro". If you really feel the need for perl on an embe
dded system, this is where to start.
</tr>
<tr>
<td><a href=http://www.lua.org/pil/>Lua</a></td>
<td>If you just want a small embedded scripting language to write <em>new</en>
<td><a href="http://www.lua.org/pil/">Lua</a></td>
<td>If you just want a small embedded scripting language to write <em>new</em>
code in, this Brazilian import is lightweight, fairly popular, and has
a complete book about it online.</td>
</tr>
<tr>
<td><a href= http://www.star.le.ac.uk/%7Etjg/rc/>rc</a></td>
<td><a href="http://www.star.le.ac.uk/%7Etjg/rc/">rc</a></td>
<td>The PLAN9 shell. Not compatible with conventional bourne shell syntax,
but fairly lightweight and small.</td>
</tr>
</tr>
<tr>
<td><a href=http://www.forth.org>forth</a></td>
<td><a href="http://www.forth.org/">forth</a></td>
<td>A well known language for fast and small programs, decades old but still
in use for everything from OpenBIOS to computer controlled engine timing.</td>
</tr>
</table>
<p>For more information, you probably want to look at
<a href=http://buildroot.uclibc.org>buildroot</a> and
<a href=http://gentoo-wiki.com/TinyGentoo>TinyGentoo</a>, which
<a href="http://buildroot.uclibc.org/">buildroot</a> and
<a href="http://gentoo-wiki.com/TinyGentoo">TinyGentoo</a>, which
build and use tiny utilities for all sorts of things.</p>
<!--#include file="footer.html" -->
+6 -5
View File
@@ -6,9 +6,9 @@ BusyBox - The Swiss Army Knife of Embedded Linux
=head1 SYNTAX
BusyBox <function> [arguments...] # or
busybox <applet> [arguments...] # or
<function> [arguments...] # if symlinked
<applet> [arguments...] # if symlinked
=head1 DESCRIPTION
@@ -45,7 +45,8 @@ BusyBox is a multi-call binary. A multi-call binary is an executable program
that performs the same job as more than one utility program. That means there
is just a single BusyBox binary, but that single binary acts like a large
number of utilities. This allows BusyBox to be smaller since all the built-in
utility programs (we call them applets) can share code for many common operations.
utility programs (we call them applets) can share code for many common
operations.
You can also invoke BusyBox by issuing a command as an argument on the
command line. For example, entering
@@ -72,11 +73,11 @@ applets that have been compiled into your BusyBox binary.
=head1 COMMON OPTIONS
Most BusyBox commands support the B<--help> argument to provide a terse runtime
Most BusyBox applets support the B<--help> argument to provide a terse runtime
description of their behavior. If the CONFIG_FEATURE_VERBOSE_USAGE option has
been enabled, more detailed usage information will also be available.
=head1 COMMANDS
Currently defined functions include:
Currently available applets include:
+4 -2
View File
@@ -51,9 +51,11 @@ device nodes if your system needs something more than the default root/root
660 permissions.
The file has the format:
<device regex> <uid>:<gid> <octal permissions>
<device regex> <uid>:<gid> <octal permissions>
or @<maj[,min1[-min2]]> <uid>:<gid> <octal permissions>
For example:
hd[a-z][0-9]* 0:3 660
hd[a-z][0-9]* 0:3 660
The config file parsing stops at the first matching line. If no line is
matched, then the default of 0:0 660 is used. To set your own default, simply
+2 -2
View File
@@ -313,10 +313,10 @@ static void load_fs_info(const char *filename)
// Loop through entries
while (getmntent_r(fstab, &mte, bb_common_bufsiz1, COMMON_BUFSIZE)) {
//bb_info_msg("CREATE[%s][%s][%s][%s][%d]", mte.mnt_fsname, mte.mnt_dir,
// mte.mnt_type, mte.mnt_opts,
// mte.mnt_type, mte.mnt_opts,
// mte.mnt_passno);
fs = create_fs_device(mte.mnt_fsname, mte.mnt_dir,
mte.mnt_type, mte.mnt_opts,
mte.mnt_type, mte.mnt_opts,
mte.mnt_passno);
}
endmntent(fstab);
+9 -9
View File
@@ -192,10 +192,10 @@ struct buffer_head {
#define K_DEV_FS 1
#define K_DEV_JOURNAL 2
#define lock_buffer(bh) do {} while(0)
#define unlock_buffer(bh) do {} while(0)
#define lock_buffer(bh) do {} while (0)
#define unlock_buffer(bh) do {} while (0)
#define buffer_req(bh) 1
#define do_readahead(journal, start) do {} while(0)
#define do_readahead(journal, start) do {} while (0)
static e2fsck_t e2fsck_global_ctx; /* Try your very best not to use this! */
@@ -10014,7 +10014,7 @@ static int do_one_pass(journal_t *journal,
* all of the sequence number checks. What are we going
* to do with it? That depends on the pass... */
switch(blocktype) {
switch (blocktype) {
case JFS_DESCRIPTOR_BLOCK:
/* If it is a valid descriptor block, replay it
* in pass REPLAY; otherwise, just skip over the
@@ -11158,7 +11158,7 @@ int journal_init_revoke(journal_t *journal, int hash_size)
shift = 0;
tmp = hash_size;
while((tmp >>= 1UL) != 0UL)
while ((tmp >>= 1UL) != 0UL)
shift++;
journal->j_revoke->hash_shift = shift;
@@ -12251,7 +12251,7 @@ static int read_a_char(void)
int r;
int fail = 0;
while(1) {
while (1) {
if (e2fsck_global_ctx &&
(e2fsck_global_ctx->flags & E2F_FLAG_CANCEL)) {
return 3;
@@ -12281,7 +12281,7 @@ static int ask_yn(const char * string, int def)
tmp.c_lflag &= ~(ICANON | ECHO);
tmp.c_cc[VMIN] = 1;
tmp.c_cc[VTIME] = 0;
tcsetattr (0, TCSANOW, &tmp);
tcsetattr_stdin_TCSANOW(&tmp);
#endif
if (def == 1)
@@ -12297,7 +12297,7 @@ static int ask_yn(const char * string, int def)
break;
if (c == 3) {
#ifdef HAVE_TERMIOS_H
tcsetattr (0, TCSANOW, &termios);
tcsetattr_stdin_TCSANOW(&termios);
#endif
if (e2fsck_global_ctx &&
e2fsck_global_ctx->flags & E2F_FLAG_SETJMP_OK) {
@@ -12323,7 +12323,7 @@ static int ask_yn(const char * string, int def)
else
puts ("no\n");
#ifdef HAVE_TERMIOS_H
tcsetattr (0, TCSANOW, &termios);
tcsetattr_stdin_TCSANOW(&termios);
#endif
return def;
}
+1 -1
View File
@@ -42,7 +42,7 @@ static void TEA_transform(__u32 buf[4], __u32 const in[])
sum += DELTA;
b0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b);
b1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d);
} while(--n);
} while (--n);
buf[0] += b0;
buf[1] += b1;
+1 -1
View File
@@ -113,7 +113,7 @@ errcode_t ext2fs_create_resize_inode(ext2_filsys fs)
inode_size *= fs->blocksize;
inode.i_size = inode_size & 0xFFFFFFFF;
inode.i_size_high = (inode_size >> 32) & 0xFFFFFFFF;
if(inode.i_size_high) {
if (inode.i_size_high) {
sb->s_feature_ro_compat |=
EXT2_FEATURE_RO_COMPAT_LARGE_FILE;
}
+15 -15
View File
@@ -533,21 +533,21 @@ static struct fs_info *lookup(char *filesys)
/* Find fsck program for a given fs type. */
static char *find_fsck(char *type)
{
char *s;
const char *tpl;
char *p = string_copy(fsck_path);
struct stat st;
char *s;
const char *tpl;
char *p = string_copy(fsck_path);
struct stat st;
/* Are we looking for a program or just a type? */
tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
/* Are we looking for a program or just a type? */
tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
for(s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
s = xasprintf(tpl, s, type);
if (stat(s, &st) == 0) break;
free(s);
}
free(p);
return s;
for (s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
s = xasprintf(tpl, s, type);
if (stat(s, &st) == 0) break;
free(s);
}
free(p);
return s;
}
static int progress_active(void)
@@ -885,7 +885,7 @@ static void compile_fs_type(char *fs_type, struct fs_type_compile *cmp)
list = string_copy(fs_type);
num = 0;
s = strtok(list, ",");
while(s) {
while (s) {
negate = 0;
if (strncmp(s, "no", 2) == 0) {
s += 2;
@@ -930,7 +930,7 @@ static int opt_in_list(char *opt, char *optlist)
list = string_copy(optlist);
s = strtok(list, ",");
while(s) {
while (s) {
if (strcmp(s, opt) == 0) {
free(list);
return 1;
+2 -2
View File
@@ -676,7 +676,7 @@ static int set_os(struct ext2_super_block *sb, char *os)
return 1;
}
if((sb->s_creator_os = e2p_string2os(os)) >= 0) {
if ((sb->s_creator_os = e2p_string2os(os)) >= 0) {
return 1;
} else if (!strcasecmp("GNU", os)) {
sb->s_creator_os = EXT2_OS_HURD;
@@ -1187,7 +1187,7 @@ int mke2fs_main (int argc, char **argv)
if (ENABLE_FEATURE_CLEAN_UP)
atexit(mke2fs_clean_up);
if(!PRS(argc, argv))
if (!PRS(argc, argv))
return 0;
#ifdef CONFIG_TESTIO_DEBUG
+8 -8
View File
@@ -37,7 +37,7 @@ void check_plausibility(const char *device, int force)
val = stat(device, &s);
if (force)
return;
if(val == -1)
if (val == -1)
bb_perror_msg_and_die("cannot stat %s", device);
if (!S_ISBLK(s.st_mode)) {
printf("%s is not a block special device.\n", device);
@@ -220,13 +220,13 @@ void make_journal_device(char *journal_device, ext2_filsys fs, int quiet, int fo
fs->blocksize, io_ptr, &jfs);
if (retval)
bb_error_msg_and_die("cannot journal device %s", journal_device);
if(!quiet)
if (!quiet)
printf("Adding journal to device %s: ", journal_device);
fflush(stdout);
retval = ext2fs_add_journal_device(fs, jfs);
if(retval)
if (retval)
bb_error_msg_and_die("\nFailed to add journal to device %s", journal_device);
if(!quiet)
if (!quiet)
puts("done");
ext2fs_close(jfs);
}
@@ -242,14 +242,14 @@ void make_journal_blocks(ext2_filsys fs, int journal_size, int journal_flags, in
~EXT3_FEATURE_COMPAT_HAS_JOURNAL;
return;
}
if(!quiet)
if (!quiet)
printf("Creating journal (%ld blocks): ", journal_blocks);
fflush(stdout);
retval = ext2fs_add_journal_inode(fs, journal_blocks,
journal_flags);
if(retval)
if (retval)
bb_error_msg_and_die("cannot create journal");
if(!quiet)
if (!quiet)
puts("done");
}
@@ -262,6 +262,6 @@ char *e2fs_set_sbin_path(void)
oldpath = xasprintf("%s:%s", PATH_SET, oldpath);
else
oldpath = PATH_SET;
putenv (oldpath);
putenv(oldpath);
return oldpath;
}
+2 -2
View File
@@ -12,9 +12,9 @@ config AWK
Awk is used as a pattern scanning and processing language. This is
the BusyBox implementation of that programming language.
config FEATURE_AWK_MATH
config FEATURE_AWK_LIBM
bool "Enable math functions (requires libm)"
default y
default n
depends on AWK
help
Enable math functions of the Awk programming language.
+41 -14
View File
@@ -512,7 +512,7 @@ static const char EMSG_TOO_FEW_ARGS[] ALIGN1 = "Too few arguments for builtin";
static const char EMSG_NOT_ARRAY[] ALIGN1 = "Not an array";
static const char EMSG_POSSIBLE_ERROR[] ALIGN1 = "Possible syntax error";
static const char EMSG_UNDEF_FUNC[] ALIGN1 = "Call to undefined function";
#if !ENABLE_FEATURE_AWK_MATH
#if !ENABLE_FEATURE_AWK_LIBM
static const char EMSG_NO_MATH[] ALIGN1 = "Math support is not compiled in";
#endif
@@ -681,6 +681,18 @@ static ALWAYS_INLINE int isalnum_(int c)
return (isalnum(c) || c == '_');
}
static double my_strtod(char **pp)
{
#if ENABLE_DESKTOP
if ((*pp)[0] == '0'
&& ((((*pp)[1] | 0x20) == 'x') || isdigit((*pp)[1]))
) {
return strtoull(*pp, pp, 0);
}
#endif
return strtod(*pp, pp);
}
/* -------- working with variables (set/get/copy/etc) -------- */
static xhash *iamarray(var *v)
@@ -790,7 +802,7 @@ static double getvar_i(var *v)
v->number = 0;
s = v->string;
if (s && *s) {
v->number = strtod(s, &s);
v->number = my_strtod(&s);
if (v->type & VF_USER) {
skip_spaces(&s);
if (*s != '\0')
@@ -804,6 +816,19 @@ static double getvar_i(var *v)
return v->number;
}
/* Used for operands of bitwise ops */
static unsigned long getvar_i_int(var *v)
{
double d = getvar_i(v);
/* Casting doubles to longs is undefined for values outside
* of target type range. Try to widen it as much as possible */
if (d >= 0)
return (unsigned long)d;
/* Why? Think about d == -4294967295.0 (assuming 32bit longs) */
return - (long) (unsigned long) (-d);
}
static var *copyvar(var *dest, const var *src)
{
if (dest != src) {
@@ -973,7 +998,7 @@ static uint32_t next_token(uint32_t expected)
} else if (*p == '.' || isdigit(*p)) {
/* it's a number */
t_double = strtod(p, &p);
t_double = my_strtod(&p);
if (*p == '.')
syntax_error(EMSG_UNEXP_TOKEN);
tc = TC_NUMBER;
@@ -1999,8 +2024,8 @@ static var *exec_builtin(node *op, var *res)
switch (info & OPNMASK) {
case B_a2:
#if ENABLE_FEATURE_AWK_MATH
setvar_i(res, atan2(getvar_i(av[i]), getvar_i(av[1])));
#if ENABLE_FEATURE_AWK_LIBM
setvar_i(res, atan2(getvar_i(av[0]), getvar_i(av[1])));
#else
syntax_error(EMSG_NO_MATH);
#endif
@@ -2017,7 +2042,7 @@ static var *exec_builtin(node *op, var *res)
n = awk_split(as[0], spl, &s);
s1 = s;
clear_array(iamarray(av[1]));
for (i=1; i<=n; i++)
for (i = 1; i <= n; i++)
setari_u(av[1], i, nextword(&s1));
free(s);
setvar_i(res, n);
@@ -2034,28 +2059,30 @@ static var *exec_builtin(node *op, var *res)
setvar_p(res, s);
break;
/* Bitwise ops must assume that operands are unsigned. GNU Awk 3.1.5:
* awk '{ print or(-1,1) }' gives "4.29497e+09", not "-2.xxxe+09" */
case B_an:
setvar_i(res, (long)getvar_i(av[0]) & (long)getvar_i(av[1]));
setvar_i(res, getvar_i_int(av[0]) & getvar_i_int(av[1]));
break;
case B_co:
setvar_i(res, ~(long)getvar_i(av[0]));
setvar_i(res, ~getvar_i_int(av[0]));
break;
case B_ls:
setvar_i(res, (long)getvar_i(av[0]) << (long)getvar_i(av[1]));
setvar_i(res, getvar_i_int(av[0]) << getvar_i_int(av[1]));
break;
case B_or:
setvar_i(res, (long)getvar_i(av[0]) | (long)getvar_i(av[1]));
setvar_i(res, getvar_i_int(av[0]) | getvar_i_int(av[1]));
break;
case B_rs:
setvar_i(res, (long)((unsigned long)getvar_i(av[0]) >> (unsigned long)getvar_i(av[1])));
setvar_i(res, getvar_i_int(av[0]) >> getvar_i_int(av[1]));
break;
case B_xo:
setvar_i(res, (long)getvar_i(av[0]) ^ (long)getvar_i(av[1]));
setvar_i(res, getvar_i_int(av[0]) ^ getvar_i_int(av[1]));
break;
case B_lo:
@@ -2438,7 +2465,7 @@ static var *evaluate(node *op, var *res)
case F_rn:
R.d = (double)rand() / (double)RAND_MAX;
break;
#if ENABLE_FEATURE_AWK_MATH
#if ENABLE_FEATURE_AWK_LIBM
case F_co:
R.d = cos(L.d);
break;
@@ -2606,7 +2633,7 @@ static var *evaluate(node *op, var *res)
L.d /= R.d;
break;
case '&':
#if ENABLE_FEATURE_AWK_MATH
#if ENABLE_FEATURE_AWK_LIBM
L.d = pow(L.d, R.d);
#else
syntax_error(EMSG_NO_MATH);
+1 -1
View File
@@ -1189,7 +1189,7 @@ static char **get_recursive_dirlist(char *path)
recursive_action(path, ACTION_RECURSE|ACTION_FOLLOWLINKS,
add_to_dirlist, /* file_action */
NULL, /* dir_action */
(void*)(strlen(path) + 1),
(void*)(ptrdiff_t)(strlen(path) + 1),
0);
} else {
DIR *dp;
+122 -243
View File
@@ -57,30 +57,6 @@ enum {
MAX_SCR_ROWS = CONFIG_FEATURE_VI_MAX_LEN,
};
// Misc. non-Ascii keys that report an escape sequence
#define VI_K_UP (char)128 // cursor key Up
#define VI_K_DOWN (char)129 // cursor key Down
#define VI_K_RIGHT (char)130 // Cursor Key Right
#define VI_K_LEFT (char)131 // cursor key Left
#define VI_K_HOME (char)132 // Cursor Key Home
#define VI_K_END (char)133 // Cursor Key End
#define VI_K_INSERT (char)134 // Cursor Key Insert
#define VI_K_DELETE (char)135 // Cursor Key Insert
#define VI_K_PAGEUP (char)136 // Cursor Key Page Up
#define VI_K_PAGEDOWN (char)137 // Cursor Key Page Down
#define VI_K_FUN1 (char)138 // Function Key F1
#define VI_K_FUN2 (char)139 // Function Key F2
#define VI_K_FUN3 (char)140 // Function Key F3
#define VI_K_FUN4 (char)141 // Function Key F4
#define VI_K_FUN5 (char)142 // Function Key F5
#define VI_K_FUN6 (char)143 // Function Key F6
#define VI_K_FUN7 (char)144 // Function Key F7
#define VI_K_FUN8 (char)145 // Function Key F8
#define VI_K_FUN9 (char)146 // Function Key F9
#define VI_K_FUN10 (char)147 // Function Key F10
#define VI_K_FUN11 (char)148 // Function Key F11
#define VI_K_FUN12 (char)149 // Function Key F12
/* vt102 typical ESC sequence */
/* terminal standout start/normal ESC sequence */
static const char SOs[] ALIGN1 = "\033[7m";
@@ -96,6 +72,12 @@ static const char CMrc[] ALIGN1 = "\033[%d;%dH";
static const char CMup[] ALIGN1 = "\033[A";
static const char CMdown[] ALIGN1 = "\n";
#if ENABLE_FEATURE_VI_DOT_CMD || ENABLE_FEATURE_VI_YANKMARK
// cmds modifying text[]
// vda: removed "aAiIs" as they switch us into insert mode
// and remembering input for replay after them makes no sense
static const char modifying_cmds[] = "cCdDJoOpPrRxX<>~";
#endif
enum {
YANKONLY = FALSE,
@@ -147,10 +129,10 @@ struct globals {
#endif
smallint editing; // >0 while we are editing a file
// [code audit says "can be 0 or 1 only"]
// [code audit says "can be 0, 1 or 2 only"]
smallint cmd_mode; // 0=command 1=insert 2=replace
int file_modified; // buffer contents changed (counter, not flag!)
int last_file_modified; // = -1;
int last_file_modified; // = -1;
int fn_start; // index of first cmd line file name
int save_argc; // how many file names on cmd line
int cmdcnt; // repetition count
@@ -165,10 +147,11 @@ struct globals {
char *screen; // pointer to the virtual screen buffer
int screensize; // and its size
int tabstop;
int last_forward_char; // last char searched for with 'f' (int because of Unicode)
char erase_char; // the users erase character
char last_input_char; // last char read from user
char last_forward_char; // last char searched for with 'f'
smalluint chars_to_parse;
#if ENABLE_FEATURE_VI_DOT_CMD
smallint adding2q; // are we currently adding user input to q
int lmc_len; // length of last_modifying_cmd
@@ -180,13 +163,10 @@ struct globals {
#if ENABLE_FEATURE_VI_USE_SIGNALS || ENABLE_FEATURE_VI_CRASHME
int my_pid;
#endif
#if ENABLE_FEATURE_VI_DOT_CMD || ENABLE_FEATURE_VI_YANKMARK
char *modifying_cmds; // cmds that modify text[]
#endif
#if ENABLE_FEATURE_VI_SEARCH
char *last_search_pattern; // last pattern from a '/' or '?' search
#endif
int chars_to_parse;
/* former statics */
#if ENABLE_FEATURE_VI_YANKMARK
char *edit_file__cur_line;
@@ -209,11 +189,11 @@ struct globals {
char *initial_cmds[3]; // currently 2 entries, NULL terminated
#endif
// Should be just enough to hold a key sequence,
// but CRASME mode uses it as generated command buffer too
// but CRASHME mode uses it as generated command buffer too
#if ENABLE_FEATURE_VI_CRASHME
char readbuffer[128];
#else
char readbuffer[32];
char readbuffer[KEYCODE_BUFFER_SIZE];
#endif
#define STATUS_BUFFER_LEN 200
char status_buffer[STATUS_BUFFER_LEN]; // messages to the user
@@ -252,9 +232,10 @@ struct globals {
#define screensize (G.screensize )
#define screenbegin (G.screenbegin )
#define tabstop (G.tabstop )
#define last_forward_char (G.last_forward_char )
#define erase_char (G.erase_char )
#define last_input_char (G.last_input_char )
#define last_forward_char (G.last_forward_char )
#define chars_to_parse (G.chars_to_parse )
#if ENABLE_FEATURE_VI_READONLY
#define readonly_mode (G.readonly_mode )
#else
@@ -266,9 +247,7 @@ struct globals {
#define ioq_start (G.ioq_start )
#define last_row (G.last_row )
#define my_pid (G.my_pid )
#define modifying_cmds (G.modifying_cmds )
#define last_search_pattern (G.last_search_pattern)
#define chars_to_parse (G.chars_to_parse )
#define edit_file__cur_line (G.edit_file__cur_line)
#define refresh__old_offset (G.refresh__old_offset)
@@ -291,12 +270,14 @@ struct globals {
#define INIT_G() do { \
SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
last_file_modified = -1; \
/* "" but has space for 2 chars: */ \
USE_FEATURE_VI_SEARCH(last_search_pattern = xzalloc(2);) \
} while (0)
static int init_text_buffer(char *); // init from file or create new
static void edit_file(char *); // edit one file
static void do_cmd(char); // execute a command
static void do_cmd(int); // execute a command
static int next_tabstop(int);
static void sync_cursor(char *, int *, int *); // synchronize the screen cursor to dot
static char *begin_line(char *); // return pointer to cur line B-o-l
@@ -332,8 +313,8 @@ static void rawmode(void); // set "raw" mode on tty
static void cookmode(void); // return to "cooked" mode on tty
// sleep for 'h' 1/100 seconds, return 1/0 if stdin is (ready for read)/(not ready)
static int mysleep(int);
static char readit(void); // read (maybe cursor) key from stdin
static char get_one_char(void); // read 1 char from stdin
static int readit(void); // read (maybe cursor) key from stdin
static int get_one_char(void); // read 1 char from stdin
static int file_size(const char *); // what is the byte size of "fn"
#if ENABLE_FEATURE_VI_READONLY
static int file_insert(const char *, char *, int);
@@ -348,6 +329,7 @@ static void place_cursor(int, int, int);
static void screen_erase(void);
static void clear_to_eol(void);
static void clear_to_eos(void);
static void go_bottom_and_clear_to_eol(void);
static void standout_start(void); // send "start reverse video" sequence
static void standout_end(void); // send "end reverse video" sequence
static void flash(int); // flash the terminal screen
@@ -428,10 +410,6 @@ int vi_main(int argc, char **argv)
#endif
vi_setops = VI_AUTOINDENT | VI_SHOWMATCH | VI_IGNORECASE;
#if ENABLE_FEATURE_VI_DOT_CMD || ENABLE_FEATURE_VI_YANKMARK
modifying_cmds = (char *) "aAcCdDiIJoOpPrRsxX<>~"; // cmds modifying text[]
#endif
// 1- process $HOME/.exrc file (not inplemented yet)
// 2- process EXINIT variable from environment
// 3- process command line args
@@ -525,7 +503,7 @@ static void edit_file(char *fn)
#if ENABLE_FEATURE_VI_YANKMARK
#define cur_line edit_file__cur_line
#endif
char c;
int c;
int size;
#if ENABLE_FEATURE_VI_USE_SIGNALS
int sig;
@@ -623,18 +601,21 @@ static void edit_file(char *fn)
// These are commands that change text[].
// Remember the input for the "." command
if (!adding2q && ioq_start == NULL
&& cmd_mode == 0 // command mode
&& c > '\0' // exclude NUL and non-ASCII chars
&& c < 0x7f // (Unicode and such)
&& strchr(modifying_cmds, c)
) {
start_new_cmd_q(c);
}
#endif
do_cmd(c); // execute the user command
//
// poll to see if there is input already waiting. if we are
// not able to display output fast enough to keep up, skip
// the display update until we catch up with input.
if (mysleep(0) == 0) {
// no input pending- so update output
if (!chars_to_parse && mysleep(0) == 0) {
// no input pending - so update output
refresh(FALSE);
show_status_line();
}
@@ -645,8 +626,7 @@ static void edit_file(char *fn)
}
//-------------------------------------------------------------------
place_cursor(rows, 0, FALSE); // go to bottom of screen
clear_to_eol(); // Erase to end of line
go_bottom_and_clear_to_eol();
cookmode();
#undef cur_line
}
@@ -842,8 +822,7 @@ static void colon(char *buf)
else if (strncmp(cmd, "!", 1) == 0) { // run a cmd
int retcode;
// :!ls run the <cmd>
place_cursor(rows - 1, 0, FALSE); // go to Status line
clear_to_eol(); // clear the line
go_bottom_and_clear_to_eol();
cookmode();
retcode = system(orig_buf + 1); // run the cmd
if (retcode)
@@ -920,8 +899,7 @@ static void colon(char *buf)
}
} else if (strncasecmp(cmd, "features", i) == 0) { // what features are available
// print out values of all features
place_cursor(rows - 1, 0, FALSE); // go to Status line, bottom of screen
clear_to_eol(); // clear the line
go_bottom_and_clear_to_eol();
cookmode();
show_help();
rawmode();
@@ -931,8 +909,7 @@ static void colon(char *buf)
q = begin_line(dot); // assume .,. for the range
r = end_line(dot);
}
place_cursor(rows - 1, 0, FALSE); // go to Status line, bottom of screen
clear_to_eol(); // clear the line
go_bottom_and_clear_to_eol();
puts("\r");
for (; q <= r; q++) {
int c_is_no_print;
@@ -1032,8 +1009,7 @@ static void colon(char *buf)
// only blank is regarded as args delmiter. What about tab '\t' ?
if (!args[0] || strcasecmp(args, "all") == 0) {
// print out values of all options
place_cursor(rows - 1, 0, FALSE); // go to Status line, bottom of screen
clear_to_eol(); // clear the line
go_bottom_and_clear_to_eol();
printf("----------------------------------------\r\n");
#if ENABLE_FEATURE_VI_SETOPTS
if (!autoindent)
@@ -1203,7 +1179,7 @@ static void colon(char *buf)
static void Hit_Return(void)
{
char c;
int c;
standout_start();
write1("[Hit return to continue]");
@@ -2009,9 +1985,9 @@ static void start_new_cmd_q(char c)
{
// get buffer for new cmd
// if there is a current cmd count put it in the buffer first
if (cmdcnt > 0)
if (cmdcnt > 0) {
lmc_len = sprintf(last_modifying_cmd, "%d%c", cmdcnt, c);
else { // just save char c onto queue
} else { // just save char c onto queue
last_modifying_cmd[0] = c;
lmc_len = 1;
}
@@ -2130,13 +2106,13 @@ static void rawmode(void)
term_vi.c_cc[VMIN] = 1;
term_vi.c_cc[VTIME] = 0;
erase_char = term_vi.c_cc[VERASE];
tcsetattr(0, TCSANOW, &term_vi);
tcsetattr_stdin_TCSANOW(&term_vi);
}
static void cookmode(void)
{
fflush(stdout);
tcsetattr(0, TCSANOW, &term_orig);
tcsetattr_stdin_TCSANOW(&term_orig);
}
//----- Come here when we get a window resize signal ---------
@@ -2157,21 +2133,20 @@ static void winch_sig(int sig UNUSED_PARAM)
//----- Come here when we get a continue signal -------------------
static void cont_sig(int sig UNUSED_PARAM)
{
rawmode(); // terminal to "raw"
last_status_cksum = 0; // force status update
redraw(TRUE); // re-draw the screen
rawmode(); // terminal to "raw"
last_status_cksum = 0; // force status update
redraw(TRUE); // re-draw the screen
signal(SIGTSTP, suspend_sig);
signal(SIGCONT, SIG_DFL);
kill(my_pid, SIGCONT);
kill(my_pid, SIGCONT); // huh? why? we are already "continued"...
}
//----- Come here when we get a Suspend signal -------------------
static void suspend_sig(int sig UNUSED_PARAM)
{
place_cursor(rows - 1, 0, FALSE); // go to bottom of screen
clear_to_eol(); // Erase to end of line
cookmode(); // terminal to "cooked"
go_bottom_and_clear_to_eol();
cookmode(); // terminal to "cooked"
signal(SIGCONT, cont_sig);
signal(SIGTSTP, SIG_DFL);
@@ -2197,118 +2172,24 @@ static int mysleep(int hund) // sleep for 'h' 1/100 seconds
}
//----- IO Routines --------------------------------------------
static char readit(void) // read (maybe cursor) key from stdin
static int readit(void) // read (maybe cursor) key from stdin
{
char c;
int n;
struct esc_cmds {
const char seq[4];
char val;
};
static const struct esc_cmds esccmds[] = {
{"OA" , VI_K_UP }, // cursor key Up
{"OB" , VI_K_DOWN }, // cursor key Down
{"OC" , VI_K_RIGHT }, // Cursor Key Right
{"OD" , VI_K_LEFT }, // cursor key Left
{"OH" , VI_K_HOME }, // Cursor Key Home
{"OF" , VI_K_END }, // Cursor Key End
{"[A" , VI_K_UP }, // cursor key Up
{"[B" , VI_K_DOWN }, // cursor key Down
{"[C" , VI_K_RIGHT }, // Cursor Key Right
{"[D" , VI_K_LEFT }, // cursor key Left
{"[H" , VI_K_HOME }, // Cursor Key Home
{"[F" , VI_K_END }, // Cursor Key End
{"[1~" , VI_K_HOME }, // Cursor Key Home
{"[2~" , VI_K_INSERT }, // Cursor Key Insert
{"[3~" , VI_K_DELETE }, // Cursor Key Delete
{"[4~" , VI_K_END }, // Cursor Key End
{"[5~" , VI_K_PAGEUP }, // Cursor Key Page Up
{"[6~" , VI_K_PAGEDOWN}, // Cursor Key Page Down
{"OP" , VI_K_FUN1 }, // Function Key F1
{"OQ" , VI_K_FUN2 }, // Function Key F2
{"OR" , VI_K_FUN3 }, // Function Key F3
{"OS" , VI_K_FUN4 }, // Function Key F4
// careful: these have no terminating NUL!
{"[11~", VI_K_FUN1 }, // Function Key F1
{"[12~", VI_K_FUN2 }, // Function Key F2
{"[13~", VI_K_FUN3 }, // Function Key F3
{"[14~", VI_K_FUN4 }, // Function Key F4
{"[15~", VI_K_FUN5 }, // Function Key F5
{"[17~", VI_K_FUN6 }, // Function Key F6
{"[18~", VI_K_FUN7 }, // Function Key F7
{"[19~", VI_K_FUN8 }, // Function Key F8
{"[20~", VI_K_FUN9 }, // Function Key F9
{"[21~", VI_K_FUN10 }, // Function Key F10
{"[23~", VI_K_FUN11 }, // Function Key F11
{"[24~", VI_K_FUN12 }, // Function Key F12
};
enum { ESCCMDS_COUNT = ARRAY_SIZE(esccmds) };
int c;
fflush(stdout);
n = chars_to_parse;
// get input from User- are there already input chars in Q?
if (n <= 0) {
// the Q is empty, wait for a typed char
n = safe_read(STDIN_FILENO, readbuffer, sizeof(readbuffer));
if (n < 0) {
if (errno == EBADF || errno == EFAULT || errno == EINVAL
|| errno == EIO)
editing = 0; // want to exit
errno = 0;
}
if (n <= 0)
return 0; // error
if (readbuffer[0] == 27) {
// This is an ESC char. Is this Esc sequence?
// Could be bare Esc key. See if there are any
// more chars to read after the ESC. This would
// be a Function or Cursor Key sequence.
struct pollfd pfd[1];
pfd[0].fd = 0;
pfd[0].events = POLLIN;
// keep reading while there are input chars, and room in buffer
// for a complete ESC sequence (assuming 8 chars is enough)
while ((safe_poll(pfd, 1, 0) > 0)
&& ((size_t)n <= (sizeof(readbuffer) - 8))
) {
// read the rest of the ESC string
int r = safe_read(STDIN_FILENO, readbuffer + n, sizeof(readbuffer) - n);
if (r > 0)
n += r;
}
}
chars_to_parse = n;
c = read_key(STDIN_FILENO, &chars_to_parse, readbuffer);
if (c == -1) { // EOF/error
go_bottom_and_clear_to_eol();
cookmode(); // terminal to "cooked"
bb_error_msg_and_die("can't read user input");
}
c = readbuffer[0];
if (c == 27 && n > 1) {
// Maybe cursor or function key?
const struct esc_cmds *eindex;
for (eindex = esccmds; eindex < &esccmds[ESCCMDS_COUNT]; eindex++) {
int cnt = strnlen(eindex->seq, 4);
if (n <= cnt)
continue;
if (strncmp(eindex->seq, readbuffer + 1, cnt) != 0)
continue;
c = eindex->val; // magic char value
n = cnt + 1; // squeeze out the ESC sequence
goto found;
}
// defined ESC sequence not found
}
n = 1;
found:
// remove key sequence from Q
chars_to_parse -= n;
memmove(readbuffer, readbuffer + n, sizeof(readbuffer) - n);
return c;
}
//----- IO Routines --------------------------------------------
static char get_one_char(void)
static int get_one_char(void)
{
char c;
int c;
#if ENABLE_FEATURE_VI_DOT_CMD
if (!adding2q) {
@@ -2319,7 +2200,8 @@ static char get_one_char(void)
c = readit(); // get the users input
} else {
// there is a queue to get chars from first
c = *ioq++;
// careful with correct sign expansion!
c = (unsigned char)*ioq++;
if (c == '\0') {
// the end of the q, read from STDIN
free(ioq_start);
@@ -2349,13 +2231,12 @@ static char *get_input_line(const char *prompt)
// char [MAX_INPUT_LEN]
#define buf get_input_line__buf
char c;
int c;
int i;
strcpy(buf, prompt);
last_status_cksum = 0; // force status update
place_cursor(rows - 1, 0, FALSE); // go to Status line, bottom of screen
clear_to_eol(); // clear the line
go_bottom_and_clear_to_eol();
write1(prompt); // write out the :, /, or ? prompt
i = strlen(buf);
@@ -2369,7 +2250,8 @@ static char *get_input_line(const char *prompt)
write1("\b \b"); // erase char on screen
if (i <= 0) // user backs up before b-o-l, exit
break;
} else {
} else if (c > 0 && c < 256) { // exclude Unicode
// (TODO: need to handle Unicode)
buf[i] = c;
buf[++i] = '\0';
bb_putchar(c);
@@ -2559,6 +2441,12 @@ static void clear_to_eol(void)
write1(Ceol); // Erase from cursor to end of line
}
static void go_bottom_and_clear_to_eol(void)
{
place_cursor(rows - 1, 0, FALSE); // go to bottom of screen
clear_to_eol(); // erase to end of line
}
//----- Erase from cursor to end of screen -----------------------
static void clear_to_eos(void)
{
@@ -2630,9 +2518,8 @@ static void show_status_line(void)
}
if (have_status_msg || ((cnt > 0 && last_status_cksum != cksum))) {
last_status_cksum = cksum; // remember if we have seen this line
place_cursor(rows - 1, 0, FALSE); // put cursor on status line
go_bottom_and_clear_to_eol();
write1(status_buffer);
clear_to_eol();
if (have_status_msg) {
if (((int)strlen(status_buffer) - (have_status_msg - 1)) >
(columns - 1) ) {
@@ -2967,13 +2854,14 @@ static void refresh(int full_screen)
//---------------------------------------------------------------------
//----- Execute a Vi Command -----------------------------------
static void do_cmd(char c)
static void do_cmd(int c)
{
const char *msg = msg; // for compiler
char c1, *p, *q, *save_dot;
char *p, *q, *save_dot;
char buf[12];
int dir = dir; // for compiler
int dir;
int cnt, i, j;
int c1;
// c1 = c; // quiet the compiler
// cnt = yf = 0; // quiet the compiler
@@ -2984,20 +2872,21 @@ static void do_cmd(char c)
/* if this is a cursor key, skip these checks */
switch (c) {
case VI_K_UP:
case VI_K_DOWN:
case VI_K_LEFT:
case VI_K_RIGHT:
case VI_K_HOME:
case VI_K_END:
case VI_K_PAGEUP:
case VI_K_PAGEDOWN:
case KEYCODE_UP:
case KEYCODE_DOWN:
case KEYCODE_LEFT:
case KEYCODE_RIGHT:
case KEYCODE_HOME:
case KEYCODE_END:
case KEYCODE_PAGEUP:
case KEYCODE_PAGEDOWN:
case KEYCODE_DELETE:
goto key_cmd_mode;
}
if (cmd_mode == 2) {
// flip-flop Insert/Replace mode
if (c == VI_K_INSERT)
if (c == KEYCODE_INSERT)
goto dc_i;
// we are 'R'eplacing the current *dot with new char
if (*dot == '\n') {
@@ -3014,7 +2903,7 @@ static void do_cmd(char c)
}
if (cmd_mode == 1) {
// hitting "Insert" twice means "R" replace mode
if (c == VI_K_INSERT) goto dc5;
if (c == KEYCODE_INSERT) goto dc5;
// insert the char c at "dot"
if (1 <= c || Isprint(c)) {
dot = char_insert(dot, c);
@@ -3078,7 +2967,7 @@ static void do_cmd(char c)
case 0x00: // nul- ignore
break;
case 2: // ctrl-B scroll up full screen
case VI_K_PAGEUP: // Cursor Key Page Up
case KEYCODE_PAGEUP: // Cursor Key Page Up
dot_scroll(rows - 2, -1);
break;
case 4: // ctrl-D scroll down half screen
@@ -3088,14 +2977,14 @@ static void do_cmd(char c)
dot_scroll(1, 1);
break;
case 6: // ctrl-F scroll down full screen
case VI_K_PAGEDOWN: // Cursor Key Page Down
case KEYCODE_PAGEDOWN: // Cursor Key Page Down
dot_scroll(rows - 2, 1);
break;
case 7: // ctrl-G show current status
last_status_cksum = 0; // force status update
break;
case 'h': // h- move left
case VI_K_LEFT: // cursor key Left
case KEYCODE_LEFT: // cursor key Left
case 8: // ctrl-H- move left (This may be ERASE char)
case 0x7f: // DEL- move left (This may be ERASE char)
if (cmdcnt-- > 1) {
@@ -3105,7 +2994,7 @@ static void do_cmd(char c)
break;
case 10: // Newline ^J
case 'j': // j- goto next line, same col
case VI_K_DOWN: // cursor key Down
case KEYCODE_DOWN: // cursor key Down
if (cmdcnt-- > 1) {
do_cmd(c);
} // repeat cnt
@@ -3144,7 +3033,7 @@ static void do_cmd(char c)
break;
case ' ': // move right
case 'l': // move right
case VI_K_RIGHT: // Cursor Key Right
case KEYCODE_RIGHT: // Cursor Key Right
if (cmdcnt-- > 1) {
do_cmd(c);
} // repeat cnt
@@ -3152,21 +3041,18 @@ static void do_cmd(char c)
break;
#if ENABLE_FEATURE_VI_YANKMARK
case '"': // "- name a register to use for Delete/Yank
c1 = get_one_char();
c1 = tolower(c1);
if (islower(c1)) {
YDreg = c1 - 'a';
c1 = (get_one_char() | 0x20) - 'a'; // | 0x20 is tolower()
if ((unsigned)c1 <= 25) { // a-z?
YDreg = c1;
} else {
indicate_error(c);
}
break;
case '\'': // '- goto a specific mark
c1 = get_one_char();
c1 = tolower(c1);
if (islower(c1)) {
c1 = c1 - 'a';
c1 = (get_one_char() | 0x20) - 'a';
if ((unsigned)c1 <= 25) { // a-z?
// get the b-o-l
q = mark[(unsigned char) c1];
q = mark[c1];
if (text <= q && q < end) {
dot = q;
dot_begin(); // go to B-o-l
@@ -3185,12 +3071,10 @@ static void do_cmd(char c)
// between text[0] and dot then this mark will not point to the
// correct location! It could be off by many lines!
// Well..., at least its quick and dirty.
c1 = get_one_char();
c1 = tolower(c1);
if (islower(c1)) {
c1 = c1 - 'a';
c1 = (get_one_char() | 0x20) - 'a';
if ((unsigned)c1 <= 25) { // a-z?
// remember the line
mark[(int) c1] = dot;
mark[c1] = dot;
} else {
indicate_error(c);
}
@@ -3234,7 +3118,7 @@ static void do_cmd(char c)
break;
#endif /* FEATURE_VI_YANKMARK */
case '$': // $- goto end of line
case VI_K_END: // Cursor Key End
case KEYCODE_END: // Cursor Key End
if (cmdcnt-- > 1) {
do_cmd(c);
} // repeat cnt
@@ -3314,7 +3198,7 @@ static void do_cmd(char c)
q = get_input_line(buf); // get input line- use "status line"
if (q[0] && !q[1]) {
if (last_search_pattern[0])
last_search_pattern[0] = c;
last_search_pattern[0] = c;
goto dc3; // if no pat re-use old pat
}
if (q[0]) { // strlen(q) > 1: new pat- save it and find
@@ -3344,14 +3228,8 @@ static void do_cmd(char c)
do_cmd(c);
} // repeat cnt
dc3:
if (last_search_pattern == 0) {
msg = "No previous regular expression";
goto dc2;
}
if (last_search_pattern[0] == '/') {
dir = FORWARD; // assume FORWARD search
p = dot + 1;
}
dir = FORWARD; // assume FORWARD search
p = dot + 1;
if (last_search_pattern[0] == '?') {
dir = BACK;
p = dot - 1;
@@ -3525,12 +3403,11 @@ static void do_cmd(char c)
end_cmd_q(); // stop adding to q
#endif
break;
case 'g': // 'gg' goto a line number (from vim)
// (default to first line in file)
case 'g': // 'gg' goto a line number (vim) (default: very first line)
c1 = get_one_char();
if (c1 != 'g') {
buf[0] = 'g';
buf[1] = c1;
buf[1] = c1; // TODO: if Unicode?
buf[2] = '\0';
not_implemented(buf);
break;
@@ -3560,7 +3437,7 @@ static void do_cmd(char c)
dot_skip_over_ws();
//**** fall through to ... 'i'
case 'i': // i- insert before current char
case VI_K_INSERT: // Cursor Key Insert
case KEYCODE_INSERT: // Cursor Key Insert
dc_i:
cmd_mode = 1; // start insrting
break;
@@ -3613,7 +3490,7 @@ static void do_cmd(char c)
dc5:
cmd_mode = 2;
break;
case VI_K_DELETE:
case KEYCODE_DELETE:
c = 'x';
// fall through
case 'X': // X- delete char before dot
@@ -3687,7 +3564,7 @@ static void do_cmd(char c)
case 'y': // y- yank something
case 'Y': // Y- Yank a line
#endif
{
{
int yf, ml, whole = 0;
yf = YANKDEL; // assume either "c" or "d"
#if ENABLE_FEATURE_VI_YANKMARK
@@ -3760,10 +3637,10 @@ static void do_cmd(char c)
#endif
end_cmd_q(); // stop adding to q
}
}
break;
}
case 'k': // k- goto prev line, same col
case VI_K_UP: // cursor key Up
case KEYCODE_UP: // cursor key Up
if (cmdcnt-- > 1) {
do_cmd(c);
} // repeat cnt
@@ -3783,7 +3660,7 @@ static void do_cmd(char c)
do_cmd(';');
if (*dot == last_forward_char)
dot_left();
last_forward_char= 0;
last_forward_char = 0;
break;
case 'w': // w- forward a word
if (cmdcnt-- > 1) {
@@ -3828,23 +3705,25 @@ static void do_cmd(char c)
end_cmd_q(); // stop adding to q
break;
//----- The Cursor and Function Keys -----------------------------
case VI_K_HOME: // Cursor Key Home
case KEYCODE_HOME: // Cursor Key Home
dot_begin();
break;
// The Fn keys could point to do_macro which could translate them
case VI_K_FUN1: // Function Key F1
case VI_K_FUN2: // Function Key F2
case VI_K_FUN3: // Function Key F3
case VI_K_FUN4: // Function Key F4
case VI_K_FUN5: // Function Key F5
case VI_K_FUN6: // Function Key F6
case VI_K_FUN7: // Function Key F7
case VI_K_FUN8: // Function Key F8
case VI_K_FUN9: // Function Key F9
case VI_K_FUN10: // Function Key F10
case VI_K_FUN11: // Function Key F11
case VI_K_FUN12: // Function Key F12
#if 0
case KEYCODE_FUN1: // Function Key F1
case KEYCODE_FUN2: // Function Key F2
case KEYCODE_FUN3: // Function Key F3
case KEYCODE_FUN4: // Function Key F4
case KEYCODE_FUN5: // Function Key F5
case KEYCODE_FUN6: // Function Key F6
case KEYCODE_FUN7: // Function Key F7
case KEYCODE_FUN8: // Function Key F8
case KEYCODE_FUN9: // Function Key F9
case KEYCODE_FUN10: // Function Key F10
case KEYCODE_FUN11: // Function Key F11
case KEYCODE_FUN12: // Function Key F12
break;
#endif
}
dc1:
+1 -1
View File
@@ -146,7 +146,7 @@ config FEATURE_FIND_DELETE
default n
depends on FIND && FEATURE_FIND_DEPTH
help
Support the 'find -delete' option for deleting files and direcotries.
Support the 'find -delete' option for deleting files and directories.
WARNING: This option can do much harm if used wrong. Busybox will not
try to protect the user from doing stupid things. Use with care.
+47 -3
View File
@@ -87,7 +87,11 @@ enum {
struct globals {
int max_matches;
#if !ENABLE_EXTRA_COMPAT
int reflags;
#else
RE_TRANSLATE_TYPE case_fold; /* RE_TRANSLATE_TYPE is [[un]signed] char* */
#endif
smalluint invert_search;
smalluint print_filename;
smalluint open_errors;
@@ -110,7 +114,19 @@ struct globals {
}; \
} while (0)
#define max_matches (G.max_matches )
#if !ENABLE_EXTRA_COMPAT
#define reflags (G.reflags )
#else
#define case_fold (G.case_fold )
/* http://www.delorie.com/gnu/docs/regex/regex_46.html */
#define reflags re_syntax_options
#undef REG_NOSUB
#undef REG_EXTENDED
#undef REG_ICASE
#define REG_NOSUB bug:is:here /* should not be used */
#define REG_EXTENDED RE_SYNTAX_EGREP
#define REG_ICASE bug:is:here /* should not be used */
#endif
#define invert_search (G.invert_search )
#define print_filename (G.print_filename )
#define open_errors (G.open_errors )
@@ -240,6 +256,7 @@ static int grep_file(FILE *file)
xregcomp(&gl->compiled_regex, gl->pattern, reflags);
#else
memset(&gl->compiled_regex, 0, sizeof(gl->compiled_regex));
gl->compiled_regex.translate = case_fold; /* for -i */
if (re_compile_pattern(gl->pattern, strlen(gl->pattern), &gl->compiled_regex))
bb_error_msg_and_die("bad regex '%s'", gl->pattern);
#endif
@@ -346,12 +363,22 @@ static int grep_file(FILE *file)
* (unless -v: -Fov doesnt print anything at all) */
if (found)
print_line(gl->pattern, strlen(gl->pattern), linenum, ':');
} else {
} else while (1) {
char old = line[gl->matched_range.rm_eo];
line[gl->matched_range.rm_eo] = '\0';
print_line(line + gl->matched_range.rm_so,
gl->matched_range.rm_eo - gl->matched_range.rm_so,
linenum, ':');
}
line[gl->matched_range.rm_eo] = old;
#if !ENABLE_EXTRA_COMPAT
break;
#else
if (re_search(&gl->compiled_regex, line, line_len,
gl->matched_range.rm_eo, line_len - gl->matched_range.rm_eo,
&gl->matched_range) < 0)
break;
#endif
}
} else {
print_line(line, line_len, linenum, ':');
}
@@ -532,17 +559,34 @@ int grep_main(int argc, char **argv)
if (ENABLE_FEATURE_GREP_FGREP_ALIAS && applet_name[0] == 'f')
option_mask32 |= OPT_F;
#if !ENABLE_EXTRA_COMPAT
if (!(option_mask32 & (OPT_o | OPT_w)))
reflags = REG_NOSUB;
#endif
if (ENABLE_FEATURE_GREP_EGREP_ALIAS
&& (applet_name[0] == 'e' || (option_mask32 & OPT_E))
) {
reflags |= REG_EXTENDED;
}
#if ENABLE_EXTRA_COMPAT
else {
reflags = RE_SYNTAX_GREP;
}
#endif
if (option_mask32 & OPT_i)
if (option_mask32 & OPT_i) {
#if !ENABLE_EXTRA_COMPAT
reflags |= REG_ICASE;
#else
int i;
case_fold = xmalloc(256);
for (i = 0; i < 256; i++)
case_fold[i] = (unsigned char)i;
for (i = 'a'; i <= 'z'; i++)
case_fold[i] = (unsigned char)(i - ('a' - 'A'));
#endif
}
argv += optind;
argc -= optind;
+10 -5
View File
@@ -80,6 +80,7 @@ USE_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_NEVER, awk))
USE_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_NEVER, basename))
USE_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_NEVER))
//USE_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_BLKID(APPLET(blkid, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_BRCTL(APPLET(brctl, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_BUNZIP2(APPLET(bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER, bzcat))
@@ -118,6 +119,7 @@ USE_DELUSER(APPLET(deluser, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_DEPMOD(APPLET(depmod, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, _BB_DIR_SBIN, _BB_SUID_NEVER, modprobe))
USE_DEVFSD(APPLET(devfsd, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_DEVMEM(APPLET(devmem, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_DF(APPLET(df, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_APP_DHCPRELAY(APPLET(dhcprelay, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_DIFF(APPLET(diff, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
@@ -136,7 +138,7 @@ USE_ECHO(APPLET_NOFORK(echo, echo, _BB_DIR_BIN, _BB_SUID_NEVER, echo))
USE_ED(APPLET(ed, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_FEATURE_GREP_EGREP_ALIAS(APPLET_ODDNAME(egrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER, egrep))
USE_EJECT(APPLET(eject, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_ENV(APPLET(env, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_ENV(APPLET_NOEXEC(env, env, _BB_DIR_USR_BIN, _BB_SUID_NEVER, env))
USE_ENVDIR(APPLET_ODDNAME(envdir, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envdir))
USE_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envuidgid))
USE_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, _BB_DIR_USR_BIN, _BB_SUID_NEVER, ether_wake))
@@ -149,7 +151,6 @@ USE_FBSPLASH(APPLET(fbsplash, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, _BB_DIR_BIN, _BB_SUID_NEVER, fdflush))
USE_FDFORMAT(APPLET(fdformat, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_FDISK(APPLET(fdisk, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_FETCHMAIL(APPLET_ODDNAME(fetchmail, sendgetmail, _BB_DIR_USR_BIN, _BB_SUID_NEVER, fetchmail))
USE_FEATURE_GREP_FGREP_ALIAS(APPLET_ODDNAME(fgrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER, fgrep))
USE_FIND(APPLET_NOEXEC(find, find, _BB_DIR_USR_BIN, _BB_SUID_NEVER, find))
USE_FINDFS(APPLET(findfs, _BB_DIR_SBIN, _BB_SUID_MAYBE))
@@ -171,7 +172,7 @@ USE_GREP(APPLET(grep, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_GUNZIP(APPLET(gunzip, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_GZIP(APPLET(gzip, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_HALT(APPLET(halt, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_HD(APPLET_ODDNAME(hd, hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER, hd))
USE_HD(APPLET_NOEXEC(hd, hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER, hd))
USE_HDPARM(APPLET(hdparm, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_HEAD(APPLET(head, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER, hexdump))
@@ -236,6 +237,7 @@ USE_LSMOD(APPLET(lsmod, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, _BB_DIR_SBIN, _BB_SUID_NEVER, modprobe))
USE_UNLZMA(APPLET_ODDNAME(lzmacat, unlzma, _BB_DIR_USR_BIN, _BB_SUID_NEVER, lzmacat))
USE_MAKEDEVS(APPLET(makedevs, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_MAKEMIME(APPLET(makemime, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_MAN(APPLET(man, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_MATCHPATHCON(APPLET(matchpathcon, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_MD5SUM(APPLET_ODDNAME(md5sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_NEVER, md5sum))
@@ -268,7 +270,7 @@ USE_NOHUP(APPLET(nohup, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_NSLOOKUP(APPLET(nslookup, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_OD(APPLET(od, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_OPENVT(APPLET(openvt, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_PARSE(APPLET(parse, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
//USE_PARSE(APPLET(parse, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_PASSWD(APPLET(passwd, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
USE_PATCH(APPLET(patch, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_PGREP(APPLET(pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
@@ -278,6 +280,7 @@ USE_PING6(APPLET(ping6, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PIPE_PROGRESS(APPLET(pipe_progress, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PIVOT_ROOT(APPLET(pivot_root, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_PKILL(APPLET_ODDNAME(pkill, pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER, pkill))
USE_POPMAILDIR(APPLET(popmaildir, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_HALT(APPLET_ODDNAME(poweroff, halt, _BB_DIR_SBIN, _BB_SUID_NEVER, poweroff))
USE_PRINTENV(APPLET(printenv, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PRINTF(APPLET_NOFORK(printf, printf, _BB_DIR_USR_BIN, _BB_SUID_NEVER, printf))
@@ -292,6 +295,7 @@ USE_READLINK(APPLET(readlink, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_READPROFILE(APPLET(readprofile, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_REALPATH(APPLET(realpath, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_HALT(APPLET_ODDNAME(reboot, halt, _BB_DIR_SBIN, _BB_SUID_NEVER, reboot))
USE_REFORMIME(APPLET(reformime, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_RENICE(APPLET(renice, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_RESET(APPLET(reset, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_RESIZE(APPLET(resize, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
@@ -313,7 +317,7 @@ USE_RX(APPLET(rx, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_SCRIPT(APPLET(script, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_SED(APPLET(sed, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_SELINUXENABLED(APPLET(selinuxenabled, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_SENDMAIL(APPLET_ODDNAME(sendmail, sendgetmail, _BB_DIR_USR_SBIN, _BB_SUID_NEVER, sendmail))
USE_SENDMAIL(APPLET(sendmail, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_SEQ(APPLET_NOFORK(seq, seq, _BB_DIR_USR_BIN, _BB_SUID_NEVER, seq))
USE_SESTATUS(APPLET(sestatus, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_SETARCH(APPLET(setarch, _BB_DIR_BIN, _BB_SUID_NEVER))
@@ -355,6 +359,7 @@ USE_TAC(APPLET_NOEXEC(tac, tac, _BB_DIR_USR_BIN, _BB_SUID_NEVER, tac))
USE_TAIL(APPLET(tail, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_TAR(APPLET(tar, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_TASKSET(APPLET(taskset, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
/* USE_TC(APPLET(tc, _BB_DIR_SBIN, _BB_SUID_NEVER)) */
USE_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, _BB_DIR_USR_BIN, _BB_SUID_NEVER, tcpsvd))
USE_TEE(APPLET(tee, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_TELNET(APPLET(telnet, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
+12 -18
View File
@@ -21,21 +21,17 @@
* POSIX Standard: 9.2.1 Group Database Access <grp.h>
*/
#ifndef _GRP_H
#define _GRP_H 1
#ifndef BB_GRP_H
#define BB_GRP_H 1
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility push(hidden)
#endif
/* The group structure. */
struct group {
char *gr_name; /* Group name. */
char *gr_passwd; /* Password. */
gid_t gr_gid; /* Group ID. */
char **gr_mem; /* Member list. */
};
/* This file is #included after #include <grp.h>
* We will use libc-defined structures, but will #define function names
* so that function calls are directed to bb_internal_XXX replacements
*/
#define setgrent bb_internal_setgrent
#define endgrent bb_internal_endgrent
@@ -53,9 +49,7 @@ struct group {
/* All function names below should be remapped by #defines above
* in order to not collide with libc names.
* In theory it isn't necessary, but I saw weird interactions at link time.
* Let's play safe */
* in order to not collide with libc names. */
/* Rewind the group-file stream. */
@@ -71,14 +65,14 @@ extern struct group *getgrent(void);
extern struct group *fgetgrent(FILE *__stream);
/* Write the given entry onto the given stream. */
extern int putgrent(__const struct group *__restrict __p,
extern int putgrent(const struct group *__restrict __p,
FILE *__restrict __f);
/* Search for an entry with a matching group ID. */
extern struct group *getgrgid(gid_t __gid);
/* Search for an entry with a matching group name. */
extern struct group *getgrnam(__const char *__name);
extern struct group *getgrnam(const char *__name);
/* Reentrant versions of some of the functions above.
@@ -98,7 +92,7 @@ extern int getgrgid_r(gid_t __gid, struct group *__restrict __resultbuf,
struct group **__restrict __result);
/* Search for an entry with a matching group name. */
extern int getgrnam_r(__const char *__restrict __name,
extern int getgrnam_r(const char *__restrict __name,
struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result);
@@ -113,13 +107,13 @@ extern int fgetgrent_r(FILE *__restrict __stream,
/* Store at most *NGROUPS members of the group set for USER into
*GROUPS. Also include GROUP. The actual number of groups found is
returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */
extern int getgrouplist(__const char *__user, gid_t __group,
extern int getgrouplist(const char *__user, gid_t __group,
gid_t *__groups, int *__ngroups);
/* Initialize the group set for the current user
by reading the group database and using all groups
of which USER is a member. Also include GROUP. */
extern int initgroups(__const char *__user, gid_t __group);
extern int initgroups(const char *__user, gid_t __group);
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility pop
+64 -25
View File
@@ -69,21 +69,15 @@
#include <dmalloc.h>
#endif
#if !ENABLE_USE_BB_PWD_GRP
# include <pwd.h>
# include <grp.h>
#endif
#include <pwd.h>
#include <grp.h>
#if ENABLE_FEATURE_SHADOWPASSWDS
# if !ENABLE_USE_BB_SHADOW
# include <shadow.h>
# endif
# include <shadow.h>
#endif
/* Some libc's forget to declare these, do it ourself */
extern char **environ;
/* Set the group set for the current user to GROUPS (N of them). */
int setgroups(size_t n, const gid_t *groups);
extern char **environ;
#if defined(__GLIBC__) && __GLIBC__ < 2
int vdprintf(int d, const char *format, va_list ap);
#endif
@@ -109,7 +103,7 @@ struct sysinfo {
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20 - 2*sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */
char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */
};
int sysinfo(struct sysinfo* info);
@@ -373,6 +367,9 @@ void sig_unblock(int sig) FAST_FUNC;
int sigaction_set(int sig, const struct sigaction *act) FAST_FUNC;
/* SIG_BLOCK/SIG_UNBLOCK all signals: */
int sigprocmask_allsigs(int how) FAST_FUNC;
/* Standard handler which just records signo */
extern smallint bb_got_signal;
void record_signo(int signo); /* not FAST_FUNC! */
void xsetgid(gid_t gid) FAST_FUNC;
@@ -440,6 +437,7 @@ ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to,
* Turn it on before you call bind(). */
void setsockopt_reuseaddr(int fd) FAST_FUNC; /* On Linux this never fails. */
int setsockopt_broadcast(int fd) FAST_FUNC;
int setsockopt_bindtodevice(int fd, const char *iface) FAST_FUNC;
/* NB: returns port in host byte order */
unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) FAST_FUNC;
typedef struct len_and_sockaddr {
@@ -746,7 +744,7 @@ int bb_execvp(const char *file, char *const argv[]) FAST_FUNC;
pid_t spawn(char **argv) FAST_FUNC;
pid_t xspawn(char **argv) FAST_FUNC;
int safe_waitpid(int pid, int *wstat, int options) FAST_FUNC;
pid_t safe_waitpid(pid_t pid, int *wstat, int options) FAST_FUNC;
/* Unlike waitpid, waits ONLY for one process.
* It's safe to pass negative 'pids' from failed [v]fork -
* wait4pid will return -1 (and will not clobber [v]fork's errno).
@@ -754,14 +752,14 @@ int safe_waitpid(int pid, int *wstat, int options) FAST_FUNC;
* if (rc < 0) bb_perror_msg("%s", argv[0]);
* if (rc > 0) bb_error_msg("exit code: %d", rc);
*/
int wait4pid(int pid) FAST_FUNC;
int wait_any_nohang(int *wstat) FAST_FUNC;
int wait4pid(pid_t pid) FAST_FUNC;
pid_t wait_any_nohang(int *wstat) FAST_FUNC;
#define wait_crashed(w) ((w) & 127)
#define wait_exitcode(w) ((w) >> 8)
#define wait_stopsig(w) ((w) >> 8)
#define wait_stopped(w) (((w) & 127) == 127)
/* wait4pid(spawn(argv)) + NOFORK/NOEXEC (if configured) */
int spawn_and_wait(char **argv) FAST_FUNC;
pid_t spawn_and_wait(char **argv) FAST_FUNC;
struct nofork_save_area {
jmp_buf die_jmp;
const char *applet_name;
@@ -792,7 +790,7 @@ int run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **
*
* forkexit_or_rexec(argv) = bare-bones "fork + parent exits" on MMU,
* "vfork + re-exec ourself" on NOMMU. No fd redirection, no setsid().
* Currently used for openvt and setsid. On MMU ignores argv.
* Currently used for setsid only. On MMU ignores argv.
*
* Helper for network daemons in foreground mode:
*
@@ -915,15 +913,47 @@ int chown_main(int argc, char **argv) USE_CHOWN(MAIN_EXTERNALLY_VISIBLE);
/* Don't need USE_xxx() guard for these */
int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int bbunpack(char **argv,
char* (*make_new_name)(char *filename),
USE_DESKTOP(long long) int (*unpacker)(void)
) FAST_FUNC;
#if ENABLE_ROUTE
void bb_displayroutes(int noresolve, int netstatfmt) FAST_FUNC;
#endif
/* "Keycodes" that report an escape sequence.
* We use something which fits into signed char,
* yet doesn't represent any valid Unicode characher.
* Also, -1 is reserved for error indication and we don't use it. */
enum {
KEYCODE_UP = -2,
KEYCODE_DOWN = -3,
KEYCODE_RIGHT = -4,
KEYCODE_LEFT = -5,
KEYCODE_HOME = -6,
KEYCODE_END = -7,
KEYCODE_INSERT = -8,
KEYCODE_DELETE = -9,
KEYCODE_PAGEUP = -10,
KEYCODE_PAGEDOWN = -11,
#if 0
KEYCODE_FUN1 = -12,
KEYCODE_FUN2 = -13,
KEYCODE_FUN3 = -14,
KEYCODE_FUN4 = -15,
KEYCODE_FUN5 = -16,
KEYCODE_FUN6 = -17,
KEYCODE_FUN7 = -18,
KEYCODE_FUN8 = -19,
KEYCODE_FUN9 = -20,
KEYCODE_FUN10 = -21,
KEYCODE_FUN11 = -22,
KEYCODE_FUN12 = -23,
#endif
/* How long the longest ESC sequence we know? */
KEYCODE_BUFFER_SIZE = 4
};
int read_key(int fd, smalluint *nbuffered, char *buffer) FAST_FUNC;
/* Networking */
int create_icmp_socket(void) FAST_FUNC;
int create_icmp6_socket(void) FAST_FUNC;
@@ -1008,7 +1038,7 @@ enum {
PARSE_GREEDY = 0x00040000, // last token takes entire remainder of the line
PARSE_MIN_DIE = 0x00100000, // die if < min tokens found
// keep a copy of current line
PARSE_KEEP_COPY = 0x00200000 * ENABLE_DEBUG_CROND_OPTION,
PARSE_KEEP_COPY = 0x00200000 * ENABLE_FEATURE_CROND_D,
// PARSE_ESCAPE = 0x00400000, // process escape sequences in tokens
// NORMAL is:
// * remove leading and trailing delimiters and collapse
@@ -1113,6 +1143,8 @@ extern void print_login_prompt(void) FAST_FUNC;
/* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */
int get_terminal_width_height(int fd, unsigned *width, unsigned *height) FAST_FUNC;
int tcsetattr_stdin_TCSANOW(const struct termios *tp) FAST_FUNC;
/* NB: "unsigned request" is crucial! "int request" will break some arches! */
int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC;
int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC;
@@ -1222,6 +1254,9 @@ typedef struct procps_status_t {
* by link target or interpreter name) */
char comm[COMM_LEN];
/* user/group? - use passwd/group parsing functions */
#if ENABLE_FEATURE_TOP_SMP_PROCESS
int last_seen_on_cpu;
#endif
} procps_status_t;
enum {
PSSCAN_PID = 1 << 0,
@@ -1243,12 +1278,16 @@ enum {
PSSCAN_ARGVN = (1 << 16) * (ENABLE_PGREP || ENABLE_PKILL || ENABLE_PIDOF),
USE_SELINUX(PSSCAN_CONTEXT = 1 << 17,)
PSSCAN_START_TIME = 1 << 18,
PSSCAN_CPU = 1 << 19,
/* These are all retrieved from proc/NN/stat in one go: */
PSSCAN_STAT = PSSCAN_PPID | PSSCAN_PGID | PSSCAN_SID
| PSSCAN_COMM | PSSCAN_STATE
| PSSCAN_VSZ | PSSCAN_RSS
| PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME
| PSSCAN_TTY,
/**/ | PSSCAN_COMM | PSSCAN_STATE
/**/ | PSSCAN_VSZ | PSSCAN_RSS
/**/ | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME
/**/ | PSSCAN_TTY
#if ENABLE_FEATURE_TOP_SMP_PROCESS
/**/ | PSSCAN_CPU
#endif
};
//procps_status_t* alloc_procps_scan(void) FAST_FUNC;
void free_procps_scan(procps_status_t* sp) FAST_FUNC;
+2 -1
View File
@@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
Copyright 2006, Bernhard Fischer
Copyright 2006, Bernhard Reutner-Fischer
Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
@@ -132,6 +132,7 @@
# define BB_LITTLE_ENDIAN 1
#endif
/* SWAP_LEnn means "convert CPU<->little_endian by swapping bytes" */
#if BB_BIG_ENDIAN
#define SWAP_BE16(x) (x)
#define SWAP_BE32(x) (x)
+12 -21
View File
@@ -21,24 +21,17 @@
* POSIX Standard: 9.2.2 User Database Access <pwd.h>
*/
#ifndef _PWD_H
#define _PWD_H 1
#ifndef BB_PWD_H
#define BB_PWD_H 1
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility push(hidden)
#endif
/* The passwd structure. */
struct passwd {
char *pw_name; /* Username. */
char *pw_passwd; /* Password. */
uid_t pw_uid; /* User ID. */
gid_t pw_gid; /* Group ID. */
char *pw_gecos; /* Real name. */
char *pw_dir; /* Home directory. */
char *pw_shell; /* Shell program. */
};
/* This file is #included after #include <pwd.h>
* We will use libc-defined structures, but will #define function names
* so that function calls are directed to bb_internal_XXX replacements
*/
#define setpwent bb_internal_setpwent
#define endpwent bb_internal_endpwent
@@ -51,13 +44,11 @@ struct passwd {
#define getpwuid_r bb_internal_getpwuid_r
#define getpwnam_r bb_internal_getpwnam_r
#define fgetpwent_r bb_internal_fgetpwent_r
#define getpw bb_internal_getpw
//#define getpw bb_internal_getpw
/* All function names below should be remapped by #defines above
* in order to not collide with libc names.
* In theory it isn't necessary, but I saw weird interactions at link time.
* Let's play safe */
* in order to not collide with libc names. */
/* Rewind the password-file stream. */
@@ -73,14 +64,14 @@ extern struct passwd *getpwent(void);
extern struct passwd *fgetpwent(FILE *__stream);
/* Write the given entry onto the given stream. */
extern int putpwent(__const struct passwd *__restrict __p,
extern int putpwent(const struct passwd *__restrict __p,
FILE *__restrict __f);
/* Search for an entry with a matching user ID. */
extern struct passwd *getpwuid(uid_t __uid);
/* Search for an entry with a matching username. */
extern struct passwd *getpwnam(__const char *__name);
extern struct passwd *getpwnam(const char *__name);
/* Reentrant versions of some of the functions above.
@@ -99,7 +90,7 @@ extern int getpwuid_r(uid_t __uid,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result);
extern int getpwnam_r(__const char *__restrict __name,
extern int getpwnam_r(const char *__restrict __name,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result);
@@ -114,7 +105,7 @@ extern int fgetpwent_r(FILE *__restrict __stream,
/* Re-construct the password-file line for the given uid
in the given buffer. This knows the format that the caller
will expect, but this need not be the format of the password file. */
extern int getpw(uid_t __uid, char *__buffer);
/* UNUSED extern int getpw(uid_t __uid, char *__buffer); */
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility pop
+2 -2
View File
@@ -4,8 +4,8 @@
* Licensed under the GPL-2 or later.
*/
#ifndef _BB_RTC_H_
#define _BB_RTC_H_
#ifndef BB_RTC_H
#define BB_RTC_H
#include "libbb.h"
+13 -24
View File
@@ -19,32 +19,23 @@
/* Declaration of types and functions for shadow password suite */
#ifndef _SHADOW_H
#define _SHADOW_H 1
#ifndef BB_SHADOW_H
#define BB_SHADOW_H 1
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility push(hidden)
#endif
/* This file is #included after #include <shadow.h>
* We will use libc-defined structures, but will #define function names
* so that function calls are directed to bb_internal_XXX replacements
*/
/* Paths to the user database files */
#ifndef _PATH_SHADOW
#define _PATH_SHADOW "/etc/shadow"
#endif
/* Structure of the password file */
struct spwd {
char *sp_namp; /* Login name */
char *sp_pwdp; /* Encrypted password */
long sp_lstchg; /* Date of last change */
long sp_min; /* Minimum number of days between changes */
long sp_max; /* Maximum number of days between changes */
long sp_warn; /* Number of days to warn user to change the password */
long sp_inact; /* Number of days the account may be inactive */
long sp_expire; /* Number of days since 1970-01-01 until account expires */
unsigned long sp_flag; /* Reserved */
};
#define setspent bb_internal_setspent
#define endspent bb_internal_endspent
#define getspent bb_internal_getspent
@@ -61,9 +52,7 @@ struct spwd {
/* All function names below should be remapped by #defines above
* in order to not collide with libc names.
* In theory it isn't necessary, but I saw weird interactions at link time.
* Let's play safe */
* in order to not collide with libc names. */
/* Open database for reading */
@@ -76,26 +65,26 @@ extern void endspent(void);
extern struct spwd *getspent(void);
/* Get shadow entry matching NAME */
extern struct spwd *getspnam(__const char *__name);
extern struct spwd *getspnam(const char *__name);
/* Read shadow entry from STRING */
extern struct spwd *sgetspent(__const char *__string);
extern struct spwd *sgetspent(const char *__string);
/* Read next shadow entry from STREAM */
extern struct spwd *fgetspent(FILE *__stream);
/* Write line containing shadow password entry to stream */
extern int putspent(__const struct spwd *__p, FILE *__stream);
extern int putspent(const struct spwd *__p, FILE *__stream);
/* Reentrant versions of some of the functions above */
extern int getspent_r(struct spwd *__result_buf, char *__buffer,
size_t __buflen, struct spwd **__result);
extern int getspnam_r(__const char *__name, struct spwd *__result_buf,
extern int getspnam_r(const char *__name, struct spwd *__result_buf,
char *__buffer, size_t __buflen,
struct spwd **__result);
extern int sgetspent_r(__const char *__string, struct spwd *__result_buf,
extern int sgetspent_r(const char *__string, struct spwd *__result_buf,
char *__buffer, size_t __buflen,
struct spwd **__result);
+11
View File
@@ -77,6 +77,12 @@ typedef struct archive_handle_t {
} archive_handle_t;
/* Info struct unpackers can fill out to inform users of thing like
* timestamps of unpacked files */
typedef struct unpack_info_t {
time_t mtime;
} unpack_info_t;
extern archive_handle_t *init_handle(void) FAST_FUNC;
extern char filter_accept_all(archive_handle_t *archive_handle) FAST_FUNC;
@@ -126,10 +132,15 @@ USE_DESKTOP(long long) int unpack_lzma_stream(int src_fd, int dst_fd) FAST_FUNC;
/* the rest wants 2 first bytes already skipped by the caller */
USE_DESKTOP(long long) int unpack_bz2_stream(int src_fd, int dst_fd) FAST_FUNC;
USE_DESKTOP(long long) int unpack_gz_stream(int src_fd, int dst_fd) FAST_FUNC;
USE_DESKTOP(long long) int unpack_gz_stream_with_info(int src_fd, int dst_fd, unpack_info_t *info) FAST_FUNC;
USE_DESKTOP(long long) int unpack_Z_stream(int fd_in, int fd_out) FAST_FUNC;
/* wrapper which checks first two bytes to be "BZ" */
USE_DESKTOP(long long) int unpack_bz2_stream_prime(int src_fd, int dst_fd) FAST_FUNC;
int bbunpack(char **argv,
char* (*make_new_name)(char *filename),
USE_DESKTOP(long long) int (*unpacker)(unpack_info_t *info)) FAST_FUNC;
#if BB_MMU
void open_transformer(int fd,
USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd)) FAST_FUNC;
+234 -109
View File
@@ -535,13 +535,13 @@
"\n F Input from file" \
#define crond_trivial_usage \
"-fbS -l N " USE_DEBUG_CROND_OPTION("-d N ") "-L LOGFILE -c DIR"
"-fbS -l N " USE_FEATURE_CROND_D("-d N ") "-L LOGFILE -c DIR"
#define crond_full_usage "\n\n" \
" -f Foreground" \
"\n -b Background (default)" \
"\n -S Log to syslog (default)" \
"\n -l Set log level. 0 is the most verbose, default 8" \
USE_DEBUG_CROND_OPTION( \
USE_FEATURE_CROND_D( \
"\n -d Set log level, log to stderr" \
) \
"\n -L Log to file" \
@@ -690,6 +690,15 @@
#define depmod_trivial_usage NOUSAGE_STR
#define depmod_full_usage ""
#define devmem_trivial_usage \
"ADDRESS [WIDTH [VALUE]]"
#define devmem_full_usage "\n\n" \
"Read/write from physical address\n" \
"\n ADDRESS Address to act upon" \
"\n WIDTH Width (8/16/...)" \
"\n VALUE Data to be written" \
#define devfsd_trivial_usage \
"mntpnt [-v]" USE_DEVFSD_FG_NP("[-fg][-np]")
#define devfsd_full_usage "\n\n" \
@@ -705,36 +714,40 @@
"\n do not poll for events" \
)
/* -k is accepted but ignored for !HUMAN_READABLE,
* but we won't mention this (unimportant) */
#if ENABLE_FEATURE_HUMAN_READABLE || ENABLE_FEATURE_DF_INODE
#define DF_HAS_OPTIONS(x) x
#else
#define DF_HAS_OPTIONS(x)
#endif
#define df_trivial_usage \
DF_HAS_OPTIONS("[-") \
USE_FEATURE_HUMAN_READABLE("hmk") USE_FEATURE_DF_INODE("i") \
DF_HAS_OPTIONS("] ") "[FILESYSTEM...]"
"[-Pk" \
USE_FEATURE_HUMAN_READABLE("mh") \
USE_FEATURE_DF_FANCY("ai] [-B SIZE") \
"] [FILESYSTEM...]"
#define df_full_usage "\n\n" \
"Print filesystem usage statistics\n" \
DF_HAS_OPTIONS("\nOptions:") \
"\nOptions:" \
"\n -P POSIX output format" \
"\n -k 1024-byte blocks (default)" \
USE_FEATURE_HUMAN_READABLE( \
"\n -m 1M-byte blocks" \
"\n -h Human readable (e.g. 1K 243M 2G)" \
"\n -m 1024*1024 blocks" \
"\n -k 1024 blocks" \
) \
USE_FEATURE_DF_INODE( \
USE_FEATURE_DF_FANCY( \
"\n -a Show all filesystems" \
"\n -i Inodes" \
)
"\n -B SIZE Blocksize" \
) \
#define df_example_usage \
"$ df\n" \
"Filesystem 1k-blocks Used Available Use% Mounted on\n" \
"Filesystem 1K-blocks Used Available Use% Mounted on\n" \
"/dev/sda3 8690864 8553540 137324 98% /\n" \
"/dev/sda1 64216 36364 27852 57% /boot\n" \
"$ df /dev/sda3\n" \
"Filesystem 1k-blocks Used Available Use% Mounted on\n" \
"/dev/sda3 8690864 8553540 137324 98% /\n"
"Filesystem 1K-blocks Used Available Use% Mounted on\n" \
"/dev/sda3 8690864 8553540 137324 98% /\n" \
"$ POSIXLY_CORRECT=sure df /dev/sda3\n" \
"Filesystem 512B-blocks Used Available Use% Mounted on\n" \
"/dev/sda3 17381728 17107080 274648 98% /\n" \
"$ POSIXLY_CORRECT=yep df -P /dev/sda3\n" \
"Filesystem 512-blocks Used Available Capacity Mounted on\n" \
"/dev/sda3 17381728 17107080 274648 98% /\n"
#define dhcprelay_trivial_usage \
"[client1,client2,...] [server_device]"
@@ -1082,17 +1095,10 @@
"\n -H HEADS\n" \
"\n -S SECTORS" \
#define fetchmail_trivial_usage \
"[-w timeout] [-H [user:pass@]server[:port]] [-S] [-t] [-z] maildir [prog]"
#define fetchmail_full_usage "\n\n" \
"Fetch content of remote mailbox to local maildir\n" \
"\nOptions:" \
"\n -w timeout Network timeout" \
"\n -H [user:pass@]server[:port] Server" \
"\n -S Use openssl connection helper for secure servers" \
"\n -t Get only headers" \
"\n -z Delete messages on server" \
"\n prog Run 'prog <message_file>' on message delivery" \
#define blkid_trivial_usage \
""
#define blkid_full_usage "\n\n" \
"Print UUIDs of all filesystems."
#define findfs_trivial_usage \
"LABEL=label or UUID=uuid"
@@ -1223,14 +1229,14 @@
#define ftpget_full_usage "\n\n" \
"Retrieve a remote file via FTP\n" \
"\nOptions:" \
USE_GETOPT_LONG( \
USE_FEATURE_FTPGETPUT_LONG_OPTIONS( \
"\n -c,--continue Continue previous transfer" \
"\n -v,--verbose Verbose" \
"\n -u,--username Username" \
"\n -p,--password Password" \
"\n -P,--port Port number" \
) \
SKIP_GETOPT_LONG( \
SKIP_FEATURE_FTPGETPUT_LONG_OPTIONS( \
"\n -c Continue previous transfer" \
"\n -v Verbose" \
"\n -u Username" \
@@ -1243,13 +1249,13 @@
#define ftpput_full_usage "\n\n" \
"Store a local file on a remote machine via FTP\n" \
"\nOptions:" \
USE_GETOPT_LONG( \
USE_FEATURE_FTPGETPUT_LONG_OPTIONS( \
"\n -v,--verbose Verbose" \
"\n -u,--username Username" \
"\n -p,--password Password" \
"\n -P,--port Port number" \
) \
SKIP_GETOPT_LONG( \
SKIP_FEATURE_FTPGETPUT_LONG_OPTIONS( \
"\n -v Verbose" \
"\n -u Username" \
"\n -p Password" \
@@ -1420,7 +1426,7 @@
"-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
#define halt_trivial_usage \
"[-d delay] [-n] [-f]"
"[-d delay] [-n] [-f]" USE_FEATURE_WTMP(" [-w]")
#define halt_full_usage "\n\n" \
"Halt the system\n" \
"\nOptions:" \
@@ -1572,12 +1578,12 @@
"\n -d STRING URL decode STRING" \
#define hwclock_trivial_usage \
USE_GETOPT_LONG( \
USE_FEATURE_HWCLOCK_LONG_OPTIONS( \
"[-r|--show] [-s|--hctosys] [-w|--systohc]" \
" [-l|--localtime] [-u|--utc]" \
" [-f FILE]" \
) \
SKIP_GETOPT_LONG( \
SKIP_FEATURE_HWCLOCK_LONG_OPTIONS( \
"[-r] [-s] [-w] [-l] [-u] [-f FILE]" \
)
#define hwclock_full_usage "\n\n" \
@@ -1598,8 +1604,9 @@
USE_SELINUX( \
"\n -Z Print the security context" \
) \
"\n -g Print group ID" \
"\n -u Print user ID" \
"\n -g Print group ID" \
"\n -G Print supplementary group IDs" \
"\n -n Print name instead of a number" \
"\n -r Print real user ID instead of effective ID" \
@@ -1868,20 +1875,22 @@
"\n -x Do not export externs" \
)
/* -v, -b, -c are ignored */
#define install_trivial_usage \
"[-cgmops] [sources] dest|directory"
"[-cdDsp] [-o USER] [-g GRP] [-m MODE] [source] dest|directory"
#define install_full_usage "\n\n" \
"Copy files and set attributes\n" \
"\nOptions:" \
"\n -c Copy the file, default" \
"\n -c Just copy (default)" \
"\n -d Create directories" \
"\n -g Set group ownership" \
"\n -m Set permissions" \
"\n -o Set ownership" \
"\n -D Create leading target directories" \
"\n -s Strip symbol table" \
"\n -p Preserve date" \
"\n -s Strip symbol tables" \
"\n -o USER Set ownership" \
"\n -g GRP Set group ownership" \
"\n -m MODE Set permissions" \
USE_SELINUX( \
"\n -Z Set security context of copy" \
"\n -Z Set security context" \
)
/* would need to make the " | " optional depending on more than one selected: */
@@ -1985,7 +1994,8 @@
" [oif STRING] [tos TOS]\n" \
"iproute { add | del | change | append | replace | monitor } ROUTE\n" \
" SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n" \
" ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]" \
" ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]\n" \
" [metric METRIC]" \
#define iprule_trivial_usage \
"{[list | add | del] RULE}"
@@ -2009,7 +2019,7 @@
" [ttl TTL] [tos TOS] [[no]pmtudisc] [dev PHYS_DEV]" \
#define kbd_mode_trivial_usage \
"[-a|k|s|u]"
"[-a|k|s|u] [-C TTY]"
#define kbd_mode_full_usage "\n\n" \
"Report or set the keyboard mode\n" \
"\nOptions set mode:" \
@@ -2017,13 +2027,15 @@
"\n -k Medium-raw (keyboard)" \
"\n -s Raw (scancode)" \
"\n -u Unicode (utf-8)" \
"\n -C TTY Affect TTY instead of /dev/tty" \
#define kill_trivial_usage \
"[-l] [-signal] process-id..."
"[-l] [-SIG] PID..."
#define kill_full_usage "\n\n" \
"Send a signal (default is TERM) to the specified process(es)\n" \
"Send a signal (default is TERM) to given PIDs\n" \
"\nOptions:" \
"\n -l List all signal names and numbers" \
/* "\n -s SIG Yet another way of specifying SIG" */ \
#define kill_example_usage \
"$ ps | grep apache\n" \
@@ -2036,22 +2048,24 @@
"$ kill 252\n"
#define killall_trivial_usage \
"[-l] [-q] [-signal] process-name..."
"[-l] [-q] [-SIG] process-name..."
#define killall_full_usage "\n\n" \
"Send a signal (default is TERM) to the specified process(es)\n" \
"Send a signal (default is TERM) to given processes\n" \
"\nOptions:" \
"\n -l List all signal names and numbers" \
/* "\n -s SIG Yet another way of specifying SIG" */ \
"\n -q Do not complain if no processes were killed" \
#define killall_example_usage \
"$ killall apache\n"
#define killall5_trivial_usage \
"[-l] [-signal]"
"[-l] [-SIG]"
#define killall5_full_usage "\n\n" \
"Send a signal (default is TERM) to all processes outside current session\n" \
"\nOptions:" \
"\n -l List all signal names and numbers" \
/* "\n -s SIG Yet another way of specifying SIG" */ \
#define klogd_trivial_usage \
"[-c N] [-n]"
@@ -2071,7 +2085,7 @@
"5\n"
#define less_trivial_usage \
"[-EMNmh~?] [FILE...]"
"[-EMNmh~I?] [FILE...]"
#define less_full_usage "\n\n" \
"View a file or list of files. The position within files can be\n" \
"changed, and files can be manipulated in various ways.\n" \
@@ -2080,6 +2094,7 @@
"\n -M,-m Display a status line containing the line numbers" \
"\n and percentage through the file" \
"\n -N Prefix line numbers to each line" \
"\n -I Ignore case in all searches" \
"\n -~ Suppress ~s displayed past the end of the file" \
#define linux32_trivial_usage NOUSAGE_STR
@@ -2115,20 +2130,23 @@
"lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*\n"
#define load_policy_trivial_usage NOUSAGE_STR
#define load_policy_full_usage ""
#define loadfont_trivial_usage \
"< font"
#define loadfont_full_usage "\n\n" \
"Load a console font from standard input"
"Load a console font from standard input" \
/* "\n -C TTY Affect TTY instead of /dev/tty" */ \
#define loadfont_example_usage \
"$ loadfont < /etc/i18n/fontname\n"
#define loadkmap_trivial_usage \
"< keymap"
#define loadkmap_full_usage "\n\n" \
"Load a binary keyboard translation table from standard input"
"Load a binary keyboard translation table from standard input\n" \
/* "\n -C TTY Affect TTY instead of /dev/tty" */ \
#define loadkmap_example_usage \
"$ loadkmap < /etc/i18n/lang-keymap\n"
@@ -2229,21 +2247,21 @@
#define ls_full_usage "\n\n" \
"List directory contents\n" \
"\nOptions:" \
"\n -1 List files in a single column" \
"\n -A Do not list implied . and .." \
"\n -a Do not hide entries starting with ." \
"\n -C List entries by columns" \
"\n -1 List in a single column" \
"\n -A Don't list . and .." \
"\n -a Don't hide entries starting with ." \
"\n -C List by columns" \
USE_FEATURE_LS_TIMESTAMPS( \
"\n -c With -l: show ctime") \
"\n -c With -l: sort by ctime") \
USE_FEATURE_LS_COLOR( \
"\n --color[={always,never,auto}] Control coloring") \
"\n -d List directory entries instead of contents" \
USE_FEATURE_LS_TIMESTAMPS( \
"\n -e List both full date and full time") \
"\n -e List full date and time") \
USE_FEATURE_LS_FILETYPES( \
"\n -F Append indicator (one of */=@|) to entries") \
"\n -i List the i-node for each file" \
"\n -l Use a long listing format" \
"\n -i List inode numbers" \
"\n -l Long listing format" \
"\n -n List numeric UIDs and GIDs instead of names" \
USE_FEATURE_LS_FILETYPES( \
"\n -p Append indicator (one of /=@|) to entries") \
@@ -2252,31 +2270,31 @@
USE_FEATURE_LS_RECURSIVE( \
"\n -R List subdirectories recursively") \
USE_FEATURE_LS_SORTFILES( \
"\n -r Sort the listing in reverse order") \
"\n -r Sort in reverse order") \
USE_FEATURE_LS_SORTFILES( \
"\n -S Sort the listing by file size") \
"\n -S Sort by file size") \
"\n -s List the size of each file, in blocks" \
USE_FEATURE_AUTOWIDTH( \
"\n -T NUM Assume Tabstop every NUM columns") \
"\n -T NUM Assume tabstop every NUM columns") \
USE_FEATURE_LS_TIMESTAMPS( \
"\n -t With -l: show modification time") \
"\n -t With -l: sort by modification time") \
USE_FEATURE_LS_TIMESTAMPS( \
"\n -u With -l: show access time") \
"\n -u With -l: sort by access time") \
USE_FEATURE_LS_SORTFILES( \
"\n -v Sort the listing by version") \
"\n -v Sort by version") \
USE_FEATURE_AUTOWIDTH( \
"\n -w NUM Assume the terminal is NUM columns wide") \
"\n -x List entries by lines instead of by columns" \
"\n -x List by lines" \
USE_FEATURE_LS_SORTFILES( \
"\n -X Sort the listing by extension") \
"\n -X Sort by extension") \
USE_FEATURE_HUMAN_READABLE( \
"\n -h Print sizes in human readable format (e.g., 1K 243M 2G)") \
"\n -h List sizes in human readable format (1K 243M 2G)") \
USE_SELINUX( \
"\n -k Print security context") \
"\n -k List security context") \
USE_SELINUX( \
"\n -K Print security context in long format") \
"\n -K List security context in long format") \
USE_SELINUX( \
"\n -Z Print security context and permission") \
"\n -Z List security context and permission") \
#define lsattr_trivial_usage \
"[-Radlv] [files...]"
@@ -2286,7 +2304,7 @@
"\n -R Recursively list subdirectories" \
"\n -a Do not hide entries starting with ." \
"\n -d List directory entries instead of contents" \
"\n -l Print long flag names" \
"\n -l List long flag names" \
"\n -v List the file's version/generation number" \
#define lsmod_trivial_usage \
@@ -2352,6 +2370,16 @@
"/dev/hda[0-15]\n"
#endif
#define makemime_trivial_usage \
"[OPTION]... [FILE]..."
#define makemime_full_usage "\n\n" \
"Create MIME-encoded message\n" \
"\nOptions:" \
"\n -C Charset" \
"\n -e Tranfer encoding. Ignored. base64 is assumed" \
"\n" \
"\nOther options are silently ignored." \
#define man_trivial_usage \
"[OPTION]... [MANPAGE]..."
#define man_full_usage "\n\n" \
@@ -2562,12 +2590,17 @@
"[-knqrsv] MODULE [symbol=value...]"
#define modprobe_full_usage "\n\n" \
"Options:" \
USE_FEATURE_2_4_MODULES( \
"\n -k Make module autoclean-able" \
) \
"\n -n Dry run" \
"\n -q Quiet" \
"\n -r Remove module (stacks) or do autoclean" \
"\n -s Report via syslog instead of stderr" \
"\n -v Verbose" \
USE_FEATURE_MODPROBE_BLACKLIST( \
"\n -b Apply blacklist to module names too" \
)
#define modprobe_notes_usage \
"modprobe can (un)load a stack of modules, passing each module options (when\n" \
@@ -3064,6 +3097,33 @@
"\n -v Negate the matching" \
"\n -x Match whole name (not substring)" \
#define popmaildir_trivial_usage \
"[OPTIONS] Maildir [connection-helper ...]"
#define popmaildir_full_usage "\n\n" \
"Fetch content of remote mailbox to local maildir\n" \
"\nOptions:" \
"\n -b Binary mode. Ignored" \
"\n -d Debug. Ignored" \
"\n -m Show used memory. Ignored" \
"\n -V Show version. Ignored" \
"\n -c Use tcpclient. Ignored" \
"\n -a Use APOP protocol. Implied. If server supports APOP -> use it" \
"\n -s Skip authorization" \
"\n -T Get messages with TOP instead with RETR" \
"\n -k Keep retrieved messages on the server" \
"\n -t timeout Set network timeout" \
USE_FEATURE_POPMAILDIR_DELIVERY( \
"\n -F \"program arg1 arg2 ...\" Filter by program. May be multiple" \
"\n -M \"program arg1 arg2 ...\" Deliver by program" \
) \
"\n -R size Remove old messages on the server >= size (in bytes). Ignored" \
"\n -Z N1-N2 Remove messages from N1 to N2 (dangerous). Ignored" \
"\n -L size Do not retrieve new messages >= size (in bytes). Ignored" \
"\n -H lines Type specified number of lines of a message. Ignored"
#define popmaildir_example_usage \
"$ popmaildir -k ~/Maildir -- nc pop.drvv.ru 110 [<password_file]\n" \
"$ popmaildir ~/Maildir -- openssl s_client -quiet -connect pop.gmail.com:995 [<password_file]\n"
#define poweroff_trivial_usage \
"[-d delay] [-n] [-f]"
#define poweroff_full_usage "\n\n" \
@@ -3219,6 +3279,17 @@
"\n -n No call to sync()" \
"\n -f Force reboot (don't go through init)" \
#define reformime_trivial_usage \
"[OPTION]... [FILE]..."
#define reformime_full_usage "\n\n" \
"Parse MIME-encoded message\n" \
"\nOptions:" \
"\n -x prefix Extract content of MIME sections to files" \
"\n -X prog [args] Filter content of MIME sections through prog." \
"\n Must be the last option" \
"\n" \
"\nOther options are silently ignored." \
#define renice_trivial_usage \
"{{-n INCREMENT} | PRIORITY} [[-p | -g | -u] ID...]"
#define renice_full_usage "\n\n" \
@@ -3271,7 +3342,16 @@
#define rmdir_trivial_usage \
"[OPTION]... DIRECTORY..."
#define rmdir_full_usage "\n\n" \
"Remove the DIRECTORY, if it is empty"
"Remove the DIRECTORY, if it is empty.\n" \
"\nOptions:" \
USE_FEATURE_RMDIR_LONG_OPTIONS( \
"\n -p|--parents Include parents" \
"\n -ignore-fail-on-non-empty" \
) \
SKIP_FEATURE_RMDIR_LONG_OPTIONS( \
"\n -p Include parents" \
)
#define rmdir_example_usage \
"# rmdir /tmp/foo\n"
@@ -3280,6 +3360,8 @@
#define rmmod_full_usage "\n\n" \
"Unload the specified kernel modules from the kernel\n" \
"\nOptions:" \
"\n -w Wait until the module is no longer used" \
"\n -f Force unloading" \
"\n -a Remove all unused modules (recursively)" \
#define rmmod_example_usage \
@@ -3288,7 +3370,7 @@
#define route_trivial_usage \
"[{add|del|delete}]"
#define route_full_usage "\n\n" \
"Edit the kernel's routing tables\n" \
"Edit kernel routing tables\n" \
"\nOptions:" \
"\n -n Don't resolve names" \
"\n -e Display other/more information" \
@@ -3341,14 +3423,14 @@
#define runcon_full_usage "\n\n" \
"Run a program in a different security context\n" \
"\n CONTEXT Complete security context\n" \
USE_GETOPT_LONG( \
USE_FEATURE_RUNCON_LONG_OPTIONS( \
"\n -c,--compute Compute process transition context before modifying" \
"\n -t,--type=TYPE Type (for same role as parent)" \
"\n -u,--user=USER User identity" \
"\n -r,--role=ROLE Role" \
"\n -l,--range=RNG Levelrange" \
) \
SKIP_GETOPT_LONG( \
SKIP_FEATURE_RUNCON_LONG_OPTIONS( \
"\n -c Compute process transition context before modifying" \
"\n -t TYPE Type (for same role as parent)" \
"\n -u USER User identity" \
@@ -3398,9 +3480,11 @@
"Start and monitor a service and optionally an appendant log service"
#define runsvdir_trivial_usage \
"[-P] dir"
"[-P] [-s SCRIPT] dir"
#define runsvdir_full_usage "\n\n" \
"Start a runsv process for each subdirectory"
"Start a runsv process for each subdirectory. If it exits, restart it.\n" \
"\n -P Put each runsv in a new session" \
"\n -s SCRIPT Run SCRIPT <signo> after signal is processed" \
#define rx_trivial_usage \
"FILE"
@@ -3442,21 +3526,30 @@
#define selinuxenabled_full_usage ""
#define sendmail_trivial_usage \
"[-w timeout] [-H [user:pass@]server[:port]] [-S]\n" \
"[-c charset] [-N type] [-i] [-s subject] [-a attach]... [-t] [-f sender] [rcpt]..."
"[OPTIONS] [rcpt]..."
#define sendmail_full_usage "\n\n" \
"Send an email\n" \
"\nOptions:" \
"\n -w timeout Network timeout" \
"\n -H [user:pass@]server[:port] Server" \
"\n -S Use openssl connection helper for secure servers" \
"\n -c charset Assume charset for body and subject (utf-8)" \
"\n -N type Request delivery notification. Type is ignored" \
"\n -i Ignore single dots in mail body. Implied" \
"\n -s subject Subject" \
"\n -a file File to attach. May be multiple" \
"\n -t Read recipients and subject from body" \
"\n -f sender Sender" \
"\n -F fullname Sender full name. Overrides $NAME" \
USE_FEATURE_SENDMAIL_MAILX( \
"\n -s subject Subject" \
"\n -j charset Assume charset for body and subject (" CONFIG_FEATURE_MIME_CHARSET ")" \
"\n -a file File to attach. May be multiple" \
"\n -H \"prog args...\" Use external connection helper. E.g. openssl for secure servers" \
"\n -S server[:port] Server" \
) \
USE_FEATURE_SENDMAIL_MAILXX( \
"\n -c rcpt Cc: recipient. May be multiple" \
"\n -e rcpt Errors-To: recipient" \
)
"\n -t Read recipients and subject from body" \
"\n" \
"\nOther options are silently ignored; -oi is implied" \
#define seq_trivial_usage \
"[first [increment]] last"
@@ -3510,11 +3603,13 @@
"\n -W Display warnings about entries that had no matching files" \
#define setfont_trivial_usage \
"[-m mapfile] font"
"FONT [-m MAPFILE] [-C TTY]"
#define setfont_full_usage "\n\n" \
"Load a console font\n" \
"\nOptions:" \
"\n -m mapfile Load console screen map from mapfile"
"\n -m MAPFILE Load console screen map" \
"\n -C TTY Affect TTY instead of /dev/tty" \
#define setfont_example_usage \
"$ setfont -m koi8-r /etc/i18n/fontname\n"
@@ -3679,7 +3774,7 @@
"Search for matching processes, and then\n" \
"-K: stop all matching processes.\n" \
"-S: start a process unless a matching process is found.\n" \
USE_GETOPT_LONG( \
USE_FEATURE_START_STOP_DAEMON_LONG_OPTIONS( \
"\nProcess matching:" \
"\n -u,--user USERNAME|UID Match only this user's processes" \
"\n -n,--name NAME Match processes with NAME" \
@@ -3703,11 +3798,11 @@
"\nOther:" \
USE_FEATURE_START_STOP_DAEMON_FANCY( \
"\n -o,--oknodo Exit with status 0 if nothing is done" \
"\n -q,--quiet Quiet" \
) \
"\n -v,--verbose Verbose" \
) \
SKIP_GETOPT_LONG( \
"\n -q,--quiet Quiet" \
) \
SKIP_FEATURE_START_STOP_DAEMON_LONG_OPTIONS( \
"\nProcess matching:" \
"\n -u USERNAME|UID Match only this user's processes" \
"\n -n NAME Match processes with NAME" \
@@ -3731,10 +3826,10 @@
"\nOther:" \
USE_FEATURE_START_STOP_DAEMON_FANCY( \
"\n -o Exit with status 0 if nothing is done" \
"\n -q Quiet" \
) \
"\n -v Verbose" \
) \
"\n -q Quiet" \
) \
#define stat_trivial_usage \
"[OPTION] FILE..."
@@ -4094,6 +4189,26 @@
"$ echo $?\n" \
"1\n"
#define tc_trivial_usage \
/*"[OPTIONS] "*/"OBJECT CMD [dev STRING]"
#define tc_full_usage "\n\n" \
"OBJECT: {qdisc|class|filter}\n" \
"CMD: {add|del|change|replace|show}\n" \
"\n" \
"qdisc [ handle QHANDLE ] [ root |"USE_FEATURE_TC_INGRESS(" ingress |")" parent CLASSID ]\n" \
/* "\t[ estimator INTERVAL TIME_CONSTANT ]\n" */ \
"\t[ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" \
"\tQDISC_KIND := { [p|b]fifo | tbf | prio | cbq | red | etc. }\n" \
"qdisc show [ dev STRING ]"USE_FEATURE_TC_INGRESS(" [ingress]")"\n" \
"class [ classid CLASSID ] [ root | parent CLASSID ]\n" \
"\t[ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" \
"class show [ dev STRING ] [ root | parent CLASSID ]\n" \
"filter [ pref PRIO ] [ protocol PROTO ]\n" \
/* "\t[ estimator INTERVAL TIME_CONSTANT ]\n" */ \
"\t[ root | classid CLASSID ] [ handle FILTERID ]\n" \
"\t[ [ FILTER_TYPE ] [ help | OPTIONS ] ]\n" \
"filter show [ dev STRING ] [ root | parent CLASSID ]"
#define tcpsvd_trivial_usage \
"[-hEv] [-c n] [-C n:msg] [-b n] [-u user] [-l name] ip port prog..."
/* with not-implemented options: */
@@ -4152,6 +4267,12 @@
"[-cr] [-u USER] [DIR]"
#define tftpd_full_usage "\n\n" \
"Transfer a file on tftp client's request.\n" \
"\n" \
"tftpd should be used as an inetd service.\n" \
"tftpd's line for inetd.conf:\n" \
" 69 dgram udp nowait root tftpd tftpd /files/to/serve\n" \
"It also can be ran from udpsvd:\n" \
" udpsvd -vE 0.0.0.0 69 tftpd /files/to/serve\n" \
"\nOptions:" \
"\n -r Prohibit upload" \
"\n -c Allow file creation via upload" \
@@ -4166,7 +4287,7 @@
"\n -v Verbose" \
#define top_trivial_usage \
"[-b] [-n COUNT] [-d SECONDS]"
"[-b] [-nCOUNT] [-dSECONDS]"
#define top_full_usage "\n\n" \
"Provide a view of process activity in real time.\n" \
"Read the status of all processes from /proc each SECONDS\n" \
@@ -4272,7 +4393,7 @@
"\n -C,--clientid-none Suppress default client identifier" \
"\n -p,--pidfile=file Create pidfile" \
"\n -r,--request=IP IP address to request" \
"\n -s,--script=file Run file at DHCP events (default "CONFIG_DHCPC_DEFAULT_SCRIPT")" \
"\n -s,--script=file Run file at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \
"\n -t,--retries=N Send up to N request packets" \
"\n -T,--timeout=N Try to get a lease for N seconds (default 3)" \
"\n -A,--tryagain=N Wait N seconds (default 20) after failure" \
@@ -4301,7 +4422,7 @@
"\n -C Suppress default client identifier" \
"\n -p file Create pidfile" \
"\n -r IP IP address to request" \
"\n -s file Run file at DHCP events (default "CONFIG_DHCPC_DEFAULT_SCRIPT")" \
"\n -s file Run file at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \
"\n -t N Send up to N request packets" \
"\n -T N Try to get a lease for N seconds (default 3)" \
"\n -A N Wait N seconds (default 20) after failure" \
@@ -4524,14 +4645,15 @@
"Mon Dec 17 10:31:44 GMT 2000"
#define watchdog_trivial_usage \
"[-t N[ms]] [-F] DEV"
"[-t N[ms]] [-T N[ms]] [-F] DEV"
#define watchdog_full_usage "\n\n" \
"Periodically write to watchdog device DEV\n" \
"\nOptions:" \
"\n -t N Timer period (default 30)" \
"\n -T N Reboot after N seconds if not reset (default 60)" \
"\n -t N Reset every N seconds (default 30)" \
"\n -F Run in foreground" \
"\n" \
"\nUse -t 500ms to specify period in milliseconds" \
"\nUse 500ms to specify period in milliseconds" \
#define wc_trivial_usage \
"[OPTION]... [FILE]..."
@@ -4549,12 +4671,12 @@
" 31 46 1365 /etc/passwd\n"
#define wget_trivial_usage \
USE_GETOPT_LONG( \
USE_FEATURE_WGET_LONG_OPTIONS( \
"[-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document file]\n" \
" [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]\n" \
" [-U|--user-agent agent] url" \
) \
SKIP_GETOPT_LONG( \
SKIP_FEATURE_WGET_LONG_OPTIONS( \
"[-csq] [-O file] [-Y on/off] [-P DIR] [-U agent] url" \
)
#define wget_full_usage "\n\n" \
@@ -4599,7 +4721,7 @@
USE_FEATURE_XARGS_SUPPORT_ZERO_TERM( \
"\n -0 Input is separated by NUL characters") \
"\n -t Print the command on stderr before execution" \
"\n -e[STR] STR stops input processing (default _)" \
"\n -e[STR] STR stops input processing" \
"\n -n N Pass no more than N args to COMMAND" \
"\n -s N Pass command line of no more than N bytes" \
USE_FEATURE_XARGS_SUPPORT_TERMOPT( \
@@ -4625,8 +4747,11 @@
"Manage a ZeroConf IPv4 link-local address\n" \
"\nOptions:" \
"\n -f Run in foreground" \
"\n -q Quit after address (no daemon)" \
"\n -q Quit after obtaining address" \
"\n -r 169.254.x.x Request this address first" \
"\n -v Verbose" \
"\n" \
"\nWith no -q, runs continuously monitoring for ARP conflicts," \
"\nexits only on I/O errors (link down etc)" \
#endif /* __BB_USAGE_H__ */
+1
View File
@@ -20,3 +20,4 @@
char *get_devname_from_label(const char *spec);
char *get_devname_from_uuid(const char *spec);
void display_uuid_cache(void);
-10
View File
@@ -12,14 +12,6 @@ config INIT
help
init is the first program run when the system boots.
config DEBUG_INIT
bool "Debugging aid"
default n
depends on INIT
help
Turn this on to disable all the dangerous
rebooting stuff when debugging.
config FEATURE_USE_INITTAB
bool "Support reading an inittab file"
default y
@@ -83,8 +75,6 @@ config FEATURE_INIT_COREDUMPS
core file sizes. If this option is disabled, processes
will not generate any core files.
config FEATURE_INITRD
bool "Support running init from within an initrd (not initramfs)"
default y
+42 -35
View File
@@ -13,44 +13,11 @@
#if ENABLE_FEATURE_WTMP
#include <sys/utsname.h>
#include <utmp.h>
#endif
int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int halt_main(int argc UNUSED_PARAM, char **argv)
static void write_wtmp(void)
{
static const int magic[] = {
#ifdef RB_HALT_SYSTEM
RB_HALT_SYSTEM,
#elif defined RB_HALT
RB_HALT,
#endif
#ifdef RB_POWER_OFF
RB_POWER_OFF,
#elif defined RB_POWERDOWN
RB_POWERDOWN,
#endif
RB_AUTOBOOT
};
static const smallint signals[] = { SIGUSR1, SIGUSR2, SIGTERM };
int delay = 0;
int which, flags, rc;
#if ENABLE_FEATURE_WTMP
struct utmp utmp;
struct utsname uts;
#endif
/* Figure out which applet we're running */
for (which = 0; "hpr"[which] != *applet_name; which++)
continue;
/* Parse and handle arguments */
opt_complementary = "d+"; /* -d N */
flags = getopt32(argv, "d:nfw", &delay);
sleep(delay);
#if ENABLE_FEATURE_WTMP
if (access(bb_path_wtmp_file, R_OK|W_OK) == -1) {
close(creat(bb_path_wtmp_file, 0664));
}
@@ -63,10 +30,50 @@ RB_AUTOBOOT
if (uname(&uts) == 0)
safe_strncpy(utmp.ut_host, uts.release, sizeof(utmp.ut_host));
updwtmp(bb_path_wtmp_file, &utmp);
#endif /* !ENABLE_FEATURE_WTMP */
}
#else
#define write_wtmp() ((void)0)
#endif
#ifndef RB_HALT_SYSTEM
#define RB_HALT_SYSTEM RB_HALT
#endif
#ifndef RB_POWER_OFF
#define RB_POWER_OFF RB_POWERDOWN
#endif
int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int halt_main(int argc UNUSED_PARAM, char **argv)
{
static const int magic[] = {
RB_HALT_SYSTEM,
RB_POWER_OFF,
RB_AUTOBOOT
};
static const smallint signals[] = { SIGUSR1, SIGUSR2, SIGTERM };
int delay = 0;
int which, flags, rc;
/* Figure out which applet we're running */
for (which = 0; "hpr"[which] != applet_name[0]; which++)
continue;
/* Parse and handle arguments */
opt_complementary = "d+"; /* -d N */
/* We support -w even if !ENABLE_FEATURE_WTMP, in order
* to not break scripts */
flags = getopt32(argv, "d:nfw", &delay);
sleep(delay);
write_wtmp();
if (flags & 8) /* -w */
return EXIT_SUCCESS;
if (!(flags & 2)) /* no -n */
sync();
+33 -37
View File
@@ -14,6 +14,10 @@
#include <paths.h>
#include <sys/reboot.h>
/* Was a CONFIG_xxx option. A lot of people were building
* not fully functional init by switching it on! */
#define DEBUG_INIT 0
#define COMMAND_SIZE 256
#define CONSOLE_NAME_SIZE 32
#define MAXENV 16 /* Number of env. vars */
@@ -56,7 +60,6 @@ struct init_action {
static struct init_action *init_action_list = NULL;
static const char *log_console = VC_5;
static sig_atomic_t got_cont = 0;
enum {
L_LOG = 0x1,
@@ -77,14 +80,6 @@ enum {
#endif
};
static const char *const environment[] = {
"HOME=/",
bb_PATH_root_path,
"SHELL=/bin/sh",
"USER=root",
NULL
};
/* Function prototypes */
static void halt_reboot_pwoff(int sig) NORETURN;
@@ -111,29 +106,30 @@ static void loop_forever(void)
* "where" may be bitwise-or'd from L_LOG | L_CONSOLE
* NB: careful, we can be called after vfork!
*/
#define messageD(...) do { if (ENABLE_DEBUG_INIT) message(__VA_ARGS__); } while (0)
#define messageD(...) do { if (DEBUG_INIT) message(__VA_ARGS__); } while (0)
static void message(int where, const char *fmt, ...)
__attribute__ ((format(printf, 2, 3)));
static void message(int where, const char *fmt, ...)
{
static int log_fd = -1;
va_list arguments;
int l;
unsigned l;
char msg[128];
msg[0] = '\r';
va_start(arguments, fmt);
vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
l = 1 + vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
if (l > sizeof(msg) - 1)
l = sizeof(msg) - 1;
msg[l] = '\0';
va_end(arguments);
msg[sizeof(msg) - 2] = '\0';
l = strlen(msg);
if (ENABLE_FEATURE_INIT_SYSLOG) {
/* Log the message to syslogd */
if (where & L_LOG) {
/* don't print out "\r" */
openlog(applet_name, 0, LOG_DAEMON);
syslog(LOG_INFO, "init: %s", msg + 1);
/* Log the message to syslogd */
openlog("init", 0, LOG_DAEMON);
/* don't print "\r" */
syslog(LOG_INFO, "%s", msg + 1);
closelog();
}
msg[l++] = '\n';
@@ -213,6 +209,9 @@ static void console_init(void)
/* Make sure fd 0,1,2 are not closed
* (so that they won't be used by future opens) */
bb_sanitize_stdio();
// Users report problems
// /* Make sure init can't be blocked by writing to stderr */
// fcntl(STDERR_FILENO, F_SETFL, fcntl(STDERR_FILENO, F_GETFL) | O_NONBLOCK);
}
s = getenv("TERM");
@@ -262,7 +261,7 @@ static void set_sane_term(void)
tty.c_lflag =
ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN;
tcsetattr(STDIN_FILENO, TCSANOW, &tty);
tcsetattr_stdin_TCSANOW(&tty);
}
/* Open the new terminal device.
@@ -280,7 +279,7 @@ static void open_stdio_to_tty(const char* tty_name, int exit_on_failure)
tty_name, strerror(errno));
if (exit_on_failure)
_exit(EXIT_FAILURE);
if (ENABLE_DEBUG_INIT)
if (DEBUG_INIT)
_exit(2);
/* NB: we don't reach this if we were called after vfork.
* Thus halt_reboot_pwoff() itself need not be vfork-safe. */
@@ -614,24 +613,21 @@ static void ctrlaltdel_signal(int sig UNUSED_PARAM)
run_actions(CTRLALTDEL);
}
/* The SIGCONT handler is set to record_signo().
* It just sets bb_got_signal = SIGCONT. */
/* The SIGSTOP & SIGTSTP handler */
static void stop_handler(int sig UNUSED_PARAM)
{
int saved_errno = errno;
got_cont = 0;
while (!got_cont)
bb_got_signal = 0;
while (bb_got_signal == 0)
pause();
errno = saved_errno;
}
/* The SIGCONT handler */
static void cont_handler(int sig UNUSED_PARAM)
{
got_cont = 1;
}
static void new_init_action(uint8_t action_type, const char *command, const char *cons)
{
struct init_action *a, *last;
@@ -793,7 +789,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
return kill(1, SIGHUP);
}
if (!ENABLE_DEBUG_INIT) {
if (!DEBUG_INIT) {
/* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
if (getpid() != 1
&& (!ENABLE_FEATURE_INITRD || !strstr(applet_name, "linuxrc"))
@@ -809,7 +805,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
+ (1 << SIGTERM) /* reboot */
, halt_reboot_pwoff);
signal(SIGINT, ctrlaltdel_signal);
signal(SIGCONT, cont_handler);
signal(SIGCONT, record_signo);
bb_signals(0
+ (1 << SIGSTOP)
+ (1 << SIGTSTP)
@@ -825,15 +821,15 @@ int init_main(int argc UNUSED_PARAM, char **argv)
set_sane_term();
xchdir("/");
setsid();
{
const char *const *e;
/* Make sure environs is set to something sane */
for (e = environment; *e; e++)
putenv((char *) *e);
}
/* Make sure environs is set to something sane */
putenv((char *) "HOME=/");
putenv((char *) bb_PATH_root_path);
putenv((char *) "SHELL=/bin/sh");
putenv((char *) "USER=root"); /* needed? why? */
if (argv[1])
setenv("RUNLEVEL", argv[1], 1);
xsetenv("RUNLEVEL", argv[1]);
/* Hello world */
message(MAYBE_CONSOLE | L_LOG, "init started: %s", bb_banner);
+1
View File
@@ -75,6 +75,7 @@ lib-y += process_escape_sequence.o
lib-y += procps.o
lib-y += ptr_to_globals.o
lib-y += read.o
lib-y += read_key.o
lib-y += recursive_action.o
lib-y += remove_file.o
lib-y += restricted_shell.o
+2 -2
View File
@@ -37,7 +37,7 @@ char* FAST_FUNC bb_askpass(int timeout, const char *prompt)
tio = oldtio;
tio.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY);
tio.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP);
tcsetattr(STDIN_FILENO, TCSANOW, &tio);
tcsetattr_stdin_TCSANOW(&tio);
memset(&sa, 0, sizeof(sa));
/* sa.sa_flags = 0; - no SA_RESTART! */
@@ -70,7 +70,7 @@ char* FAST_FUNC bb_askpass(int timeout, const char *prompt)
}
sigaction_set(SIGINT, &oldsa);
tcsetattr(STDIN_FILENO, TCSANOW, &oldtio);
tcsetattr_stdin_TCSANOW(&oldtio);
bb_putchar('\n');
fflush(stdout);
return ret;
+2 -1
View File
@@ -17,7 +17,8 @@ double FAST_FUNC bb_strtod(const char *arg, char **endp)
double v;
char *endptr;
if (arg[0] != '-' && NOT_DIGIT(arg[0]))
/* Allow .NN form. People want to use "sleep .15" etc */
if (arg[0] != '-' && arg[0] != '.' && NOT_DIGIT(arg[0]))
goto err;
errno = 0;
v = strtod(arg, &endptr);
+3 -2
View File
@@ -298,7 +298,7 @@ static void rewrite(priv_dumper_t *dumper, FS *fs)
* if, rep count is greater than 1, no trailing whitespace
* gets output from the last iteration of the format unit.
*/
for (fu = fs->nextfu;; fu = fu->nextfu) {
for (fu = fs->nextfu; fu; fu = fu->nextfu) {
if (!fu->nextfu && fs->bcnt < dumper->blocksize
&& !(fu->flags & F_SETREP) && fu->bcnt
) {
@@ -723,7 +723,8 @@ void FAST_FUNC bb_dump_add(dumper_t* pub_dumper, const char *fmt)
nextfupp = &tfs->nextfu;
/* take the format string and break it up into format units */
for (p = fmt;;) {
p = fmt;
for (;;) {
p = skip_whitespace(p);
if (!*p) {
break;
+1 -1
View File
@@ -88,7 +88,7 @@ pid_t* FAST_FUNC find_pid_by_name(const char *procName)
if (comm_match(p, procName)
/* or we require argv0 to match (essential for matching reexeced /proc/self/exe)*/
|| (p->argv0 && strcmp(bb_basename(p->argv0), procName) == 0)
/* TOOD: we can also try /proc/NUM/exe link, do we want that? */
/* TODO: we can also try /proc/NUM/exe link, do we want that? */
) {
pidList = xrealloc_vector(pidList, 2, i);
pidList[i++] = p->pid;
-2
View File
@@ -13,7 +13,6 @@
/* From <linux/kd.h> */
enum { KDGKBTYPE = 0x4B33 }; /* get keyboard type */
static int open_a_console(const char *fnam)
{
int fd;
@@ -37,7 +36,6 @@ static int open_a_console(const char *fnam)
* We try several things because opening /dev/console will fail
* if someone else used X (which does a chown on /dev/console).
*/
int FAST_FUNC get_console_fd_or_die(void)
{
static const char *const console_names[] = {
+4 -13
View File
@@ -510,25 +510,15 @@ getopt32(char **argv, const char *applet_opts, ...)
*pargv = pp;
}
if (!(spec_flgs & ALL_ARGV_IS_OPTS))
break;
break;
pargv++;
}
}
/* In case getopt32 was already called:
* reset the libc getopt() function, which keeps internal state.
*
* BSD-derived getopt() functions require that optind be set to 1 in
* order to reset getopt() state. This used to be generally accepted
* way of resetting getopt(). However, glibc's getopt()
* has additional getopt() state beyond optind, and requires that
* optind be set to zero to reset its state. So the unfortunate state of
* affairs is that BSD-derived versions of getopt() misbehave if
* optind is set to 0 in order to reset getopt(), and glibc's getopt()
* will core dump if optind is set 1 in order to reset getopt().
*
* More modern versions of BSD require that optreset be set to 1 in
* order to reset getopt(). Sigh. Standards, anyone?
* run_nofork_applet_prime() does this, but we might end up here
* also via gunzip_main() -> gzip_main(). Play safe.
*/
#ifdef __GLIBC__
optind = 0;
@@ -537,6 +527,7 @@ getopt32(char **argv, const char *applet_opts, ...)
/* optreset = 1; */
#endif
/* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */
pargv = NULL;
/* Note: just "getopt() <= 0" will not work well for
+21 -12
View File
@@ -32,7 +32,9 @@ const char* FAST_FUNC make_human_readable_str(unsigned long long size,
unsigned long block_size, unsigned long display_unit)
{
/* The code will adjust for additional (appended) units */
static const char zero_and_units[] ALIGN1 = { '0', 0, 'k', 'M', 'G', 'T' };
static const char unit_chars[] ALIGN1 = {
'\0', 'K', 'M', 'G', 'T', 'P', 'E'
};
static const char fmt[] ALIGN1 = "%llu";
static const char fmt_tenths[] ALIGN1 = "%llu.%d%c";
@@ -42,26 +44,33 @@ const char* FAST_FUNC make_human_readable_str(unsigned long long size,
int frac;
const char *u;
const char *f;
smallint no_tenths;
u = zero_and_units;
if (size == 0)
return "0";
/* If block_size is 0 then do not print tenths */
no_tenths = 0;
if (block_size == 0) {
no_tenths = 1;
block_size = 1;
}
u = unit_chars;
val = size * block_size;
f = fmt;
frac = 0;
val = size * block_size;
if (val == 0) {
return u;
}
if (display_unit) {
val += display_unit/2; /* Deal with rounding */
val /= display_unit; /* Don't combine with the line above!!! */
/* will just print it as ulonglong (below) */
} else {
++u;
while ((val >= 1024)
&& (u < zero_and_units + sizeof(zero_and_units) - 1)
&& (u < unit_chars + sizeof(unit_chars) - 1)
) {
f = fmt_tenths;
++u;
u++;
frac = (((int)(val % 1024)) * 10 + 1024/2) / 1024;
val /= 1024;
}
@@ -69,9 +78,9 @@ const char* FAST_FUNC make_human_readable_str(unsigned long long size,
++val;
frac = 0;
}
#if 0
#if 1
/* Sample code to omit decimal point and tenths digit. */
if (/* no_tenths */ 1) {
if (no_tenths) {
if (frac >= 5) {
++val;
}
-3
View File
@@ -63,9 +63,6 @@ int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostf
#ifdef DEBUG
res_init();
_res.options |= RES_DEBUG;
#endif
#ifdef DEBUG
bb_error_msg("gethostbyname(%s)", name);
#endif
hp = gethostbyname(name);
+53 -29
View File
@@ -956,24 +956,33 @@ static void input_tab(smallint *lastWasTab)
#if MAX_HISTORY > 0
/* state->flags is already checked to be nonzero */
static void get_previous_history(void)
static void save_command_ps_at_cur_history(void)
{
if (command_ps[0] != '\0' || state->history[state->cur_history] == NULL) {
free(state->history[state->cur_history]);
state->history[state->cur_history] = xstrdup(command_ps);
if (command_ps[0] != '\0') {
int cur = state->cur_history;
free(state->history[cur]);
state->history[cur] = xstrdup(command_ps);
}
state->cur_history--;
}
/* state->flags is already checked to be nonzero */
static int get_previous_history(void)
{
if ((state->flags & DO_HISTORY) && state->cur_history) {
save_command_ps_at_cur_history();
state->cur_history--;
return 1;
}
beep();
return 0;
}
static int get_next_history(void)
{
if (state->flags & DO_HISTORY) {
int ch = state->cur_history;
if (ch < state->cnt_history) {
get_previous_history(); /* save the current history line */
state->cur_history = ch + 1;
return state->cur_history;
if (state->cur_history < state->cnt_history) {
save_command_ps_at_cur_history(); /* save the current history line */
return ++state->cur_history;
}
}
beep();
@@ -995,6 +1004,7 @@ static void load_history(const char *fromfile)
for (hi = state->cnt_history; hi > 0;) {
hi--;
free(state->history[hi]);
state->history[hi] = NULL;
}
for (hi = 0; hi < MAX_HISTORY;) {
@@ -1006,14 +1016,14 @@ static void load_history(const char *fromfile)
l = strlen(hl);
if (l >= MAX_LINELEN)
hl[MAX_LINELEN-1] = '\0';
if (l == 0 || hl[0] == ' ') {
if (l == 0) {
free(hl);
continue;
}
state->history[hi++] = hl;
}
fclose(fp);
state->cur_history = state->cnt_history = hi;
state->cnt_history = hi;
}
}
@@ -1043,19 +1053,27 @@ static void remember_in_history(const char *str)
if (!(state->flags & DO_HISTORY))
return;
if (str[0] == '\0')
return;
i = state->cnt_history;
free(state->history[MAX_HISTORY]);
state->history[MAX_HISTORY] = NULL;
/* After max history, remove the oldest command */
/* Don't save dupes */
if (i && strcmp(state->history[i-1], str) == 0)
return;
free(state->history[MAX_HISTORY]); /* redundant, paranoia */
state->history[MAX_HISTORY] = NULL; /* redundant, paranoia */
/* If history[] is full, remove the oldest command */
/* we need to keep history[MAX_HISTORY] empty, hence >=, not > */
if (i >= MAX_HISTORY) {
free(state->history[0]);
for (i = 0; i < MAX_HISTORY-1; i++)
state->history[i] = state->history[i+1];
/* i == MAX_HISTORY-1 */
}
// Maybe "if (!i || strcmp(history[i-1], command) != 0) ..."
// (i.e. do not save dups?)
/* i <= MAX_HISTORY-1 */
state->history[i++] = xstrdup(str);
/* i <= MAX_HISTORY */
state->cur_history = i;
state->cnt_history = i;
#if ENABLE_FEATURE_EDITING_SAVEHISTORY
@@ -1397,6 +1415,10 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
if ((state->flags & SAVE_HISTORY) && state->hist_file)
load_history(state->hist_file);
#endif
#if MAX_HISTORY > 0
if (state->flags & DO_HISTORY)
state->cur_history = state->cnt_history;
#endif
/* prepare before init handlers */
cmdedit_y = 0; /* quasireal y, not true if line > xt*yt */
@@ -1416,7 +1438,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
#define _POSIX_VDISABLE '\0'
#endif
new_settings.c_cc[VINTR] = _POSIX_VDISABLE;
tcsetattr(STDIN_FILENO, TCSANOW, &new_settings);
tcsetattr_stdin_TCSANOW(&new_settings);
/* Now initialize things */
previous_SIGWINCH_handler = signal(SIGWINCH, win_changed);
@@ -1432,6 +1454,13 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
}
}
#endif
#if 0
for (ic = 0; ic <= MAX_HISTORY; ic++)
bb_error_msg("history[%d]:'%s'", ic, state->history[ic]);
bb_error_msg("cur_history:%d cnt_history:%d", state->cur_history, state->cnt_history);
#endif
/* Print out the command prompt */
parse_and_put_prompt(prompt);
@@ -1540,11 +1569,8 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
vi_case(CTRL('P')|vbit:)
vi_case('k'|vbit:)
/* Control-p -- Get previous command from history */
if ((state->flags & DO_HISTORY) && state->cur_history > 0) {
get_previous_history();
if (get_previous_history())
goto rewrite_line;
}
beep();
break;
#endif
@@ -1733,10 +1759,8 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
#if MAX_HISTORY > 0
case 'A':
/* Up Arrow -- Get previous command from history */
if ((state->flags & DO_HISTORY) && state->cur_history > 0) {
get_previous_history();
if (get_previous_history())
goto rewrite_line;
}
beep();
break;
case 'B':
@@ -1746,7 +1770,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
rewrite_line:
/* Rewrite the line with the selected history item */
/* change command */
command_len = strlen(strcpy(command, state->history[state->cur_history]));
command_len = strlen(strcpy(command, state->history[state->cur_history] ? : ""));
/* redraw and go to eol (bol, in vi */
redraw(cmdedit_y, (state->flags & VI_MODE) ? 9999 : 0);
break;
@@ -1838,7 +1862,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
#endif
/* restore initial_settings */
tcsetattr(STDIN_FILENO, TCSANOW, &initial_settings);
tcsetattr_stdin_TCSANOW(&initial_settings);
/* restore SIGWINCH handler */
signal(SIGWINCH, previous_SIGWINCH_handler);
fflush(stdout);
+1 -3
View File
@@ -4,7 +4,7 @@
*
* Copyright (C) 2003 Glenn McGrath
* Copyright (C) 2005 Vladimir Oleynik
* Copyright (C) 2005 Bernhard Fischer
* Copyright (C) 2005 Bernhard Reutner-Fischer
* Copyright (C) 2006 Rob Landley <rob@landley.net>
*
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
@@ -90,7 +90,6 @@ void FAST_FUNC llist_free(llist_t *elm, void (*freeit) (void *data))
}
}
#ifdef UNUSED
/* Reverse list order. */
llist_t* FAST_FUNC llist_rev(llist_t *list)
{
@@ -105,4 +104,3 @@ llist_t* FAST_FUNC llist_rev(llist_t *list)
}
return rev;
}
#endif
Loaded 100 of 267 files, more files were not shown because too many files have changed in this diff. Show more