update busybox support
[nestedvm.git] / upstream / patches / busybox.patch
index ce510eb..24c99d7 100644 (file)
-Only in .: BusyBox.class
-Only in .: BusyBox.java
-diff -ur ../busybox-0.60.5/Config.h ./Config.h
---- ../busybox-0.60.5/Config.h Tue Sep 17 18:04:28 2002
-+++ ./Config.h Tue Nov 25 11:05:07 2003
-@@ -12,95 +12,95 @@
- #define BB_ASH
- #define BB_BASENAME
- #define BB_CAT
--#define BB_CHGRP
--#define BB_CHMOD
--#define BB_CHOWN
--#define BB_CHROOT
--#define BB_CHVT
-+//#define BB_CHGRP
-+//#define BB_CHMOD
-+//#define BB_CHOWN
-+//#define BB_CHROOT
-+//#define BB_CHVT
- #define BB_CLEAR
--//#define BB_CMP
--#define BB_CP
-+#define BB_CMP
-+//#define BB_CP
- //#define BB_CPIO
- #define BB_CUT
- #define BB_DATE
- //#define BB_DC
--#define BB_DD
-+//#define BB_DD
- //#define BB_DEALLOCVT
--#define BB_DF
-+//#define BB_DF
- #define BB_DIRNAME
--#define BB_DMESG
-+//#define BB_DMESG
- //#define BB_DOS2UNIX
- //#define BB_DPKG
- //#define BB_DPKG_DEB
- //#define BB_DUTMP
--#define BB_DU
-+//#define BB_DU
- //#define BB_DUMPKMAP
- #define BB_ECHO
--#define BB_ENV
-+//#define BB_ENV
- //#define BB_EXPR
- //#define BB_FBSET
- //#define BB_FDFLUSH
--#define BB_FIND
--#define BB_FREE
-+//#define BB_FIND
-+//#define BB_FREE
- //#define BB_FREERAMDISK
- //#define BB_FSCK_MINIX
- //#define BB_GETOPT
- #define BB_GREP
--#define BB_GUNZIP
-+//#define BB_GUNZIP
- #define BB_GZIP
--#define BB_HALT
-+//#define BB_HALT
- #define BB_HEAD
- //#define BB_HOSTID
- //#define BB_HOSTNAME
- //#define BB_HUSH
--#define BB_ID
-+//#define BB_ID
- //#define BB_IFCONFIG
--#define BB_INIT
-+//#define BB_INIT
- //#define BB_INSMOD
--#define BB_KILL
--#define BB_KILLALL
--#define BB_KLOGD
-+//#define BB_KILL
-+//#define BB_KILLALL
-+//#define BB_KLOGD
- //#define BB_LASH
- //#define BB_LENGTH
--#define BB_LN
-+//#define BB_LN
- //#define BB_LOADACM
- //#define BB_LOADFONT
- //#define BB_LOADKMAP
--#define BB_LOGGER
-+//#define BB_LOGGER
- //#define BB_LOGNAME
- //#define BB_LOSETUP
- #define BB_LS
--#define BB_LSMOD
-+//#define BB_LSMOD
- //#define BB_MAKEDEVS
--//#define BB_MD5SUM
-+#define BB_MD5SUM
- #define BB_MKDIR
- //#define BB_MKFIFO
- //#define BB_MKFS_MINIX
--#define BB_MKNOD
--#define BB_MKSWAP
-+//#define BB_MKNOD
-+//#define BB_MKSWAP
- //#define BB_MKTEMP
--#define BB_MODPROBE
--#define BB_MORE
--#define BB_MOUNT
-+//#define BB_MODPROBE
-+//#define BB_MORE
-+//#define BB_MOUNT
- //#define BB_MSH
- //#define BB_MT
--#define BB_MV
-+//#define BB_MV
- //#define BB_NC
- //#define BB_NSLOOKUP
--#define BB_PIDOF
-+//#define BB_PIDOF
- //#define BB_PING
- //#define BB_PIVOT_ROOT
--#define BB_POWEROFF
--//#define BB_PRINTF
--#define BB_PS
--#define BB_PWD
-+//#define BB_POWEROFF
-+#define BB_PRINTF
-+//#define BB_PS
-+//#define BB_PWD
- //#define BB_RDATE
- //#define BB_READLINK
--#define BB_REBOOT
-+//#define BB_REBOOT
- //#define BB_RENICE
- #define BB_RESET
--#define BB_RM
--#define BB_RMDIR
-+//#define BB_RM
-+//#define BB_RMDIR
- //#define BB_RMMOD
- //#define BB_ROUTE
- //#define BB_RPM2CPIO
-@@ -109,13 +109,13 @@
- #define BB_SLEEP
- #define BB_SORT
- //#define BB_STTY
--#define BB_SWAPONOFF
--#define BB_SYNC
--#define BB_SYSLOGD
-+//#define BB_SWAPONOFF
-+//#define BB_SYNC
-+//#define BB_SYSLOGD
- #define BB_TAIL
--#define BB_TAR
--//#define BB_TEE
--//#define BB_TEST
-+//#define BB_TAR
-+#define BB_TEE
-+#define BB_TEST
- //#define BB_TELNET
- //#define BB_TFTP
- //#define BB_TIME
-@@ -124,15 +124,15 @@
- //#define BB_TR
- //#define BB_TRACEROUTE
- #define BB_TRUE_FALSE
--#define BB_TTY
-+//#define BB_TTY
- //#define BB_UNIX2DOS
- //#define BB_UUENCODE
- //#define BB_UUDECODE
--#define BB_UMOUNT
-+//#define BB_UMOUNT
- #define BB_UNIQ
--#define BB_UNAME
-+//#define BB_UNAME
- //#define BB_UPDATE
--#define BB_UPTIME
-+//#define BB_UPTIME
- //#define BB_USLEEP
- //#define BB_VI
- //#define BB_WATCHDOG
-@@ -140,7 +140,7 @@
- //#define BB_WGET
- #define BB_WHICH
- #define BB_WHOAMI
--#define BB_XARGS
-+//#define BB_XARGS
- #define BB_YES
- // End of Applications List
- //
-@@ -182,13 +182,13 @@
- //#define BB_FEATURE_USE_DEVPS_PATCH
- //
- // show verbose usage messages
--#define BB_FEATURE_VERBOSE_USAGE
-+//#define BB_FEATURE_VERBOSE_USAGE
- //
- // Use termios to manipulate the screen ('more' is prettier with this on)
- //#define BB_FEATURE_USE_TERMIOS
- //
- // calculate terminal & column widths (for more, ls, and telnet)
--#define BB_FEATURE_AUTOWIDTH
-+//#define BB_FEATURE_AUTOWIDTH
- //
- // show username/groupnames for ls
- #define BB_FEATURE_LS_USERNAME
-@@ -271,11 +271,11 @@
- //
- // Enable command line editing in the shell.  
- // Only relevant if a shell is enabled. On by default.
--#define BB_FEATURE_COMMAND_EDITING
-+//#define BB_FEATURE_COMMAND_EDITING
- //
- // Enable tab completion in the shell.  This is now working quite nicely.
- // This feature adds a bit over 4k. Only relevant if a shell is enabled.
--#define BB_FEATURE_COMMAND_TAB_COMPLETION
-+//#define BB_FEATURE_COMMAND_TAB_COMPLETION
- //
- // Attempts to match usernames in a ~-prefixed path
- //#define BB_FEATURE_COMMAND_USERNAME_COMPLETION
-@@ -284,7 +284,7 @@
- //were shell builtins.  Nice for staticly linking an emergency rescue shell,
- //among other things. Off by default.
- // Only relevant if a shell is enabled.
--//#define BB_FEATURE_SH_STANDALONE_SHELL
-+#define BB_FEATURE_SH_STANDALONE_SHELL
- //
- //When this is enabled, busybox shell applets can be called using full path
- //names.  This causes applets (i.e., most busybox commands) to override
-@@ -306,7 +306,7 @@
- // are doing is running scripts).  Disabing this is bad for interactive
- // use, since when you hit ^C in an application, it will also kill the 
- // shell.  This adds about 2.5k on an x86 system.
--#define BB_FEATURE_ASH_JOB_CONTROL
-+//#define BB_FEATURE_ASH_JOB_CONTROL
- //
- //Turn on extra fbset options
- //#define BB_FEATURE_FBSET_FANCY
-@@ -371,7 +371,7 @@
- #define BB_FEATURE_FIND_TYPE
- //
- // Support for the find -perm option.
--#define BB_FEATURE_FIND_PERM
-+//#define BB_FEATURE_FIND_PERM
- //
- // Support for the find -mtime option.
- #define BB_FEATURE_FIND_MTIME
-@@ -420,7 +420,10 @@
- // Nothing beyond this point should ever be touched by 
- // mere mortals so leave this stuff alone.
- //
-+#ifdef _GNU_SOURCE
- #include <features.h>
+diff -Bubr ../busybox-1.00+/archival/libunarchive/decompress_bunzip2.c ./archival/libunarchive/decompress_bunzip2.c
+--- ../busybox-1.00+/archival/libunarchive/decompress_bunzip2.c        2004-08-27 17:43:05.000000000 -0700
++++ ./archival/libunarchive/decompress_bunzip2.c       2009-06-07 15:10:37.000000000 -0700
+@@ -136,7 +136,7 @@
+ {
+       /* Note: Ignore the warning about hufGroup, base and limit being used uninitialized.
+        * They will be initialized on the fist pass of the loop. */
+-      struct group_data *hufGroup;
++      struct group_data *hufGroup=NULL;
+       int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector,
+               i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256];
+       unsigned char uc, symToByte[256], mtfSymbol[256], *selectors;
+Only in ./archival/libunarchive: decompress_bunzip2.c.orig
+diff -Bubr ../busybox-1.00+/archival/tar.c ./archival/tar.c
+--- ../busybox-1.00+/archival/tar.c    2004-08-26 15:18:56.000000000 -0700
++++ ./archival/tar.c   2009-06-07 15:19:14.000000000 -0700
+@@ -48,8 +48,10 @@
+ #include <errno.h>
+ #include <signal.h>
+ #include <sys/wait.h>
++#ifndef NESTEDVM
+ #include <sys/socket.h>
+ #include <sys/sysmacros.h>     /* major() and minor() */
++#endif
+ #include "unarchive.h"
+ #include "busybox.h"
+Only in ./archival: tar.c.orig
+Only in .: busybox-1.00-pre9
+Only in .: .config
+Only in .: .config.cmd
+Only in .: .config.old
+diff -Bubr ../busybox-1.00+/coreutils/cal.c ./coreutils/cal.c
+--- ../busybox-1.00+/coreutils/cal.c   2004-04-14 10:51:09.000000000 -0700
++++ ./coreutils/cal.c  2009-06-07 15:08:50.000000000 -0700
+@@ -31,7 +31,9 @@
+ #include <sys/types.h>
+ #include <ctype.h>
++#ifndef NESTEDVM
+ #include <err.h>
 +#endif
-+
- #if defined(__uClinux__)
-       #undef BB_ASH                   /* Not even a chance it will work */
-       #undef BB_RPM2CPIO              /* Uses gz_open(), which uses fork() */
-diff -ur ../busybox-0.60.5/Makefile ./Makefile
---- ../busybox-0.60.5/Makefile Sun Oct 27 00:47:54 2002
-+++ ./Makefile Tue Nov 25 11:27:30 2003
-@@ -49,7 +49,7 @@
- # just 1.4k to the binary size (which is a _lot_ less then glibc NSS costs).
- # Note that if you want hostname resolution to work with glibc, you still need
- # the libnss_* libraries.  
--USE_SYSTEM_PWD_GRP = true
-+USE_SYSTEM_PWD_GRP = false
- # This enables compiling with dmalloc ( http://dmalloc.com/ )
- # which is an excellent public domain mem leak and malloc problem
-@@ -83,7 +83,7 @@
- # If you are running a cross compiler, you may want to set this
- # to something more interesting, like "powerpc-linux-".
--CROSS =
-+CROSS = mips-unknown-elf-
- CC = $(CROSS)gcc
- AR = $(CROSS)ar
- STRIP = $(CROSS)strip
-@@ -106,11 +106,11 @@
- #
- # For other libraries, you are on your own...
- #LDFLAGS+=-nostdlib
--#LIBRARIES = $(LIBCDIR)/lib/libc.a -lgcc
-+LIBRARIES = -lglob -lregex
- #CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
- #GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
--WARNINGS = -Wall -Wshadow
-+WARNINGS = -Wall -Wshadow -Werror -Wno-unused
- ARFLAGS = -r
-@@ -181,9 +181,9 @@
-     LDFLAGS += -Wl,-warn-common
-     STRIPCMD    = /bin/true -Since_we_are_debugging
- else
--    CFLAGS  += $(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE
--    LDFLAGS += -s -Wl,-warn-common
--    STRIPCMD    = $(STRIP) -s --remove-section=.note --remove-section=.comment
-+    CFLAGS  += $(WARNINGS) $(OPTIMIZATIONS) -DNEWLIB_ASH
-+    LDFLAGS += -Wl,-warn-common
-+    STRIPCMD    = true
- endif
- ifeq ($(strip $(DOSTATIC)),true)
-     LDFLAGS += --static
-@@ -260,7 +260,7 @@
-     PWD_LIB     = libpwd.a
-     PWD_CSRC=__getpwent.c pwent.c getpwnam.c getpwuid.c putpwent.c getpw.c \
-           fgetpwent.c __getgrent.c grent.c getgrnam.c getgrgid.c fgetgrent.c \
--          initgroups.c setgroups.c
-+          initgroups.c
-     PWD_OBJS=$(patsubst %.c,$(PWD_GRP)/%.o, $(PWD_CSRC))
- ifneq ($(strip $(BB_SRC_DIR)),)
-     PWD_CFLAGS = -I- -I.
-@@ -273,19 +273,19 @@
- LIBBB   = libbb
- LIBBB_LIB = libbb.a
- LIBBB_CSRC= ask_confirmation.c chomp.c concat_path_file.c copy_file.c \
--copy_file_chunk.c libc5.c device_open.c error_msg.c inode_hash.c \
--error_msg_and_die.c fgets_str.c find_mount_point.c find_pid_by_name.c \
--find_root_device.c full_read.c full_write.c get_console.c \
-+copy_file_chunk.c device_open.c error_msg.c inode_hash.c \
-+error_msg_and_die.c fgets_str.c find_pid_by_name.c \
-+find_root_device.c full_read.c full_write.c \
- get_last_path_component.c get_line_from_file.c gz_open.c human_readable.c \
--isdirectory.c kernel_version.c loop.c mode_string.c module_syscalls.c mtab.c \
-+isdirectory.c mode_string.c \
- mtab_file.c my_getgrnam.c my_getgrgid.c my_getpwnam.c my_getpwnamegid.c \
- my_getpwuid.c parse_mode.c parse_number.c perror_msg.c perror_msg_and_die.c \
- print_file.c process_escape_sequence.c read_package_field.c recursive_action.c \
--safe_read.c safe_strncpy.c syscalls.c syslog_msg_with_name.c time_string.c \
-+safe_read.c safe_strncpy.c time_string.c \
- trim.c unzip.c vdprintf.c verror_msg.c vperror_msg.c wfopen.c xfuncs.c \
--xgetcwd.c xreadlink.c xregcomp.c interface.c remove_file.c last_char_is.c \
--copyfd.c vherror_msg.c herror_msg.c herror_msg_and_die.c xgethostbyname.c \
--dirname.c make_directory.c create_icmp_socket.c u_signal_names.c arith.c \
-+xgetcwd.c xreadlink.c xregcomp.c remove_file.c last_char_is.c \
-+copyfd.c herror_msg.c herror_msg_and_die.c \
-+dirname.c make_directory.c u_signal_names.c arith.c \
- simplify_path.c
- LIBBB_OBJS=$(patsubst %.c,$(LIBBB)/%.o, $(LIBBB_CSRC))
- ifeq ($(strip $(BB_SRC_DIR)),)
-diff -ur ../busybox-0.60.5/ash.c ./ash.c
---- ../busybox-0.60.5/ash.c    Tue Oct 22 18:14:29 2002
-+++ ./ash.c    Tue Nov 25 11:17:08 2003
-@@ -84,11 +84,15 @@
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
-+#ifndef NEWLIB_ASH
- #include <sysexits.h>
+diff -Bubr ../busybox-1.00+/coreutils/date.c ./coreutils/date.c
+--- ../busybox-1.00+/coreutils/date.c  2004-10-11 13:52:16.000000000 -0700
++++ ./coreutils/date.c 2009-06-07 15:08:50.000000000 -0700
+@@ -236,7 +236,11 @@
+               }
+               /* if setting time, set it */
++#ifndef NESTEDVM
+               if (set_time && (stime(&tm) < 0)) {
++#else
++        if(0) {
 +#endif
+                       bb_perror_msg("cannot set date");
+               }
+       }
+Only in ./coreutils: date.c.orig
+diff -Bubr ../busybox-1.00+/coreutils/df.c ./coreutils/df.c
+--- ../busybox-1.00+/coreutils/df.c    2004-08-02 17:14:01.000000000 -0700
++++ ./coreutils/df.c   2009-06-07 15:20:57.000000000 -0700
+@@ -35,8 +35,10 @@
+ #include <stdlib.h>
+ #include <string.h>
  #include <unistd.h>
- #include <sys/stat.h>
- #include <sys/cdefs.h>
-+#ifndef NEWLIB_ASH
- #include <sys/ioctl.h>
++#ifndef NESTEDVM
+ #include <mntent.h>
+ #include <sys/vfs.h>
 +#endif
- #include <sys/param.h>
- #include <sys/resource.h>
- #include <sys/time.h>
-@@ -268,6 +272,7 @@
-  * more fun than worrying about efficiency and portability. :-))
-  */
+ #include "busybox.h"
  
-+#ifndef NEWLIB_ASH
- static void onint(void);
- static volatile int suppressint;
- static volatile int intpending;
-@@ -287,6 +292,16 @@
- #define CLEAR_PENDING_INT intpending = 0
- #define int_pending() intpending
+ #ifndef CONFIG_FEATURE_HUMAN_READABLE
+@@ -46,6 +48,7 @@
+ }
+ #endif
  
-+#else
-+
-+#define INTON
-+#define INTOFF
-+#define FORCEINTON
-+#define CLEAR_PENDING_INT
-+#define int_pending() 0
-+
++#ifndef NESTEDVM
+ extern int df_main(int argc, char **argv)
+ {
+       long blocks_used;
+@@ -160,6 +163,7 @@
+       bb_fflush_stdout_and_exit(status);
+ }
 +#endif
-+
  
- typedef void *pointer;
+ /*
+ Local Variables:
+diff -Bubr ../busybox-1.00+/coreutils/dos2unix.c ./coreutils/dos2unix.c
+--- ../busybox-1.00+/coreutils/dos2unix.c      2004-05-05 12:39:21.000000000 -0700
++++ ./coreutils/dos2unix.c     2009-06-07 15:08:50.000000000 -0700
+@@ -30,7 +30,9 @@
+ #include <string.h>
+ #include <getopt.h>
+ #include <unistd.h>
++#ifndef NESTEDVM
+ #include <stdint.h>
++#endif
+ #include <fcntl.h>
+ #include <sys/time.h>
+ #include "busybox.h"
+diff -Bubr ../busybox-1.00+/coreutils/env.c ./coreutils/env.c
+--- ../busybox-1.00+/coreutils/env.c   2004-04-16 08:02:10.000000000 -0700
++++ ./coreutils/env.c  2009-06-07 15:08:50.000000000 -0700
+@@ -50,12 +50,13 @@
+ #include <getopt.h>
+ #include "busybox.h"
  
-@@ -1556,7 +1571,9 @@
- #endif
- static int unsetcmd(int, char **);
- static int waitcmd(int, char **);
-+#ifndef NEWLIB_ASH
- static int ulimitcmd(int, char **);
+-
++#ifdef NESTEDVM
+ static const struct option env_long_options[] = {
+       { "ignore-environment", 0, NULL, 'i' },
+       { "unset", 1, NULL, 'u' },
+       { 0, 0, 0, 0 }
+ };
 +#endif
- static int timescmd(int, char **);
  
- #ifdef CONFIG_ASH_MATH_SUPPORT
-@@ -1647,10 +1664,14 @@
-       {BUILTIN_NOSPEC "setvar", setvarcmd},
-       {BUILTIN_SPECIAL "shift", shiftcmd},
-       {BUILTIN_SPECIAL "times", timescmd},
-+#ifndef NEWLIB_ASH
-       {BUILTIN_SPECIAL "trap", trapcmd},
-+#endif
-       {BUILTIN_REGULAR "true", true_main},
-       {BUILTIN_NOSPEC "type", typecmd},
-+#ifndef NEWLIB_ASH
-       {BUILTIN_NOSPEC "ulimit", ulimitcmd},
-+#endif
-       {BUILTIN_REGULAR "umask", umaskcmd},
- #ifdef CONFIG_ASH_ALIAS
-       {BUILTIN_REGULAR "unalias", unaliascmd},
-@@ -1918,6 +1939,8 @@
-  * just defensive programming.)
-  */
+ extern int env_main(int argc, char** argv)
+ {
+diff -Bubr ../busybox-1.00+/coreutils/expr.c ./coreutils/expr.c
+--- ../busybox-1.00+/coreutils/expr.c  2004-04-14 10:51:09.000000000 -0700
++++ ./coreutils/expr.c 2009-06-07 15:22:16.000000000 -0700
+@@ -244,6 +244,7 @@
  
-+#ifndef NEWLIB_ASH
-+
- static void onint(void)
+ static VALUE *docolon (VALUE *sv, VALUE *pv)
  {
-       sigset_t mysigset;
-@@ -1937,6 +1960,7 @@
-       /* NOTREACHED */
++#ifndef NESTEDVM
+       VALUE *v;
+       const char *errmsg;
+       struct re_pattern_buffer re_buffer;
+@@ -291,6 +292,9 @@
+       }
+       free (re_buffer.buffer);
+       return v;
++#else
++        return NULL;
++#endif
  }
  
+ /* Handle bare operands and ( expr ) syntax.  */
+diff -Bubr ../busybox-1.00+/coreutils/ls.c ./coreutils/ls.c
+--- ../busybox-1.00+/coreutils/ls.c    2004-09-23 19:04:13.000000000 -0700
++++ ./coreutils/ls.c   2009-06-07 15:22:37.000000000 -0700
+@@ -59,9 +59,11 @@
+ #include <stdlib.h>
+ #include <fcntl.h>
+ #include <signal.h>
++#ifndef NESTEDVM
+ #include <termios.h>
+ #include <sys/ioctl.h>
+ #include <sys/sysmacros.h>     /* major() and minor() */
 +#endif
+ #include "busybox.h"
+ #ifdef CONFIG_SELINUX
+ #include <fs_secure.h>
+@@ -984,8 +986,11 @@
+ #endif
  
- static char *commandname;     /* currently executing command */
+ #ifdef CONFIG_FEATURE_LS_COLOR
+-      if (isatty(STDOUT_FILENO))
++    {
++        char *term = getenv("TERM");
++        if (isatty(STDOUT_FILENO) && term && *term)
+               show_color = 1;
++    }
+ #endif
  
-@@ -2086,7 +2110,7 @@
- }
+       /* process options */
+Only in ./coreutils: ls.c.orig
+diff -Bubr ../busybox-1.00+/coreutils/md5_sha1_sum.c ./coreutils/md5_sha1_sum.c
+--- ../busybox-1.00+/coreutils/md5_sha1_sum.c  2004-04-14 10:51:09.000000000 -0700
++++ ./coreutils/md5_sha1_sum.c 2009-06-07 15:08:50.000000000 -0700
+@@ -20,7 +20,9 @@
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <stdio.h>
++#ifndef NESTEDVM
+ #include <stdint.h>
++#endif
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+diff -Bubr ../busybox-1.00+/coreutils/rmdir.c ./coreutils/rmdir.c
+--- ../busybox-1.00+/coreutils/rmdir.c 2004-03-15 00:28:21.000000000 -0800
++++ ./coreutils/rmdir.c        2009-06-07 15:08:50.000000000 -0700
+@@ -25,7 +25,9 @@
  
+ #include <stdlib.h>
+ #include <unistd.h>
++#ifndef NESTEDVM
+ #include <libgen.h>
++#endif
+ #include "busybox.h"
  
--#ifdef CONFIG_ASH_OPTIMIZE_FOR_SIZE
-+#if defined(CONFIG_ASH_OPTIMIZE_FOR_SIZE) && !defined(NEWLIB_ASH)
- static void __inton()
+ extern int rmdir_main(int argc, char **argv)
+diff -Bubr ../busybox-1.00+/editors/vi.c ./editors/vi.c
+--- ../busybox-1.00+/editors/vi.c      2004-08-19 12:15:06.000000000 -0700
++++ ./editors/vi.c     2009-06-07 15:24:23.000000000 -0700
+@@ -68,7 +68,9 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifndef NESTEDVM
+ #include <termios.h>
++#endif
+ #include <unistd.h>
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
+@@ -183,7 +185,9 @@
+ static Byte *screenbegin;     // index into text[], of top line on the screen
+ static Byte *dot;             // where all the action takes place
+ static int tabstop;
++#ifndef NESTEDVM
+ static struct termios term_orig, term_vi;     // remember what the cooked mode was
++#endif
+ static Byte erase_char;         // the users erase character
+ static Byte last_input_char;    // last char read from user
+ static Byte last_forward_char;  // last char searched for with 'f'
+@@ -2113,6 +2117,7 @@
+ //----- Set terminal attributes --------------------------------
+ static void rawmode(void)
  {
-       if (--suppressint == 0 && intpending) {
-@@ -5597,7 +5621,6 @@
++#ifndef NESTEDVM
+       tcgetattr(0, &term_orig);
+       term_vi = term_orig;
+       term_vi.c_lflag &= (~ICANON & ~ECHO);   // leave ISIG ON- allow intr's
+@@ -2122,12 +2127,15 @@
+       term_vi.c_cc[VTIME] = 0;
+       erase_char = term_vi.c_cc[VERASE];
+       tcsetattr(0, TCSANOW, &term_vi);
++#endif
+ }
  
- static void init(void)
+ static void cookmode(void)
  {
--
-       /* from cd.c: */
-       {
-               curdir = nullstr;
-@@ -5621,8 +5644,10 @@
-                       }
-               }
-+#ifndef NEWLIB_ASH
-               snprintf(ppid, sizeof(ppid), "%d", (int) getppid());
-               setvar("PPID", ppid, 0);
+       fflush(stdout);
++#ifndef NESTEDVM
+       tcsetattr(0, TCSANOW, &term_orig);
 +#endif
-       }
  }
  
-@@ -6214,12 +6239,16 @@
-                               else    /* WIFSIGNALED(ps->status) */
+ //----- Come here when we get a window resize signal ---------
+diff -Bubr ../busybox-1.00+/include/busybox.h ./include/busybox.h
+--- ../busybox-1.00+/include/busybox.h 2004-03-15 00:28:38.000000000 -0800
++++ ./include/busybox.h        2009-06-07 15:08:50.000000000 -0700
+@@ -33,7 +33,7 @@
+ #include <sys/types.h>
+ #if __GNU_LIBRARY__ < 5
+-#ifndef __dietlibc__
++#if !defined(__dietlibc__) && !defined(NESTEDVM)
+ #error "Sorry, libc5 is not supported"
  #endif
-                                       i = WTERMSIG(ps->status);
-+#ifndef NEWLIB_ASH
-                               if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F])
-                                       strcpy(s, sys_siglist[i & 0x7F]);
-                               else
-+#endif
-                                       snprintf(s, 64, "Signal %d", i & 0x7F);
-+#ifndef NEWLIB_ASH
-                               if (WCOREDUMP(ps->status))
-                                       strcat(s, " (core dumped)");
-+#endif
-                       }
-                       out1str(s);
-                       col += strlen(s);
-@@ -6641,7 +6670,11 @@
  #endif
-       if (block == 0)
-               flags |= WNOHANG;
-+#ifndef NEWLIB_ASH
-       return wait3(status, flags, (struct rusage *) NULL);
-+#else
-+    return waitpid(-1,status,flags);
+@@ -48,7 +48,9 @@
+ #include <dmalloc.h>
+ #endif
++#ifndef NESTEDVM
+ #include <features.h>
 +#endif
- }
  
- static int dowait(int block, struct job *job)
-@@ -6700,7 +6733,9 @@
-       }
-       INTON;
-       if (!rootshell || !iflag || (job && thisjob == job)) {
-+#ifndef NEWLIB_ASH
-               core = WCOREDUMP(status);
-+#endif
- #ifdef BB_FEATURE_ASH_JOB_CONTROL
-               if (WIFSTOPPED(status))
-                       sig = WSTOPSIG(status);
-@@ -6718,12 +6753,16 @@
-                       if (sig == SIGTSTP && rootshell && iflag)
-                               out2fmt("%%%ld ", (long) (job - jobtab + 1));
- #endif
-+#ifndef NEWLIB_ASH
-                       if (sig < NSIG && sys_siglist[sig])
-                               out2str(sys_siglist[sig]);
-                       else
-+#endif
-                               out2fmt("Signal %d", sig);
-+#ifndef NEWLIB_ASH
-                       if (core)
-                               out2str(" - core dumped");
-+#endif
-                       out2c('\n');
-               } else {
-                       TRACE(("Not printing status: status=%d, sig=%d\n", status, sig));
-@@ -7993,6 +8032,8 @@
-       {NULL, 0, 0}
- };
+ /* Pull in the utility routines from libbb */
+ #include "libbb.h"
+diff -Bubr ../busybox-1.00+/include/grp_.h ./include/grp_.h
+--- ../busybox-1.00+/include/grp_.h    2004-07-15 05:53:49.000000000 -0700
++++ ./include/grp_.h   2009-06-07 15:08:50.000000000 -0700
+@@ -31,7 +31,9 @@
  
-+#ifndef NEWLIB_ASH
-+
- static int ulimitcmd(int argc, char **argv)
- {
-       static const char unlimited_string[] = "unlimited";
-@@ -8118,6 +8159,8 @@
-       return 0;
- }
  
-+#endif /* !NEWLIB_ASH */
-+
- /*
-  * prefix -- see if pfx is a prefix of string.
-  */
-@@ -11426,6 +11469,8 @@
-  * The trap builtin.
-  */
+ #include <sys/types.h>
++#ifndef NESTEDVM
+ #include <features.h>
++#endif
+ #include <stdio.h>
  
-+#ifndef NEWLIB_ASH
-+
- static int trapcmd(int argc, char **argv)
- {
-       char *action;
-@@ -11475,6 +11520,7 @@
-       return 0;
- }
  
-+#endif /*!NEWLIB_ASH */
+Only in ./include: grp_.h.orig
+diff -Bubr ../busybox-1.00+/include/libbb.h ./include/libbb.h
+--- ../busybox-1.00+/include/libbb.h   2004-09-14 20:04:07.000000000 -0700
++++ ./include/libbb.h  2009-06-07 15:08:50.000000000 -0700
+@@ -24,22 +24,68 @@
+ #ifndef       __LIBCONFIG_H__
+ #define       __LIBCONFIG_H__    1
  
- /*
-  * Set the signal handler for the specified signal.  The routine figures
-@@ -11485,7 +11531,9 @@
- {
-       int action;
-       char *t;
-+#ifndef NEWLIB_ASH
-       struct sigaction act;
-+#endif
-       if ((t = trap[signo]) == NULL)
-               action = S_DFL;
-@@ -11527,6 +11575,7 @@
-               /*
-                * current setting unknown
-                */
-+#ifndef NEWLIB_ASH
-               if (sigaction(signo, 0, &act) == -1) {
-                       /*
-                        * Pretend it worked; maybe we should give a warning
-@@ -11536,6 +11585,7 @@
-                       return;
-               }
-               if (act.sa_handler == SIG_IGN) {
 +
-                       if (mflag && (signo == SIGTSTP ||
-                                                 signo == SIGTTIN || signo == SIGTTOU)) {
-                               *t = S_IGN;     /* don't hard ignore these */
-@@ -11544,15 +11594,22 @@
-               } else {
-                       *t = S_RESET;   /* force to be set */
-               }
-+#else
-+        *t = S_DFL;
++#ifdef NESTEDVM
++#include <sys/cdefs.h>
++#include <sys/fcntl.h>
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++
++#define WCOREDUMP(x) 0
++
++typedef char int8_t;
++typedef unsigned char uint8_t;
++typedef short int16_t;
++typedef unsigned short uint16_t;
++typedef int int32_t;
++typedef unsigned int uint32_t;
++typedef long long int64_t;
++typedef unsigned long long uint64_t;
++
++struct option {
++      const char *name;
++      int has_arg;
++      int *flag;
++      int val;
++};
++
++#include <stdarg.h>
++
++static char *strchrnul(const char *s, int c) {
++    char *ret;
++    ret = strchr(s,c);
++    return ret ? ret : (char*)s + strlen(s);
++}
++
++static char *stpcpy(char *dest, const char *src) {
++    while((*dest = *src) != '\0') { dest++; src++; }
++    return dest;
++}
++
 +#endif
-       }
-       if (*t == S_HARD_IGN || *t == action)
-               return;
-+      *t = action;
-+#ifndef NEWLIB_ASH
-       act.sa_handler = ((action == S_CATCH) ? onsig
-                                         : ((action == S_IGN) ? SIG_IGN : SIG_DFL));
--      *t = action;
-       act.sa_flags = 0;
-       sigemptyset(&act.sa_mask);
-       sigaction(signo, &act, 0);
-+#else
-+    signal(signo,((action == S_CATCH) ? onsig : ((action == S_IGN) ? SIG_IGN : SIG_DFL)));
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <regex.h>
++#ifndef NESTEDVM
+ #include <termios.h>
+ #include <stdint.h>
 +#endif
- }
  
- /*
-@@ -11574,10 +11631,12 @@
+ #include <netdb.h>
++#include <netinet/in.h>
  
- static void onsig(int signo)
- {
-+#ifndef NEWLIB_ASH
-       if (signo == SIGINT && trap[SIGINT] == NULL) {
-               onint();
-               return;
-       }
-+#endif
-       gotsig[signo - 1] = 1;
-       pendingsigs++;
- }
-@@ -12153,6 +12212,7 @@
- static struct var **findvar(struct var **vpp, const char *name)
- {
-+    int n=0;
-       for (; *vpp; vpp = &(*vpp)->next) {
-               if (varequal((*vpp)->text, name)) {
-                       break;
-@@ -12168,8 +12228,11 @@
- static int timescmd(int argc, char **argv)
- {
-       struct tms buf;
-+#ifdef NEWLIB_ASH
-+    long int clk_tck = _CLOCKS_PER_SEC_;
-+#else
-       long int clk_tck = sysconf(_SC_CLK_TCK);
--
-+#endif
-       times(&buf);
-       printf("%dm%fs %dm%fs\n%dm%fs %dm%fs\n",
-                  (int) (buf.tms_utime / clk_tck / 60),
-diff -ur ../busybox-0.60.5/busybox.h ./busybox.h
---- ../busybox-0.60.5/busybox.h        Fri Mar 15 21:11:46 2002
-+++ ./busybox.h        Tue Nov 25 11:10:52 2003
-@@ -37,8 +37,9 @@
- #include "dmalloc.h"
+ #ifdef DMALLOC
+ #include <dmalloc.h>
  #endif
  
-+#ifdef _GNU_SOURCE
++#ifndef NESTEDVM
  #include <features.h>
--
 +#endif
  
- enum Location {
-       _BB_DIR_ROOT = 0,
-@@ -85,7 +86,9 @@
- /* Bit map related macros -- libc5 doens't provide these... sigh.  */
- #ifndef setbit
-+#ifndef NBBY
- #define NBBY            CHAR_BIT
-+#endif
- #define setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
- #define clrbit(a,i)     ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
- #define isset(a,i)      ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
-Only in ../busybox-0.60.5: busybox.links
-diff -ur ../busybox-0.60.5/busybox.sh ./busybox.sh
---- ../busybox-0.60.5/busybox.sh       Wed Sep 26 02:20:54 2001
-+++ ./busybox.sh       Tue Nov 25 10:57:58 2003
-@@ -5,7 +5,7 @@
- RAW=` \
-     $CC -E -dM ${1:-Config.h} | \
--    sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/\1.c/gp;' \
-+     sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*BB_\([A-Z0-9_]*\)/\1.c/gp;' \
-     | tr A-Z a-z | sort
- `
- test "${RAW}" != "" ||  exit
-diff -ur ../busybox-0.60.5/date.c ./date.c
---- ../busybox-0.60.5/date.c   Sat Jun 15 10:35:13 2002
-+++ ./date.c   Tue Nov 25 11:26:25 2003
-@@ -210,9 +210,7 @@
+ #include "config.h"
+ #ifdef CONFIG_SELINUX
+@@ -123,8 +169,10 @@
+ extern int bb_parse_mode( const char* s, mode_t* theMode);
+ extern long bb_xgetlarg(const char *arg, int base, long lower, long upper);
  
-               /* if setting time, set it */
-               if (set_time) {
--                      if (stime(&tm) < 0) {
--                              perror_msg("cannot set date");
--                      }
-+            perror_msg("cannot set date");
-               }
-       }
++#ifndef NESTEDVM
+ extern unsigned long bb_baud_to_value(speed_t speed);
+ extern speed_t bb_value_to_baud(unsigned long value);
++#endif
  
-Only in ../busybox-0.60.5/docs: BusyBox.1
-Only in ../busybox-0.60.5/docs: BusyBox.html
-Only in ../busybox-0.60.5/docs: BusyBox.txt
-Only in ../busybox-0.60.5/docs: busybox.pod
-diff -ur ../busybox-0.60.5/libbb/libbb.h ./libbb/libbb.h
---- ../busybox-0.60.5/libbb/libbb.h    Wed Sep 18 15:21:07 2002
-+++ ./libbb/libbb.h    Tue Nov 25 11:10:27 2003
-@@ -25,8 +25,6 @@
- #include <sys/stat.h>
- #include <sys/types.h>
+ extern int get_kernel_revision(void);
  
--#include <netdb.h>
--
- #ifndef _BB_INTERNAL_H_
- #include "../busybox.h"
- #endif
-@@ -35,7 +33,9 @@
- #include "dmalloc.h"
- #endif
+diff -Bubr ../busybox-1.00+/include/pwd_.h ./include/pwd_.h
+--- ../busybox-1.00+/include/pwd_.h    2004-07-15 05:53:49.000000000 -0700
++++ ./include/pwd_.h   2009-06-07 15:08:50.000000000 -0700
+@@ -29,7 +29,9 @@
+ #define       _PWD_H  1
  
-+#ifdef _GNU_SOURCE
+ #include <sys/types.h>
++#ifndef NESTEDVM
  #include <features.h>
 +#endif
+ #include <stdio.h>
  
- #if (__GNU_LIBRARY__ < 5) && (!defined __dietlibc__)
- /* libc5 doesn't define socklen_t */
-diff -ur ../busybox-0.60.5/ls.c ./ls.c
---- ../busybox-0.60.5/ls.c     Mon Sep 16 01:53:01 2002
-+++ ./ls.c     Tue Nov 25 11:29:41 2003
-@@ -43,7 +43,7 @@
- enum {
-       TERMINAL_WIDTH = 80,            /* use 79 if terminal has linefold bug */
--      COLUMN_WIDTH = 14,                      /* default if AUTOWIDTH not defined */
-+      COLUMN_WIDTH = 18,                      /* default if AUTOWIDTH not defined */
-       COLUMN_GAP = 2,                         /* includes the file type char */
- };
-@@ -61,8 +61,10 @@
+ /* The passwd structure.  */
+Only in ./include: pwd_.h.orig
+diff -Bubr ../busybox-1.00+/init/halt.c ./init/halt.c
+--- ../busybox-1.00+/init/halt.c       2004-03-15 00:28:40.000000000 -0800
++++ ./init/halt.c      2009-06-07 15:24:41.000000000 -0700
+@@ -24,7 +24,9 @@
  #include <stdlib.h>
- #include <fcntl.h>
+ #include <unistd.h>
+ #include <getopt.h>
++#ifndef NESTEDVM
+ #include <sys/reboot.h>
++#endif
+ #include "busybox.h"
+ #include "init_shared.h"
+Only in ./init: .#init.c
+diff -Bubr ../busybox-1.00+/init/init.c ./init/init.c
+--- ../busybox-1.00+/init/init.c       2004-10-08 01:21:54.000000000 -0700
++++ ./init/init.c      2009-06-07 15:26:03.000000000 -0700
+@@ -34,23 +34,31 @@
  #include <signal.h>
-+#ifdef BB_FEATURE_AUTOWIDTH
+ #include <stdarg.h>
+ #include <string.h>
++#ifndef NESTEDVM
  #include <termios.h>
++#endif
+ #include <unistd.h>
+ #include <limits.h>
+ #include <sys/fcntl.h>
  #include <sys/ioctl.h>
++#ifndef NESTEDVM
+ #include <sys/mount.h>
++#endif
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#ifndef NESTEDVM
+ #include <sys/reboot.h>
 +#endif
  #include "busybox.h"
  
- #ifdef BB_FEATURE_LS_TIMESTAMPS
-@@ -484,7 +486,7 @@
-               column_width = COLUMN_WIDTH;
-       }
- #else
--      ncols= TERMINAL_WIDTH;
-+    ncols= (int) (TERMINAL_WIDTH / (COLUMN_WIDTH+COLUMN_GAP));
+ #include "init_shared.h"
++#ifndef NESTEDVM
+ #ifdef CONFIG_SYSLOGD
+ # include <sys/syslog.h>
  #endif
-       switch (style_fmt) {
-               case STYLE_LONG:        /* one record per line, extended info */
-diff -ur ../busybox-0.60.5/md5sum.c ./md5sum.c
---- ../busybox-0.60.5/md5sum.c Tue Oct 22 18:13:57 2002
-+++ ./md5sum.c Tue Nov 25 11:22:37 2003
-@@ -44,13 +44,17 @@
- #include <getopt.h>
++#endif
+ #define INIT_BUFFS_SIZE 256
+@@ -675,7 +683,9 @@
+        * linux/kernel/sys.c, which can cause the machine to panic when
+        * the init process is killed.... */
+       if ((pid = fork()) == 0) {
++#ifndef NESTEDVM
+               reboot(magic);
++#endif
+               _exit(0);
+       }
+       waitpid (pid, NULL, 0);
+diff -Bubr ../busybox-1.00+/libbb/getopt_ulflags.c ./libbb/getopt_ulflags.c
+--- ../busybox-1.00+/libbb/getopt_ulflags.c    2004-02-05 05:49:29.000000000 -0800
++++ ./libbb/getopt_ulflags.c   2009-06-07 15:08:50.000000000 -0700
+@@ -150,8 +150,14 @@
+     s--;
+   }
+-  while ((c = getopt_long (argc, argv, applet_opts,
+-                          bb_applet_long_options, NULL)) > 0) {
++    
++  while ((c = 
++#ifdef NESTEDVM
++          getopt(argc,argv,applet_opts)
++#else
++          getopt_long (argc, argv, applet_opts,bb_applet_long_options, NULL) 
++#endif
++  ) > 0) {
+       for (on_off = complementaly; on_off->opt != c; on_off++) {
+           if(!on_off->opt)
+                       bb_show_usage ();
+diff -Bubr ../busybox-1.00+/libbb/get_terminal_width_height.c ./libbb/get_terminal_width_height.c
+--- ../busybox-1.00+/libbb/get_terminal_width_height.c 2004-03-23 15:15:35.000000000 -0800
++++ ./libbb/get_terminal_width_height.c        2009-06-07 15:08:50.000000000 -0700
+@@ -24,8 +24,10 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <unistd.h>
++#ifndef NESTEDVM
+ #include <termios.h>
+ #include <sys/ioctl.h>
++#endif
+ #include "busybox.h"
+ /* It is perfectly ok to pass in a NULL for either width or for
+@@ -34,7 +36,11 @@
+  * which case you will always get 80x24 */
+ void get_terminal_width_height(int fd, int *width, int *height)
+ {
++#ifdef NESTEDVM
++    struct { int ws_row; int ws_col; } win = { 0, 0};
++#else
+       struct winsize win = { 0, 0, 0, 0 };
++#endif
+ #ifdef CONFIG_FEATURE_AUTOWIDTH
+       if (ioctl(fd, TIOCGWINSZ, &win) != 0) {
+               win.ws_row = 24;
+diff -Bubr ../busybox-1.00+/libbb/hash_fd.c ./libbb/hash_fd.c
+--- ../busybox-1.00+/libbb/hash_fd.c   2004-03-15 00:28:42.000000000 -0800
++++ ./libbb/hash_fd.c  2009-06-07 15:08:50.000000000 -0700
+@@ -20,18 +20,27 @@
+  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
++#ifndef NESTEDVM
+ #include <byteswap.h>
+ #include <endian.h>
++#endif
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <stdio.h>
++#ifndef NESTEDVM
+ #include <stdint.h>
++#endif
  #include <stdlib.h>
  #include <string.h>
--#include <endian.h>
- #include <sys/types.h>
- #if defined HAVE_LIMITS_H
- # include <limits.h>
- #endif
+ #include <unistd.h>
  #include "busybox.h"
  
-+typedef unsigned int u_int32_t;
-+#ifndef __P
-+#define __P(x) x
++#ifdef NESTEDVM
++#define __BYTE_ORDER BYTE_ORDER
++#define __LITTLE_ENDIAN LITTLE_ENDIAN
++#define __BIG_ENDIAN BIG_ENDIAN
 +#endif
-+
- /* For some silly reason, this file uses backwards TRUE and FALSE conventions */
- #undef TRUE
- #undef FALSE
-@@ -146,11 +150,7 @@
- //----------------------------------------------------------------------------
- /* Handle endian-ness */
--#if __BYTE_ORDER == __LITTLE_ENDIAN
--      #define SWAP(n) (n)
--#else
--      #define SWAP(n) ((n << 24) | ((n&65280)<<8) | ((n&16711680)>>8) | (n>>24))
--#endif
-+#define SWAP(n) ((n << 24) | ((n&65280)<<8) | ((n&16711680)>>8) | (n>>24))
-diff -ur ../busybox-0.60.5/printf.c ./printf.c
---- ../busybox-0.60.5/printf.c Mon Mar 19 14:25:49 2001
-+++ ./printf.c Tue Nov 25 11:22:49 2003
-@@ -57,6 +57,10 @@
- #include <ctype.h>
- #include "busybox.h"
  
-+#ifndef __P
-+#define __P(x) x
+ #ifdef CONFIG_SHA1SUM
+ /*
+Only in ./libbb: Makefile.in.orig
+diff -Bubr ../busybox-1.00+/libbb/procps.c ./libbb/procps.c
+--- ../busybox-1.00+/libbb/procps.c    2004-08-26 15:18:58.000000000 -0700
++++ ./libbb/procps.c   2009-06-07 15:08:50.000000000 -0700
+@@ -12,7 +12,9 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#ifndef NESTEDVM
+ #include <asm/page.h>
 +#endif
-+
  
- #ifndef S_IFMT
- static const int S_IFMT = 0170000;
-diff -ur ../busybox-0.60.5/pwd_grp/grp.h ./pwd_grp/grp.h
---- ../busybox-0.60.5/pwd_grp/grp.h    Sat Jan 27 03:24:39 2001
-+++ ./pwd_grp/grp.h    Tue Nov 25 11:05:36 2003
-@@ -5,8 +5,14 @@
- #include <grp.h>
- #else
+ #include "libbb.h"
  
-+#ifndef __P
-+#define __P(x) x
+diff -Bubr ../busybox-1.00+/libbb/run_shell.c ./libbb/run_shell.c
+--- ../busybox-1.00+/libbb/run_shell.c 2004-03-15 00:28:43.000000000 -0800
++++ ./libbb/run_shell.c        2009-06-07 15:08:50.000000000 -0700
+@@ -33,7 +33,9 @@
+ #include <unistd.h>
+ #include <string.h>
+ #include <stdlib.h>
++#ifndef NESTEDVM
+ #include <syslog.h>
 +#endif
+ #include <ctype.h>
+ #include "libbb.h"
+ #ifdef CONFIG_SELINUX
+diff -Bubr ../busybox-1.00+/libbb/u_signal_names.c ./libbb/u_signal_names.c
+--- ../busybox-1.00+/libbb/u_signal_names.c    2004-03-15 00:28:43.000000000 -0800
++++ ./libbb/u_signal_names.c   2009-06-07 15:08:50.000000000 -0700
+@@ -21,6 +21,7 @@
+  * USA
+  */
++#include <sys/types.h>
+ #include <signal.h>
+ #include <ctype.h>
+ #include <string.h>
+diff -Bubr ../busybox-1.00+/libbb/vdprintf.c ./libbb/vdprintf.c
+--- ../busybox-1.00+/libbb/vdprintf.c  2004-03-15 00:28:43.000000000 -0800
++++ ./libbb/vdprintf.c 2009-06-07 15:08:50.000000000 -0700
+@@ -26,7 +26,17 @@
+ #if (__GLIBC__ < 2)
+-extern int vdprintf(int d, const char *format, va_list ap)
++int dprintf(int d, const char *fmt, ...) {
++    int ret;
++    va_list ap;
++    
++    va_start (ap, fmt);
++    ret = vdprintf (d, fmt, ap);
++    va_end (ap);
++    return ret;
++}
 +
- #include <sys/types.h>
-+#ifdef _GNU_SOURCE
- #include <features.h>
++int vdprintf(int d, const char *format, va_list ap)
+ {
+       char buf[BUF_SIZE];
+       int len;
+diff -Bubr ../busybox-1.00+/libbb/xconnect.c ./libbb/xconnect.c
+--- ../busybox-1.00+/libbb/xconnect.c  2004-04-14 10:51:16.000000000 -0700
++++ ./libbb/xconnect.c 2009-06-07 15:08:50.000000000 -0700
+@@ -62,7 +62,7 @@
+ int xconnect(struct sockaddr_in *s_addr)
+ {
+       int s = socket(AF_INET, SOCK_STREAM, 0);
+-      if (connect(s, (struct sockaddr_in *)s_addr, sizeof(struct sockaddr_in)) < 0)
++      if (connect(s, (struct sockaddr *)s_addr, sizeof(struct sockaddr_in)) < 0)
+       {
+               bb_perror_msg_and_die("Unable to connect to remote host (%s)",
+                               inet_ntoa(s_addr->sin_addr));
+diff -Bubr ../busybox-1.00+/libbb/xgetcwd.c ./libbb/xgetcwd.c
+--- ../busybox-1.00+/libbb/xgetcwd.c   2003-05-26 07:06:00.000000000 -0700
++++ ./libbb/xgetcwd.c  2009-06-07 15:08:50.000000000 -0700
+@@ -11,6 +11,7 @@
+ #include <unistd.h>
+ #include <limits.h>
+ #include <sys/param.h>
++#include <sys/syslimits.h>
+ #include "libbb.h"
+ /* Amount to increase buffer size by in each try. */
+diff -Bubr ../busybox-1.00+/networking/httpd.c ./networking/httpd.c
+--- ../busybox-1.00+/networking/httpd.c        2004-10-08 01:03:29.000000000 -0700
++++ ./networking/httpd.c       2009-06-07 15:11:28.000000000 -0700
+@@ -1789,11 +1789,15 @@
+   FD_ZERO (&s_fd) ;
+   FD_SET (a_c_w, &s_fd) ;
++#ifdef NESTEDVM
++  //while(read(a_c_w, buf, sizeof(config->buf) > 0));
++#else
+   do {
+     tv.tv_sec = 2 ;
+     tv.tv_usec = 0 ;
+     retval = select (a_c_w + 1, &s_fd, NULL, NULL, &tv);
+   } while (retval > 0 && (read (a_c_w, buf, sizeof (config->buf)) > 0));
 +#endif
- #include <stdio.h>
  
- /* The group structure */
-diff -ur ../busybox-0.60.5/pwd_grp/pwd.h ./pwd_grp/pwd.h
---- ../busybox-0.60.5/pwd_grp/pwd.h    Sat Jan 27 03:24:39 2001
-+++ ./pwd_grp/pwd.h    Tue Nov 25 11:05:09 2003
-@@ -5,8 +5,14 @@
- #include <pwd.h>
- #else
+   shutdown(a_c_r, SHUT_RD);
+   close(config->accepted_socket);
+@@ -1818,18 +1822,22 @@
+ #ifndef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY
+ static int miniHttpd(int server)
+ {
++#ifndef NESTEDVM
+   fd_set readfd, portfd;
  
-+#ifndef __P
-+#define __P(x) x
+   FD_ZERO(&portfd);
+   FD_SET(server, &portfd);
 +#endif
-+
+   /* copy the ports we are watching to the readfd set */
+   while (1) {
++#ifndef NESTEDVM
+     readfd = portfd;
+     /* Now wait INDEFINITELY on the set of sockets! */
+     if (select(server + 1, &readfd, 0, 0, 0) > 0) {
+       if (FD_ISSET(server, &readfd)) {
++#endif
+       int on;
+       struct sockaddr_in fromAddr;
+@@ -1838,7 +1846,7 @@
+                      (struct sockaddr *)&fromAddr, &fromAddrLen);
+       if (s < 0) {
+-          continue;
++          break;
+       }
+       config->accepted_socket = s;
+       config->rmt_ip = ntohl(fromAddr.sin_addr.s_addr);
+@@ -1872,8 +1880,10 @@
+               exit(0);
+       }
+       close(s);
++#ifndef NESTEDVM
+       }
+     }
++#endif
+   } // while (1)
+   return 0;
+ }
+Only in ./networking: httpd.c.orig
+diff -Bubr ../busybox-1.00+/networking/tftp.c ./networking/tftp.c
+--- ../busybox-1.00+/networking/tftp.c 2004-09-14 10:24:58.000000000 -0700
++++ ./networking/tftp.c        2009-06-07 15:09:40.000000000 -0700
+@@ -320,7 +320,11 @@
+                       FD_ZERO(&rfds);
+                       FD_SET(socketfd, &rfds);
++#ifdef NESTEDVM
++                      switch(1) {
++#else
+                       switch (select(FD_SETSIZE, &rfds, NULL, NULL, &tv)) {
++#endif
+                       case 1:
+                               len = recvfrom(socketfd, buf, tftp_bufsize, 0,
+                                               (struct sockaddr *) &from, &fromlen);
+diff -Bubr ../busybox-1.00+/procps/ps.c ./procps/ps.c
+--- ../busybox-1.00+/procps/ps.c       2004-03-15 00:29:03.000000000 -0800
++++ ./procps/ps.c      2009-06-07 15:08:54.000000000 -0700
+@@ -27,8 +27,10 @@
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <string.h>
++#ifndef NESTEDVM
+ #include <termios.h>
+ #include <sys/ioctl.h>
++#endif
+ #include "busybox.h"
+ #ifdef CONFIG_SELINUX
+ #include <fs_secure.h>
+diff -Bubr ../busybox-1.00+/Rules.mak ./Rules.mak
+--- ../busybox-1.00+/Rules.mak 2004-10-08 03:52:33.000000000 -0700
++++ ./Rules.mak        2009-06-07 15:08:50.000000000 -0700
+@@ -158,8 +158,8 @@
+     STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
+ else
+     CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
+-    LDFLAGS += -s -Wl,-warn-common
+-    STRIPCMD:=$(STRIP) --remove-section=.note --remove-section=.comment
++    LDFLAGS += -Wl,-warn-common
++    STRIPCMD:= true
+ endif
+ ifeq ($(strip $(CONFIG_STATIC)),y)
+     LDFLAGS += --static
+Only in .: Rules.mak.orig
+diff -Bubr ../busybox-1.00+/shell/ash.c ./shell/ash.c
+--- ../busybox-1.00+/shell/ash.c       2004-10-08 02:43:34.000000000 -0700
++++ ./shell/ash.c      2009-06-07 15:08:54.000000000 -0700
+@@ -67,7 +67,9 @@
  #include <sys/types.h>
-+#ifdef _GNU_SOURCE
- #include <features.h>
+ #include <sys/cdefs.h>
++#ifndef NESTEDVM
+ #include <sys/ioctl.h>
 +#endif
- #include <stdio.h>
+ #include <sys/param.h>
+ #include <sys/resource.h>
+ #include <sys/stat.h>
+@@ -90,8 +92,10 @@
+ #include <paths.h>
+ #include <setjmp.h>
+ #include <signal.h>
++#ifndef NESTEDVM
+ #include <stdint.h>
+ #include <sysexits.h>
++#endif
+ #include <time.h>
+ #include <fnmatch.h>
+@@ -1403,7 +1407,9 @@
+       { BUILTIN_SPEC_REG      "trap", trapcmd },
+       { BUILTIN_REGULAR       "true", truecmd },
+       { BUILTIN_NOSPEC        "type", typecmd },
++#ifndef NESTEDVM
+       { BUILTIN_NOSPEC        "ulimit", ulimitcmd },
++#endif
+       { BUILTIN_REGULAR       "umask", umaskcmd },
+ #ifdef CONFIG_ASH_ALIAS
+       { BUILTIN_REGULAR       "unalias", unaliascmd },
+@@ -2563,7 +2569,9 @@
+       int i;
+       intpending = 0;
++#ifndef NESTEDVM
+       sigsetmask(0);
++#endif
+       i = EXSIG;
+       if (gotsig[SIGINT - 1] && !trap[SIGINT]) {
+               if (!(rootshell && iflag)) {
+@@ -6716,7 +6724,11 @@
+ #endif
+               }
+               st &= 0x7f;
++#ifdef NESTEDVM
++              col = fmtstr(s, 32, "signal %d",st);
++#else
+               col = fmtstr(s, 32, strsignal(st));
++#endif
+               if (WCOREDUMP(status)) {
+                       col += fmtstr(s + col, 16, " (core dumped)");
+               }
+@@ -7323,7 +7335,7 @@
+ #endif
+       if (block == 0)
+               flags |= WNOHANG;
+-      return wait3(status, flags, (struct rusage *)NULL);
++    return waitpid((pid_t)-1,status,flags);
+ }
+ /*
+@@ -12717,6 +12729,8 @@
+       return 0;
+ }
++#ifndef NESTEDVM
++
+ /*
+  * ulimit builtin
+  *
+@@ -12898,7 +12912,7 @@
+       }
+       return 0;
+ }
+-
++#endif /* NESTEDVM */
+ #ifdef CONFIG_ASH_MATH_SUPPORT
+Only in ./shell: ash.c.orig
+diff -Bubr ../busybox-1.00+/util-linux/more.c ./util-linux/more.c
+--- ../busybox-1.00+/util-linux/more.c 2004-03-27 02:02:48.000000000 -0800
++++ ./util-linux/more.c        2009-06-07 15:08:54.000000000 -0700
+@@ -32,7 +32,9 @@
+ #include <signal.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#ifndef NESTEDVM
+ #include <sys/ioctl.h>
++#endif
+ #include "busybox.h"
  
- /* The passwd structure.  */