aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/obsolete/busybox
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/obsolete/busybox')
-rw-r--r--recipes/obsolete/busybox/busybox-1.13.2/r24785.patch14
-rw-r--r--recipes/obsolete/busybox/busybox-1.14.3/r24785.patch14
-rw-r--r--recipes/obsolete/busybox/busybox-1.15.3/r24785.patch14
-rw-r--r--recipes/obsolete/busybox/busybox-1.16.2/r24785.patch14
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/add-getkey-applet.patch167
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/below.patch46
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/dhcpretrytime.patch85
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/fbset.patch24
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/hdparm_M.patch47
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/iproute-flush-cache.patch23
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/mount-all-type.patch84
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/readlink.patch85
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/rmmod.patch40
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/udhcppidfile-breakage.patch57
-rw-r--r--recipes/obsolete/busybox/busybox-1.2.1/udhcppidfile.patch274
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/add-getkey-applet.patch167
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/angstrom-busybox-syslogd-conf.patch19
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/below.patch46
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/dhcpretrytime.patch85
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/fbset.patch24
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/hdparm_M.patch47
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/iproute-flush-cache.patch23
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/mount-all-type.patch84
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/readlink.patch85
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/rmmod.patch40
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/udhcppidfile-breakage.patch57
-rw-r--r--recipes/obsolete/busybox/busybox-static-1.2.1/udhcppidfile.patch274
-rw-r--r--recipes/obsolete/busybox/files/glibc2.4-icmp6.patch15
28 files changed, 1954 insertions, 0 deletions
diff --git a/recipes/obsolete/busybox/busybox-1.13.2/r24785.patch b/recipes/obsolete/busybox/busybox-1.13.2/r24785.patch
new file mode 100644
index 0000000000..e3e80befcd
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.13.2/r24785.patch
@@ -0,0 +1,14 @@
+--- busybox/util-linux/mdev.c 2009/01/08 17:19:01 24725
++++ busybox/util-linux/mdev.c 2009/01/12 07:57:52 24785
+@@ -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/recipes/obsolete/busybox/busybox-1.14.3/r24785.patch b/recipes/obsolete/busybox/busybox-1.14.3/r24785.patch
new file mode 100644
index 0000000000..e3e80befcd
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.14.3/r24785.patch
@@ -0,0 +1,14 @@
+--- busybox/util-linux/mdev.c 2009/01/08 17:19:01 24725
++++ busybox/util-linux/mdev.c 2009/01/12 07:57:52 24785
+@@ -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/recipes/obsolete/busybox/busybox-1.15.3/r24785.patch b/recipes/obsolete/busybox/busybox-1.15.3/r24785.patch
new file mode 100644
index 0000000000..e3e80befcd
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.15.3/r24785.patch
@@ -0,0 +1,14 @@
+--- busybox/util-linux/mdev.c 2009/01/08 17:19:01 24725
++++ busybox/util-linux/mdev.c 2009/01/12 07:57:52 24785
+@@ -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/recipes/obsolete/busybox/busybox-1.16.2/r24785.patch b/recipes/obsolete/busybox/busybox-1.16.2/r24785.patch
new file mode 100644
index 0000000000..e3e80befcd
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.16.2/r24785.patch
@@ -0,0 +1,14 @@
+--- busybox/util-linux/mdev.c 2009/01/08 17:19:01 24725
++++ busybox/util-linux/mdev.c 2009/01/12 07:57:52 24785
+@@ -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/recipes/obsolete/busybox/busybox-1.2.1/add-getkey-applet.patch b/recipes/obsolete/busybox/busybox-1.2.1/add-getkey-applet.patch
new file mode 100644
index 0000000000..a75cf823c7
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/add-getkey-applet.patch
@@ -0,0 +1,167 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+Index: busybox-1.1.0/console-tools/getkey.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ busybox-1.1.0/console-tools/getkey.c 2006-03-14 17:17:28.000000000 +0100
+@@ -0,0 +1,94 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * getkey.c - Michael 'Mickey' Lauer
++ *
++ * Version 0.1
++ *
++ * A simple keygrapper. Displays a configurable message and waits a dedicated number
++ * of seconds for a keypress. Sets the exit code accordingly (SUCCESS on keypress).
++ */
++#include <stdio.h>
++#include <fcntl.h>
++#include <memory.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <sys/types.h>
++#include <errno.h>
++#include <sys/ioctl.h>
++#include <sys/kd.h>
++#include "busybox.h"
++
++extern int getkey_main(int argc, char **argv)
++{
++ int status = EXIT_FAILURE;
++
++ if ( argc < 2 )
++ {
++ bb_show_usage();
++ }
++
++ /*
++ * If no terminal is attached it is quite useless
++ * to treat it like one.
++ */
++ if( !isatty(STDIN_FILENO) )
++ {
++ goto error_hard;
++ }
++
++ //bb_printf( "DEBUG: time = '%s'\n", argv[1] );
++ //bb_printf( "DEBUG: mesg = '%s'\n", argv[2] );
++
++ struct termios orig;
++ struct termios attr;
++
++ if ( tcgetattr(STDIN_FILENO, &orig) == -1 )
++ {
++ goto error_hard;
++ }
++
++ attr = orig;
++ attr.c_cc[VMIN] = 0;
++ attr.c_cc[VTIME] = 0;
++ attr.c_iflag |= INLCR;
++ attr.c_oflag |= OPOST|ONLCR;
++ attr.c_cflag &= ~PARENB;
++ attr.c_lflag &= ~(ICANON/*|ECHO*/);
++ if ( tcsetattr(STDIN_FILENO,TCSANOW,&attr) == -1 )
++ {
++ goto error_hard;
++ }
++
++ fd_set rfds;
++ struct timeval tv;
++ int retval;
++
++ FD_ZERO(&rfds);
++ FD_SET(0, &rfds);
++
++ tv.tv_sec = atoi( argv[1] );
++ tv.tv_usec = 0;
++
++ if ( argc == 3 )
++ {
++ bb_printf( argv[2], tv.tv_sec );
++ bb_printf( "\n" );
++ fflush(stdout);
++ }
++ retval = select(1, &rfds, NULL, NULL, &tv);
++ if (retval > 0)
++ {
++ status = EXIT_SUCCESS;
++ }
++
++ if (tcsetattr(STDIN_FILENO,TCSANOW,&orig) == -1 )
++ {
++ goto error_hard;
++ }
++
++ return status;
++
++error_hard :
++ return EXIT_FAILURE;
++};
++
+Index: busybox-1.1.0/console-tools/Makefile.in
+===================================================================
+--- busybox-1.1.0.orig/console-tools/Makefile.in 2006-01-11 06:43:57.000000000 +0100
++++ busybox-1.1.0/console-tools/Makefile.in 2006-03-14 17:18:18.000000000 +0100
+@@ -21,6 +21,7 @@
+ CONSOLETOOLS_DIR-$(CONFIG_OPENVT) += openvt.o
+ CONSOLETOOLS_DIR-$(CONFIG_RESET) += reset.o
+ CONSOLETOOLS_DIR-$(CONFIG_SETKEYCODES) += setkeycodes.o
++CONSOLETOOLS_DIR-$(CONFIG_GETKEY) += getkey.o
+
+ libraries-y+=$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR)
+
+Index: busybox-1.1.0/console-tools/Config.in
+===================================================================
+--- busybox-1.1.0.orig/console-tools/Config.in 2006-01-11 06:43:57.000000000 +0100
++++ busybox-1.1.0/console-tools/Config.in 2006-03-14 17:17:28.000000000 +0100
+@@ -31,6 +31,14 @@
+ This program dumps the kernel's keyboard translation table to
+ stdout, in binary format. You can then use loadkmap to load it.
+
++config CONFIG_GETKEY
++ bool "getkey"
++ default n
++ help
++ This program displays a configurable message and waits
++ a dedicated number of seconds for a keypress. It sets
++ the exit code accordingly, i.e. SUCCESS if there was a keypress.
++
+ config CONFIG_LOADFONT
+ bool "loadfont"
+ default n
+Index: busybox-1.1.0/include/applets.h
+===================================================================
+--- busybox-1.1.0.orig/include/applets.h 2006-01-11 06:44:14.000000000 +0100
++++ busybox-1.1.0/include/applets.h 2006-03-14 17:17:28.000000000 +0100
+@@ -261,6 +261,9 @@
+ #ifdef CONFIG_FUSER
+ APPLET(fuser, fuser_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
+ #endif
++#ifdef CONFIG_GETKEY
++ APPLET(getkey, getkey_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
++#endif
+ #ifdef CONFIG_GETOPT
+ APPLET(getopt, getopt_main, _BB_DIR_BIN, _BB_SUID_NEVER)
+ #endif
+Index: busybox-1.1.0/include/usage.h
+===================================================================
+--- busybox-1.1.0.orig/include/usage.h 2006-01-11 06:44:14.000000000 +0100
++++ busybox-1.1.0/include/usage.h 2006-03-14 17:19:11.000000000 +0100
+@@ -841,6 +841,13 @@
+ "\t-p, --password Password to be used\n" \
+ "\t-P, --port Port number to be used"
+
++#define getkey_trivial_usage \
++ "time [message]"
++#define getkey_full_usage \
++ "Display a message and wait for a keypress."
++#define getkey_example_usage \
++ "$ getkey 5 'Press a key within %d seconds to interrupt autoboot.'"
++
+ #define fuser_trivial_usage \
+ "[options] file OR port/proto"
+ #define fuser_full_usage \
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/below.patch b/recipes/obsolete/busybox/busybox-1.2.1/below.patch
new file mode 100644
index 0000000000..95e8376e46
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/below.patch
@@ -0,0 +1,46 @@
+Index: busybox-1.1.0/modutils/modprobe.c
+===================================================================
+--- busybox-1.1.0.orig/modutils/modprobe.c 2006-01-11 06:43:56.000000000 +0100
++++ busybox-1.1.0/modutils/modprobe.c 2006-03-14 16:36:54.000000000 +0100
+@@ -509,6 +509,41 @@
+ }
+ }
+ }
++ else if ((strncmp (buffer, "below", 5) == 0) && isspace (buffer[5])) {
++ char *mod, *deps;
++ if (parse_tag_value (buffer + 6, &mod, &deps)) {
++ struct dep_t *dt;
++
++ for (dt = first; dt; dt = dt->m_next) {
++ if (strcmp (dt->m_name, mod) == 0)
++ break;
++ }
++ if (dt) {
++ char *pp;
++ char *name;
++
++ pp = name = deps;
++
++ for (;;) {
++ while (*pp != 0 && !isspace (*pp))
++ pp++;
++ if (isspace (*pp))
++ *(pp++) = 0;
++
++ dt->m_depcnt++;
++ dt->m_deparr = (char **) xrealloc (dt->m_deparr,
++ sizeof (char *) * dt->m_depcnt);
++ dt->m_deparr[dt->m_depcnt - 1] = bb_xstrdup (name);
++
++ while (isspace (*pp))
++ pp++;
++ name = pp;
++ if (*pp == 0)
++ break;
++ }
++ }
++ }
++ }
+ }
+ }
+ close ( fd );
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/dhcpretrytime.patch b/recipes/obsolete/busybox/busybox-1.2.1/dhcpretrytime.patch
new file mode 100644
index 0000000000..893e346acf
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/dhcpretrytime.patch
@@ -0,0 +1,85 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+Index: busybox-1.1.0/networking/udhcp/dhcpc.c
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/dhcpc.c 2006-03-14 17:19:31.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/dhcpc.c 2006-03-14 17:20:45.000000000 +0100
+@@ -48,6 +48,7 @@
+ static unsigned long requested_ip; /* = 0 */
+ static unsigned long server_addr;
+ static unsigned long timeout;
++static unsigned long retrytime = 60;
+ static int packet_num; /* = 0 */
+ static int fd = -1;
+
+@@ -95,6 +96,7 @@
+ " -r, --request=IP IP address to request (default: none)\n"
+ " -s, --script=file Run file at dhcp events (default:\n"
+ " " DEFAULT_SCRIPT ")\n"
++" -t, --retrytime time to retry DHCP request (default 60s)\n")
+ " -v, --version Display version\n"
+ );
+ exit(0);
+@@ -214,6 +216,7 @@
+ {"quit", no_argument, 0, 'q'},
+ {"request", required_argument, 0, 'r'},
+ {"script", required_argument, 0, 's'},
++ {"retrytime", required_argument, 0, 't'},
+ {"version", no_argument, 0, 'v'},
+ {0, 0, 0, 0}
+ };
+@@ -229,7 +232,7 @@
+ /* get options */
+ while (1) {
+ int option_index = 0;
+- c = getopt_long(argc, argv, "c:CV:fbH:h:F:i:np:qr:s:v", arg_options, &option_index);
++ c = getopt_long(argc, argv, "c:CV:fbH:h:F:i:np:qr:s:t:v", arg_options, &option_index);
+ if (c == -1) break;
+
+ switch (c) {
+@@ -305,6 +308,9 @@
+ case 's':
+ client_config.script = optarg;
+ break;
++ case 't':
++ retrytime = atol(optarg);
++ break;
+ case 'v':
+ printf("udhcpcd, version %s\n\n", VERSION);
+ return 0;
+@@ -394,7 +400,7 @@
+ }
+ /* wait to try again */
+ packet_num = 0;
+- timeout = now + 60;
++ timeout = now + retrytime;
+ }
+ break;
+ case RENEW_REQUESTED:
+Index: busybox-1.1.0/networking/ifupdown.c
+===================================================================
+--- busybox-1.1.0.orig/networking/ifupdown.c 2006-01-11 06:43:51.000000000 +0100
++++ busybox-1.1.0/networking/ifupdown.c 2006-03-14 17:19:41.000000000 +0100
+@@ -506,7 +506,7 @@
+ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
+ {
+ if (execable("/sbin/udhcpc")) {
+- return( execute("udhcpc -n -p /var/run/udhcpc.%iface%.pid -i "
++ return( execute("udhcpc -b -p /var/run/udhcpc.%iface%.pid -i "
+ "%iface% [[-H %hostname%]] [[-c %clientid%]]", ifd, exec));
+ } else if (execable("/sbin/pump")) {
+ return( execute("pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]]", ifd, exec));
+@@ -526,8 +526,8 @@
+ /* SIGUSR2 forces udhcpc to release the current lease and go inactive,
+ * and SIGTERM causes udhcpc to exit. Signals are queued and processed
+ * sequentially so we don't need to sleep */
+- result = execute("kill -USR2 `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
+- result += execute("kill -TERM `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
++ result = execute("kill -USR2 `cat /var/run/udhcpc.%iface%.pid 2>/dev/null` 2>/dev/null", ifd, exec);
++ result += execute("kill -TERM `cat /var/run/udhcpc.%iface%.pid 2>/dev/null` 2>/dev/null", ifd, exec);
+ } else if (execable("/sbin/pump")) {
+ result = execute("pump -i %iface% -k", ifd, exec);
+ } else if (execable("/sbin/dhclient")) {
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/fbset.patch b/recipes/obsolete/busybox/busybox-1.2.1/fbset.patch
new file mode 100644
index 0000000000..d0609ce6f7
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/fbset.patch
@@ -0,0 +1,24 @@
+--- busybox/util-linux/fbset.c~ 2004-07-03 16:24:23.000000000 +0100
++++ busybox/util-linux/fbset.c 2004-12-30 20:09:26.000000000 +0000
+@@ -337,7 +337,7 @@
+ {
+ struct fb_var_screeninfo var, varset;
+ int fh, i;
+- char *fbdev = DEFAULTFBDEV;
++ char *fbdev = NULL;
+ char *modefile = DEFAULTFBMODE;
+ char *thisarg, *mode = NULL;
+
+@@ -404,7 +404,12 @@
+ }
+ }
+
++ if (fbdev == NULL)
++ fbdev = DEFAULTFBDEV;
+ if ((fh = open(fbdev, O_RDONLY)) < 0)
++#ifdef CONFIG_FEATURE_DEVFS
++ if ((fh = open("/dev/fb0", O_RDONLY)) < 0)
++#endif
+ bb_perror_msg_and_die("fbset(open)");
+ if (ioctl(fh, FBIOGET_VSCREENINFO, &var))
+ bb_perror_msg_and_die("fbset(ioctl)");
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/hdparm_M.patch b/recipes/obsolete/busybox/busybox-1.2.1/hdparm_M.patch
new file mode 100644
index 0000000000..9adcd36f92
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/hdparm_M.patch
@@ -0,0 +1,47 @@
+Index: busybox-1.1.0/miscutils/hdparm.c
+===================================================================
+--- busybox-1.1.0.orig/miscutils/hdparm.c 2006-01-11 06:44:13.000000000 +0100
++++ busybox-1.1.0/miscutils/hdparm.c 2006-03-14 17:22:22.000000000 +0100
+@@ -1255,6 +1255,7 @@
+ static unsigned long set_sleepnow, get_sleepnow;
+ static unsigned long get_powermode;
+ static unsigned long set_apmmode, get_apmmode, apmmode;
++static unsigned long set_acoustic = 0, get_acoustic = 0, acoustic = 0;
+ #endif
+ #ifdef CONFIG_FEATURE_HDPARM_GET_IDENTITY
+ static int get_IDentity;
+@@ -2124,6 +2125,20 @@
+ }
+ bb_ioctl(fd, HDIO_DRIVE_CMD, &args,"HDIO_DRIVE_CMD");
+ }
++ if (set_acoustic)
++ {
++ no_scsi();
++ acoustic=check_if_min_and_set_val(acoustic,0);
++ acoustic=check_if_maj_and_set_val(acoustic,254);
++ if_printf(get_acoustic," setting AAM level to 0x%02lX (%ld)\n", acoustic, acoustic);
++ bb_ioctl(fd, HDIO_SET_ACOUSTIC, (int*)acoustic,"HDIO_SET_ACOUSTIC");
++ }
++ if (get_acoustic)
++ {
++ no_scsi();
++ bb_ioctl(fd, HDIO_GET_ACOUSTIC, (unsigned long*)&parm,"HDIO_GET_ACOUSTIC");
++ printf(" acoustic = %2ld (128=quiet ... 254=fast)\n", parm);
++ }
+ if (set_wcache)
+ {
+ #ifdef DO_FLUSHCACHE
+@@ -2832,6 +2847,13 @@
+ p = *argv++, --argc;
+ p=GET_NUMBER(p,&set_readahead,&Xreadahead);
+ break;
++ case 'M':
++ get_acoustic = noisy;
++ noisy = 1;
++ if (!*p && argc && isalnum(**argv))
++ p = *argv++, --argc;
++ p=GET_NUMBER(p,&set_acoustic,&acoustic);
++ break;
+ case 'B':
+ get_apmmode = noisy;
+ noisy = 1;
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/iproute-flush-cache.patch b/recipes/obsolete/busybox/busybox-1.2.1/iproute-flush-cache.patch
new file mode 100644
index 0000000000..f8becc3390
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/iproute-flush-cache.patch
@@ -0,0 +1,23 @@
+Index: networking/libiproute/iproute.c
+===================================================================
+RCS file: /var/cvs/busybox/networking/libiproute/iproute.c,v
+retrieving revision 1.14
+diff -u -r1.14 iproute.c
+--- networking/libiproute/iproute.c 11 Aug 2004 08:10:58 -0000 1.14
++++ networking/libiproute/iproute.c 30 Nov 2004 20:43:44 -0000
+@@ -537,6 +537,15 @@
+ } else if (matches(*argv, "match") == 0) {
+ NEXT_ARG();
+ get_prefix(&filter.mdst, *argv, do_ipv6);
++ } else if (matches(*argv, "table") == 0) {
++ NEXT_ARG();
++ if (matches(*argv, "cache") == 0) {
++ filter.tb = -1;
++ } else if (matches(*argv, "main") != 0) {
++ invarg("invalid \"table\"", *argv);
++ }
++ } else if (matches(*argv, "cache") == 0) {
++ filter.tb = -1;
+ } else {
+ if (matches(*argv, "exact") == 0) {
+ NEXT_ARG();
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/mount-all-type.patch b/recipes/obsolete/busybox/busybox-1.2.1/mount-all-type.patch
new file mode 100644
index 0000000000..476094a804
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/mount-all-type.patch
@@ -0,0 +1,84 @@
+--- busybox-1.00/.pc/mount-all-type.patch/util-linux/mount.c 2004-08-02 17:14:02.000000000 -0700
++++ busybox-1.00/util-linux/mount.c 2005-05-13 00:17:19.054232796 -0700
+@@ -364,6 +364,56 @@
+ exit(EXIT_SUCCESS);
+ }
+
++/* Does this file system type, from /etc/fstab, match the given
++ * -t option value?
++ */
++static int match_fs(const char *option, const char *type)
++{
++ const int len = strlen(type);
++ const int no = option[0] == 'n' && option[1] == 'o';
++ const char *optp = option;
++
++ if (len > 0) do {
++ const char *match = strstr(optp, type);
++
++ if (match == NULL) {
++ /* No match, but if the option string starts 'no' no match
++ * means yes.
++ */
++ return no;
++ }
++
++ /* Match, may be partial, check for end-of-type in option string. */
++ if (match[len] == 0 || match[len] == ',') {
++ /* Ok, check for type or notype. */
++ if (match == option) {
++ /* Exact match at start (can't be 'no') */
++ return 1;
++ }
++ if (match > option+1) {
++ if (match[-1] == ',') {
++ /* Exact match in middle, might be 'no' */
++ return !no;
++ }
++ if (match == option+2 && no) {
++ /* Exact match to 'notype' at start. */
++ return 0;
++ }
++ if (match > option+2 && match[-3] == ',' &&
++ match[-2] == 'n' && match[-1] == 'o') {
++ return 0;
++ }
++ }
++ }
++
++ /* Look for another match. */
++ optp = match+1;
++ } while (1);
++
++ /* zero length type in fstab (impossible?), don't match it. */
++ return 0;
++}
++
+ extern int mount_main(int argc, char **argv)
+ {
+ struct stat statbuf;
+@@ -371,6 +421,7 @@
+ char *extra_opts;
+ int flags = 0;
+ char *filesystemType = "auto";
++ char *filesystemOption = 0;
+ int got_filesystemType = 0;
+ char *device = xmalloc(PATH_MAX);
+ char *directory = xmalloc(PATH_MAX);
+@@ -393,6 +444,7 @@
+ break;
+ case 't':
+ filesystemType = optarg;
++ filesystemOption = optarg;
+ got_filesystemType = 1;
+ break;
+ case 'w':
+@@ -460,6 +512,8 @@
+
+ strcpy(device, m->mnt_fsname);
+ strcpy(directory, m->mnt_dir);
++ if (all && filesystemOption != 0 && !match_fs(filesystemOption, m->mnt_type))
++ continue;
+ filesystemType = bb_xstrdup(m->mnt_type);
+ singlemount:
+ extra_opts = string_flags;
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/readlink.patch b/recipes/obsolete/busybox/busybox-1.2.1/readlink.patch
new file mode 100644
index 0000000000..0c5431085a
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/readlink.patch
@@ -0,0 +1,85 @@
+diff -p -u -r1.7 Config.in
+--- busybox-1.00/debianutils/Config.in 15 Mar 2004 08:28:24 -0000 1.7
++++ busybox-1.00-patched/debianutils/Config.in 16 Nov 2004 11:46:41 -0000
+@@ -24,6 +24,13 @@ config CONFIG_READLINK
+ This program reads a symbolic link and returns the name
+ of the file it points to
+
++config CONFIG_FEATURE_READLINK_FOLLOW
++ bool " Enable canonicalization by following all symlinks (-f)"
++ default n
++ depends on CONFIG_READLINK
++ help
++ Enable the readlink option (-f).
++
+ config CONFIG_RUN_PARTS
+ bool "run-parts"
+ default n
+diff -p -u -r1.2 readlink.c
+--- busybox-1.00/debianutils/readlink.c 19 Mar 2003 09:11:41 -0000 1.2
++++ busybox-1.00-patched/debianutils/readlink.c 16 Nov 2004 11:46:41 -0000
+@@ -23,18 +23,38 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <getopt.h>
+ #include "busybox.h"
+
++#ifdef CONFIG_FEATURE_READLINK_FOLLOW
++# define READLINK_FOLLOW "f"
++# define READLINK_FLAG_f (1 << 0)
++#else
++# define READLINK_FOLLOW ""
++#endif
++
++static const char readlink_options[] = READLINK_FOLLOW;
++
+ int readlink_main(int argc, char **argv)
+ {
+ char *buf = NULL;
++ unsigned long opt = bb_getopt_ulflags(argc, argv, readlink_options);
++#ifdef CONFIG_FEATURE_READLINK_FOLLOW
++ RESERVE_CONFIG_BUFFER(resolved_path, PATH_MAX);
++#endif
+
+ /* no options, no getopt */
+
+- if (argc != 2)
++ if (optind + 1 != argc)
+ bb_show_usage();
+
+- buf = xreadlink(argv[1]);
++#ifdef CONFIG_FEATURE_READLINK_FOLLOW
++ if (opt & READLINK_FLAG_f) {
++ buf = realpath(argv[optind], resolved_path);
++ } else
++#endif
++ buf = xreadlink(argv[optind]);
++
+ if (!buf)
+ return EXIT_FAILURE;
+ puts(buf);
+diff -p -u -r1.222 usage.h
+--- busybox-1.00/include/usage.h 14 Sep 2004 16:23:56 -0000 1.222
++++ busybox-1.00-patched/include/usage.h 16 Nov 2004 11:46:42 -0000
+@@ -1985,10 +1985,18 @@
+ "\t-s\tSet the system date and time (default).\n" \
+ "\t-p\tPrint the date and time."
+
++#ifdef CONFIG_FEATURE_READLINK_FOLLOW
++#define USAGE_READLINK_FOLLOW(a) a
++#else
++#define USAGE_READLINK_FOLLOW(a)
++#endif
++
+ #define readlink_trivial_usage \
+- ""
++ USAGE_READLINK_FOLLOW("[-f] ") "FILE"
+ #define readlink_full_usage \
+- "Displays the value of a symbolic link."
++ "Displays the value of a symbolic link." \
++ USAGE_READLINK_FOLLOW("\n\nOptions:\n" \
++ "\t-f\tcanonicalize by following all symlinks")
+
+ #define realpath_trivial_usage \
+ "pathname ..."
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/rmmod.patch b/recipes/obsolete/busybox/busybox-1.2.1/rmmod.patch
new file mode 100644
index 0000000000..20770e0dc4
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/rmmod.patch
@@ -0,0 +1,40 @@
+Index: busybox-1.1.0/modutils/rmmod.c
+===================================================================
+--- busybox-1.1.0.orig/modutils/rmmod.c 2006-01-11 06:43:56.000000000 +0100
++++ busybox-1.1.0/modutils/rmmod.c 2006-03-14 16:42:14.000000000 +0100
+@@ -29,6 +29,7 @@
+ #include <string.h>
+ #include <sys/utsname.h>
+ #include <sys/syscall.h>
++#include <sys/utsname.h>
+ #include "busybox.h"
+
+ #ifdef CONFIG_FEATURE_2_6_MODULES
+@@ -64,6 +65,16 @@
+ but must get */
+ size_t bufsize = sizeof(bb_common_bufsiz1);
+ #endif
++#ifdef CONFIG_FEATURE_2_6_MODULES
++ int k_version = 0;
++ struct utsname myuname;
++
++ if (uname(&myuname) == 0) {
++ if (myuname.release[0] == '2') {
++ k_version = myuname.release[2] - '0';
++ }
++ }
++#endif
+
+ /* Parse command line. */
+ n = bb_getopt_ulflags(argc, argv, "wfa");
+@@ -109,6 +120,10 @@
+ afterslash++;
+ module_name = alloca(strlen(afterslash) + 1);
+ filename2modname(module_name, afterslash);
++ if (k_version != 4)
++ filename2modname(module_name, afterslash);
++ else
++ strcpy(module_name, afterslash);
+ #else
+ #define module_name argv[n]
+ #endif
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/udhcppidfile-breakage.patch b/recipes/obsolete/busybox/busybox-1.2.1/udhcppidfile-breakage.patch
new file mode 100644
index 0000000000..031274908b
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/udhcppidfile-breakage.patch
@@ -0,0 +1,57 @@
+--- busybox-1.00/networking/udhcp/common.c~udhcppidfile2
++++ busybox-1.00/networking/udhcp/common.c
+@@ -74,7 +74,7 @@
+
+ if (pid > 0) {
+ /* parent */
+- if (pidfile_reassign(pidfile, pid) < 0) {
++ if (pidfile != NULL && pidfile_reassign(pidfile, pid) < 0) {
+ (void)kill(pid, SIGKILL);
+ exit(1);
+ } else
+@@ -119,7 +119,7 @@
+ sanitize_fds();
+
+ /* do some other misc startup stuff while we are here to save bytes */
+- if (pidfile_acquire(pidfile) < 0)
++ if (pidfile != NULL && pidfile_acquire(pidfile) < 0)
+ exit(1);
+
+ /* equivelent of doing a fflush after every \n */
+@@ -166,7 +166,7 @@
+ sanitize_fds();
+
+ /* do some other misc startup stuff while we are here to save bytes */
+- if (pidfile_acquire(pidfile) < 0)
++ if (pidfile != NULL && pidfile_acquire(pidfile) < 0)
+ exit(1);
+
+ /* equivelent of doing a fflush after every \n */
+--- busybox-1.00/networking/udhcp/pidfile.c~udhcppidfile2
++++ busybox-1.00/networking/udhcp/pidfile.c
+@@ -141,7 +141,11 @@
+ int pidfile_acquire(const char *pidfile)
+ {
+ int fd, result;
+- if (!pidfile) return (-1);
++
++ if (pidfile == NULL) {
++ LOG(LOG_ERR, "pidfile_acquire: filename is NULL\n");
++ return (-1);
++ }
+
+ if ((fd = pidfile_open(pidfile)) < 0)
+ return (-1);
+@@ -170,7 +174,11 @@
+ int pidfile_reassign(const char *pidfile, int pid)
+ {
+ int fd, result;
+- if (!pidfile) return (-1);
++
++ if (pidfile == NULL) {
++ LOG(LOG_ERR, "pidfile_reassign: filename is NULL\n");
++ return (-1);
++ }
+
+ if ((fd = pidfile_open(pidfile)) < 0)
+ return (-1);
diff --git a/recipes/obsolete/busybox/busybox-1.2.1/udhcppidfile.patch b/recipes/obsolete/busybox/busybox-1.2.1/udhcppidfile.patch
new file mode 100644
index 0000000000..b4b86b8775
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-1.2.1/udhcppidfile.patch
@@ -0,0 +1,274 @@
+Index: busybox-1.1.0/networking/udhcp/pidfile.h
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/pidfile.h 2006-01-11 06:43:50.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/pidfile.h 2006-03-14 17:15:45.000000000 +0100
+@@ -21,5 +21,5 @@
+
+
+ int pidfile_acquire(const char *pidfile);
+-void pidfile_write_release(int pid_fd);
++int pidfile_reassign(const char *pidfile, int newpid);
+
+Index: busybox-1.1.0/networking/udhcp/pidfile.c
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/pidfile.c 2006-01-11 06:43:50.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/pidfile.c 2006-03-14 17:15:45.000000000 +0100
+@@ -25,6 +25,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <errno.h>
+
+ #include "pidfile.h"
+ #include "common.h"
+@@ -37,39 +38,146 @@
+ }
+
+
+-int pidfile_acquire(const char *pidfile)
++static int pidfile_open(const char *pidfile)
+ {
+- int pid_fd;
+- if (!pidfile) return -1;
++ int fd;
+
+- pid_fd = open(pidfile, O_CREAT | O_WRONLY, 0644);
+- if (pid_fd < 0) {
+- LOG(LOG_ERR, "Unable to open pidfile %s: %m\n", pidfile);
+- } else {
+- lockf(pid_fd, F_LOCK, 0);
+- if (!saved_pidfile)
+- atexit(pidfile_delete);
+- saved_pidfile = (char *) pidfile;
++ if ((fd = open(pidfile, O_CREAT | O_RDWR, 0644)) < 0) {
++ LOG(LOG_ERR, "pidfile_open: open %s failed: %m\n", pidfile);
++ return (-1);
++ }
++
++ /* NOTE: lockf is not inherited by child after fork */
++ if (lockf(fd, F_LOCK, 0) < 0) {
++ LOG(LOG_ERR, "pidfile_open: lock %s failed: %m\n", pidfile);
++ close(fd);
++ return (-1);
++ }
++
++ return (fd);
++}
++
++
++static int pidfile_check(int fd, const char *pidfile)
++{
++ int len, pid;
++ char buf[20];
++
++ if (lseek(fd, 0L, SEEK_SET) < 0) {
++ LOG(LOG_ERR, "pidfile_check: lseek %s failed: %m\n", pidfile);
++ return (-1);
++ }
++
++ if ((len = read(fd, buf, sizeof buf - 1)) < 0) {
++ LOG(LOG_ERR, "pidfile_check: read %s failed: %m\n", pidfile);
++ return (-1);
++ }
++
++ if (len == 0)
++ return (0);
++
++ buf[len] = '\0';
++
++ if ((pid = atoi(buf)) <= 1) {
++ LOG(LOG_WARNING,
++ "pidfile_check: ignoring bogus pid (%s) in %s\n",
++ buf, pidfile);
++ return (0);
++ }
++
++ if (kill((pid_t)pid, 0) == 0) {
++ LOG(LOG_ERR, "pidfile_check: process %d exists (%s)\n",
++ pid, pidfile);
++ return (-1);
++ }
++
++ if (errno != ESRCH) {
++ LOG(LOG_ERR, "pidfile_check: kill %d failed (%s): %m\n",
++ pid, pidfile);
++ return (-1);
++ }
++
++ return (0);
++}
++
++
++static int pidfile_store(int fd, const char *pidfile, int pid)
++{
++ int len;
++ char buf[20];
++
++ if (lseek(fd, 0L, SEEK_SET) < 0) {
++ LOG(LOG_ERR, "pidfile_store: lseek %s failed: %m\n", pidfile);
++ return (-1);
++ }
++
++ len = snprintf(buf, sizeof buf - 1, "%d\n", pid);
++ buf[len] = '\0';
++
++ if (write(fd, buf, len) < 0) {
++ LOG(LOG_ERR, "pidfile_store: write %s failed: %m\n",
++ pidfile);
++ return (-1);
++ }
++
++ if (ftruncate(fd, len) < 0) {
++ LOG(LOG_ERR, "pidfile_store: ftruncate %d failed (%s): %m\n",
++ len, pidfile);
++ return (-1);
+ }
+
+- return pid_fd;
++ return (0);
+ }
+
+
+-void pidfile_write_release(int pid_fd)
++static void pidfile_close(int fd)
+ {
+- FILE *out;
++ (void)lseek(fd, 0L, SEEK_SET);
++ (void)lockf(fd, F_ULOCK, 0);
++ (void)close(fd);
++}
+
+- if (pid_fd < 0) return;
+
+- if ((out = fdopen(pid_fd, "w")) != NULL) {
+- fprintf(out, "%d\n", getpid());
+- fclose(out);
++int pidfile_acquire(const char *pidfile)
++{
++ int fd, result;
++ if (!pidfile) return (-1);
++
++ if ((fd = pidfile_open(pidfile)) < 0)
++ return (-1);
++
++ if ((result = pidfile_check(fd, pidfile)) == 0)
++ result = pidfile_store(fd, pidfile, getpid());
++
++ pidfile_close(fd);
++
++ if (result == 0) {
++ saved_pidfile = (char *) pidfile;
++ atexit(pidfile_delete);
+ }
+- lockf(pid_fd, F_UNLCK, 0);
+- close(pid_fd);
++
++ return (result);
+ }
+
+
++/*
++ * reassign the pid in a pidfile - used just after a fork so a parent
++ * can store the pid of its child into the file without any window
++ * where the pid in the file is a dead process (which might let another
++ * instance of the program start). Note the parent must use _exit() to
++ * avoid triggering the unlink scheduled above in pidfile_acquire()
++ */
++int pidfile_reassign(const char *pidfile, int pid)
++{
++ int fd, result;
++ if (!pidfile) return (-1);
++
++ if ((fd = pidfile_open(pidfile)) < 0)
++ return (-1);
+
++ result = pidfile_store(fd, pidfile, pid);
+
++ pidfile_close(fd);
++
++ return (result);
++}
+Index: busybox-1.1.0/networking/udhcp/common.c
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/common.c 2006-01-11 06:43:50.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/common.c 2006-03-14 17:15:45.000000000 +0100
+@@ -64,16 +64,34 @@
+ #ifdef __uClinux__
+ LOG(LOG_ERR, "Cannot background in uclinux (yet)");
+ #else /* __uClinux__ */
+- int pid_fd;
++ int pid, fd;
+
+- /* hold lock during fork. */
+- pid_fd = pidfile_acquire(pidfile);
+- if (daemon(0, 0) == -1) {
++ /* NOTE: lockf is not inherited by the child after fork */
++ if ((pid = fork()) < 0) {
+ perror("fork");
+ exit(1);
+ }
++
++ if (pid > 0) {
++ /* parent */
++ if (pidfile_reassign(pidfile, pid) < 0) {
++ (void)kill(pid, SIGKILL);
++ exit(1);
++ } else
++ _exit(0);
++ }
++
++ /* child */
++ (void)chdir("/");
++ if ((fd = open("/dev/null", O_RDWR)) >= 0) {
++ (void)dup2(fd, 0);
++ (void)dup2(fd, 1);
++ (void)dup2(fd, 2);
++ (void)close(fd);
++ }
++ (void)setsid();
++
+ daemonized++;
+- pidfile_write_release(pid_fd);
+ #endif /* __uClinux__ */
+ }
+
+@@ -97,14 +115,12 @@
+
+ void start_log_and_pid(const char *client_server, const char *pidfile)
+ {
+- int pid_fd;
+-
+ /* Make sure our syslog fd isn't overwritten */
+ sanitize_fds();
+
+ /* do some other misc startup stuff while we are here to save bytes */
+- pid_fd = pidfile_acquire(pidfile);
+- pidfile_write_release(pid_fd);
++ if (pidfile_acquire(pidfile) < 0)
++ exit(1);
+
+ /* equivelent of doing a fflush after every \n */
+ setlinebuf(stdout);
+@@ -150,8 +166,8 @@
+ sanitize_fds();
+
+ /* do some other misc startup stuff while we are here to save bytes */
+- pid_fd = pidfile_acquire(pidfile);
+- pidfile_write_release(pid_fd);
++ if (pidfile_acquire(pidfile) < 0)
++ exit(1);
+
+ /* equivelent of doing a fflush after every \n */
+ setlinebuf(stdout);
+Index: busybox-1.1.0/networking/udhcp/script.c
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/script.c 2006-01-11 06:43:50.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/script.c 2006-03-14 17:15:45.000000000 +0100
+@@ -229,6 +229,6 @@
+ execle(client_config.script, client_config.script,
+ name, NULL, envp);
+ LOG(LOG_ERR, "script %s failed: %m", client_config.script);
+- exit(1);
++ _exit(1);
+ }
+ }
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/add-getkey-applet.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/add-getkey-applet.patch
new file mode 100644
index 0000000000..a75cf823c7
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/add-getkey-applet.patch
@@ -0,0 +1,167 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+Index: busybox-1.1.0/console-tools/getkey.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ busybox-1.1.0/console-tools/getkey.c 2006-03-14 17:17:28.000000000 +0100
+@@ -0,0 +1,94 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * getkey.c - Michael 'Mickey' Lauer
++ *
++ * Version 0.1
++ *
++ * A simple keygrapper. Displays a configurable message and waits a dedicated number
++ * of seconds for a keypress. Sets the exit code accordingly (SUCCESS on keypress).
++ */
++#include <stdio.h>
++#include <fcntl.h>
++#include <memory.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <sys/types.h>
++#include <errno.h>
++#include <sys/ioctl.h>
++#include <sys/kd.h>
++#include "busybox.h"
++
++extern int getkey_main(int argc, char **argv)
++{
++ int status = EXIT_FAILURE;
++
++ if ( argc < 2 )
++ {
++ bb_show_usage();
++ }
++
++ /*
++ * If no terminal is attached it is quite useless
++ * to treat it like one.
++ */
++ if( !isatty(STDIN_FILENO) )
++ {
++ goto error_hard;
++ }
++
++ //bb_printf( "DEBUG: time = '%s'\n", argv[1] );
++ //bb_printf( "DEBUG: mesg = '%s'\n", argv[2] );
++
++ struct termios orig;
++ struct termios attr;
++
++ if ( tcgetattr(STDIN_FILENO, &orig) == -1 )
++ {
++ goto error_hard;
++ }
++
++ attr = orig;
++ attr.c_cc[VMIN] = 0;
++ attr.c_cc[VTIME] = 0;
++ attr.c_iflag |= INLCR;
++ attr.c_oflag |= OPOST|ONLCR;
++ attr.c_cflag &= ~PARENB;
++ attr.c_lflag &= ~(ICANON/*|ECHO*/);
++ if ( tcsetattr(STDIN_FILENO,TCSANOW,&attr) == -1 )
++ {
++ goto error_hard;
++ }
++
++ fd_set rfds;
++ struct timeval tv;
++ int retval;
++
++ FD_ZERO(&rfds);
++ FD_SET(0, &rfds);
++
++ tv.tv_sec = atoi( argv[1] );
++ tv.tv_usec = 0;
++
++ if ( argc == 3 )
++ {
++ bb_printf( argv[2], tv.tv_sec );
++ bb_printf( "\n" );
++ fflush(stdout);
++ }
++ retval = select(1, &rfds, NULL, NULL, &tv);
++ if (retval > 0)
++ {
++ status = EXIT_SUCCESS;
++ }
++
++ if (tcsetattr(STDIN_FILENO,TCSANOW,&orig) == -1 )
++ {
++ goto error_hard;
++ }
++
++ return status;
++
++error_hard :
++ return EXIT_FAILURE;
++};
++
+Index: busybox-1.1.0/console-tools/Makefile.in
+===================================================================
+--- busybox-1.1.0.orig/console-tools/Makefile.in 2006-01-11 06:43:57.000000000 +0100
++++ busybox-1.1.0/console-tools/Makefile.in 2006-03-14 17:18:18.000000000 +0100
+@@ -21,6 +21,7 @@
+ CONSOLETOOLS_DIR-$(CONFIG_OPENVT) += openvt.o
+ CONSOLETOOLS_DIR-$(CONFIG_RESET) += reset.o
+ CONSOLETOOLS_DIR-$(CONFIG_SETKEYCODES) += setkeycodes.o
++CONSOLETOOLS_DIR-$(CONFIG_GETKEY) += getkey.o
+
+ libraries-y+=$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR)
+
+Index: busybox-1.1.0/console-tools/Config.in
+===================================================================
+--- busybox-1.1.0.orig/console-tools/Config.in 2006-01-11 06:43:57.000000000 +0100
++++ busybox-1.1.0/console-tools/Config.in 2006-03-14 17:17:28.000000000 +0100
+@@ -31,6 +31,14 @@
+ This program dumps the kernel's keyboard translation table to
+ stdout, in binary format. You can then use loadkmap to load it.
+
++config CONFIG_GETKEY
++ bool "getkey"
++ default n
++ help
++ This program displays a configurable message and waits
++ a dedicated number of seconds for a keypress. It sets
++ the exit code accordingly, i.e. SUCCESS if there was a keypress.
++
+ config CONFIG_LOADFONT
+ bool "loadfont"
+ default n
+Index: busybox-1.1.0/include/applets.h
+===================================================================
+--- busybox-1.1.0.orig/include/applets.h 2006-01-11 06:44:14.000000000 +0100
++++ busybox-1.1.0/include/applets.h 2006-03-14 17:17:28.000000000 +0100
+@@ -261,6 +261,9 @@
+ #ifdef CONFIG_FUSER
+ APPLET(fuser, fuser_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
+ #endif
++#ifdef CONFIG_GETKEY
++ APPLET(getkey, getkey_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
++#endif
+ #ifdef CONFIG_GETOPT
+ APPLET(getopt, getopt_main, _BB_DIR_BIN, _BB_SUID_NEVER)
+ #endif
+Index: busybox-1.1.0/include/usage.h
+===================================================================
+--- busybox-1.1.0.orig/include/usage.h 2006-01-11 06:44:14.000000000 +0100
++++ busybox-1.1.0/include/usage.h 2006-03-14 17:19:11.000000000 +0100
+@@ -841,6 +841,13 @@
+ "\t-p, --password Password to be used\n" \
+ "\t-P, --port Port number to be used"
+
++#define getkey_trivial_usage \
++ "time [message]"
++#define getkey_full_usage \
++ "Display a message and wait for a keypress."
++#define getkey_example_usage \
++ "$ getkey 5 'Press a key within %d seconds to interrupt autoboot.'"
++
+ #define fuser_trivial_usage \
+ "[options] file OR port/proto"
+ #define fuser_full_usage \
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/angstrom-busybox-syslogd-conf.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/angstrom-busybox-syslogd-conf.patch
new file mode 100644
index 0000000000..c0afe5a07a
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/angstrom-busybox-syslogd-conf.patch
@@ -0,0 +1,19 @@
+#
+# old_revision [fdb3a990f25607c7b10b3ace56859b837e3e6a99]
+#
+# add_file "packages/busybox/busybox-1.2.1/angstrom/syslog.conf"
+# content [96581f5fbde2e5e5109328e8b42d14d53a5c2119]
+#
+============================================================
+--- packages/busybox/busybox-1.2.1/angstrom/syslog.conf 96581f5fbde2e5e5109328e8b42d14d53a5c2119
++++ packages/busybox/busybox-1.2.1/angstrom/syslog.conf 96581f5fbde2e5e5109328e8b42d14d53a5c2119
+@@ -0,0 +1,9 @@
++DESTINATION="file" # log destinations (buffer file remote)
++MARKINT=20 # interval between --mark-- entries [min]
++REDUCE=no # reduced-size logging
++BUFFERSIZE=64 # buffer: size of circular buffer [kByte]
++LOGFILE=/var/log/messages # file: where to log
++ROTATESIZE=32 # file: rotate log if grown beyond X [kByte] (busybox 1.2+)
++ROTATEGENS=1 # file: keep X generations of rotated logs (busybox 1.2+)
++REMOTE=loghost:514 # remote: where to log
++FOREGROUND=no # run in foreground (don't use!)
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/below.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/below.patch
new file mode 100644
index 0000000000..95e8376e46
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/below.patch
@@ -0,0 +1,46 @@
+Index: busybox-1.1.0/modutils/modprobe.c
+===================================================================
+--- busybox-1.1.0.orig/modutils/modprobe.c 2006-01-11 06:43:56.000000000 +0100
++++ busybox-1.1.0/modutils/modprobe.c 2006-03-14 16:36:54.000000000 +0100
+@@ -509,6 +509,41 @@
+ }
+ }
+ }
++ else if ((strncmp (buffer, "below", 5) == 0) && isspace (buffer[5])) {
++ char *mod, *deps;
++ if (parse_tag_value (buffer + 6, &mod, &deps)) {
++ struct dep_t *dt;
++
++ for (dt = first; dt; dt = dt->m_next) {
++ if (strcmp (dt->m_name, mod) == 0)
++ break;
++ }
++ if (dt) {
++ char *pp;
++ char *name;
++
++ pp = name = deps;
++
++ for (;;) {
++ while (*pp != 0 && !isspace (*pp))
++ pp++;
++ if (isspace (*pp))
++ *(pp++) = 0;
++
++ dt->m_depcnt++;
++ dt->m_deparr = (char **) xrealloc (dt->m_deparr,
++ sizeof (char *) * dt->m_depcnt);
++ dt->m_deparr[dt->m_depcnt - 1] = bb_xstrdup (name);
++
++ while (isspace (*pp))
++ pp++;
++ name = pp;
++ if (*pp == 0)
++ break;
++ }
++ }
++ }
++ }
+ }
+ }
+ close ( fd );
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/dhcpretrytime.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/dhcpretrytime.patch
new file mode 100644
index 0000000000..893e346acf
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/dhcpretrytime.patch
@@ -0,0 +1,85 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+Index: busybox-1.1.0/networking/udhcp/dhcpc.c
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/dhcpc.c 2006-03-14 17:19:31.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/dhcpc.c 2006-03-14 17:20:45.000000000 +0100
+@@ -48,6 +48,7 @@
+ static unsigned long requested_ip; /* = 0 */
+ static unsigned long server_addr;
+ static unsigned long timeout;
++static unsigned long retrytime = 60;
+ static int packet_num; /* = 0 */
+ static int fd = -1;
+
+@@ -95,6 +96,7 @@
+ " -r, --request=IP IP address to request (default: none)\n"
+ " -s, --script=file Run file at dhcp events (default:\n"
+ " " DEFAULT_SCRIPT ")\n"
++" -t, --retrytime time to retry DHCP request (default 60s)\n")
+ " -v, --version Display version\n"
+ );
+ exit(0);
+@@ -214,6 +216,7 @@
+ {"quit", no_argument, 0, 'q'},
+ {"request", required_argument, 0, 'r'},
+ {"script", required_argument, 0, 's'},
++ {"retrytime", required_argument, 0, 't'},
+ {"version", no_argument, 0, 'v'},
+ {0, 0, 0, 0}
+ };
+@@ -229,7 +232,7 @@
+ /* get options */
+ while (1) {
+ int option_index = 0;
+- c = getopt_long(argc, argv, "c:CV:fbH:h:F:i:np:qr:s:v", arg_options, &option_index);
++ c = getopt_long(argc, argv, "c:CV:fbH:h:F:i:np:qr:s:t:v", arg_options, &option_index);
+ if (c == -1) break;
+
+ switch (c) {
+@@ -305,6 +308,9 @@
+ case 's':
+ client_config.script = optarg;
+ break;
++ case 't':
++ retrytime = atol(optarg);
++ break;
+ case 'v':
+ printf("udhcpcd, version %s\n\n", VERSION);
+ return 0;
+@@ -394,7 +400,7 @@
+ }
+ /* wait to try again */
+ packet_num = 0;
+- timeout = now + 60;
++ timeout = now + retrytime;
+ }
+ break;
+ case RENEW_REQUESTED:
+Index: busybox-1.1.0/networking/ifupdown.c
+===================================================================
+--- busybox-1.1.0.orig/networking/ifupdown.c 2006-01-11 06:43:51.000000000 +0100
++++ busybox-1.1.0/networking/ifupdown.c 2006-03-14 17:19:41.000000000 +0100
+@@ -506,7 +506,7 @@
+ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
+ {
+ if (execable("/sbin/udhcpc")) {
+- return( execute("udhcpc -n -p /var/run/udhcpc.%iface%.pid -i "
++ return( execute("udhcpc -b -p /var/run/udhcpc.%iface%.pid -i "
+ "%iface% [[-H %hostname%]] [[-c %clientid%]]", ifd, exec));
+ } else if (execable("/sbin/pump")) {
+ return( execute("pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]]", ifd, exec));
+@@ -526,8 +526,8 @@
+ /* SIGUSR2 forces udhcpc to release the current lease and go inactive,
+ * and SIGTERM causes udhcpc to exit. Signals are queued and processed
+ * sequentially so we don't need to sleep */
+- result = execute("kill -USR2 `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
+- result += execute("kill -TERM `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
++ result = execute("kill -USR2 `cat /var/run/udhcpc.%iface%.pid 2>/dev/null` 2>/dev/null", ifd, exec);
++ result += execute("kill -TERM `cat /var/run/udhcpc.%iface%.pid 2>/dev/null` 2>/dev/null", ifd, exec);
+ } else if (execable("/sbin/pump")) {
+ result = execute("pump -i %iface% -k", ifd, exec);
+ } else if (execable("/sbin/dhclient")) {
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/fbset.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/fbset.patch
new file mode 100644
index 0000000000..d0609ce6f7
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/fbset.patch
@@ -0,0 +1,24 @@
+--- busybox/util-linux/fbset.c~ 2004-07-03 16:24:23.000000000 +0100
++++ busybox/util-linux/fbset.c 2004-12-30 20:09:26.000000000 +0000
+@@ -337,7 +337,7 @@
+ {
+ struct fb_var_screeninfo var, varset;
+ int fh, i;
+- char *fbdev = DEFAULTFBDEV;
++ char *fbdev = NULL;
+ char *modefile = DEFAULTFBMODE;
+ char *thisarg, *mode = NULL;
+
+@@ -404,7 +404,12 @@
+ }
+ }
+
++ if (fbdev == NULL)
++ fbdev = DEFAULTFBDEV;
+ if ((fh = open(fbdev, O_RDONLY)) < 0)
++#ifdef CONFIG_FEATURE_DEVFS
++ if ((fh = open("/dev/fb0", O_RDONLY)) < 0)
++#endif
+ bb_perror_msg_and_die("fbset(open)");
+ if (ioctl(fh, FBIOGET_VSCREENINFO, &var))
+ bb_perror_msg_and_die("fbset(ioctl)");
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/hdparm_M.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/hdparm_M.patch
new file mode 100644
index 0000000000..9adcd36f92
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/hdparm_M.patch
@@ -0,0 +1,47 @@
+Index: busybox-1.1.0/miscutils/hdparm.c
+===================================================================
+--- busybox-1.1.0.orig/miscutils/hdparm.c 2006-01-11 06:44:13.000000000 +0100
++++ busybox-1.1.0/miscutils/hdparm.c 2006-03-14 17:22:22.000000000 +0100
+@@ -1255,6 +1255,7 @@
+ static unsigned long set_sleepnow, get_sleepnow;
+ static unsigned long get_powermode;
+ static unsigned long set_apmmode, get_apmmode, apmmode;
++static unsigned long set_acoustic = 0, get_acoustic = 0, acoustic = 0;
+ #endif
+ #ifdef CONFIG_FEATURE_HDPARM_GET_IDENTITY
+ static int get_IDentity;
+@@ -2124,6 +2125,20 @@
+ }
+ bb_ioctl(fd, HDIO_DRIVE_CMD, &args,"HDIO_DRIVE_CMD");
+ }
++ if (set_acoustic)
++ {
++ no_scsi();
++ acoustic=check_if_min_and_set_val(acoustic,0);
++ acoustic=check_if_maj_and_set_val(acoustic,254);
++ if_printf(get_acoustic," setting AAM level to 0x%02lX (%ld)\n", acoustic, acoustic);
++ bb_ioctl(fd, HDIO_SET_ACOUSTIC, (int*)acoustic,"HDIO_SET_ACOUSTIC");
++ }
++ if (get_acoustic)
++ {
++ no_scsi();
++ bb_ioctl(fd, HDIO_GET_ACOUSTIC, (unsigned long*)&parm,"HDIO_GET_ACOUSTIC");
++ printf(" acoustic = %2ld (128=quiet ... 254=fast)\n", parm);
++ }
+ if (set_wcache)
+ {
+ #ifdef DO_FLUSHCACHE
+@@ -2832,6 +2847,13 @@
+ p = *argv++, --argc;
+ p=GET_NUMBER(p,&set_readahead,&Xreadahead);
+ break;
++ case 'M':
++ get_acoustic = noisy;
++ noisy = 1;
++ if (!*p && argc && isalnum(**argv))
++ p = *argv++, --argc;
++ p=GET_NUMBER(p,&set_acoustic,&acoustic);
++ break;
+ case 'B':
+ get_apmmode = noisy;
+ noisy = 1;
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/iproute-flush-cache.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/iproute-flush-cache.patch
new file mode 100644
index 0000000000..f8becc3390
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/iproute-flush-cache.patch
@@ -0,0 +1,23 @@
+Index: networking/libiproute/iproute.c
+===================================================================
+RCS file: /var/cvs/busybox/networking/libiproute/iproute.c,v
+retrieving revision 1.14
+diff -u -r1.14 iproute.c
+--- networking/libiproute/iproute.c 11 Aug 2004 08:10:58 -0000 1.14
++++ networking/libiproute/iproute.c 30 Nov 2004 20:43:44 -0000
+@@ -537,6 +537,15 @@
+ } else if (matches(*argv, "match") == 0) {
+ NEXT_ARG();
+ get_prefix(&filter.mdst, *argv, do_ipv6);
++ } else if (matches(*argv, "table") == 0) {
++ NEXT_ARG();
++ if (matches(*argv, "cache") == 0) {
++ filter.tb = -1;
++ } else if (matches(*argv, "main") != 0) {
++ invarg("invalid \"table\"", *argv);
++ }
++ } else if (matches(*argv, "cache") == 0) {
++ filter.tb = -1;
+ } else {
+ if (matches(*argv, "exact") == 0) {
+ NEXT_ARG();
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/mount-all-type.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/mount-all-type.patch
new file mode 100644
index 0000000000..476094a804
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/mount-all-type.patch
@@ -0,0 +1,84 @@
+--- busybox-1.00/.pc/mount-all-type.patch/util-linux/mount.c 2004-08-02 17:14:02.000000000 -0700
++++ busybox-1.00/util-linux/mount.c 2005-05-13 00:17:19.054232796 -0700
+@@ -364,6 +364,56 @@
+ exit(EXIT_SUCCESS);
+ }
+
++/* Does this file system type, from /etc/fstab, match the given
++ * -t option value?
++ */
++static int match_fs(const char *option, const char *type)
++{
++ const int len = strlen(type);
++ const int no = option[0] == 'n' && option[1] == 'o';
++ const char *optp = option;
++
++ if (len > 0) do {
++ const char *match = strstr(optp, type);
++
++ if (match == NULL) {
++ /* No match, but if the option string starts 'no' no match
++ * means yes.
++ */
++ return no;
++ }
++
++ /* Match, may be partial, check for end-of-type in option string. */
++ if (match[len] == 0 || match[len] == ',') {
++ /* Ok, check for type or notype. */
++ if (match == option) {
++ /* Exact match at start (can't be 'no') */
++ return 1;
++ }
++ if (match > option+1) {
++ if (match[-1] == ',') {
++ /* Exact match in middle, might be 'no' */
++ return !no;
++ }
++ if (match == option+2 && no) {
++ /* Exact match to 'notype' at start. */
++ return 0;
++ }
++ if (match > option+2 && match[-3] == ',' &&
++ match[-2] == 'n' && match[-1] == 'o') {
++ return 0;
++ }
++ }
++ }
++
++ /* Look for another match. */
++ optp = match+1;
++ } while (1);
++
++ /* zero length type in fstab (impossible?), don't match it. */
++ return 0;
++}
++
+ extern int mount_main(int argc, char **argv)
+ {
+ struct stat statbuf;
+@@ -371,6 +421,7 @@
+ char *extra_opts;
+ int flags = 0;
+ char *filesystemType = "auto";
++ char *filesystemOption = 0;
+ int got_filesystemType = 0;
+ char *device = xmalloc(PATH_MAX);
+ char *directory = xmalloc(PATH_MAX);
+@@ -393,6 +444,7 @@
+ break;
+ case 't':
+ filesystemType = optarg;
++ filesystemOption = optarg;
+ got_filesystemType = 1;
+ break;
+ case 'w':
+@@ -460,6 +512,8 @@
+
+ strcpy(device, m->mnt_fsname);
+ strcpy(directory, m->mnt_dir);
++ if (all && filesystemOption != 0 && !match_fs(filesystemOption, m->mnt_type))
++ continue;
+ filesystemType = bb_xstrdup(m->mnt_type);
+ singlemount:
+ extra_opts = string_flags;
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/readlink.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/readlink.patch
new file mode 100644
index 0000000000..0c5431085a
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/readlink.patch
@@ -0,0 +1,85 @@
+diff -p -u -r1.7 Config.in
+--- busybox-1.00/debianutils/Config.in 15 Mar 2004 08:28:24 -0000 1.7
++++ busybox-1.00-patched/debianutils/Config.in 16 Nov 2004 11:46:41 -0000
+@@ -24,6 +24,13 @@ config CONFIG_READLINK
+ This program reads a symbolic link and returns the name
+ of the file it points to
+
++config CONFIG_FEATURE_READLINK_FOLLOW
++ bool " Enable canonicalization by following all symlinks (-f)"
++ default n
++ depends on CONFIG_READLINK
++ help
++ Enable the readlink option (-f).
++
+ config CONFIG_RUN_PARTS
+ bool "run-parts"
+ default n
+diff -p -u -r1.2 readlink.c
+--- busybox-1.00/debianutils/readlink.c 19 Mar 2003 09:11:41 -0000 1.2
++++ busybox-1.00-patched/debianutils/readlink.c 16 Nov 2004 11:46:41 -0000
+@@ -23,18 +23,38 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <getopt.h>
+ #include "busybox.h"
+
++#ifdef CONFIG_FEATURE_READLINK_FOLLOW
++# define READLINK_FOLLOW "f"
++# define READLINK_FLAG_f (1 << 0)
++#else
++# define READLINK_FOLLOW ""
++#endif
++
++static const char readlink_options[] = READLINK_FOLLOW;
++
+ int readlink_main(int argc, char **argv)
+ {
+ char *buf = NULL;
++ unsigned long opt = bb_getopt_ulflags(argc, argv, readlink_options);
++#ifdef CONFIG_FEATURE_READLINK_FOLLOW
++ RESERVE_CONFIG_BUFFER(resolved_path, PATH_MAX);
++#endif
+
+ /* no options, no getopt */
+
+- if (argc != 2)
++ if (optind + 1 != argc)
+ bb_show_usage();
+
+- buf = xreadlink(argv[1]);
++#ifdef CONFIG_FEATURE_READLINK_FOLLOW
++ if (opt & READLINK_FLAG_f) {
++ buf = realpath(argv[optind], resolved_path);
++ } else
++#endif
++ buf = xreadlink(argv[optind]);
++
+ if (!buf)
+ return EXIT_FAILURE;
+ puts(buf);
+diff -p -u -r1.222 usage.h
+--- busybox-1.00/include/usage.h 14 Sep 2004 16:23:56 -0000 1.222
++++ busybox-1.00-patched/include/usage.h 16 Nov 2004 11:46:42 -0000
+@@ -1985,10 +1985,18 @@
+ "\t-s\tSet the system date and time (default).\n" \
+ "\t-p\tPrint the date and time."
+
++#ifdef CONFIG_FEATURE_READLINK_FOLLOW
++#define USAGE_READLINK_FOLLOW(a) a
++#else
++#define USAGE_READLINK_FOLLOW(a)
++#endif
++
+ #define readlink_trivial_usage \
+- ""
++ USAGE_READLINK_FOLLOW("[-f] ") "FILE"
+ #define readlink_full_usage \
+- "Displays the value of a symbolic link."
++ "Displays the value of a symbolic link." \
++ USAGE_READLINK_FOLLOW("\n\nOptions:\n" \
++ "\t-f\tcanonicalize by following all symlinks")
+
+ #define realpath_trivial_usage \
+ "pathname ..."
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/rmmod.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/rmmod.patch
new file mode 100644
index 0000000000..20770e0dc4
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/rmmod.patch
@@ -0,0 +1,40 @@
+Index: busybox-1.1.0/modutils/rmmod.c
+===================================================================
+--- busybox-1.1.0.orig/modutils/rmmod.c 2006-01-11 06:43:56.000000000 +0100
++++ busybox-1.1.0/modutils/rmmod.c 2006-03-14 16:42:14.000000000 +0100
+@@ -29,6 +29,7 @@
+ #include <string.h>
+ #include <sys/utsname.h>
+ #include <sys/syscall.h>
++#include <sys/utsname.h>
+ #include "busybox.h"
+
+ #ifdef CONFIG_FEATURE_2_6_MODULES
+@@ -64,6 +65,16 @@
+ but must get */
+ size_t bufsize = sizeof(bb_common_bufsiz1);
+ #endif
++#ifdef CONFIG_FEATURE_2_6_MODULES
++ int k_version = 0;
++ struct utsname myuname;
++
++ if (uname(&myuname) == 0) {
++ if (myuname.release[0] == '2') {
++ k_version = myuname.release[2] - '0';
++ }
++ }
++#endif
+
+ /* Parse command line. */
+ n = bb_getopt_ulflags(argc, argv, "wfa");
+@@ -109,6 +120,10 @@
+ afterslash++;
+ module_name = alloca(strlen(afterslash) + 1);
+ filename2modname(module_name, afterslash);
++ if (k_version != 4)
++ filename2modname(module_name, afterslash);
++ else
++ strcpy(module_name, afterslash);
+ #else
+ #define module_name argv[n]
+ #endif
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/udhcppidfile-breakage.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/udhcppidfile-breakage.patch
new file mode 100644
index 0000000000..031274908b
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/udhcppidfile-breakage.patch
@@ -0,0 +1,57 @@
+--- busybox-1.00/networking/udhcp/common.c~udhcppidfile2
++++ busybox-1.00/networking/udhcp/common.c
+@@ -74,7 +74,7 @@
+
+ if (pid > 0) {
+ /* parent */
+- if (pidfile_reassign(pidfile, pid) < 0) {
++ if (pidfile != NULL && pidfile_reassign(pidfile, pid) < 0) {
+ (void)kill(pid, SIGKILL);
+ exit(1);
+ } else
+@@ -119,7 +119,7 @@
+ sanitize_fds();
+
+ /* do some other misc startup stuff while we are here to save bytes */
+- if (pidfile_acquire(pidfile) < 0)
++ if (pidfile != NULL && pidfile_acquire(pidfile) < 0)
+ exit(1);
+
+ /* equivelent of doing a fflush after every \n */
+@@ -166,7 +166,7 @@
+ sanitize_fds();
+
+ /* do some other misc startup stuff while we are here to save bytes */
+- if (pidfile_acquire(pidfile) < 0)
++ if (pidfile != NULL && pidfile_acquire(pidfile) < 0)
+ exit(1);
+
+ /* equivelent of doing a fflush after every \n */
+--- busybox-1.00/networking/udhcp/pidfile.c~udhcppidfile2
++++ busybox-1.00/networking/udhcp/pidfile.c
+@@ -141,7 +141,11 @@
+ int pidfile_acquire(const char *pidfile)
+ {
+ int fd, result;
+- if (!pidfile) return (-1);
++
++ if (pidfile == NULL) {
++ LOG(LOG_ERR, "pidfile_acquire: filename is NULL\n");
++ return (-1);
++ }
+
+ if ((fd = pidfile_open(pidfile)) < 0)
+ return (-1);
+@@ -170,7 +174,11 @@
+ int pidfile_reassign(const char *pidfile, int pid)
+ {
+ int fd, result;
+- if (!pidfile) return (-1);
++
++ if (pidfile == NULL) {
++ LOG(LOG_ERR, "pidfile_reassign: filename is NULL\n");
++ return (-1);
++ }
+
+ if ((fd = pidfile_open(pidfile)) < 0)
+ return (-1);
diff --git a/recipes/obsolete/busybox/busybox-static-1.2.1/udhcppidfile.patch b/recipes/obsolete/busybox/busybox-static-1.2.1/udhcppidfile.patch
new file mode 100644
index 0000000000..b4b86b8775
--- /dev/null
+++ b/recipes/obsolete/busybox/busybox-static-1.2.1/udhcppidfile.patch
@@ -0,0 +1,274 @@
+Index: busybox-1.1.0/networking/udhcp/pidfile.h
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/pidfile.h 2006-01-11 06:43:50.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/pidfile.h 2006-03-14 17:15:45.000000000 +0100
+@@ -21,5 +21,5 @@
+
+
+ int pidfile_acquire(const char *pidfile);
+-void pidfile_write_release(int pid_fd);
++int pidfile_reassign(const char *pidfile, int newpid);
+
+Index: busybox-1.1.0/networking/udhcp/pidfile.c
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/pidfile.c 2006-01-11 06:43:50.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/pidfile.c 2006-03-14 17:15:45.000000000 +0100
+@@ -25,6 +25,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <errno.h>
+
+ #include "pidfile.h"
+ #include "common.h"
+@@ -37,39 +38,146 @@
+ }
+
+
+-int pidfile_acquire(const char *pidfile)
++static int pidfile_open(const char *pidfile)
+ {
+- int pid_fd;
+- if (!pidfile) return -1;
++ int fd;
+
+- pid_fd = open(pidfile, O_CREAT | O_WRONLY, 0644);
+- if (pid_fd < 0) {
+- LOG(LOG_ERR, "Unable to open pidfile %s: %m\n", pidfile);
+- } else {
+- lockf(pid_fd, F_LOCK, 0);
+- if (!saved_pidfile)
+- atexit(pidfile_delete);
+- saved_pidfile = (char *) pidfile;
++ if ((fd = open(pidfile, O_CREAT | O_RDWR, 0644)) < 0) {
++ LOG(LOG_ERR, "pidfile_open: open %s failed: %m\n", pidfile);
++ return (-1);
++ }
++
++ /* NOTE: lockf is not inherited by child after fork */
++ if (lockf(fd, F_LOCK, 0) < 0) {
++ LOG(LOG_ERR, "pidfile_open: lock %s failed: %m\n", pidfile);
++ close(fd);
++ return (-1);
++ }
++
++ return (fd);
++}
++
++
++static int pidfile_check(int fd, const char *pidfile)
++{
++ int len, pid;
++ char buf[20];
++
++ if (lseek(fd, 0L, SEEK_SET) < 0) {
++ LOG(LOG_ERR, "pidfile_check: lseek %s failed: %m\n", pidfile);
++ return (-1);
++ }
++
++ if ((len = read(fd, buf, sizeof buf - 1)) < 0) {
++ LOG(LOG_ERR, "pidfile_check: read %s failed: %m\n", pidfile);
++ return (-1);
++ }
++
++ if (len == 0)
++ return (0);
++
++ buf[len] = '\0';
++
++ if ((pid = atoi(buf)) <= 1) {
++ LOG(LOG_WARNING,
++ "pidfile_check: ignoring bogus pid (%s) in %s\n",
++ buf, pidfile);
++ return (0);
++ }
++
++ if (kill((pid_t)pid, 0) == 0) {
++ LOG(LOG_ERR, "pidfile_check: process %d exists (%s)\n",
++ pid, pidfile);
++ return (-1);
++ }
++
++ if (errno != ESRCH) {
++ LOG(LOG_ERR, "pidfile_check: kill %d failed (%s): %m\n",
++ pid, pidfile);
++ return (-1);
++ }
++
++ return (0);
++}
++
++
++static int pidfile_store(int fd, const char *pidfile, int pid)
++{
++ int len;
++ char buf[20];
++
++ if (lseek(fd, 0L, SEEK_SET) < 0) {
++ LOG(LOG_ERR, "pidfile_store: lseek %s failed: %m\n", pidfile);
++ return (-1);
++ }
++
++ len = snprintf(buf, sizeof buf - 1, "%d\n", pid);
++ buf[len] = '\0';
++
++ if (write(fd, buf, len) < 0) {
++ LOG(LOG_ERR, "pidfile_store: write %s failed: %m\n",
++ pidfile);
++ return (-1);
++ }
++
++ if (ftruncate(fd, len) < 0) {
++ LOG(LOG_ERR, "pidfile_store: ftruncate %d failed (%s): %m\n",
++ len, pidfile);
++ return (-1);
+ }
+
+- return pid_fd;
++ return (0);
+ }
+
+
+-void pidfile_write_release(int pid_fd)
++static void pidfile_close(int fd)
+ {
+- FILE *out;
++ (void)lseek(fd, 0L, SEEK_SET);
++ (void)lockf(fd, F_ULOCK, 0);
++ (void)close(fd);
++}
+
+- if (pid_fd < 0) return;
+
+- if ((out = fdopen(pid_fd, "w")) != NULL) {
+- fprintf(out, "%d\n", getpid());
+- fclose(out);
++int pidfile_acquire(const char *pidfile)
++{
++ int fd, result;
++ if (!pidfile) return (-1);
++
++ if ((fd = pidfile_open(pidfile)) < 0)
++ return (-1);
++
++ if ((result = pidfile_check(fd, pidfile)) == 0)
++ result = pidfile_store(fd, pidfile, getpid());
++
++ pidfile_close(fd);
++
++ if (result == 0) {
++ saved_pidfile = (char *) pidfile;
++ atexit(pidfile_delete);
+ }
+- lockf(pid_fd, F_UNLCK, 0);
+- close(pid_fd);
++
++ return (result);
+ }
+
+
++/*
++ * reassign the pid in a pidfile - used just after a fork so a parent
++ * can store the pid of its child into the file without any window
++ * where the pid in the file is a dead process (which might let another
++ * instance of the program start). Note the parent must use _exit() to
++ * avoid triggering the unlink scheduled above in pidfile_acquire()
++ */
++int pidfile_reassign(const char *pidfile, int pid)
++{
++ int fd, result;
++ if (!pidfile) return (-1);
++
++ if ((fd = pidfile_open(pidfile)) < 0)
++ return (-1);
+
++ result = pidfile_store(fd, pidfile, pid);
+
++ pidfile_close(fd);
++
++ return (result);
++}
+Index: busybox-1.1.0/networking/udhcp/common.c
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/common.c 2006-01-11 06:43:50.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/common.c 2006-03-14 17:15:45.000000000 +0100
+@@ -64,16 +64,34 @@
+ #ifdef __uClinux__
+ LOG(LOG_ERR, "Cannot background in uclinux (yet)");
+ #else /* __uClinux__ */
+- int pid_fd;
++ int pid, fd;
+
+- /* hold lock during fork. */
+- pid_fd = pidfile_acquire(pidfile);
+- if (daemon(0, 0) == -1) {
++ /* NOTE: lockf is not inherited by the child after fork */
++ if ((pid = fork()) < 0) {
+ perror("fork");
+ exit(1);
+ }
++
++ if (pid > 0) {
++ /* parent */
++ if (pidfile_reassign(pidfile, pid) < 0) {
++ (void)kill(pid, SIGKILL);
++ exit(1);
++ } else
++ _exit(0);
++ }
++
++ /* child */
++ (void)chdir("/");
++ if ((fd = open("/dev/null", O_RDWR)) >= 0) {
++ (void)dup2(fd, 0);
++ (void)dup2(fd, 1);
++ (void)dup2(fd, 2);
++ (void)close(fd);
++ }
++ (void)setsid();
++
+ daemonized++;
+- pidfile_write_release(pid_fd);
+ #endif /* __uClinux__ */
+ }
+
+@@ -97,14 +115,12 @@
+
+ void start_log_and_pid(const char *client_server, const char *pidfile)
+ {
+- int pid_fd;
+-
+ /* Make sure our syslog fd isn't overwritten */
+ sanitize_fds();
+
+ /* do some other misc startup stuff while we are here to save bytes */
+- pid_fd = pidfile_acquire(pidfile);
+- pidfile_write_release(pid_fd);
++ if (pidfile_acquire(pidfile) < 0)
++ exit(1);
+
+ /* equivelent of doing a fflush after every \n */
+ setlinebuf(stdout);
+@@ -150,8 +166,8 @@
+ sanitize_fds();
+
+ /* do some other misc startup stuff while we are here to save bytes */
+- pid_fd = pidfile_acquire(pidfile);
+- pidfile_write_release(pid_fd);
++ if (pidfile_acquire(pidfile) < 0)
++ exit(1);
+
+ /* equivelent of doing a fflush after every \n */
+ setlinebuf(stdout);
+Index: busybox-1.1.0/networking/udhcp/script.c
+===================================================================
+--- busybox-1.1.0.orig/networking/udhcp/script.c 2006-01-11 06:43:50.000000000 +0100
++++ busybox-1.1.0/networking/udhcp/script.c 2006-03-14 17:15:45.000000000 +0100
+@@ -229,6 +229,6 @@
+ execle(client_config.script, client_config.script,
+ name, NULL, envp);
+ LOG(LOG_ERR, "script %s failed: %m", client_config.script);
+- exit(1);
++ _exit(1);
+ }
+ }
diff --git a/recipes/obsolete/busybox/files/glibc2.4-icmp6.patch b/recipes/obsolete/busybox/files/glibc2.4-icmp6.patch
new file mode 100644
index 0000000000..3cec1dd31a
--- /dev/null
+++ b/recipes/obsolete/busybox/files/glibc2.4-icmp6.patch
@@ -0,0 +1,15 @@
+--- busybox-1.01/networking/ping6.c.orig 2006-03-15 15:43:21.000000000 +0100
++++ busybox-1.01/networking/ping6.c 2006-03-15 15:49:29.000000000 +0100
+@@ -56,6 +56,12 @@
+ #include <stddef.h> /* offsetof */
+ #include "busybox.h"
+
++#ifndef ICMP6_MEMBERSHIP_QUERY /* glibc >= 2.4 */
++#define ICMP6_MEMBERSHIP_QUERY MLD_LISTENER_QUERY
++#define ICMP6_MEMBERSHIP_REPORT MLD_LISTENER_REPORT
++#define ICMP6_MEMBERSHIP_REDUCTION MLD_LISTENER_REDUCTION
++#endif
++
+ static const int DEFDATALEN = 56;
+ static const int MAXIPLEN = 60;
+ static const int MAXICMPLEN = 76;