From 342a5e65c3ebe6bce363d9b887e62f1c75fa3b51 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 20 Mar 2009 21:00:10 +0000 Subject: core/apk-tools: upgrade to 2.0_pre10 --- core/apk-tools/APKBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/apk-tools/APKBUILD b/core/apk-tools/APKBUILD index d048a3fb9..3cfc3984c 100644 --- a/core/apk-tools/APKBUILD +++ b/core/apk-tools/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Natanael Copa pkgname=apk-tools -pkgver=2.0_pre9 +pkgver=2.0_pre10 pkgrel=0 pkgdesc="Alpine Package Keeper - package manager for alpine" depends="uclibc" @@ -22,4 +22,4 @@ build() { ln -s apk apk_version } -md5sums="c694f45bde3f971a67dc0c0e14b9e82a apk-tools-2.0_pre9.tar.bz2" +md5sums="7469f5e314109fba4c4e7d43889964ca apk-tools-2.0_pre10.tar.bz2" -- cgit v1.2.3 From ac6eb553e9ce3abb203e991c622d82df69133fbf Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 20 Mar 2009 21:54:40 +0000 Subject: extra/wget: restore busybox links on deinstall --- core/busybox/APKBUILD | 28 +- core/busybox/busybox-1.13.2-depmod.patch | 121 ------ core/busybox/busybox-1.13.2-init.patch | 50 --- core/busybox/busybox-1.13.2-mdev.patch | 39 -- core/busybox/busybox-1.13.2-modprobe-speedup.patch | 445 --------------------- core/busybox/busybox-1.13.2-modprobe.patch | 99 ----- core/busybox/busybox-1.13.2-tar.patch | 11 - core/busybox/busybox-1.13.3-ash.patch | 384 ++++++++++++++++++ core/busybox/busybox-1.13.3-hush.patch | 160 ++++++++ core/busybox/busybox.post-install | 3 + core/busybox/busybox.post-upgrade | 3 + core/busybox/busyboxconfig | 12 +- 12 files changed, 568 insertions(+), 787 deletions(-) delete mode 100644 core/busybox/busybox-1.13.2-depmod.patch delete mode 100644 core/busybox/busybox-1.13.2-init.patch delete mode 100644 core/busybox/busybox-1.13.2-mdev.patch delete mode 100644 core/busybox/busybox-1.13.2-modprobe-speedup.patch delete mode 100644 core/busybox/busybox-1.13.2-modprobe.patch delete mode 100644 core/busybox/busybox-1.13.2-tar.patch create mode 100644 core/busybox/busybox-1.13.3-ash.patch create mode 100644 core/busybox/busybox-1.13.3-hush.patch create mode 100644 core/busybox/busybox.post-install create mode 100644 core/busybox/busybox.post-upgrade (limited to 'core') diff --git a/core/busybox/APKBUILD b/core/busybox/APKBUILD index 523fdd882..d75fd21b4 100644 --- a/core/busybox/APKBUILD +++ b/core/busybox/APKBUILD @@ -1,22 +1,20 @@ # Maintainer: Natanael Copa pkgname=busybox -pkgver=1.13.2 -pkgrel=5 +pkgver=1.13.3 +pkgrel=1 pkgdesc="Size optimized toolbox of many common UNIX utilities" url=http://busybox.net license=GPL-2 depends=uclibc +install="$pkgname.post-install $pkgname.post-upgrade" source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2 $pkgname-1.12.1-vi-path.patch $pkgname-1.11.1-bb.patch - busybox-1.13.2-depmod.patch - busybox-1.13.2-init.patch - busybox-1.13.2-mdev.patch - busybox-1.13.2-modprobe.patch busybox-1.13.2-modprobe-errormsg.patch - busybox-1.13.2-modprobe-speedup.patch - busybox-1.13.2-tar.patch busybox-1.13.2-depmod2.patch + busybox-1.13.3-ash.patch + busybox-1.13.3-hush.patch + $install busyboxconfig" build() { @@ -37,15 +35,13 @@ build() { make install DESTDIR=$pkgdir } -md5sums="9e2a604d18bef219a5a6bf3acf78b9e1 busybox-1.13.2.tar.bz2 +md5sums="0cde6d2790e790837d6d7e82faae3ca1 busybox-1.13.3.tar.bz2 f5a8ae3145aa249868c1a1abc319c228 busybox-1.12.1-vi-path.patch 4c0f3b486eaa0674961b7ddcd0c60a9b busybox-1.11.1-bb.patch -7c9dfb5dcd66a1d6e837e72ad0cb05d4 busybox-1.13.2-depmod.patch -7afb3a1b474742bc198b3c8450ab9a7e busybox-1.13.2-init.patch -a72d169e9545e26257032e0e367feb95 busybox-1.13.2-mdev.patch -6eeb6efcd71e57082d6654a9a6a368eb busybox-1.13.2-modprobe.patch a743ec04f378b8456a725c7270b0be8b busybox-1.13.2-modprobe-errormsg.patch -2120bc7d9fb4dcbbb94664c9fefa4c8a busybox-1.13.2-modprobe-speedup.patch -90d093817855bc63ad16fbb8524f80df busybox-1.13.2-tar.patch 3c43008545e069749d2d653532e1feb3 busybox-1.13.2-depmod2.patch -7da47c98607834ca9c47a22bf3fe4b6e busyboxconfig" +ed7537bc7193ab35f4e4ac6ce26d8270 busybox-1.13.3-ash.patch +4a5fe634708150f65b6d9b51dba20a51 busybox-1.13.3-hush.patch +542ea5a470af0db6794ba38db9f8e779 busybox.post-install +542ea5a470af0db6794ba38db9f8e779 busybox.post-upgrade +fa6b9e2021102a53c43875ef0704d6f3 busyboxconfig" diff --git a/core/busybox/busybox-1.13.2-depmod.patch b/core/busybox/busybox-1.13.2-depmod.patch deleted file mode 100644 index 32d616384..000000000 --- a/core/busybox/busybox-1.13.2-depmod.patch +++ /dev/null @@ -1,121 +0,0 @@ ---- busybox-1.13.2/modutils/depmod.c Sun Nov 9 18:28:03 2008 -+++ busybox-1.13.2-depmod/modutils/depmod.c Mon Jan 12 23:12:59 2009 -@@ -33,7 +33,7 @@ - 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), /* not /lib/modules/$(uname -r)/ but this base-dir */ -+ 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 */ -@@ -57,7 +57,7 @@ - *first = info; - - info->dnext = info->dprev = info; -- info->name = xstrdup(fname); -+ info->name = xasprintf("/%s", fname); - info->modname = filename2modname(fname, NULL); - for (ptr = image; ptr < image + len - 10; ptr++) { - if (strncmp(ptr, "depends=", 8) == 0) { -@@ -123,44 +123,61 @@ - } - } - -+static void xfreopen_write(const char *file, FILE *f) -+{ -+ if (freopen(file, "w", f) == NULL) -+ bb_perror_msg_and_die("can't open '%s'", file); -+} -+ - 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; -- char *moddir_base = (char *)CONFIG_DEFAULT_MODULES_DIR; -+ const char *moddir_base = "/"; -+ char *moddir, *version; -+ struct utsname uts; - int tmp; - - getopt32(argv, "aAb:eF:n", &moddir_base, NULL); - argv += optind; - - /* goto modules location */ -+ xchdir(moddir_base); - - /* 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"). */ -- xchdir(moddir_base); -- if (*argv && (sscanf(*argv, "%d.%d.%d", &tmp, &tmp, &tmp) == 3)) { -- xchdir(*argv++); -+ if (*argv && sscanf(*argv, "%d.%d.%d", &tmp, &tmp, &tmp) == 3) { -+ version = *argv++; - } else { -- struct utsname uts; - uname(&uts); -- xchdir(uts.release); -+ version = uts.release; - } -- /* If no modules are given on the command-line, -a is on per default. */ -- option_mask32 |= *argv == NULL; -+ moddir = concat_path_file(&CONFIG_DEFAULT_MODULES_DIR[1], version); - - /* Scan modules */ -- moddir_base = xrealloc_getcwd_or_warn(NULL); -- do { -- recursive_action((option_mask32 & ARG_a) ? moddir_base : *argv, -- ACTION_RECURSE, parse_module, NULL, &modules, 0); -- } while (!(option_mask32 & ARG_a) && *(++argv)); -+ 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)); -+ } else { -+ recursive_action(moddir, ACTION_RECURSE, -+ parse_module, NULL, &modules, 0); -+ } -+ -+ /* Prepare for writing out the dep files */ -+ xchdir(moddir); - if (ENABLE_FEATURE_CLEAN_UP) -- free(moddir_base); -+ free(moddir); - - /* Generate dependency and alias files */ - if (!(option_mask32 & ARG_n)) -- freopen(CONFIG_DEFAULT_DEPMOD_FILE, "w", stdout); -+ xfreopen_write(CONFIG_DEFAULT_DEPMOD_FILE, stdout); - for (m = modules; m != NULL; m = m->next) { - printf("%s:", m->name); - -@@ -174,12 +191,12 @@ - dep->dprev->dnext = dep->dnext; - dep->dnext = dep->dprev = dep; - } -- puts(""); -+ bb_putchar('\n'); - } - - #if ENABLE_FEATURE_MODUTILS_ALIAS - if (!(option_mask32 & ARG_n)) -- freopen("modules.alias", "w", stdout); -+ xfreopen_write("modules.alias", stdout); - for (m = modules; m != NULL; m = m->next) { - while (m->aliases) { - printf("alias %s %s\n", -@@ -190,7 +207,7 @@ - #endif - #if ENABLE_FEATURE_MODUTILS_SYMBOLS - if (!(option_mask32 & ARG_n)) -- freopen("modules.symbols", "w", stdout); -+ xfreopen_write("modules.symbols", stdout); - for (m = modules; m != NULL; m = m->next) { - while (m->symbols) { - printf("alias symbol:%s %s\n", diff --git a/core/busybox/busybox-1.13.2-init.patch b/core/busybox/busybox-1.13.2-init.patch deleted file mode 100644 index 1d98467ac..000000000 --- a/core/busybox/busybox-1.13.2-init.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- busybox-1.13.2/init/init.c Wed Dec 31 04:06:45 2008 -+++ busybox-1.13.2-init/init/init.c Thu Jan 29 03:02:13 2009 -@@ -671,15 +671,14 @@ - */ - static void parse_inittab(void) - { -+#if ENABLE_FEATURE_USE_INITTAB - char *token[4]; -- /* order must correspond to SYSINIT..RESTART constants */ -- static const char actions[] ALIGN1 = -- "sysinit\0""respawn\0""askfirst\0""wait\0""once\0" -- "ctrlaltdel\0""shutdown\0""restart\0"; -+ parser_t *parser = config_open2("/etc/inittab", fopen_for_read); - -- parser_t *parser = config_open2(INITTAB, fopen_for_read); -- /* No inittab file -- set up some default behavior */ -- if (parser == NULL) { -+ if (parser == NULL) -+#endif -+ { -+ /* No inittab file -- set up some default behavior */ - /* Reboot on Ctrl-Alt-Del */ - new_init_action(CTRLALTDEL, "reboot", ""); - /* Umount all filesystems on halt/reboot */ -@@ -699,11 +698,17 @@ - new_init_action(SYSINIT, INIT_SCRIPT, ""); - return; - } -+ -+#if ENABLE_FEATURE_USE_INITTAB - /* optional_tty:ignored_runlevel:action:command - * Delims are not to be collapsed and need exactly 4 tokens - */ - while (config_read(parser, token, 4, 0, "#:", - PARSE_NORMAL & ~(PARSE_TRIM | PARSE_COLLAPSE))) { -+ /* order must correspond to SYSINIT..RESTART constants */ -+ static const char actions[] ALIGN1 = -+ "sysinit\0""respawn\0""askfirst\0""wait\0""once\0" -+ "ctrlaltdel\0""shutdown\0""restart\0"; - int action; - char *tty = token[0]; - -@@ -727,6 +732,7 @@ - parser->lineno); - } - config_close(parser); -+#endif - } - - #if ENABLE_FEATURE_USE_INITTAB diff --git a/core/busybox/busybox-1.13.2-mdev.patch b/core/busybox/busybox-1.13.2-mdev.patch deleted file mode 100644 index bd17f9912..000000000 --- a/core/busybox/busybox-1.13.2-mdev.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- busybox-1.13.2/testsuite/mdev.tests Sun Nov 9 18:28:19 2008 -+++ busybox-1.13.2-mdev/testsuite/mdev.tests Mon Jan 12 08:59:15 2009 -@@ -111,6 +111,22 @@ - - # continuing to use directory structure from prev test - rm -rf mdev.testdir/dev/* -+echo "sda 0:0 644 =block/ @echo @echo TEST" >mdev.testdir/etc/mdev.conf -+testing "mdev move and command" \ -+ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; -+ ls -lnR mdev.testdir/dev | $FILTER_LS2" \ -+"\ -+@echo TEST -+mdev.testdir/dev: -+drwxr-xr-x 2 0 0 block -+ -+mdev.testdir/dev/block: -+brw-r--r-- 1 0 0 sda -+" \ -+ "" "" -+ -+# continuing to use directory structure from prev test -+rm -rf mdev.testdir/dev/* - echo "@8,0 :1 644" >mdev.testdir/etc/mdev.conf - testing "mdev #maj,min and no explicit uid" \ - "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; ---- busybox-1.13.2/util-linux/mdev.c Sun Nov 9 18:28:22 2008 -+++ busybox-1.13.2-mdev/util-linux/mdev.c Mon Jan 12 08:59:15 2009 -@@ -179,8 +179,9 @@ - unsigned i, n; - #endif - char *a = val; -- s = strchr(val, ' '); -- val = (s && s[1]) ? s+1 : NULL; -+ s = strchrnul(val, ' '); -+ val = (s[0] && s[1]) ? s+1 : NULL; -+ s[0] = '\0'; - #if ENABLE_FEATURE_MDEV_RENAME_REGEXP - /* substitute %1..9 with off[1..9], if any */ - n = 0; diff --git a/core/busybox/busybox-1.13.2-modprobe-speedup.patch b/core/busybox/busybox-1.13.2-modprobe-speedup.patch deleted file mode 100644 index 94a15d496..000000000 --- a/core/busybox/busybox-1.13.2-modprobe-speedup.patch +++ /dev/null @@ -1,445 +0,0 @@ -Index: modutils/modutils.c -=================================================================== ---- a/modutils/modutils.c (revision 25448) -+++ b/modutils/modutils.c (working copy) -@@ -71,7 +71,7 @@ - if (modname == NULL) - modname = xmalloc(MODULE_NAME_LEN); - from = bb_get_last_path_component_nostrip(filename); -- for (i = 0; i < MODULE_NAME_LEN && from[i] != '\0' && from[i] != '.'; i++) -+ for (i = 0; i < (MODULE_NAME_LEN-1) && from[i] != '\0' && from[i] != '.'; i++) - modname[i] = (from[i] == '-') ? '_' : from[i]; - modname[i] = 0; - -Index: modutils/modutils.h -=================================================================== ---- a/modutils/modutils.h (revision 25448) -+++ b/modutils/modutils.h (working copy) -@@ -15,8 +15,9 @@ - # pragma GCC visibility push(hidden) - #endif - --/* As defined in linux/include/linux/module.h */ --#define MODULE_NAME_LEN 64 -+/* linux/include/linux/module.h has 64, but this is also used -+ * internally for the maximum alias name length, which can be quite long */ -+#define MODULE_NAME_LEN 256 - - const char *moderror(int err) FAST_FUNC; - llist_t *llist_find(llist_t *first, const char *str) FAST_FUNC; -Index: modutils/modprobe.c -=================================================================== ---- a/modutils/modprobe.c (revision 25448) -+++ b/modutils/modprobe.c (working copy) -@@ -13,23 +13,26 @@ - #include - #include - --struct modprobe_option { -+#define MODULE_FLAG_LOADED 0x0001 -+#define MODULE_FLAG_NEED_DEPS 0x0002 -+#define MODULE_FLAG_EXISTS 0x0004 -+#define MODULE_FLAG_BLACKLISTED 0x0008 -+ -+struct module_entry { - char *module; -- char *option; -+ const char *probe; -+ unsigned int flags; -+ llist_t *aliases; -+ llist_t *options; -+ llist_t *deps; - }; - - struct modprobe_conf { -- char probename[MODULE_NAME_LEN]; -+ llist_t *db; -+ llist_t *probes; - llist_t *options; -- llist_t *aliases; --#if ENABLE_FEATURE_MODPROBE_BLACKLIST --#define add_to_blacklist(conf, name) llist_add_to(&conf->blacklist, name) --#define check_blacklist(conf, name) (llist_find(conf->blacklist, name) == NULL) -- llist_t *blacklist; --#else --#define add_to_blacklist(conf, name) do {} while (0) --#define check_blacklist(conf, name) (1) --#endif -+ int num_deps; -+ int num_symbols; - }; - - #define MODPROBE_OPTS "acdlnrt:VC:" USE_FEATURE_MODPROBE_BLACKLIST("b") -@@ -46,21 +49,55 @@ - MODPROBE_OPT_BLACKLIST = (INSMOD_OPT_UNUSED << 9) * ENABLE_FEATURE_MODPROBE_BLACKLIST, - }; - --static llist_t *loaded; -- - static int read_config(struct modprobe_conf *conf, const char *path); - --static void add_option(llist_t **all_opts, const char *module, const char *opts) -+static struct module_entry *_get_module(struct modprobe_conf *conf, -+ const char *module, int create) - { -- struct modprobe_option *o; -+ char modname[MODULE_NAME_LEN]; -+ struct module_entry *e; -+ llist_t *l; - -- o = xzalloc(sizeof(struct modprobe_option)); -- if (module) -- o->module = filename2modname(module, NULL); -- o->option = xstrdup(opts); -- llist_add_to(all_opts, o); -+ filename2modname(module, modname); -+ for (l = conf->db; l != NULL; l = l->link) { -+ e = (struct module_entry *) l->data; -+ if (strcmp(e->module, modname) == 0) -+ return e; -+ } -+ if (!create) -+ return NULL; -+ -+ e = xzalloc(sizeof(*e)); -+ e->module = xstrdup(modname); -+ llist_add_to(&conf->db, e); -+ -+ return e; - } - -+static struct module_entry *get_module(struct modprobe_conf *conf, -+ const char *module) -+{ -+ return _get_module(conf, module, 1); -+} -+ -+static struct module_entry *add_probe(struct modprobe_conf *conf, -+ const char *name) -+{ -+ struct module_entry *m; -+ -+ m = get_module(conf, name); -+ m->probe = name; -+ m->flags |= MODULE_FLAG_NEED_DEPS; -+ llist_add_to(&conf->probes, m); -+ -+ conf->num_deps++; -+ if (ENABLE_FEATURE_MODUTILS_SYMBOLS && -+ strncmp(m->module, "symbol:", 7) == 0) -+ conf->num_symbols++;; -+ -+ return m; -+} -+ - static int FAST_FUNC config_file_action(const char *filename, - struct stat *statbuf UNUSED_PARAM, - void *userdata, -@@ -68,8 +105,10 @@ - { - struct modprobe_conf *conf = (struct modprobe_conf *) userdata; - RESERVE_CONFIG_BUFFER(modname, MODULE_NAME_LEN); -- char *tokens[3]; -+ char *tokens[3], *rmod; - parser_t *p; -+ llist_t *l; -+ struct module_entry *m; - int rc = TRUE; - - if (bb_basename(filename)[0] == '.') -@@ -84,18 +123,36 @@ - while (config_read(p, tokens, 3, 2, "# \t", PARSE_NORMAL)) { - if (strcmp(tokens[0], "alias") == 0) { - filename2modname(tokens[1], modname); -- if (tokens[2] && -- fnmatch(modname, conf->probename, 0) == 0) -- llist_add_to(&conf->aliases, -- filename2modname(tokens[2], NULL)); -+ if (tokens[2] == NULL) -+ continue; -+ -+ for (l = conf->probes; l != NULL; l = l->link) { -+ m = (struct module_entry *) l->data; -+ if (fnmatch(modname, m->module, 0) != 0) -+ continue; -+ rmod = filename2modname(tokens[2], NULL); -+ llist_add_to(&m->aliases, rmod); -+ -+ if (m->flags & MODULE_FLAG_NEED_DEPS) { -+ m->flags &= ~MODULE_FLAG_NEED_DEPS; -+ conf->num_deps--; -+ } -+ -+ m = get_module(conf, rmod); -+ m->flags |= MODULE_FLAG_NEED_DEPS; -+ conf->num_deps++; -+ } - } else if (strcmp(tokens[0], "options") == 0) { -- if (tokens[2]) -- add_option(&conf->options, tokens[1], tokens[2]); -+ if (tokens[2] == NULL) -+ continue; -+ m = get_module(conf, tokens[1]); -+ llist_add_to(&m->options, xstrdup(tokens[2])); - } else if (strcmp(tokens[0], "include") == 0) { - read_config(conf, tokens[1]); - } else if (ENABLE_FEATURE_MODPROBE_BLACKLIST && - strcmp(tokens[0], "blacklist") == 0) { -- add_to_blacklist(conf, xstrdup(tokens[1])); -+ get_module(conf, tokens[1])->flags -+ |= MODULE_FLAG_BLACKLISTED; - } - } - config_close(p); -@@ -111,74 +168,48 @@ - config_file_action, NULL, conf, 1); - } - --static char *gather_options(llist_t *first, const char *module, int usecmdline) -+static char *gather_options(char *opts, llist_t *o) - { -- struct modprobe_option *opt; -- llist_t *n; -- char *opts = xstrdup(""); -- int optlen = 0; -+ int optlen; - -- for (n = first; n != NULL; n = n->link) { -- opt = (struct modprobe_option *) n->data; -+ if (opts == NULL) -+ opts = xstrdup(""); -+ optlen = strlen(opts); - -- if (opt->module == NULL && !usecmdline) -- continue; -- if (opt->module != NULL && strcmp(opt->module, module) != 0) -- continue; -- -- opts = xrealloc(opts, optlen + strlen(opt->option) + 2); -- optlen += sprintf(opts + optlen, "%s ", opt->option); -+ for (; o != NULL; o = o->link) { -+ opts = xrealloc(opts, optlen + strlen(o->data) + 2); -+ optlen += sprintf(opts + optlen, "%s ", o->data); - } - return opts; - } - --static int do_modprobe(struct modprobe_conf *conf, const char *module) -+static int do_modprobe(struct modprobe_conf *conf, struct module_entry *m) - { -- RESERVE_CONFIG_BUFFER(modname, MODULE_NAME_LEN); -- llist_t *deps = NULL; -- char *fn, *options, *colon = NULL, *tokens[2]; -- parser_t *p; -+ struct module_entry *m2; -+ char *fn, *options; - int rc = -1; - -- p = config_open2(CONFIG_DEFAULT_DEPMOD_FILE, fopen_for_read); -- if (p == NULL) -- goto error; -+ if (!(m->flags & MODULE_FLAG_EXISTS)) -+ return -ENOENT; - -- while (config_read(p, tokens, 2, 1, "# \t", PARSE_NORMAL)) { -- colon = last_char_is(tokens[0], ':'); -- if (colon == NULL) -- continue; -- -- filename2modname(tokens[0], modname); -- if (strcmp(modname, module) == 0) -- break; -- -- colon = NULL; -- } -- if (colon == NULL) -- goto error_not_found; -- -- colon[0] = '\0'; -- llist_add_to(&deps, xstrdup(tokens[0])); -- if (tokens[1]) -- string_to_llist(tokens[1], &deps, " "); -- - if (!(option_mask32 & MODPROBE_OPT_REMOVE)) -- deps = llist_rev(deps); -+ m->deps = llist_rev(m->deps); - - rc = 0; -- while (deps && rc == 0) { -- fn = llist_pop(&deps); -- filename2modname(fn, modname); -+ while (m->deps && rc == 0) { -+ fn = llist_pop(&m->deps); -+ m2 = get_module(conf, fn); - if (option_mask32 & MODPROBE_OPT_REMOVE) { -- if (bb_delete_module(modname, O_EXCL) != 0) -+ if (bb_delete_module(m->module, O_EXCL) != 0) - rc = errno; -- } else if (llist_find(loaded, modname) == NULL) { -- options = gather_options(conf->options, modname, -- strcmp(modname, module) == 0); -+ } else if (!(m2->flags & MODULE_FLAG_LOADED)) { -+ options = gather_options(NULL, m2->options); -+ if (m == m2) -+ options = gather_options(options, -+ conf->options); - rc = bb_init_module(fn, options); - if (rc == 0) -- llist_add_to(&loaded, xstrdup(modname)); -+ m2->flags |= MODULE_FLAG_LOADED; - if (ENABLE_FEATURE_CLEAN_UP) - free(options); - } -@@ -187,25 +218,51 @@ - free(fn); - } - --error_not_found: -- config_close(p); --error: -- if (ENABLE_FEATURE_CLEAN_UP) -- RELEASE_CONFIG_BUFFER(modname); - if (rc > 0 && !(option_mask32 & INSMOD_OPT_SILENT)) - bb_error_msg("failed to %sload module %s: %s", - (option_mask32 & MODPROBE_OPT_REMOVE) ? "un" : "", -- module, moderror(rc)); -+ m->probe ? m->probe : m->module, moderror(rc)); - return rc; - } - -+static void load_modules_dep(struct modprobe_conf *conf) -+{ -+ struct module_entry *m; -+ char *colon, *tokens[2]; -+ parser_t *p; -+ -+ p = config_open2(CONFIG_DEFAULT_DEPMOD_FILE, xfopen_for_read); -+ while (conf->num_deps && -+ config_read(p, tokens, 2, 1, "# \t", PARSE_NORMAL)) { -+ colon = last_char_is(tokens[0], ':'); -+ if (colon == NULL) -+ continue; -+ *colon = 0; -+ -+ m = _get_module(conf, tokens[0], 0); -+ if (m == NULL) -+ continue; -+ -+ m->flags |= MODULE_FLAG_EXISTS; -+ if ((m->flags & MODULE_FLAG_NEED_DEPS) && (m->deps == NULL)) { -+ conf->num_deps--; -+ llist_add_to(&m->deps, xstrdup(tokens[0])); -+ if (tokens[1]) -+ string_to_llist(tokens[1], -+ &m->deps, " "); -+ } -+ } -+ config_close(p); -+} -+ - int modprobe_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; - int modprobe_main(int argc UNUSED_PARAM, char **argv) - { - struct utsname uts; - int rc; - unsigned opt; -- llist_t *options = NULL; -+ struct modprobe_conf conf; -+ struct module_entry *m, *m2; - - opt_complementary = "q-v:v-q"; - opt = getopt32(argv, INSMOD_OPTS MODPROBE_OPTS INSMOD_ARGS, -@@ -228,11 +285,17 @@ - } - return EXIT_SUCCESS; - } -- if (!(opt & MODPROBE_OPT_INSERT_ALL)) { -- /* If not -a, we have only one module name, -- * the rest of parameters are options */ -- add_option(&options, NULL, parse_cmdline_module_options(argv)); -- argv[1] = NULL; -+ -+ memset(&conf, 0, sizeof(conf)); -+ if (opt & MODPROBE_OPT_INSERT_ALL) { -+ /* Each argument is a module name */ -+ for (; *argv != NULL; argv++) -+ add_probe(&conf, *argv); -+ conf.probes = llist_rev(conf.probes); -+ } else { -+ /* First argument is module name, rest are parameters */ -+ m = add_probe(&conf, argv[0]); -+ llist_add_to(&conf.options, parse_cmdline_module_options(argv)); - } - - /* cache modules */ -@@ -240,49 +303,42 @@ - char *s; - parser_t *parser = config_open2("/proc/modules", fopen_for_read); - while (config_read(parser, &s, 1, 1, "# \t", PARSE_NORMAL & ~PARSE_GREEDY)) -- llist_add_to(&loaded, xstrdup(s)); -+ get_module(&conf, s)->flags |= MODULE_FLAG_LOADED; - config_close(parser); - } - -- while (*argv) { -- const char *arg = *argv; -- struct modprobe_conf *conf; -+ read_config(&conf, "/etc/modprobe.conf"); -+ read_config(&conf, "/etc/modprobe.d"); -+ if (ENABLE_FEATURE_MODUTILS_SYMBOLS && conf.num_symbols) -+ read_config(&conf, "modules.symbols"); -+ load_modules_dep(&conf); -+ if (ENABLE_FEATURE_MODUTILS_ALIAS && conf.num_deps) { -+ read_config(&conf, "modules.alias"); -+ load_modules_dep(&conf); -+ } - -- conf = xzalloc(sizeof(*conf)); -- conf->options = options; -- filename2modname(arg, conf->probename); -- read_config(conf, "/etc/modprobe.conf"); -- read_config(conf, "/etc/modprobe.d"); -- if (ENABLE_FEATURE_MODUTILS_SYMBOLS -- && conf->aliases == NULL -- && strncmp(arg, "symbol:", 7) == 0 -- ) { -- read_config(conf, "modules.symbols"); -- } -- -- if (ENABLE_FEATURE_MODUTILS_ALIAS && conf->aliases == NULL) -- read_config(conf, "modules.alias"); -- -- if (conf->aliases == NULL) { -+ while ((m = llist_pop(&conf.probes)) != NULL) { -+ if (m->aliases == NULL) { - /* Try if module by literal name is found; literal - * names are blacklist only if '-b' is given. */ - if (!(opt & MODPROBE_OPT_BLACKLIST) || -- check_blacklist(conf, conf->probename)) { -- rc = do_modprobe(conf, conf->probename); -+ !(m->flags & MODULE_FLAG_BLACKLISTED)) { -+ rc = do_modprobe(&conf, m); - if (rc < 0 && !(opt & INSMOD_OPT_SILENT)) -- bb_error_msg("module %s not found", arg); -+ bb_error_msg("module %s not found", -+ m->probe); - } - } else { - /* Probe all aliases */ -- while (conf->aliases != NULL) { -- char *realname = llist_pop(&conf->aliases); -- if (check_blacklist(conf, realname)) -- do_modprobe(conf, realname); -+ while (m->aliases != NULL) { -+ char *realname = llist_pop(&m->aliases); -+ m2 = get_module(&conf, realname); -+ if (!(m2->flags & MODULE_FLAG_BLACKLISTED)) -+ do_modprobe(&conf, m2); - if (ENABLE_FEATURE_CLEAN_UP) - free(realname); - } - } -- argv++; - } - - return EXIT_SUCCESS; diff --git a/core/busybox/busybox-1.13.2-modprobe.patch b/core/busybox/busybox-1.13.2-modprobe.patch deleted file mode 100644 index 8fd7dc428..000000000 --- a/core/busybox/busybox-1.13.2-modprobe.patch +++ /dev/null @@ -1,99 +0,0 @@ ---- busybox-1.13.2/modutils/modutils-24.c Sat Nov 29 07:48:56 2008 -+++ busybox-1.13.2-modprobe/modutils/modutils-24.c Sun Feb 1 00:08:26 2009 -@@ -2150,7 +2150,7 @@ - sec->name = name; - sec->idx = newidx; - if (size) -- sec->contents = xmalloc(size); -+ sec->contents = xzalloc(size); - - obj_insert_section_load_order(f, sec); - -@@ -2165,7 +2165,7 @@ - int newidx = f->header.e_shnum++; - struct obj_section *sec; - -- f->sections = xrealloc(f->sections, (newidx + 1) * sizeof(sec)); -+ f->sections = xrealloc_vector(f->sections, 2, newidx); - f->sections[newidx] = sec = arch_new_section(); - - sec->header.sh_type = SHT_PROGBITS; -@@ -2175,7 +2175,7 @@ - sec->name = name; - sec->idx = newidx; - if (size) -- sec->contents = xmalloc(size); -+ sec->contents = xzalloc(size); - - sec->load_next = f->load_order; - f->load_order = sec; -@@ -2571,8 +2571,7 @@ - /* Collect the modules' symbols. */ - - if (nmod) { -- ext_modules = modules = xmalloc(nmod * sizeof(*modules)); -- memset(modules, 0, nmod * sizeof(*modules)); -+ ext_modules = modules = xzalloc(nmod * sizeof(*modules)); - for (i = 0, mn = module_names, m = modules; - i < nmod; ++i, ++m, mn += strlen(mn) + 1) { - struct new_module_info info; -@@ -2652,13 +2651,14 @@ - } - - --static void new_create_this_module(struct obj_file *f, const char *m_name) -+static void new_create_this_module(struct obj_file *f, const char *m_name) - { - struct obj_section *sec; - - sec = obj_create_alloced_section_first(f, ".this", tgt_sizeof_long, - sizeof(struct new_module)); -- memset(sec->contents, 0, sizeof(struct new_module)); -+ /* done by obj_create_alloced_section_first: */ -+ /*memset(sec->contents, 0, sizeof(struct new_module));*/ - - obj_add_symbol(f, SPFX "__this_module", -1, - ELF_ST_INFO(STB_LOCAL, STT_OBJECT), sec->idx, 0, -@@ -2965,9 +2965,9 @@ - if (i == f->header.e_shnum) { - struct obj_section *sec; - -+ f->header.e_shnum++; - f->sections = xrealloc_vector(f->sections, 2, i); - f->sections[i] = sec = arch_new_section(); -- f->header.e_shnum = i + 1; - - sec->header.sh_type = SHT_PROGBITS; - sec->header.sh_flags = SHF_WRITE | SHF_ALLOC; -@@ -3006,12 +3006,9 @@ - for (i = 0; i < f->header.e_shnum; ++i) { - struct obj_section *s = f->sections[i]; - if (s->header.sh_type == SHT_NOBITS) { -+ s->contents = NULL; - if (s->header.sh_size != 0) -- s->contents = memset(xmalloc(s->header.sh_size), -- 0, s->header.sh_size); -- else -- s->contents = NULL; -- -+ s->contents = xzalloc(s->header.sh_size); - s->header.sh_type = SHT_PROGBITS; - } - } -@@ -3275,14 +3272,13 @@ - case SHT_SYMTAB: - case SHT_STRTAB: - case SHT_RELM: -+ sec->contents = NULL; - if (sec->header.sh_size > 0) { -- sec->contents = xmalloc(sec->header.sh_size); -+ sec->contents = xzalloc(sec->header.sh_size); - fseek(fp, sec->header.sh_offset, SEEK_SET); - if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) { - bb_perror_msg_and_die("error reading ELF section data"); - } -- } else { -- sec->contents = NULL; - } - break; - diff --git a/core/busybox/busybox-1.13.2-tar.patch b/core/busybox/busybox-1.13.2-tar.patch deleted file mode 100644 index 3a59081c8..000000000 --- a/core/busybox/busybox-1.13.2-tar.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- busybox-1.13.2/archival/tar.c Sun Nov 9 18:28:02 2008 -+++ busybox-1.13.2-tar/archival/tar.c Tue Jan 20 03:52:04 2009 -@@ -591,8 +591,6 @@ - struct TarBallInfo tbInfo; - - tbInfo.hlInfoHead = NULL; -- -- fchmod(tar_fd, 0644); - tbInfo.tarFd = tar_fd; - tbInfo.verboseFlag = verboseFlag; - diff --git a/core/busybox/busybox-1.13.3-ash.patch b/core/busybox/busybox-1.13.3-ash.patch new file mode 100644 index 000000000..710128ab3 --- /dev/null +++ b/core/busybox/busybox-1.13.3-ash.patch @@ -0,0 +1,384 @@ +diff -urpN busybox-1.13.3/shell/ash.c busybox-1.13.3-ash/shell/ash.c +--- busybox-1.13.3/shell/ash.c 2009-02-26 12:46:55.000000000 +0100 ++++ busybox-1.13.3-ash/shell/ash.c 2009-03-20 11:14:53.000000000 +0100 +@@ -30,7 +30,7 @@ + */ + + /* +- * The follow should be set to reflect the type of system you have: ++ * The following should be set to reflect the type of system you have: + * JOBS -> 1 if you have Berkeley job control, 0 otherwise. + * define SYSV if you are running under System V. + * define DEBUG=1 to compile in debugging ('set -o debug' to turn on) +@@ -40,6 +40,11 @@ + * a quit signal will generate a core dump. + */ + #define DEBUG 0 ++/* Tweak debug output verbosity here */ ++#define DEBUG_TIME 0 ++#define DEBUG_PID 1 ++#define DEBUG_SIG 1 ++ + #define PROFILE 0 + + #define IFS_BROKEN +@@ -47,9 +52,9 @@ + #define JOBS ENABLE_ASH_JOB_CONTROL + + #if DEBUG +-#ifndef _GNU_SOURCE +-#define _GNU_SOURCE +-#endif ++# ifndef _GNU_SOURCE ++# define _GNU_SOURCE ++# endif + #endif + + #include "busybox.h" /* for applet_names */ +@@ -57,15 +62,15 @@ + #include + #include + #if JOBS || ENABLE_ASH_READ_NCHARS +-#include ++# include + #endif + + #ifndef PIPE_BUF +-#define PIPE_BUF 4096 /* amount of buffering in a pipe */ ++# define PIPE_BUF 4096 /* amount of buffering in a pipe */ + #endif + + #if defined(__uClinux__) +-#error "Do not even bother, ash will not run on uClinux" ++# error "Do not even bother, ash will not run on uClinux" + #endif + + +@@ -76,14 +81,6 @@ + #define CMDTABLESIZE 31 /* should be prime */ + + +-/* ============ Misc helpers */ +- +-#define xbarrier() do { __asm__ __volatile__ ("": : :"memory"); } while (0) +- +-/* C99 say: "char" declaration may be signed or unsigned default */ +-#define signed_char2int(sc) ((int)((signed char)sc)) +- +- + /* ============ Shell options */ + + static const char *const optletters_optnames[] = { +@@ -245,7 +242,30 @@ extern struct globals_misc *const ash_pt + } while (0) + + ++/* ============ DEBUG */ ++#if DEBUG ++static void trace_printf(const char *fmt, ...); ++static void trace_vprintf(const char *fmt, va_list va); ++# define TRACE(param) trace_printf param ++# define TRACEV(param) trace_vprintf param ++# define close(f) do { \ ++ int dfd = (f); \ ++ if (close(dfd) < 0) \ ++ bb_error_msg("bug on %d: closing %d(%x)", \ ++ __LINE__, dfd, dfd); \ ++} while (0) ++#else ++# define TRACE(param) ++# define TRACEV(param) ++#endif ++ ++ + /* ============ Utility functions */ ++#define xbarrier() do { __asm__ __volatile__ ("": : :"memory"); } while (0) ++ ++/* C99 say: "char" declaration may be signed or unsigned by default */ ++#define signed_char2int(sc) ((int)(signed char)(sc)) ++ + static int isdigit_str9(const char *str) + { + int maxlen = 9 + 1; /* max 9 digits: 999999999 */ +@@ -284,6 +304,12 @@ raise_exception(int e) + exception = e; + longjmp(exception_handler->loc, 1); + } ++#if DEBUG ++#define raise_exception(e) do { \ ++ TRACE(("raising exception %d on line %d\n", (e), __LINE__)); \ ++ raise_exception(e); \ ++} while (0) ++#endif + + /* + * Called from trap.c when a SIGINT is received. (If the user specifies +@@ -316,6 +342,12 @@ raise_interrupt(void) + raise_exception(i); + /* NOTREACHED */ + } ++#if DEBUG ++#define raise_interrupt() do { \ ++ TRACE(("raising interrupt on line %d\n", __LINE__)); \ ++ raise_interrupt(); \ ++} while (0) ++#endif + + #if ENABLE_ASH_OPTIMIZE_FOR_SIZE + static void +@@ -334,7 +366,9 @@ force_int_on(void) + raise_interrupt(); + } + #define FORCE_INT_ON force_int_on() +-#else ++ ++#else /* !ASH_OPTIMIZE_FOR_SIZE */ ++ + #define INT_ON do { \ + xbarrier(); \ + if (--suppressint == 0 && intpending) \ +@@ -346,7 +380,7 @@ force_int_on(void) + if (intpending) \ + raise_interrupt(); \ + } while (0) +-#endif /* ASH_OPTIMIZE_FOR_SIZE */ ++#endif /* !ASH_OPTIMIZE_FOR_SIZE */ + + #define SAVE_INT(v) ((v) = suppressint) + +@@ -376,7 +410,6 @@ static void + onsig(int signo) + { + gotsig[signo - 1] = 1; +- pendingsig = signo; + + if (/* exsig || */ (signo == SIGINT && !trap[SIGINT])) { + if (!suppressint) { +@@ -384,6 +417,8 @@ onsig(int signo) + raise_interrupt(); /* does not return */ + } + intpending = 1; ++ } else { ++ pendingsig = signo; + } + } + +@@ -684,6 +719,12 @@ trace_printf(const char *fmt, ...) + + if (debug != 1) + return; ++ if (DEBUG_TIME) ++ fprintf(tracefile, "%u ", (int) time(NULL)); ++ if (DEBUG_PID) ++ fprintf(tracefile, "[%u] ", (int) getpid()); ++ if (DEBUG_SIG) ++ fprintf(tracefile, "pending s:%d i:%d(supp:%d) ", pendingsig, intpending, suppressint); + va_start(va, fmt); + vfprintf(tracefile, fmt, va); + va_end(va); +@@ -694,6 +735,12 @@ trace_vprintf(const char *fmt, va_list v + { + if (debug != 1) + return; ++ if (DEBUG_TIME) ++ fprintf(tracefile, "%u ", (int) time(NULL)); ++ if (DEBUG_PID) ++ fprintf(tracefile, "[%u] ", (int) getpid()); ++ if (DEBUG_SIG) ++ fprintf(tracefile, "pending s:%d i:%d(supp:%d) ", pendingsig, intpending, suppressint); + vfprintf(tracefile, fmt, va); + } + +@@ -998,14 +1045,6 @@ showtree(union node *n) + shtree(n, 1, NULL, stdout); + } + +-#define TRACE(param) trace_printf param +-#define TRACEV(param) trace_vprintf param +- +-#else +- +-#define TRACE(param) +-#define TRACEV(param) +- + #endif /* DEBUG */ + + +@@ -3779,7 +3818,7 @@ dowait(int wait_flags, struct job *job) + * NB: _not_ safe_waitpid, we need to detect EINTR */ + pid = waitpid(-1, &status, + (doing_jobctl ? (wait_flags | WUNTRACED) : wait_flags)); +- TRACE(("wait returns pid=%d, status=0x%x\n", pid, status)); ++ TRACE(("wait returns pid=%d, status=0x%x, errno=%d(%s)\n", pid, status, errno, strerror(errno))); + + if (pid <= 0) { + /* If we were doing blocking wait and (probably) got EINTR, +@@ -5031,7 +5070,9 @@ redirect(union node *redir, int flags) + if (newfd < 0) { + /* NTOFD/NFROMFD: copy redir->ndup.dupfd to fd */ + if (redir->ndup.dupfd < 0) { /* "fd>&-" */ +- close(fd); ++ /* Don't want to trigger debugging */ ++ if (fd != -1) ++ close(fd); + } else { + copyfd(redir->ndup.dupfd, fd | COPYFD_EXACT); + } +@@ -5084,7 +5125,7 @@ popredir(int drop, int restore) + /*close(fd);*/ + copyfd(copy, fd | COPYFD_EXACT); + } +- close(copy); ++ close(copy & ~COPYFD_RESTORE); + } + } + redirlist = rp->next; +@@ -7871,20 +7912,30 @@ dotrap(void) + pendingsig = 0; + xbarrier(); + ++ TRACE(("dotrap entered\n")); + for (i = 1, q = gotsig; i < NSIG; i++, q++) { + if (!*q) + continue; +- *q = '\0'; + + p = trap[i]; ++ /* non-trapped SIGINT is handled separately by raise_interrupt, ++ * don't upset it by resetting gotsig[SIGINT-1] */ ++ if (i == SIGINT && !p) ++ continue; ++ ++ TRACE(("sig %d is active, will run handler '%s'\n", i, p)); ++ *q = '\0'; + if (!p) + continue; + skip = evalstring(p, SKIPEVAL); + exitstatus = savestatus; +- if (skip) ++ if (skip) { ++ TRACE(("dotrap returns %d\n", skip)); + return skip; ++ } + } + ++ TRACE(("dotrap returns 0\n")); + return 0; + } + +@@ -7906,28 +7957,32 @@ static void prehash(union node *); + static void + evaltree(union node *n, int flags) + { +- + struct jmploc *volatile savehandler = exception_handler; + struct jmploc jmploc; + int checkexit = 0; + void (*evalfn)(union node *, int); + int status; ++ int int_level; ++ ++ SAVE_INT(int_level); + + if (n == NULL) { + TRACE(("evaltree(NULL) called\n")); + goto out1; + } +- TRACE(("pid %d, evaltree(%p: %d, %d) called\n", +- getpid(), n, n->type, flags)); ++ TRACE(("evaltree(%p: %d, %d) called\n", n, n->type, flags)); + + exception_handler = &jmploc; + { + int err = setjmp(jmploc.loc); + if (err) { + /* if it was a signal, check for trap handlers */ +- if (exception == EXSIG) ++ if (exception == EXSIG) { ++ TRACE(("exception %d (EXSIG) in evaltree, err=%d\n", exception, err)); + goto out; ++ } + /* continue on the way out */ ++ TRACE(("exception %d in evaltree, propagating err=%d\n", exception, err)); + exception_handler = savehandler; + longjmp(exception_handler->loc, err); + } +@@ -8010,7 +8065,8 @@ evaltree(union node *n, int flags) + if (exitstatus == 0) { + n = n->nif.ifpart; + goto evaln; +- } else if (n->nif.elsepart) { ++ } ++ if (n->nif.elsepart) { + n = n->nif.elsepart; + goto evaln; + } +@@ -8036,6 +8092,9 @@ evaltree(union node *n, int flags) + exexit: + raise_exception(EXEXIT); + } ++ ++ RESTORE_INT(int_level); ++ TRACE(("leaving evaltree (no interrupts)\n")); + } + + #if !defined(__alpha__) || (defined(__GNUC__) && __GNUC__ >= 3) +@@ -8281,7 +8340,9 @@ evalpipe(union node *n, int flags) + if (prevfd >= 0) + close(prevfd); + prevfd = pip[0]; +- close(pip[1]); ++ /* Don't want to trigger debugging */ ++ if (pip[1] != -1) ++ close(pip[1]); + } + if (n->npipe.pipe_backgnd == 0) { + exitstatus = waitforjob(jp); +@@ -8913,6 +8974,7 @@ evalcommand(union node *cmd, int flags) + if (forkshell(jp, cmd, FORK_FG) != 0) { + exitstatus = waitforjob(jp); + INT_ON; ++ TRACE(("forked child exited with %d\n", exitstatus)); + break; + } + FORCE_INT_ON; +@@ -13640,7 +13702,7 @@ int ash_main(int argc UNUSED_PARAM, char + exception_handler = &jmploc; + #if DEBUG + opentrace(); +- trace_puts("Shell args: "); ++ TRACE(("Shell args: ")); + trace_puts_args(argv); + #endif + rootpid = getpid(); +@@ -13692,8 +13754,14 @@ int ash_main(int argc UNUSED_PARAM, char + } + state3: + state = 4; +- if (minusc) ++ if (minusc) { ++ /* evalstring pushes parsefile stack. ++ * Ensure we don't falsely claim that 0 (stdin) ++ * is one of stacked source fds */ ++ if (!sflag) ++ g_parsefile->fd = -1; + evalstring(minusc, 0); ++ } + + if (sflag || minusc == NULL) { + #if ENABLE_FEATURE_EDITING_SAVEHISTORY +@@ -13720,14 +13788,6 @@ int ash_main(int argc UNUSED_PARAM, char + /* NOTREACHED */ + } + +-#if DEBUG +-const char *applet_name = "debug stuff usage"; +-int main(int argc, char **argv) +-{ +- return ash_main(argc, argv); +-} +-#endif +- + + /*- + * Copyright (c) 1989, 1991, 1993, 1994 diff --git a/core/busybox/busybox-1.13.3-hush.patch b/core/busybox/busybox-1.13.3-hush.patch new file mode 100644 index 000000000..09d9347d7 --- /dev/null +++ b/core/busybox/busybox-1.13.3-hush.patch @@ -0,0 +1,160 @@ +diff -urpN busybox-1.13.3/shell/hush.c busybox-1.13.3-hush/shell/hush.c +--- busybox-1.13.3/shell/hush.c 2009-02-26 12:46:55.000000000 +0100 ++++ busybox-1.13.3-hush/shell/hush.c 2009-03-20 13:01:52.000000000 +0100 +@@ -458,8 +458,9 @@ struct globals { + smallint fake_mode; + /* these three support $?, $#, and $1 */ + smalluint last_return_code; ++ smalluint global_args_malloced; ++ int global_argc; /* NB: $# + 1 */ + char **global_argv; +- int global_argc; + #if ENABLE_HUSH_LOOPS + unsigned depth_break_continue; + unsigned depth_of_loop; +@@ -633,7 +634,7 @@ static char *unbackslash(char *src) + return dst; + } + +-static char **add_strings_to_strings(char **strings, char **add) ++static char **add_strings_to_strings(char **strings, char **add, int need_to_dup) + { + int i; + unsigned count1; +@@ -658,7 +659,7 @@ static char **add_strings_to_strings(cha + v[count1 + count2] = NULL; + i = count2; + while (--i >= 0) +- v[count1 + i] = add[i]; ++ v[count1 + i] = (need_to_dup ? xstrdup(add[i]) : add[i]); + return v; + } + +@@ -667,7 +668,7 @@ static char **add_string_to_strings(char + char *v[2]; + v[0] = add; + v[1] = NULL; +- return add_strings_to_strings(strings, v); ++ return add_strings_to_strings(strings, v, /*dup:*/ 0); + } + + static void putenv_all(char **strings) +@@ -1213,8 +1214,13 @@ static int o_glob(o_string *o, int n) + * Otherwise, just finish current list[] and start new */ + static int o_save_ptr(o_string *o, int n) + { +- if (o->o_glob) +- return o_glob(o, n); /* o_save_ptr_helper is inside */ ++ if (o->o_glob) { /* if globbing is requested */ ++ /* If o->has_empty_slot, list[n] was already globbed ++ * (if it was requested back then when it was filled) ++ * so don't do that again! */ ++ if (!o->has_empty_slot) ++ return o_glob(o, n); /* o_save_ptr_helper is inside */ ++ } + return o_save_ptr_helper(o, n); + } + +@@ -4279,6 +4285,11 @@ int hush_main(int argc, char **argv) + switch (opt) { + case 'c': + G.global_argv = argv + optind; ++ if (!argv[optind]) { ++ /* -c 'script' (no params): prevent empty $0 */ ++ *--G.global_argv = argv[0]; ++ optind--; ++ } /* else -c 'script' PAR0 PAR1: $0 is PAR0 */ + G.global_argc = argc - optind; + opt = parse_and_run_string(optarg, 0 /* parse_flag */); + goto final_return; +@@ -4639,17 +4650,68 @@ static int builtin_read(char **argv) + return set_local_var(string, 0); + } + +-/* built-in 'set [VAR=value]' handler */ ++/* built-in 'set' handler ++ * SUSv3 says: ++ * set [-abCefmnuvx] [-h] [-o option] [argument...] ++ * set [+abCefmnuvx] [+h] [+o option] [argument...] ++ * set -- [argument...] ++ * set -o ++ * set +o ++ * Implementations shall support the options in both their hyphen and ++ * plus-sign forms. These options can also be specified as options to sh. ++ * Examples: ++ * Write out all variables and their values: set ++ * Set $1, $2, and $3 and set "$#" to 3: set c a b ++ * Turn on the -x and -v options: set -xv ++ * Unset all positional parameters: set -- ++ * Set $1 to the value of x, even if it begins with '-' or '+': set -- "$x" ++ * Set the positional parameters to the expansion of x, even if x expands ++ * with a leading '-' or '+': set -- $x ++ * ++ * So far, we only support "set -- [argument...]" by ignoring all options ++ * (also, "-o option" will be mishandled by taking "option" as parameter #1). ++ */ + static int builtin_set(char **argv) + { +- char *temp = argv[1]; + struct variable *e; ++ char **pp; ++ char *arg = *++argv; + +- if (temp == NULL) ++ if (arg == NULL) { + for (e = G.top_var; e; e = e->next) + puts(e->varstr); +- else +- set_local_var(xstrdup(temp), 0); ++ } else { ++ /* NB: G.global_argv[0] ($0) is never freed/changed */ ++ ++ if (G.global_args_malloced) { ++ pp = G.global_argv; ++ while (*++pp) ++ free(*pp); ++ G.global_argv[1] = NULL; ++ } else { ++ G.global_args_malloced = 1; ++ pp = xzalloc(sizeof(pp[0]) * 2); ++ pp[0] = G.global_argv[0]; /* retain $0 */ ++ G.global_argv = pp; ++ } ++ do { ++ if (arg[0] == '+') ++ continue; ++ if (arg[0] != '-') ++ break; ++ if (arg[1] == '-' && arg[2] == '\0') { ++ argv++; ++ break; ++ } ++ } while ((arg = *++argv) != NULL); ++ /* Now argv[0] is 1st argument */ ++ ++ /* This realloc's G.global_argv */ ++ G.global_argv = pp = add_strings_to_strings(G.global_argv, argv, /*dup:*/ 1); ++ G.global_argc = 1; ++ while (*++pp) ++ G.global_argc++; ++ } + + return EXIT_SUCCESS; + } +diff -urpN busybox-1.13.3/shell/hush_test/hush-parsing/starquoted2.right busybox-1.13.3-hush/shell/hush_test/hush-parsing/starquoted2.right +--- busybox-1.13.3/shell/hush_test/hush-parsing/starquoted2.right 2009-02-26 12:46:52.000000000 +0100 ++++ busybox-1.13.3-hush/shell/hush_test/hush-parsing/starquoted2.right 2009-03-20 12:32:30.000000000 +0100 +@@ -1,2 +1,3 @@ + Should be printed + Should be printed ++Empty: +diff -urpN busybox-1.13.3/shell/hush_test/hush-parsing/starquoted2.tests busybox-1.13.3-hush/shell/hush_test/hush-parsing/starquoted2.tests +--- busybox-1.13.3/shell/hush_test/hush-parsing/starquoted2.tests 2009-02-26 12:46:52.000000000 +0100 ++++ busybox-1.13.3-hush/shell/hush_test/hush-parsing/starquoted2.tests 2009-03-20 12:32:30.000000000 +0100 +@@ -12,3 +12,6 @@ for a in "$@"""; do echo Should not be p + for a in """$@"; do echo Should not be printed; done + for a in """$@"''"$@"''; do echo Should not be printed; done + for a in ""; do echo Should be printed; done ++ ++# Bug 207: "$@" expands to nothing, and we erroneously glob "%s\\n" twice: ++printf "Empty:%s\\n" "$@" diff --git a/core/busybox/busybox.post-install b/core/busybox/busybox.post-install new file mode 100644 index 000000000..9bb6bf4cf --- /dev/null +++ b/core/busybox/busybox.post-install @@ -0,0 +1,3 @@ +#!/bin/busybox sh + +/bin/busybox --install -s diff --git a/core/busybox/busybox.post-upgrade b/core/busybox/busybox.post-upgrade new file mode 100644 index 000000000..9bb6bf4cf --- /dev/null +++ b/core/busybox/busybox.post-upgrade @@ -0,0 +1,3 @@ +#!/bin/busybox sh + +/bin/busybox --install -s diff --git a/core/busybox/busyboxconfig b/core/busybox/busyboxconfig index 8f3ab2476..dbd392f8d 100644 --- a/core/busybox/busyboxconfig +++ b/core/busybox/busyboxconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Busybox version: 1.13.2 -# Sun Feb 8 13:25:26 2009 +# Busybox version: 1.13.3 +# Fri Mar 20 21:23:00 2009 # CONFIG_HAVE_DOT_CONFIG=y @@ -62,11 +62,11 @@ CONFIG_NO_DEBUG_LIB=y # # Installation Options # -CONFIG_INSTALL_NO_USR=y -CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_NO_USR is not set +# CONFIG_INSTALL_APPLET_SYMLINKS is not set # CONFIG_INSTALL_APPLET_HARDLINKS is not set # CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set -# CONFIG_INSTALL_APPLET_DONT is not set +CONFIG_INSTALL_APPLET_DONT=y # CONFIG_INSTALL_SH_APPLET_SYMLINK is not set # CONFIG_INSTALL_SH_APPLET_HARDLINK is not set # CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set @@ -492,7 +492,7 @@ CONFIG_MKSWAP=y # CONFIG_FEATURE_MKSWAP_V0 is not set CONFIG_MORE=y CONFIG_FEATURE_USE_TERMIOS=y -CONFIG_VOLUMEID=y +# CONFIG_VOLUMEID is not set # CONFIG_FEATURE_VOLUMEID_EXT is not set # CONFIG_FEATURE_VOLUMEID_REISERFS is not set # CONFIG_FEATURE_VOLUMEID_FAT is not set -- cgit v1.2.3