From 503a07cab24a1e58099a04970babd2b761469449 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 25 Jul 2010 00:13:27 +0200 Subject: [PATCH] Apply post-1.17.0 fixes Signed-off-by: Denys Vlasenko --- Config.in | 3 +- applets/usage_compressed | 6 +- archival/Config.src | 2 +- archival/tar.c | 2 +- archival/unzip_doc.txt.bz2 | Bin 11359 -> 0 bytes coreutils/dos2unix.c | 2 +- coreutils/realpath.c | 2 +- debianutils/mktemp.c | 3 +- e2fsprogs/Config.src | 2 +- editors/diff.c | 27 ++- editors/vi.c | 20 +- init/bootchartd.c | 4 +- libbb/Config.src | 2 +- libbb/lineedit.c | 2 + miscutils/Config.src | 14 +- modutils/depmod.c | 76 ++++--- modutils/modprobe.c | 10 +- networking/ip.c | 62 ++---- networking/nc.c | 2 +- networking/wget.c | 2 +- procps/top.c | 8 +- scripts/Makefile.build | 7 +- scripts/gen_build_files.sh | 7 +- scripts/test_make_O | 11 + testsuite/diff.tests | 31 ++- util-linux/Config.src | 435 +++++++++++++++++++------------------ util-linux/acpid.c | 18 +- util-linux/fdisk.c | 2 +- util-linux/more.c | 4 +- 29 files changed, 430 insertions(+), 336 deletions(-) delete mode 100644 archival/unzip_doc.txt.bz2 create mode 100755 scripts/test_make_O diff --git a/Config.in b/Config.in index fc02a2d93..fe64f2b3f 100644 --- a/Config.in +++ b/Config.in @@ -15,7 +15,7 @@ menu "General Configuration" config DESKTOP bool "Enable options for full-blown desktop systems" - default n + default y help Enable options and features which are not essential. Select this only if you plan to use busybox on full-blown @@ -138,6 +138,7 @@ config UNICODE_USING_LOCALE help With this option on, Unicode support is implemented using libc routines. Otherwise, internal implementation is used. + Internal implementation is smaller. config FEATURE_CHECK_UNICODE_IN_ENV bool "Check $LANG environment variable" diff --git a/applets/usage_compressed b/applets/usage_compressed index 9ddf16d38..e1fd0d94d 100755 --- a/applets/usage_compressed +++ b/applets/usage_compressed @@ -40,8 +40,4 @@ echo '#define PACKED_USAGE \' -e 's/$/ \\/' echo '' -if cmp -s "$target.$$" "$target" 2>/dev/null; then - rm -- "$target.$$" -else - mv -- "$target.$$" "$target" -fi +mv -- "$target.$$" "$target" diff --git a/archival/Config.src b/archival/Config.src index f64b3347b..9a84fd6c6 100644 --- a/archival/Config.src +++ b/archival/Config.src @@ -39,7 +39,7 @@ config FEATURE_SEAMLESS_Z config AR bool "ar" - default y + default n # needs to be improved to be able to replace binutils ar help ar is an archival utility program used to create, modify, and extract contents from archives. An archive is a single file holding diff --git a/archival/tar.c b/archival/tar.c index 9dd74536e..5ddff7fa5 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -237,7 +237,7 @@ static int writeTarHeader(struct TarBallInfo *tbInfo, struct tar_header_t header; memset(&header, 0, sizeof(header)); - + strncpy(header.name, header_name, sizeof(header.name)); /* POSIX says to mask mode with 07777. */ diff --git a/archival/unzip_doc.txt.bz2 b/archival/unzip_doc.txt.bz2 deleted file mode 100644 index ab77d10dad1ba41e97b60d6b87e966bb2ee0ff9b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11359 zcmV-lETGduT4*^jL0KkKSqN%)LI4|ve}I4geTVt~|N1}w|K7j<|MXxveeWLk(Y-LY zcXhs+qJVnJ3?ZSD(e+OA1yBG1p}s>tzsiKx#*oPxToo>FA-FhJm2<10VsQG#U*7Ad(_!r7<3bJer=Ts5X<- z2a0+|hSbOdKmY&$078)@(qzQZp`_Ih36y$<+NRX07Q`lXqhxm zM8wlZQzxpP$w!8%?L_q+pz?;AHcdbtp`Zcj1e%b6H8B91o~i8uo`l*pMo&|~ri0W0 zpwMUl0BAln`j2TOD~lkF2$}sbV9*FUBA~2Tsrr0h)n2;~{85dIeH2Ky!}{pLU}*kb zxw{37(G7-vzwNr%HY7D#aV^|wp7i`JDt_3y9c`Tujd=WCZy|=Za75nJ`a(qFi{yB<{}!(O*#>S_s4e(%@2yW zDGDYb#tVO!(~N!>L`p_=MS=^+g-EXXm!M)c5ObkIlEV)nq;EFl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Z3U$a3goDCgwQy{$9d{HAF8&^XVo?Ctz^zx+f=hI%FQSgWr)Ls4p~vwLkfVOHVPzr zb=)vgOTpU*EWp_1+;? z?1X*-_@oWMdu7NIlqzJQMF7&KN@NLq7_LZc<%z_D<)0RMB<<`w2wqLkHGJ0SU@0Wr zLP}Oo&Vj`tteVBci!9wZoZ?4Kju35t>K~<`*En}kI{P!(t%G~dX^DruJV!0=b(oGN z5iE?DNrW{JdNq>`5v&KZFoMy9*pia~dHW6Bw~kRRzbxCjxy2x7k>x_yfIAm!2j*Jfz64P4T)N z12ICxVm)A=t^h(9-iTQyu-EZzfI3V_PG-G6@{)ZN5oCuBCXt)owjFTS@7Oj@>CFZlrA&VG5dA$UcaSuBVZ?@yf(=5QM}YR|`MQoJpvMNt%MysM zM(c+&=gKAcl{Kq^wF_4 zA?h7Rn}Bj-5zORR)t#t0(T@>LK~z%x9oh0~n$y;V^onifkc zixbm@q!qHnHhmYvY%L<)U5f@c#z;uLZT=q*WbUOfc8%3CMRCIsHGl!V6*CeH=bbmC hJC4ucEL*ma;C^ztgdmnvSONe5 diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index 1911f5319..e06ecc4e0 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c @@ -92,7 +92,7 @@ int dos2unix_main(int argc UNUSED_PARAM, char **argv) do { /* might be convert(NULL) if there is no filename given */ convert(*argv, conv_type); - } while (*++argv); + } while (*argv && *++argv); return 0; } diff --git a/coreutils/realpath.c b/coreutils/realpath.c index 90a71ed7d..3bc40ee04 100644 --- a/coreutils/realpath.c +++ b/coreutils/realpath.c @@ -23,7 +23,7 @@ int realpath_main(int argc UNUSED_PARAM, char **argv) do { char *resolved_path = xmalloc_realpath(*argv); - if (resolved_path != NULL) { + if (resolved_path != NULL) { puts(resolved_path); free(resolved_path); } else { diff --git a/debianutils/mktemp.c b/debianutils/mktemp.c index c40211476..2c4e19670 100644 --- a/debianutils/mktemp.c +++ b/debianutils/mktemp.c @@ -50,7 +50,8 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv) opts = getopt32(argv, "dqtp:", &path); chp = argv[optind] ? argv[optind] : xstrdup("tmp.XXXXXX"); - chp = concat_path_file(path, chp); + if (chp[0] != '/' || (opts & 8)) + chp = concat_path_file(path, chp); if (opts & 1) { /* -d */ if (mkdtemp(chp) == NULL) diff --git a/e2fsprogs/Config.src b/e2fsprogs/Config.src index f362c6b0a..62bc810f8 100644 --- a/e2fsprogs/Config.src +++ b/e2fsprogs/Config.src @@ -45,7 +45,7 @@ config LSATTR config TUNE2FS bool "tune2fs" - default y + default n # off: it is too limited compared to upstream version help tune2fs allows the system administrator to adjust various tunable filesystem parameters on Linux ext2/ext3 filesystems. diff --git a/editors/diff.c b/editors/diff.c index 07594e8d8..a3ca2b660 100644 --- a/editors/diff.c +++ b/editors/diff.c @@ -121,6 +121,7 @@ typedef struct FILE_and_pos_t { struct globals { smallint exit_status; int opt_U_context; + const char *other_dir; char *label[2]; struct stat stb[2]; }; @@ -760,9 +761,11 @@ static int FAST_FUNC add_to_dirlist(const char *filename, void *userdata, int depth UNUSED_PARAM) { struct dlist *const l = userdata; + const char *file = filename + l->len; + while (*file == '/') + file++; l->dl = xrealloc_vector(l->dl, 6, l->e); - /* + 1 skips "/" after dirname */ - l->dl[l->e] = xstrdup(filename + l->len + 1); + l->dl[l->e] = xstrdup(file); l->e++; return TRUE; } @@ -778,6 +781,25 @@ static int FAST_FUNC skip_dir(const char *filename, add_to_dirlist(filename, sb, userdata, depth); return SKIP; } + if (!(option_mask32 & FLAG(N))) { + /* -r without -N: no need to recurse into dirs + * which do not exist on the "other side". + * Testcase: diff -r /tmp / + * (it would recurse deep into /proc without this code) */ + struct dlist *const l = userdata; + filename += l->len; + if (filename[0]) { + struct stat osb; + char *othername = concat_path_file(G.other_dir, filename); + int r = stat(othername, &osb); + free(othername); + if (r != 0 || !S_ISDIR(osb.st_mode)) { + /* other dir doesn't have similarly named + * directory, don't recurse */ + return SKIP; + } + } + } return TRUE; } @@ -791,6 +813,7 @@ static void diffdir(char *p[2], const char *s_start) /*list[i].s = list[i].e = 0; - memset did it */ /*list[i].dl = NULL; */ + G.other_dir = p[1 - i]; /* We need to trim root directory prefix. * Using list.len to specify its length, * add_to_dirlist will remove it. */ diff --git a/editors/vi.c b/editors/vi.c index 0f412c362..73e095cf8 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -504,20 +504,17 @@ static int init_text_buffer(char *fn) } #if ENABLE_FEATURE_VI_WIN_RESIZE -static void query_screen_dimensions(void) +static int query_screen_dimensions(void) { -# if ENABLE_FEATURE_VI_ASK_TERMINAL - if (!G.get_rowcol_error) - G.get_rowcol_error = -# endif - get_terminal_width_height(STDIN_FILENO, &columns, &rows); + int err = get_terminal_width_height(STDIN_FILENO, &columns, &rows); if (rows > MAX_SCR_ROWS) rows = MAX_SCR_ROWS; if (columns > MAX_SCR_COLS) columns = MAX_SCR_COLS; + return err; } #else -# define query_screen_dimensions() ((void)0) +# define query_screen_dimensions() (0) #endif static void edit_file(char *fn) @@ -536,7 +533,7 @@ static void edit_file(char *fn) rows = 24; columns = 80; size = 0; - query_screen_dimensions(); + IF_FEATURE_VI_ASK_TERMINAL(G.get_rowcol_error =) query_screen_dimensions(); #if ENABLE_FEATURE_VI_ASK_TERMINAL if (G.get_rowcol_error /* TODO? && no input on stdin */) { uint64_t k; @@ -546,9 +543,12 @@ static void edit_file(char *fn) if ((int32_t)k == KEYCODE_CURSOR_POS) { uint32_t rc = (k >> 32); columns = (rc & 0x7fff); + if (columns > MAX_SCR_COLS) + columns = MAX_SCR_COLS; rows = ((rc >> 16) & 0x7fff); + if (rows > MAX_SCR_ROWS) + rows = MAX_SCR_ROWS; } - query_screen_dimensions(); } #endif new_screen(rows, columns); // get memory for virtual screen @@ -2797,7 +2797,7 @@ static void refresh(int full_screen) int li, changed; char *tp, *sp; // pointer into text[] and screen[] - if (ENABLE_FEATURE_VI_WIN_RESIZE) { + if (ENABLE_FEATURE_VI_WIN_RESIZE IF_FEATURE_VI_ASK_TERMINAL(&& !G.get_rowcol_error) ) { unsigned c = columns, r = rows; query_screen_dimensions(); full_screen |= (c - columns) | (r - rows); diff --git a/init/bootchartd.c b/init/bootchartd.c index b3e08af92..dae2fe6e9 100644 --- a/init/bootchartd.c +++ b/init/bootchartd.c @@ -18,7 +18,7 @@ //config: and stopped using bootchartd stop. //config: //config:config FEATURE_BOOTCHARTD_BLOATED_HEADER -//config: bool "bootchartd" +//config: bool "Compatible, bloated header" //config: default y //config: depends on BOOTCHARTD //config: help @@ -35,7 +35,7 @@ //config: makes bootchartd applet to dump a subset of it. //config: //config:config FEATURE_BOOTCHARTD_CONFIG_FILE -//config: bool "bootchartd" +//config: bool "Support bootchartd.conf" //config: default y //config: depends on BOOTCHARTD //config: help diff --git a/libbb/Config.src b/libbb/Config.src index 80b1e0d21..09bf89246 100644 --- a/libbb/Config.src +++ b/libbb/Config.src @@ -98,7 +98,7 @@ config FEATURE_USERNAME_COMPLETION config FEATURE_EDITING_FANCY_PROMPT bool "Fancy shell prompts" - default n + default y depends on FEATURE_EDITING help Setting this option allows for prompts to use things like \w and diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 8a2ea7974..a9b790cf7 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -1765,11 +1765,13 @@ static void cmdedit_setwidth(unsigned w, int redraw_flg) static void win_changed(int nsig) { + int sv_errno = errno; unsigned width; get_terminal_width_height(0, &width, NULL); cmdedit_setwidth(width, nsig /* - just a yes/no flag */); if (nsig == SIGWINCH) signal(SIGWINCH, win_changed); /* rearm ourself */ + errno = sv_errno; } static int lineedit_read_key(char *read_key_buffer) diff --git a/miscutils/Config.src b/miscutils/Config.src index 012132e7b..2f7c50271 100644 --- a/miscutils/Config.src +++ b/miscutils/Config.src @@ -276,28 +276,28 @@ config FBSPLASH config FLASHCP bool "flashcp" - default y + default n # doesn't build on Ubuntu 8.04 help The flashcp binary, inspired by mtd-utils as of git head 5eceb74f7. This utility is used to copy images into a MTD device. config FLASH_LOCK bool "flash_lock" - default y + default n # doesn't build on Ubuntu 8.04 help The flash_lock binary from mtd-utils as of git head 5ec0c10d0. This utility locks part or all of the flash device. config FLASH_UNLOCK bool "flash_unlock" - default y + default n # doesn't build on Ubuntu 8.04 help The flash_unlock binary from mtd-utils as of git head 5ec0c10d0. This utility unlocks part or all of the flash device. config FLASH_ERASEALL bool "flash_eraseall" - default y + default n # doesn't build on Ubuntu 8.04 help The flash_eraseall binary from mtd-utils as of git head c4c6a59eb. This utility is used to erase the whole MTD device. @@ -311,7 +311,7 @@ config IONICE config INOTIFYD bool "inotifyd" - default y + default n # doesn't build on Knoppix 5 help Simple inotify daemon. Reports filesystem changes. Requires kernel >= 2.6.13 @@ -549,7 +549,7 @@ config READAHEAD config RFKILL bool "rfkill" - default n + default n # doesn't build on Ubuntu 9.04 help Enable/disable wireless devices. @@ -588,7 +588,7 @@ config STRINGS config TASKSET bool "taskset" - default y + default n # doesn't build on some non-x86 targets (m68k) help Retrieve or set a processes's CPU affinity. This requires sched_{g,s}etaffinity support in your libc. diff --git a/modutils/depmod.c b/modutils/depmod.c index c734f142b..694f9ea5a 100644 --- a/modutils/depmod.c +++ b/modutils/depmod.c @@ -28,16 +28,6 @@ typedef struct module_info { struct module_info *dnext, *dprev; } module_info; -enum { - ARG_a = (1<<0), /* All modules, ignore mods in argv */ - ARG_A = (1<<1), /* Only emit .ko that are newer than modules.dep file */ - ARG_b = (1<<2), /* base directory when modules are in staging area */ - ARG_e = (1<<3), /* with -F, print unresolved symbols */ - ARG_F = (1<<4), /* System.map that contains the symbols */ - ARG_n = (1<<5), /* dry-run, print to stdout only */ - ARG_r = (1<<6) /* Compat dummy. Linux Makefile uses it */ -}; - static int FAST_FUNC parse_module(const char *fname, struct stat *sb UNUSED_PARAM, void *data, int depth UNUSED_PARAM) { @@ -58,7 +48,7 @@ static int FAST_FUNC parse_module(const char *fname, struct stat *sb UNUSED_PARA *first = info; info->dnext = info->dprev = info; - info->name = xasprintf("/%s", fname); + info->name = xstrdup(fname + 2); /* skip "./" */ info->modname = xstrdup(filename2modname(fname, modname)); for (ptr = image; ptr < image + len - 10; ptr++) { if (strncmp(ptr, "depends=", 8) == 0) { @@ -134,10 +124,44 @@ static void xfreopen_write(const char *file, FILE *f) bb_perror_msg_and_die("can't open '%s'", file); } +/* Usage: + * [-aAenv] [-C FILE or DIR] [-b BASE] [-F System.map] [VERSION] [MODFILES]... + * -a --all + * Probe all modules. Default if no MODFILES. + * -A --quick + * Check modules.dep's mtime against module files' mtimes. + * -b --basedir BASE + * Use $BASE/lib/modules/VERSION + * -C --config FILE or DIR + * Path to /etc/depmod.conf or /etc/depmod.d/ + * -e --errsyms + * When combined with the -F option, this reports any symbols which + * which are not supplied by other modules or kernel. + * -F --filesyms System.map + * -n --dry-run + * Print modules.dep etc to standard output + * -v --verbose + * Print to stdout all the symbols each module depends on + * and the module's file name which provides that symbol. + * -r No-op + * + * So far we only support: [-rn] [-b BASE] [VERSION] [MODFILES]... + * -aAeF are accepted but ignored. -vC are not accepted. + */ +enum { + //OPT_a = (1 << 0), /* All modules, ignore mods in argv */ + //OPT_A = (1 << 1), /* Only emit .ko that are newer than modules.dep file */ + OPT_b = (1 << 2), /* base directory when modules are in staging area */ + //OPT_e = (1 << 3), /* with -F, print unresolved symbols */ + //OPT_F = (1 << 4), /* System.map that contains the symbols */ + OPT_n = (1 << 5), /* dry-run, print to stdout only */ + OPT_r = (1 << 6) /* Compat dummy. Linux Makefile uses it */ +}; + int depmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int depmod_main(int argc UNUSED_PARAM, char **argv) { - module_info *modules = NULL, *m, *dep; + module_info *modules, *m, *dep; const char *moddir_base = "/"; char *moddir, *version; struct utsname uts; @@ -152,36 +176,30 @@ int depmod_main(int argc UNUSED_PARAM, char **argv) /* If a version is provided, then that kernel version's module directory * is used, rather than the current kernel version (as returned by * "uname -r"). */ - if (*argv && sscanf(*argv, "%d.%d.%d", &tmp, &tmp, &tmp) == 3) { + if (*argv && sscanf(*argv, "%u.%u.%u", &tmp, &tmp, &tmp) == 3) { version = *argv++; } else { uname(&uts); version = uts.release; } moddir = concat_path_file(&CONFIG_DEFAULT_MODULES_DIR[1], version); + xchdir(moddir); + if (ENABLE_FEATURE_CLEAN_UP) + free(moddir); /* Scan modules */ + modules = NULL; if (*argv) { - char *modfile; - struct stat sb; do { - modfile = concat_path_file(moddir, *argv); - xstat(modfile, &sb); - parse_module(modfile, &sb, &modules, 0); - free(modfile); - } while (*(++argv)); + parse_module(*argv, /*sb (unused):*/ NULL, &modules, 0); + } while (*++argv); } else { - recursive_action(moddir, ACTION_RECURSE, + recursive_action(".", ACTION_RECURSE, parse_module, NULL, &modules, 0); } - /* Prepare for writing out the dep files */ - xchdir(moddir); - if (ENABLE_FEATURE_CLEAN_UP) - free(moddir); - /* Generate dependency and alias files */ - if (!(option_mask32 & ARG_n)) + if (!(option_mask32 & OPT_n)) xfreopen_write(CONFIG_DEFAULT_DEPMOD_FILE, stdout); for (m = modules; m != NULL; m = m->next) { printf("%s:", m->name); @@ -200,7 +218,7 @@ int depmod_main(int argc UNUSED_PARAM, char **argv) } #if ENABLE_FEATURE_MODUTILS_ALIAS - if (!(option_mask32 & ARG_n)) + if (!(option_mask32 & OPT_n)) xfreopen_write("modules.alias", stdout); for (m = modules; m != NULL; m = m->next) { const char *fname = bb_basename(m->name); @@ -218,7 +236,7 @@ int depmod_main(int argc UNUSED_PARAM, char **argv) } #endif #if ENABLE_FEATURE_MODUTILS_SYMBOLS - if (!(option_mask32 & ARG_n)) + if (!(option_mask32 & OPT_n)) xfreopen_write("modules.symbols", stdout); for (m = modules; m != NULL; m = m->next) { const char *fname = bb_basename(m->name); diff --git a/modutils/modprobe.c b/modutils/modprobe.c index b4de65b1f..0a9424293 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -483,6 +483,11 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) opt = getopt32(argv, INSMOD_OPTS MODPROBE_OPTS INSMOD_ARGS); argv += optind; + /* Goto modules location */ + xchdir(CONFIG_DEFAULT_MODULES_DIR); + uname(&uts); + xchdir(uts.release); + if (opt & MODPROBE_OPT_LIST_ONLY) { char name[MODULE_NAME_LEN]; char *colon, *tokens[2]; @@ -524,11 +529,6 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) return EXIT_SUCCESS; } - /* Goto modules location */ - xchdir(CONFIG_DEFAULT_MODULES_DIR); - uname(&uts); - xchdir(uts.release); - /* Retrieve module names of already loaded modules */ { char *s; diff --git a/networking/ip.c b/networking/ip.c index 7a0f308f0..3a99fa320 100644 --- a/networking/ip.c +++ b/networking/ip.c @@ -1,14 +1,12 @@ /* vi: set sw=4 ts=4: */ /* - * ip.c "ip" utility frontend. + * "ip" utility frontend. * * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. * - * Authors: Alexey Kuznetsov, - * + * Authors: Alexey Kuznetsov, * * Changes: - * * Rani Assaf 980929: resolve addresses * Bernhard Reutner-Fischer rewrote to use index_in_substr_array */ @@ -24,12 +22,14 @@ || ENABLE_FEATURE_IP_TUNNEL \ || ENABLE_FEATURE_IP_RULE -static int NORETURN ip_print_help(char **argv UNUSED_PARAM) +static int ip_print_help(char **argv UNUSED_PARAM) { bb_show_usage(); } -static int ip_do(int (*ip_func)(char **argv), char **argv) +typedef int (*ip_func_ptr_t)(char**); + +static int ip_do(ip_func_ptr_t ip_func, char **argv) { argv = ip_parse_common_args(argv + 1); return ip_func(argv); @@ -78,45 +78,29 @@ int ip_main(int argc UNUSED_PARAM, char **argv) static const char keywords[] ALIGN1 = IF_FEATURE_IP_ADDRESS("address\0") IF_FEATURE_IP_ROUTE("route\0") + IF_FEATURE_IP_ROUTE("r\0") IF_FEATURE_IP_LINK("link\0") - IF_FEATURE_IP_TUNNEL("tunnel\0" "tunl\0") + IF_FEATURE_IP_TUNNEL("tunnel\0") + IF_FEATURE_IP_TUNNEL("tunl\0") IF_FEATURE_IP_RULE("rule\0") ; - enum { - IF_FEATURE_IP_ADDRESS(IP_addr,) - IF_FEATURE_IP_ROUTE(IP_route,) - IF_FEATURE_IP_LINK(IP_link,) - IF_FEATURE_IP_TUNNEL(IP_tunnel, IP_tunl,) - IF_FEATURE_IP_RULE(IP_rule,) - IP_none + static const ip_func_ptr_t ip_func_ptrs[] = { + ip_print_help, + IF_FEATURE_IP_ADDRESS(do_ipaddr,) + IF_FEATURE_IP_ROUTE(do_iproute,) + IF_FEATURE_IP_ROUTE(do_iproute,) + IF_FEATURE_IP_LINK(do_iplink,) + IF_FEATURE_IP_TUNNEL(do_iptunnel,) + IF_FEATURE_IP_TUNNEL(do_iptunnel,) + IF_FEATURE_IP_RULE(do_iprule,) }; - int (*ip_func)(char**) = ip_print_help; + ip_func_ptr_t ip_func; + int key; argv = ip_parse_common_args(argv + 1); - if (*argv) { - int key = index_in_substrings(keywords, *argv); - argv++; -#if ENABLE_FEATURE_IP_ADDRESS - if (key == IP_addr) - ip_func = do_ipaddr; -#endif -#if ENABLE_FEATURE_IP_ROUTE - if (key == IP_route) - ip_func = do_iproute; -#endif -#if ENABLE_FEATURE_IP_LINK - if (key == IP_link) - ip_func = do_iplink; -#endif -#if ENABLE_FEATURE_IP_TUNNEL - if (key == IP_tunnel || key == IP_tunl) - ip_func = do_iptunnel; -#endif -#if ENABLE_FEATURE_IP_RULE - if (key == IP_rule) - ip_func = do_iprule; -#endif - } + key = *argv ? index_in_substrings(keywords, *argv++) : -1; + ip_func = ip_func_ptrs[key + 1]; + return ip_func(argv); } diff --git a/networking/nc.c b/networking/nc.c index 0dacaf117..c77137480 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -34,7 +34,7 @@ //config: //config:config NC_110_COMPAT //config: bool "Netcat 1.10 compatibility (+2.5k)" -//config: default y +//config: default n # off specially for Rob //config: depends on NC //config: help //config: This option makes nc closely follow original nc-1.10. diff --git a/networking/wget.c b/networking/wget.c index f55b68a38..1f35f8b03 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -50,7 +50,7 @@ static void progress_meter(int flag) } bb_progress_update(&G.pmt, G.curfile, G.beg_range, G.transferred, - G.chunked ? 0 : G.content_len + G.beg_range); + G.chunked ? 0 : G.beg_range + G.transferred + G.content_len); if (flag == 0) { /* last call to progress_meter */ diff --git a/procps/top.c b/procps/top.c index 04dd82633..ec8437442 100644 --- a/procps/top.c +++ b/procps/top.c @@ -686,10 +686,10 @@ static int topmem_sort(char *a, char *b) n = offsetof(topmem_status_t, vsz) + (sort_field * sizeof(mem_t)); l = *(mem_t*)(a + n); r = *(mem_t*)(b + n); -// if (l == r) { -// l = a->mapped_rw; -// r = b->mapped_rw; -// } + if (l == r) { + l = ((topmem_status_t*)a)->dirty; + r = ((topmem_status_t*)b)->dirty; + } /* We want to avoid unsigned->signed and truncation errors */ /* l>r: -1, l=r: 0, l r) ? -1 : (l != r); diff --git a/scripts/Makefile.build b/scripts/Makefile.build index f343818b1..5685b5bcc 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -13,8 +13,13 @@ __build: include scripts/Kbuild.include # The filename Kbuild has precedence over Makefile +# bbox: we also try to include Kbuild file in obj tree first kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) -include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) +include $(if $(wildcard $(src)/Kbuild), $(src)/Kbuild, \ + $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, \ + $(kbuild-dir)/Makefile \ + ) \ + ) include scripts/Makefile.lib diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh index a98f509ce..18c172d5a 100755 --- a/scripts/gen_build_files.sh +++ b/scripts/gen_build_files.sh @@ -4,6 +4,8 @@ test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; } # cd to objtree cd -- "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; } +# In separate objtree build, include/ might not exist yet +mkdir include 2>/dev/null srctree="$1" @@ -46,11 +48,13 @@ if test x"$new" != x"$old"; then fi # (Re)generate */Kbuild and */Config.in -find -type d | while read -r d; do +{ cd -- "$srctree" && find -type d; } | while read -r d; do d="${d#./}" + src="$srctree/$d/Kbuild.src" dst="$d/Kbuild" if test -f "$src"; then + mkdir -p -- "$d" 2>/dev/null #echo " CHK $dst" s=`sed -n 's@^//kbuild:@@p' -- "$srctree/$d"/*.c` @@ -70,6 +74,7 @@ find -type d | while read -r d; do src="$srctree/$d/Config.src" dst="$d/Config.in" if test -f "$src"; then + mkdir -p -- "$d" 2>/dev/null #echo " CHK $dst" s=`sed -n 's@^//config:@@p' -- "$srctree/$d"/*.c` diff --git a/scripts/test_make_O b/scripts/test_make_O new file mode 100755 index 000000000..a0ee6a868 --- /dev/null +++ b/scripts/test_make_O @@ -0,0 +1,11 @@ +#!/bin/sh + +b=`basename $PWD` +test "${b#busybox}" != "$b" || { echo "Must be run in busybox tree"; exit 1; } + +rm -rf ../testdir_make_O.$$ +mkdir ../testdir_make_O.$$ +odir=`cd ../testdir_make_O.$$ && pwd` +test -d "$odir" || exit 1 + +make O="$odir" $MAKEOPTS "$@" defconfig busybox 2>&1 | tee test_make_O.log diff --git a/testsuite/diff.tests b/testsuite/diff.tests index 06d5a4fd7..27a4b33a7 100755 --- a/testsuite/diff.tests +++ b/testsuite/diff.tests @@ -4,7 +4,7 @@ . ./testing.sh -# testing "test name" "options" "expected result" "file input" "stdin" +# testing "test name" "commands" "expected result" "file input" "stdin" # diff outputs date/time in the header, which should not be analysed # NB: sed has tab character in s command! @@ -100,9 +100,11 @@ testing "diff always takes context from old file" \ "abc\na c\ndef\n" \ "a c\n" -# testing "test name" "options" "expected result" "file input" "stdin" +# testing "test name" "commands" "expected result" "file input" "stdin" +# clean up rm -rf diff1 diff2 + mkdir diff1 diff2 diff2/subdir echo qwe >diff1/- echo asd >diff2/subdir/- @@ -187,4 +189,29 @@ SKIP= # clean up rm -rf diff1 diff2 +# NOT using directory structure from prev test... +mkdir diff1 diff2 +echo qwe >diff1/- +echo rty >diff2/- +optional FEATURE_DIFF_DIR +testing "diff diff1 diff2/" \ + "diff -ur diff1 diff2/ | $TRIM_TAB; diff -ur .///diff1 diff2//// | $TRIM_TAB" \ +"\ +--- diff1/- ++++ diff2/- +@@ -1 +1 @@ +-qwe ++rty +--- .///diff1/- ++++ diff2////- +@@ -1 +1 @@ +-qwe ++rty +" \ + "" "" +SKIP= + +# clean up +rm -rf diff1 diff2 + exit $FAILCOUNT diff --git a/util-linux/Config.src b/util-linux/Config.src index 3c3e05ec4..91d1fc2ce 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -470,221 +470,6 @@ config FEATURE_USE_TERMIOS will be unable to determine the current screen size, and will be unable to move the cursor. -config VOLUMEID - bool #No description makes it a hidden option - default n - -config FEATURE_VOLUMEID_EXT - bool "Ext filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_BTRFS - bool "btrfs filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_REISERFS - bool "Reiser filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_FAT - bool "fat filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_HFS - bool "hfs filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_JFS - bool "jfs filesystem" - default y - depends on VOLUMEID - help - TODO - -### config FEATURE_VOLUMEID_UFS -### bool "ufs filesystem" -### default y -### depends on VOLUMEID -### help -### TODO - -config FEATURE_VOLUMEID_XFS - bool "xfs filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_NTFS - bool "ntfs filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_ISO9660 - bool "iso9660 filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_UDF - bool "udf filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_LUKS - bool "luks filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_LINUXSWAP - bool "linux swap filesystem" - default y - depends on VOLUMEID - help - TODO - -### config FEATURE_VOLUMEID_LVM -### bool "lvm" -### default y -### depends on VOLUMEID -### help -### TODO - -config FEATURE_VOLUMEID_CRAMFS - bool "cramfs filesystem" - default y - depends on VOLUMEID - help - TODO - -### config FEATURE_VOLUMEID_HPFS -### bool "hpfs filesystem" -### default y -### depends on VOLUMEID -### help -### TODO - -config FEATURE_VOLUMEID_ROMFS - bool "romfs filesystem" - default y - depends on VOLUMEID - help - TODO - -config FEATURE_VOLUMEID_SYSV - bool "sysv filesystem" - default y - depends on VOLUMEID - help - TODO - -### config FEATURE_VOLUMEID_MINIX -### bool "minix filesystem" -### default y -### depends on VOLUMEID -### help -### TODO - -### These only detect partition tables - not used (yet?) -### config FEATURE_VOLUMEID_MAC -### bool "mac filesystem" -### default y -### depends on VOLUMEID -### help -### TODO -### -### config FEATURE_VOLUMEID_MSDOS -### bool "msdos filesystem" -### default y -### depends on VOLUMEID -### help -### TODO - -config FEATURE_VOLUMEID_OCFS2 - bool "ocfs2 filesystem" - default y - depends on VOLUMEID - help - TODO - -### config FEATURE_VOLUMEID_HIGHPOINTRAID -### bool "highpoint raid" -### default y -### depends on VOLUMEID -### help -### TODO - -### config FEATURE_VOLUMEID_ISWRAID -### bool "intel raid" -### default y -### depends on VOLUMEID -### help -### TODO - -### config FEATURE_VOLUMEID_LSIRAID -### bool "lsi raid" -### default y -### depends on VOLUMEID -### help -### TODO - -### config FEATURE_VOLUMEID_VIARAID -### bool "via raid" -### default y -### depends on VOLUMEID -### help -### TODO - -### config FEATURE_VOLUMEID_SILICONRAID -### bool "silicon raid" -### default y -### depends on VOLUMEID -### help -### TODO - -### config FEATURE_VOLUMEID_NVIDIARAID -### bool "nvidia raid" -### default y -### depends on VOLUMEID -### help -### TODO - -### config FEATURE_VOLUMEID_PROMISERAID -### bool "promise raid" -### default y -### depends on VOLUMEID -### help -### TODO - -config FEATURE_VOLUMEID_LINUXRAID - bool "linuxraid" - default y - depends on VOLUMEID - help - TODO - config MOUNT bool "mount" default y @@ -937,4 +722,224 @@ config FEATURE_MTAB_SUPPORT About the only reason to use this is if you've removed /proc from your kernel. +config VOLUMEID + bool #No description makes it a hidden option + default n + +menu "Filesystem/Volume identification" + depends on VOLUMEID + +config FEATURE_VOLUMEID_EXT + bool "Ext filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_BTRFS + bool "btrfs filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_REISERFS + bool "Reiser filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_FAT + bool "fat filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_HFS + bool "hfs filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_JFS + bool "jfs filesystem" + default y + depends on VOLUMEID + help + TODO + +### config FEATURE_VOLUMEID_UFS +### bool "ufs filesystem" +### default y +### depends on VOLUMEID +### help +### TODO + +config FEATURE_VOLUMEID_XFS + bool "xfs filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_NTFS + bool "ntfs filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_ISO9660 + bool "iso9660 filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_UDF + bool "udf filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_LUKS + bool "luks filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_LINUXSWAP + bool "linux swap filesystem" + default y + depends on VOLUMEID + help + TODO + +### config FEATURE_VOLUMEID_LVM +### bool "lvm" +### default y +### depends on VOLUMEID +### help +### TODO + +config FEATURE_VOLUMEID_CRAMFS + bool "cramfs filesystem" + default y + depends on VOLUMEID + help + TODO + +### config FEATURE_VOLUMEID_HPFS +### bool "hpfs filesystem" +### default y +### depends on VOLUMEID +### help +### TODO + +config FEATURE_VOLUMEID_ROMFS + bool "romfs filesystem" + default y + depends on VOLUMEID + help + TODO + +config FEATURE_VOLUMEID_SYSV + bool "sysv filesystem" + default y + depends on VOLUMEID + help + TODO + +### config FEATURE_VOLUMEID_MINIX +### bool "minix filesystem" +### default y +### depends on VOLUMEID +### help +### TODO + +### These only detect partition tables - not used (yet?) +### config FEATURE_VOLUMEID_MAC +### bool "mac filesystem" +### default y +### depends on VOLUMEID +### help +### TODO +### +### config FEATURE_VOLUMEID_MSDOS +### bool "msdos filesystem" +### default y +### depends on VOLUMEID +### help +### TODO + +config FEATURE_VOLUMEID_OCFS2 + bool "ocfs2 filesystem" + default y + depends on VOLUMEID + help + TODO + +### config FEATURE_VOLUMEID_HIGHPOINTRAID +### bool "highpoint raid" +### default y +### depends on VOLUMEID +### help +### TODO + +### config FEATURE_VOLUMEID_ISWRAID +### bool "intel raid" +### default y +### depends on VOLUMEID +### help +### TODO + +### config FEATURE_VOLUMEID_LSIRAID +### bool "lsi raid" +### default y +### depends on VOLUMEID +### help +### TODO + +### config FEATURE_VOLUMEID_VIARAID +### bool "via raid" +### default y +### depends on VOLUMEID +### help +### TODO + +### config FEATURE_VOLUMEID_SILICONRAID +### bool "silicon raid" +### default y +### depends on VOLUMEID +### help +### TODO + +### config FEATURE_VOLUMEID_NVIDIARAID +### bool "nvidia raid" +### default y +### depends on VOLUMEID +### help +### TODO + +### config FEATURE_VOLUMEID_PROMISERAID +### bool "promise raid" +### default y +### depends on VOLUMEID +### help +### TODO + +config FEATURE_VOLUMEID_LINUXRAID + bool "linuxraid" + default y + depends on VOLUMEID + help + TODO + +endmenu + endmenu diff --git a/util-linux/acpid.c b/util-linux/acpid.c index 342930964..11a9f624a 100644 --- a/util-linux/acpid.c +++ b/util-linux/acpid.c @@ -9,9 +9,25 @@ #include "libbb.h" #include +#ifndef EV_SW +# define EV_SW 0x05 +#endif +#ifndef EV_KEY +# define EV_KEY 0x01 +#endif +#ifndef SW_LID +# define SW_LID 0x00 +#endif #ifndef SW_RFKILL_ALL -# define SW_RFKILL_ALL 3 +# define SW_RFKILL_ALL 0x03 #endif +#ifndef KEY_POWER +# define KEY_POWER 116 /* SC System Power Down */ +#endif +#ifndef KEY_SLEEP +# define KEY_SLEEP 142 /* SC System Sleep */ +#endif + /* * acpid listens to ACPI events coming either in textual form diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 7227a829e..aa718c787 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c @@ -2805,7 +2805,7 @@ list_devs_in_proc_partititons(void) &ma, &mi, &sz, ptname) != 4) continue; for (s = ptname; *s; s++) - continue; + continue; /* note: excluding '0': e.g. mmcblk0 is not a partition name! */ if (s[-1] >= '1' && s[-1] <= '9') continue; diff --git a/util-linux/more.c b/util-linux/more.c index 55694e434..9216b6137 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -31,7 +31,7 @@ struct globals { #define setTermSettings(fd, argp) do { \ if (ENABLE_FEATURE_USE_TERMIOS) tcsetattr(fd, TCSANOW, argp); \ - } while(0) + } while (0) #define getTermSettings(fd, argp) tcgetattr(fd, argp) static void gotsig(int sig UNUSED_PARAM) @@ -46,7 +46,7 @@ static void gotsig(int sig UNUSED_PARAM) int more_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int more_main(int argc UNUSED_PARAM, char **argv) { - int c = c; /* for gcc */ + int c = c; /* for compiler */ int lines; int input = 0; int spaces = 0; -- 2.25.1