diff --git a/deps/uevalrun/.svn/all-wcprops b/deps/uevalrun/.svn/all-wcprops new file mode 100644 index 0000000..143f084 --- /dev/null +++ b/deps/uevalrun/.svn/all-wcprops @@ -0,0 +1,137 @@ +K 25 +svn:wc:ra_dav:version-url +V 32 +/svn/!svn/ver/186/trunk/uevalrun +END +download.sh +K 25 +svn:wc:ra_dav:version-url +V 44 +/svn/!svn/ver/177/trunk/uevalrun/download.sh +END +uevalrun.c +K 25 +svn:wc:ra_dav:version-url +V 43 +/svn/!svn/ver/177/trunk/uevalrun/uevalrun.c +END +make_rootfs.sh +K 25 +svn:wc:ra_dav:version-url +V 47 +/svn/!svn/ver/184/trunk/uevalrun/make_rootfs.sh +END +make_rootfs_gcx.sh +K 25 +svn:wc:ra_dav:version-url +V 51 +/svn/!svn/ver/140/trunk/uevalrun/make_rootfs_gcx.sh +END +busybox-1.17.3-config +K 25 +svn:wc:ra_dav:version-url +V 54 +/svn/!svn/ver/112/trunk/uevalrun/busybox-1.17.3-config +END +make_rootfs_mini_asroot.sh +K 25 +svn:wc:ra_dav:version-url +V 59 +/svn/!svn/ver/140/trunk/uevalrun/make_rootfs_mini_asroot.sh +END +minihalt.c +K 25 +svn:wc:ra_dav:version-url +V 43 +/svn/!svn/ver/140/trunk/uevalrun/minihalt.c +END +busybox.mini +K 25 +svn:wc:ra_dav:version-url +V 45 +/svn/!svn/ver/134/trunk/uevalrun/busybox.mini +END +make_kernel.sh +K 25 +svn:wc:ra_dav:version-url +V 47 +/svn/!svn/ver/140/trunk/uevalrun/make_kernel.sh +END +linux-2.6.36-uevalrun.patch +K 25 +svn:wc:ra_dav:version-url +V 60 +/svn/!svn/ver/177/trunk/uevalrun/linux-2.6.36-uevalrun.patch +END +busybox +K 25 +svn:wc:ra_dav:version-url +V 40 +/svn/!svn/ver/112/trunk/uevalrun/busybox +END +uevalrun.linux.uml +K 25 +svn:wc:ra_dav:version-url +V 51 +/svn/!svn/ver/177/trunk/uevalrun/uevalrun.linux.uml +END +guestinit.c +K 25 +svn:wc:ra_dav:version-url +V 44 +/svn/!svn/ver/184/trunk/uevalrun/guestinit.c +END +make_rootfs_mini.sh +K 25 +svn:wc:ra_dav:version-url +V 52 +/svn/!svn/ver/140/trunk/uevalrun/make_rootfs_mini.sh +END +ruby-1.8-Makefile +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/!svn/ver/122/trunk/uevalrun/ruby-1.8-Makefile +END +repeat.c +K 25 +svn:wc:ra_dav:version-url +V 41 +/svn/!svn/ver/142/trunk/uevalrun/repeat.c +END +ruby-1.8-configure +K 25 +svn:wc:ra_dav:version-url +V 51 +/svn/!svn/ver/122/trunk/uevalrun/ruby-1.8-configure +END +uevalrun.rootfs.mini.minix.img +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/!svn/ver/163/trunk/uevalrun/uevalrun.rootfs.mini.minix.img +END +make +K 25 +svn:wc:ra_dav:version-url +V 37 +/svn/!svn/ver/118/trunk/uevalrun/make +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 41 +/svn/!svn/ver/159/trunk/uevalrun/Makefile +END +ruby-1.8-dmyext.c +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/!svn/ver/122/trunk/uevalrun/ruby-1.8-dmyext.c +END +busybox-1.17.3-config.mini +K 25 +svn:wc:ra_dav:version-url +V 59 +/svn/!svn/ver/134/trunk/uevalrun/busybox-1.17.3-config.mini +END diff --git a/deps/uevalrun/.svn/entries b/deps/uevalrun/.svn/entries new file mode 100644 index 0000000..91b40d2 --- /dev/null +++ b/deps/uevalrun/.svn/entries @@ -0,0 +1,785 @@ +10 + +dir +207 +http://pts-mini-gpl.googlecode.com/svn/trunk/uevalrun +http://pts-mini-gpl.googlecode.com/svn + + + +2011-01-16T10:48:56.311806Z +186 +ptspts + + + + + + + + + + + + + + +5875f506-4f57-11de-a3de-f74ccfcb021d + +download.sh +file + + + + +2011-04-01T20:18:26.911106Z +ba83d07a1d2e3f6e7a8ff29dc573c173 +2010-12-07T23:11:22.235080Z +177 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +1981 + +uevalrun.c +file + + + + +2011-04-01T20:18:26.911106Z +154ecdbb6e28df25e3e3d0245109dee7 +2010-12-07T23:11:22.235080Z +177 +ptspts + + + + + + + + + + + + + + + + + + + + + +31532 + +make_rootfs.sh +file + + + + +2011-04-01T20:18:26.911106Z +31e553a7b8f7fda29539d0920c3eec34 +2011-01-01T14:19:06.220963Z +184 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +4463 + +make_rootfs_gcx.sh +file + + + + +2011-04-01T20:18:26.911106Z +51a2d6f3a78f5f63cb77ecd50abfb47f +2010-11-28T12:22:45.293610Z +140 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +4784 + +busybox-1.17.3-config +file + + + + +2011-04-01T20:18:26.911106Z +d8c9338a2e4580404759e7f9d68d6411 +2010-11-24T01:54:40.197293Z +112 +ptspts + + + + + + + + + + + + + + + + + + + + + +23501 + +make_rootfs_mini_asroot.sh +file + + + + +2011-04-01T20:18:26.911106Z +d7f14d3fff6dc45339d79418daa799a0 +2010-11-28T12:22:45.293610Z +140 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +3343 + +minihalt.c +file + + + + +2011-04-01T20:18:26.921106Z +f0fcf213d74ed55da7a1d563b8abeb91 +2010-11-28T12:22:45.293610Z +140 +ptspts + + + + + + + + + + + + + + + + + + + + + +1755 + +busybox.mini +file + + + + +2011-04-01T20:18:26.921106Z +c540ac3dfb77b41f4aafa9c0d4f3a919 +2010-11-28T00:39:45.526146Z +134 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +192664 + +make_kernel.sh +file + + + + +2011-04-01T20:18:26.921106Z +1fd5ee5699aadd8aa58f46933d4fbe15 +2010-11-28T12:22:45.293610Z +140 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +4083 + +linux-2.6.36-uevalrun.patch +file + + + + +2011-04-01T20:18:26.921106Z +1fb515a00f03eb0ed4234fae10497791 +2010-12-07T23:11:22.235080Z +177 +ptspts + + + + + + + + + + + + + + + + + + + + + +48585 + +busybox +file + + + + +2011-04-01T20:18:26.921106Z +858e9aecfe38b675a45a99c65174f761 +2010-11-24T01:54:40.197293Z +112 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +865780 + +uevalrun.linux.uml +file + + + + +2011-04-01T20:18:26.921106Z +bee41be32f7a5923305d6aabe2d941fe +2010-12-07T23:11:22.235080Z +177 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +1087212 + +guestinit.c +file + + + + +2011-04-01T20:18:26.921106Z +d06eabc14910089b3293a9d751a5d068 +2011-01-01T14:19:06.220963Z +184 +ptspts + + + + + + + + + + + + + + + + + + + + + +18290 + +make_rootfs_mini.sh +file + + + + +2011-04-01T20:18:26.921106Z +85f822db81e9533dc676b3009484c87b +2010-11-28T12:22:45.293610Z +140 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +4518 + +ruby-1.8-Makefile +file + + + + +2011-04-01T20:18:26.921106Z +51d364b699014fb6ed93a3fecfc4c22c +2010-11-25T18:09:42.600245Z +122 +ptspts + + + + + + + + + + + + + + + + + + + + + +1259 + +repeat.c +file + + + + +2011-04-01T20:18:26.921106Z +ac4f2d0f201362564dfb489a8121e874 +2010-11-28T13:23:57.704328Z +142 +ptspts + + + + + + + + + + + + + + + + + + + + + +916 + +precompiled +dir + +ruby-1.8-configure +file + + + + +2011-04-01T20:18:26.921106Z +79b305449547d2eb0be0d12b41546328 +2010-11-25T18:09:42.600245Z +122 +ptspts + + + + + + + + + + + + + + + + + + + + + +175 + +doc +dir + +uevalrun.rootfs.mini.minix.img +file + + + + +2011-04-01T20:18:26.921106Z +5f2ebf071cca384777373e64c47ab3b1 +2010-11-28T22:17:35.980551Z +163 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +254976 + +make +file + + + + +2011-04-01T20:18:26.921106Z +4b43e2c51e27f984d4a96fd2c5e7a5a9 +2010-11-25T00:04:27.954930Z +118 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +187332 + +Makefile +file + + + + +2011-04-01T20:18:26.921106Z +a54f83c4d542d2b55e3d7458eccf3062 +2010-11-28T17:02:55.323436Z +159 +ptspts + + + + + + + + + + + + + + + + + + + + + +2427 + +examples +dir + +ruby-1.8-dmyext.c +file + + + + +2011-04-01T20:18:26.921106Z +51d364b699014fb6ed93a3fecfc4c22c +2010-11-25T18:09:42.600245Z +122 +ptspts + + + + + + + + + + + + + + + + + + + + + +1259 + +busybox-1.17.3-config.mini +file + + + + +2011-04-01T20:18:26.921106Z +7c1edf090028d44f6ddb68c33a911500 +2010-11-28T00:39:45.526146Z +134 +ptspts + + + + + + + + + + + + + + + + + + + + + +29095 + diff --git a/deps/uevalrun/.svn/prop-base/busybox.mini.svn-base b/deps/uevalrun/.svn/prop-base/busybox.mini.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/busybox.mini.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/.svn/prop-base/busybox.svn-base b/deps/uevalrun/.svn/prop-base/busybox.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/busybox.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/.svn/prop-base/download.sh.svn-base b/deps/uevalrun/.svn/prop-base/download.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/download.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/uevalrun/.svn/prop-base/make.svn-base b/deps/uevalrun/.svn/prop-base/make.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/make.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/.svn/prop-base/make_kernel.sh.svn-base b/deps/uevalrun/.svn/prop-base/make_kernel.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/make_kernel.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/uevalrun/.svn/prop-base/make_rootfs.sh.svn-base b/deps/uevalrun/.svn/prop-base/make_rootfs.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/make_rootfs.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/uevalrun/.svn/prop-base/make_rootfs_gcx.sh.svn-base b/deps/uevalrun/.svn/prop-base/make_rootfs_gcx.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/make_rootfs_gcx.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/uevalrun/.svn/prop-base/make_rootfs_mini.sh.svn-base b/deps/uevalrun/.svn/prop-base/make_rootfs_mini.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/make_rootfs_mini.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/uevalrun/.svn/prop-base/make_rootfs_mini_asroot.sh.svn-base b/deps/uevalrun/.svn/prop-base/make_rootfs_mini_asroot.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/make_rootfs_mini_asroot.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/uevalrun/.svn/prop-base/uevalrun.linux.uml.svn-base b/deps/uevalrun/.svn/prop-base/uevalrun.linux.uml.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/uevalrun.linux.uml.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/.svn/prop-base/uevalrun.rootfs.mini.minix.img.svn-base b/deps/uevalrun/.svn/prop-base/uevalrun.rootfs.mini.minix.img.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/deps/uevalrun/.svn/prop-base/uevalrun.rootfs.mini.minix.img.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/.svn/text-base/Makefile.svn-base b/deps/uevalrun/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..e0a7cc2 --- /dev/null +++ b/deps/uevalrun/.svn/text-base/Makefile.svn-base @@ -0,0 +1,77 @@ +# +# Makefile for uevalrun +# by pts@fazekas.hu at Mon Nov 22 02:19:12 CET 2010 +# +# TODO(pts): Add `make mrproper' to clean up all temporary files and dirs. + +SHELL = ./busybox sh +export SHELL +PATH = /dev/null # Busybox doesn't need it. +export PATH + +# This must be a 32-bit compiler. +# TODO(pts): How to enforce 32-bit output for GCC? +CCBIN = cross-compiler/bin/i686-gcc +CFLAGS = -s -O2 -static -W -Wall +CC = $(CCBIN) + +# TODO(pts): Configure that some of these features are not needed. +ALL = uevalrun uevalrun.guestinit minihalt uevalrun.rootfs.minix.img uevalrun.rootfs.gcx.minix.img +AUX = repeat + +.PHONY: all clean run_sys run_mini_sys run_gcx_sys rootfs rootfs_gcx + +all: $(ALL) + +clean: + ./busybox rm -f $(ALL) $(AUX) + +# Cancel some implicit rules of GNU make. +%: %.c +%.o: %.c +%.o: %.s + +$(CCBIN): + ./busybox sh download.sh gcxbase.stbx86.tbz2 gcc.stbx86.tbz2 + ./busybox mkdir -p cross-compiler + cd cross-compiler && ../busybox tar xjf ../gcxbase.stbx86.tbz2 + cd cross-compiler && ../busybox tar xjf ../gcc.stbx86.tbz2 + test -x $(CCBIN) + +uevalrun: uevalrun.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +repeat: repeat.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +minihalt: minihalt.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +uevalrun.guestinit: guestinit.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +# Easier to manage the binary here (e.g. with cp precompiled/* .) +xcat: examples/xcat.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +# TODO(pts): Maybe add dependency on ruby1.8 etc. later +rootfs uevalrun.rootfs.minix.img: ./busybox make_rootfs.sh + ./busybox sh ./make_rootfs.sh + +rootfs_gcx uevalrun.rootfs.gcx.minix.img: ./busybox make_rootfs_gcx.sh + ./busybox sh ./make_rootfs_gcx.sh + +run_sys: uevalrun.rootfs.minix.img + ./uevalrun.linux.uml con=null ssl=null con0=fd:0,fd:1 mem=30M ubda=uevalrun.rootfs.minix.img rw + +run_mini_sys: uevalrun.rootfs.mini.minix.img + ./uevalrun.linux.uml con=null ssl=null con0=fd:0,fd:1 mem=30M ubda=uevalrun.rootfs.mini.minix.img init=/bin/sh rw + +run_gcx_sys: uevalrun.rootfs.gcx.minix.img + ./busybox dd if=/dev/zero of=uevalrun.rootfs.gcxtmp.minix.img bs=2000K count=1 + ./busybox mkfs.minix -n 30 -i 20 uevalrun.rootfs.gcxtmp.minix.img + ./uevalrun.linux.uml con=null ssl=null con0=fd:0,fd:1 mem=60M ubda=uevalrun.rootfs.gcx.minix.img ubdb=uevalrun.rootfs.gcxtmp.minix.img init=/sbin/minihalt rw ubde=hello.c + +precompile: uevalrun uevalrun.guestinit minihalt xcat + ./busybox sh ./make_rootfs_mini.sh + ./busybox cp $^ precompiled/ diff --git a/deps/uevalrun/.svn/text-base/busybox-1.17.3-config.mini.svn-base b/deps/uevalrun/.svn/text-base/busybox-1.17.3-config.mini.svn-base new file mode 100644 index 0000000..2b0b6c9 --- /dev/null +++ b/deps/uevalrun/.svn/text-base/busybox-1.17.3-config.mini.svn-base @@ -0,0 +1,950 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.17.3 +# Wed Nov 24 23:23:51 2010 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_DESKTOP is not set +# CONFIG_EXTRA_COMPAT is not set +# CONFIG_INCLUDE_SUSv2 is not set +# CONFIG_USE_PORTABLE_CODE is not set +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +# CONFIG_SHOW_USAGE is not set +# CONFIG_FEATURE_VERBOSE_USAGE is not set +# CONFIG_FEATURE_COMPRESS_USAGE is not set +# CONFIG_FEATURE_INSTALLER is not set +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_UNICODE_SUPPORT is not set +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +# CONFIG_LONG_OPTS is not set +CONFIG_FEATURE_DEVPTS=y +# CONFIG_FEATURE_CLEAN_UP is not set +CONFIG_FEATURE_UTMP=y +# CONFIG_FEATURE_WTMP is not set +# CONFIG_FEATURE_PIDFILE is not set +CONFIG_FEATURE_SUID=y +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +# CONFIG_FEATURE_SYSLOG is not set +# CONFIG_FEATURE_HAVE_RPC is not set + +# +# Build Options +# +CONFIG_STATIC=y +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_LFS=y +CONFIG_CROSS_COMPILER_PREFIX="/usr/src/cross-compiler-i686/bin/i686-" +CONFIG_EXTRA_CFLAGS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_WERROR is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Installation Options +# +# CONFIG_INSTALL_NO_USR is not set +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SIZE_VS_SPEED=2 +CONFIG_FEATURE_FAST_TOP=y +# CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_FEATURE_EDITING is not set +CONFIG_FEATURE_EDITING_MAX_LEN=0 +# CONFIG_FEATURE_EDITING_VI is not set +CONFIG_FEATURE_EDITING_HISTORY=0 +# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set +# CONFIG_FEATURE_TAB_COMPLETION is not set +# CONFIG_FEATURE_USERNAME_COMPLETION is not set +# CONFIG_FEATURE_EDITING_FANCY_PROMPT is not set +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_FEATURE_COPYBUF_KB=4 +CONFIG_MONOTONIC_SYSCALL=y +# CONFIG_IOCTL_HEX2STR_ERROR is not set +# CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +# CONFIG_FEATURE_SEAMLESS_XZ is not set +# CONFIG_FEATURE_SEAMLESS_LZMA is not set +CONFIG_FEATURE_SEAMLESS_BZ2=y +# CONFIG_FEATURE_SEAMLESS_GZ is not set +# CONFIG_FEATURE_SEAMLESS_Z is not set +# CONFIG_AR is not set +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_FEATURE_AR_CREATE is not set +# CONFIG_BUNZIP2 is not set +# CONFIG_BZIP2 is not set +# CONFIG_CPIO is not set +# CONFIG_FEATURE_CPIO_O is not set +# CONFIG_FEATURE_CPIO_P is not set +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +# CONFIG_GUNZIP is not set +# CONFIG_GZIP is not set +# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +# CONFIG_LZOP is not set +# CONFIG_LZOP_COMPR_HIGH is not set +# CONFIG_RPM2CPIO is not set +# CONFIG_RPM is not set +CONFIG_TAR=y +# CONFIG_FEATURE_TAR_CREATE is not set +# CONFIG_FEATURE_TAR_AUTODETECT is not set +# CONFIG_FEATURE_TAR_FROM is not set +# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_FEATURE_TAR_TO_COMMAND is not set +# CONFIG_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_FEATURE_TAR_SELINUX is not set +CONFIG_UNCOMPRESS=y +# CONFIG_UNLZMA is not set +# CONFIG_FEATURE_LZMA_FAST is not set +# CONFIG_LZMA is not set +# CONFIG_UNXZ is not set +# CONFIG_XZ is not set +# CONFIG_UNZIP is not set + +# +# Coreutils +# +# CONFIG_BASENAME is not set +CONFIG_CAT=y +# CONFIG_DATE is not set +# CONFIG_FEATURE_DATE_ISOFMT is not set +# CONFIG_FEATURE_DATE_NANO is not set +# CONFIG_FEATURE_DATE_COMPAT is not set +CONFIG_TEST=y +CONFIG_FEATURE_TEST_64=y +# CONFIG_TR is not set +# CONFIG_FEATURE_TR_CLASSES is not set +# CONFIG_FEATURE_TR_EQUIV is not set +# CONFIG_CAL is not set +# CONFIG_CATV is not set +CONFIG_CHGRP=y +CONFIG_CHMOD=y +CONFIG_CHOWN=y +# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +# CONFIG_CHROOT is not set +# CONFIG_CKSUM is not set +# CONFIG_COMM is not set +CONFIG_CP=y +# CONFIG_FEATURE_CP_LONG_OPTIONS is not set +# CONFIG_CUT is not set +CONFIG_DD=y +# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set +# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set +# CONFIG_FEATURE_DD_IBS_OBS is not set +# CONFIG_DF is not set +# CONFIG_FEATURE_DF_FANCY is not set +# CONFIG_DIRNAME is not set +# CONFIG_DOS2UNIX is not set +# CONFIG_UNIX2DOS is not set +# CONFIG_DU is not set +# CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K is not set +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +# CONFIG_ENV is not set +# CONFIG_FEATURE_ENV_LONG_OPTIONS is not set +# CONFIG_EXPAND is not set +# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set +CONFIG_EXPR=y +CONFIG_EXPR_MATH_SUPPORT_64=y +CONFIG_FALSE=y +# CONFIG_FOLD is not set +# CONFIG_FSYNC is not set +# CONFIG_HEAD is not set +# CONFIG_FEATURE_FANCY_HEAD is not set +# CONFIG_HOSTID is not set +# CONFIG_ID is not set +CONFIG_INSTALL=y +# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set +# CONFIG_LENGTH is not set +CONFIG_LN=y +# CONFIG_LOGNAME is not set +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +# CONFIG_FEATURE_LS_COLOR is not set +# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set +# CONFIG_MD5SUM is not set +CONFIG_MKDIR=y +# CONFIG_FEATURE_MKDIR_LONG_OPTIONS is not set +CONFIG_MKFIFO=y +CONFIG_MKNOD=y +CONFIG_MV=y +# CONFIG_FEATURE_MV_LONG_OPTIONS is not set +# CONFIG_NICE is not set +# CONFIG_NOHUP is not set +# CONFIG_OD is not set +# CONFIG_PRINTENV is not set +# CONFIG_PRINTF is not set +CONFIG_PWD=y +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +CONFIG_REALPATH=y +CONFIG_RM=y +CONFIG_RMDIR=y +# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set +# CONFIG_SEQ is not set +# CONFIG_SHA1SUM is not set +# CONFIG_SHA256SUM is not set +# CONFIG_SHA512SUM is not set +# CONFIG_SLEEP is not set +# CONFIG_FEATURE_FANCY_SLEEP is not set +# CONFIG_FEATURE_FLOAT_SLEEP is not set +# CONFIG_SORT is not set +# CONFIG_FEATURE_SORT_BIG is not set +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +# CONFIG_STAT is not set +# CONFIG_FEATURE_STAT_FORMAT is not set +# CONFIG_STTY is not set +# CONFIG_SUM is not set +CONFIG_SYNC=y +# CONFIG_TAC is not set +# CONFIG_TAIL is not set +# CONFIG_FEATURE_FANCY_TAIL is not set +# CONFIG_TEE is not set +# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set +# CONFIG_TOUCH is not set +CONFIG_TRUE=y +# CONFIG_TTY is not set +# CONFIG_UNAME is not set +# CONFIG_UNEXPAND is not set +# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set +# CONFIG_UNIQ is not set +# CONFIG_USLEEP is not set +# CONFIG_UUDECODE is not set +# CONFIG_UUENCODE is not set +CONFIG_WC=y +# CONFIG_FEATURE_WC_LARGE is not set +# CONFIG_WHO is not set +# CONFIG_WHOAMI is not set +CONFIG_YES=y + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for ls, more and telnet +# +# CONFIG_FEATURE_AUTOWIDTH is not set + +# +# Common options for df, du, ls +# +# CONFIG_FEATURE_HUMAN_READABLE is not set +# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set + +# +# Console Utilities +# +# CONFIG_CHVT is not set +# CONFIG_FGCONSOLE is not set +# CONFIG_CLEAR is not set +# CONFIG_DEALLOCVT is not set +# CONFIG_DUMPKMAP is not set +# CONFIG_KBD_MODE is not set +# CONFIG_LOADFONT is not set +# CONFIG_LOADKMAP is not set +# CONFIG_OPENVT is not set +# CONFIG_RESET is not set +# CONFIG_RESIZE is not set +# CONFIG_FEATURE_RESIZE_PRINT is not set +# CONFIG_SETCONSOLE is not set +# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +# CONFIG_SETFONT is not set +# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_DEFAULT_SETFONT_DIR="" +# CONFIG_SETKEYCODES is not set +# CONFIG_SETLOGCONS is not set +# CONFIG_SHOWKEY is not set +# CONFIG_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_FEATURE_LOADFONT_RAW is not set + +# +# Debian Utilities +# +# CONFIG_MKTEMP is not set +# CONFIG_PIPE_PROGRESS is not set +# CONFIG_RUN_PARTS is not set +# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +# CONFIG_START_STOP_DAEMON is not set +# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set +# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set +# CONFIG_WHICH is not set + +# +# Editors +# +CONFIG_AWK=y +# CONFIG_FEATURE_AWK_LIBM is not set +CONFIG_CMP=y +# CONFIG_DIFF is not set +# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set +# CONFIG_FEATURE_DIFF_DIR is not set +# CONFIG_ED is not set +# CONFIG_PATCH is not set +# CONFIG_SED is not set +# CONFIG_VI is not set +CONFIG_FEATURE_VI_MAX_LEN=0 +# CONFIG_FEATURE_VI_8BIT is not set +# CONFIG_FEATURE_VI_COLON is not set +# CONFIG_FEATURE_VI_YANKMARK is not set +# CONFIG_FEATURE_VI_SEARCH is not set +# CONFIG_FEATURE_VI_USE_SIGNALS is not set +# CONFIG_FEATURE_VI_DOT_CMD is not set +# CONFIG_FEATURE_VI_READONLY is not set +# CONFIG_FEATURE_VI_SETOPTS is not set +# CONFIG_FEATURE_VI_SET is not set +# CONFIG_FEATURE_VI_WIN_RESIZE is not set +# CONFIG_FEATURE_VI_ASK_TERMINAL is not set +# CONFIG_FEATURE_VI_OPTIMIZE_CURSOR is not set +# CONFIG_FEATURE_ALLOW_EXEC is not set + +# +# Finding Utilities +# +# CONFIG_FIND is not set +# CONFIG_FEATURE_FIND_PRINT0 is not set +# CONFIG_FEATURE_FIND_MTIME is not set +# CONFIG_FEATURE_FIND_MMIN is not set +# CONFIG_FEATURE_FIND_PERM is not set +# CONFIG_FEATURE_FIND_TYPE is not set +# CONFIG_FEATURE_FIND_XDEV is not set +# CONFIG_FEATURE_FIND_MAXDEPTH is not set +# CONFIG_FEATURE_FIND_NEWER is not set +# CONFIG_FEATURE_FIND_INUM is not set +# CONFIG_FEATURE_FIND_EXEC is not set +# CONFIG_FEATURE_FIND_USER is not set +# CONFIG_FEATURE_FIND_GROUP is not set +# CONFIG_FEATURE_FIND_NOT is not set +# CONFIG_FEATURE_FIND_DEPTH is not set +# CONFIG_FEATURE_FIND_PAREN is not set +# CONFIG_FEATURE_FIND_SIZE is not set +# CONFIG_FEATURE_FIND_PRUNE is not set +# CONFIG_FEATURE_FIND_DELETE is not set +# CONFIG_FEATURE_FIND_PATH is not set +# CONFIG_FEATURE_FIND_REGEX is not set +# CONFIG_FEATURE_FIND_CONTEXT is not set +# CONFIG_FEATURE_FIND_LINKS is not set +CONFIG_GREP=y +CONFIG_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_FEATURE_GREP_FGREP_ALIAS=y +# CONFIG_FEATURE_GREP_CONTEXT is not set +CONFIG_XARGS=y +# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set +CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +# CONFIG_INIT is not set +# CONFIG_FEATURE_USE_INITTAB is not set +# CONFIG_FEATURE_KILL_REMOVED is not set +CONFIG_FEATURE_KILL_DELAY=0 +# CONFIG_FEATURE_INIT_SCTTY is not set +# CONFIG_FEATURE_INIT_SYSLOG is not set +# CONFIG_FEATURE_EXTRA_QUIET is not set +# CONFIG_FEATURE_INIT_COREDUMPS is not set +# CONFIG_FEATURE_INITRD is not set +CONFIG_HALT=y +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +# CONFIG_MESG is not set + +# +# Login/Password Management Utilities +# +# CONFIG_FEATURE_SHADOWPASSWDS is not set +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_USE_BB_SHADOW is not set +# CONFIG_USE_BB_CRYPT is not set +# CONFIG_USE_BB_CRYPT_SHA is not set +# CONFIG_ADDGROUP is not set +# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_DELGROUP is not set +# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set +# CONFIG_FEATURE_CHECK_NAMES is not set +# CONFIG_ADDUSER is not set +# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set +CONFIG_FIRST_SYSTEM_ID=0 +CONFIG_LAST_SYSTEM_ID=0 +# CONFIG_DELUSER is not set +# CONFIG_GETTY is not set +# CONFIG_LOGIN is not set +# CONFIG_PAM is not set +# CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_FEATURE_SECURETTY is not set +# CONFIG_PASSWD is not set +# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set +# CONFIG_CRYPTPW is not set +# CONFIG_CHPASSWD is not set +# CONFIG_SU is not set +# CONFIG_FEATURE_SU_SYSLOG is not set +# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_SULOGIN is not set +# CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +# CONFIG_CHATTR is not set +# CONFIG_FSCK is not set +# CONFIG_LSATTR is not set +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_MODINFO is not set +# CONFIG_MODPROBE_SMALL is not set +# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set +# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +# CONFIG_INSMOD is not set +# CONFIG_RMMOD is not set +# CONFIG_LSMOD is not set +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +# CONFIG_MODPROBE is not set +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +# CONFIG_DEPMOD is not set + +# +# Options common to multiple modutils +# +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set +# CONFIG_FEATURE_MODUTILS_ALIAS is not set +# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set +CONFIG_DEFAULT_MODULES_DIR="" +CONFIG_DEFAULT_DEPMOD_FILE="" + +# +# Linux System Utilities +# +# CONFIG_REV is not set +# CONFIG_ACPID is not set +# CONFIG_FEATURE_ACPID_COMPAT is not set +# CONFIG_BLKID is not set +# CONFIG_DMESG is not set +# CONFIG_FEATURE_DMESG_PRETTY is not set +# CONFIG_FBSET is not set +# CONFIG_FEATURE_FBSET_FANCY is not set +# CONFIG_FEATURE_FBSET_READMODE is not set +# CONFIG_FDFLUSH is not set +# CONFIG_FDFORMAT is not set +# CONFIG_FDISK is not set +CONFIG_FDISK_SUPPORT_LARGE_DISKS=y +# CONFIG_FEATURE_FDISK_WRITABLE is not set +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +# CONFIG_FEATURE_FDISK_ADVANCED is not set +# CONFIG_FINDFS is not set +# CONFIG_FLOCK is not set +# CONFIG_FREERAMDISK is not set +# CONFIG_FSCK_MINIX is not set +# CONFIG_MKFS_EXT2 is not set +# CONFIG_MKFS_MINIX is not set +# CONFIG_FEATURE_MINIX2 is not set +# CONFIG_MKFS_REISER is not set +# CONFIG_MKFS_VFAT is not set +# CONFIG_GETOPT is not set +# CONFIG_FEATURE_GETOPT_LONG is not set +# CONFIG_HEXDUMP is not set +# CONFIG_FEATURE_HEXDUMP_REVERSE is not set +# CONFIG_HD is not set +# CONFIG_HWCLOCK is not set +# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set +# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_IPCRM is not set +# CONFIG_IPCS is not set +# CONFIG_LOSETUP is not set +# CONFIG_LSPCI is not set +# CONFIG_LSUSB is not set +# CONFIG_MDEV is not set +# CONFIG_FEATURE_MDEV_CONF is not set +# CONFIG_FEATURE_MDEV_RENAME is not set +# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set +# CONFIG_FEATURE_MDEV_EXEC is not set +# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set +# CONFIG_MKSWAP is not set +# CONFIG_FEATURE_MKSWAP_UUID is not set +# CONFIG_MORE is not set +# CONFIG_FEATURE_USE_TERMIOS is not set +# CONFIG_MOUNT is not set +# CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_FEATURE_MOUNT_VERBOSE is not set +# CONFIG_FEATURE_MOUNT_HELPERS is not set +# CONFIG_FEATURE_MOUNT_LABEL is not set +# CONFIG_FEATURE_MOUNT_NFS is not set +# CONFIG_FEATURE_MOUNT_CIFS is not set +# CONFIG_FEATURE_MOUNT_FLAGS is not set +# CONFIG_FEATURE_MOUNT_FSTAB is not set +# CONFIG_PIVOT_ROOT is not set +# CONFIG_RDATE is not set +# CONFIG_RDEV is not set +# CONFIG_READPROFILE is not set +# CONFIG_RTCWAKE is not set +# CONFIG_SCRIPT is not set +# CONFIG_SCRIPTREPLAY is not set +# CONFIG_SETARCH is not set +# CONFIG_SWAPONOFF is not set +# CONFIG_FEATURE_SWAPON_PRI is not set +# CONFIG_SWITCH_ROOT is not set +# CONFIG_UMOUNT is not set +# CONFIG_FEATURE_UMOUNT_ALL is not set +# CONFIG_FEATURE_MOUNT_LOOP is not set +# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set +# CONFIG_FEATURE_MTAB_SUPPORT is not set +# CONFIG_VOLUMEID is not set +# CONFIG_FEATURE_VOLUMEID_EXT is not set +# CONFIG_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_FEATURE_VOLUMEID_FAT is not set +# CONFIG_FEATURE_VOLUMEID_HFS is not set +# CONFIG_FEATURE_VOLUMEID_JFS is not set +# CONFIG_FEATURE_VOLUMEID_XFS is not set +# CONFIG_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_FEATURE_VOLUMEID_UDF is not set +# CONFIG_FEATURE_VOLUMEID_LUKS is not set +# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set +# CONFIG_FEATURE_VOLUMEID_ROMFS is not set +# CONFIG_FEATURE_VOLUMEID_SYSV is not set +# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set + +# +# Miscellaneous Utilities +# +# CONFIG_CONSPY is not set +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +# CONFIG_ADJTIMEX is not set +# CONFIG_BBCONFIG is not set +# CONFIG_BEEP is not set +CONFIG_FEATURE_BEEP_FREQ=0 +CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_CHRT is not set +# CONFIG_CROND is not set +# CONFIG_FEATURE_CROND_D is not set +# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_FEATURE_CROND_DIR="" +# CONFIG_CRONTAB is not set +# CONFIG_DC is not set +# CONFIG_FEATURE_DC_LIBM is not set +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +# CONFIG_DEVMEM is not set +# CONFIG_EJECT is not set +# CONFIG_FEATURE_EJECT_SCSI is not set +# CONFIG_FBSPLASH is not set +# CONFIG_FLASHCP is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASH_ERASEALL is not set +# CONFIG_IONICE is not set +# CONFIG_INOTIFYD is not set +# CONFIG_LAST is not set +# CONFIG_FEATURE_LAST_SMALL is not set +# CONFIG_FEATURE_LAST_FANCY is not set +# CONFIG_LESS is not set +CONFIG_FEATURE_LESS_MAXLINES=0 +# CONFIG_FEATURE_LESS_BRACKETS is not set +# CONFIG_FEATURE_LESS_FLAGS is not set +# CONFIG_FEATURE_LESS_MARKS is not set +# CONFIG_FEATURE_LESS_REGEXP is not set +# CONFIG_FEATURE_LESS_WINCH is not set +# CONFIG_FEATURE_LESS_DASHCMD is not set +# CONFIG_FEATURE_LESS_LINENUMS is not set +# CONFIG_HDPARM is not set +# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +# CONFIG_MAKEDEVS is not set +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_MAN is not set +# CONFIG_MICROCOM is not set +# CONFIG_MOUNTPOINT is not set +# CONFIG_MT is not set +# CONFIG_RAIDAUTORUN is not set +# CONFIG_READAHEAD is not set +# CONFIG_RFKILL is not set +# CONFIG_RUNLEVEL is not set +# CONFIG_RX is not set +# CONFIG_SETSID is not set +# CONFIG_STRINGS is not set +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +# CONFIG_TIME is not set +# CONFIG_TIMEOUT is not set +# CONFIG_TTYSIZE is not set +# CONFIG_VOLNAME is not set +# CONFIG_WALL is not set +# CONFIG_WATCHDOG is not set + +# +# Networking Utilities +# +# CONFIG_NC is not set +# CONFIG_NC_SERVER is not set +# CONFIG_NC_EXTRA is not set +# CONFIG_NC_110_COMPAT is not set +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_ARP is not set +# CONFIG_ARPING is not set +# CONFIG_BRCTL is not set +# CONFIG_FEATURE_BRCTL_FANCY is not set +# CONFIG_FEATURE_BRCTL_SHOW is not set +# CONFIG_DNSD is not set +# CONFIG_ETHER_WAKE is not set +# CONFIG_FAKEIDENTD is not set +# CONFIG_FTPD is not set +# CONFIG_FEATURE_FTP_WRITE is not set +# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +# CONFIG_HOSTNAME is not set +# CONFIG_HTTPD is not set +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +# CONFIG_IFCONFIG is not set +# CONFIG_FEATURE_IFCONFIG_STATUS is not set +# CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +# CONFIG_FEATURE_IFCONFIG_HW is not set +# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set +# CONFIG_IFENSLAVE is not set +# CONFIG_IFPLUGD is not set +# CONFIG_IFUPDOWN is not set +CONFIG_IFUPDOWN_IFSTATE_PATH="" +# CONFIG_FEATURE_IFUPDOWN_IP is not set +# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set +# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set +# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set +# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set +# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +# CONFIG_INETD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_FEATURE_INETD_RPC is not set +# CONFIG_IP is not set +# CONFIG_FEATURE_IP_ADDRESS is not set +# CONFIG_FEATURE_IP_LINK is not set +# CONFIG_FEATURE_IP_ROUTE is not set +# CONFIG_FEATURE_IP_TUNNEL is not set +# CONFIG_FEATURE_IP_RULE is not set +# CONFIG_FEATURE_IP_SHORT_FORMS is not set +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_IPADDR is not set +# CONFIG_IPLINK is not set +# CONFIG_IPROUTE is not set +# CONFIG_IPTUNNEL is not set +# CONFIG_IPRULE is not set +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +# CONFIG_NAMEIF is not set +# CONFIG_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_NETSTAT is not set +# CONFIG_FEATURE_NETSTAT_WIDE is not set +# CONFIG_FEATURE_NETSTAT_PRG is not set +# CONFIG_NSLOOKUP is not set +# CONFIG_NTPD is not set +# CONFIG_FEATURE_NTPD_SERVER is not set +# CONFIG_PING is not set +# CONFIG_PING6 is not set +# CONFIG_FEATURE_FANCY_PING is not set +# CONFIG_PSCAN is not set +# CONFIG_ROUTE is not set +# CONFIG_SLATTACH is not set +# CONFIG_TCPSVD is not set +# CONFIG_TELNET is not set +# CONFIG_FEATURE_TELNET_TTYPE is not set +# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set +# CONFIG_TELNETD is not set +# CONFIG_FEATURE_TELNETD_STANDALONE is not set +# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set +# CONFIG_TFTP is not set +# CONFIG_TFTPD is not set +# CONFIG_FEATURE_TFTP_GET is not set +# CONFIG_FEATURE_TFTP_PUT is not set +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_TFTP_DEBUG is not set +# CONFIG_TRACEROUTE is not set +# CONFIG_TRACEROUTE6 is not set +# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set +# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_TUNCTL is not set +# CONFIG_FEATURE_TUNCTL_UG is not set +# CONFIG_UDHCPD is not set +# CONFIG_DHCPRELAY is not set +# CONFIG_DUMPLEASES is not set +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +CONFIG_DHCPD_LEASES_FILE="" +# CONFIG_UDHCPC is not set +# CONFIG_FEATURE_UDHCPC_ARPING is not set +# CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_UDHCP_DEBUG=0 +# CONFIG_FEATURE_UDHCP_RFC3397 is not set +CONFIG_UDHCPC_DEFAULT_SCRIPT="" +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0 +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="" +# CONFIG_UDPSVD is not set +# CONFIG_VCONFIG is not set +# CONFIG_WGET is not set +# CONFIG_FEATURE_WGET_STATUSBAR is not set +# CONFIG_FEATURE_WGET_AUTHENTICATION is not set +# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set +# CONFIG_ZCIP is not set + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_MAKEMIME is not set +CONFIG_FEATURE_MIME_CHARSET="" +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_SENDMAIL is not set + +# +# Process Utilities +# +# CONFIG_SMEMCAP is not set +# CONFIG_FREE is not set +# CONFIG_FUSER is not set +# CONFIG_KILL is not set +# CONFIG_KILLALL is not set +# CONFIG_KILLALL5 is not set +# CONFIG_NMETER is not set +# CONFIG_PGREP is not set +# CONFIG_PIDOF is not set +# CONFIG_FEATURE_PIDOF_SINGLE is not set +# CONFIG_FEATURE_PIDOF_OMIT is not set +# CONFIG_PKILL is not set +# CONFIG_PS is not set +# CONFIG_FEATURE_PS_WIDE is not set +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +# CONFIG_RENICE is not set +# CONFIG_BB_SYSCTL is not set +# CONFIG_TOP is not set +# CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set +# CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS is not set +# CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_FEATURE_TOPMEM is not set +# CONFIG_FEATURE_SHOW_THREADS is not set +# CONFIG_UPTIME is not set +# CONFIG_WATCH is not set + +# +# Runit Utilities +# +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVLOGD is not set +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_CHCON is not set +# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RESTORECON is not set +# CONFIG_RUNCON is not set +# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_SETSEBOOL is not set +# CONFIG_SESTATUS is not set + +# +# Shells +# +CONFIG_ASH=y +CONFIG_ASH_BASH_COMPAT=y +CONFIG_ASH_JOB_CONTROL=y +# CONFIG_ASH_ALIAS is not set +# CONFIG_ASH_GETOPTS is not set +CONFIG_ASH_BUILTIN_ECHO=y +CONFIG_ASH_BUILTIN_PRINTF=y +CONFIG_ASH_BUILTIN_TEST=y +CONFIG_ASH_CMDCMD=y +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +# CONFIG_ASH_RANDOM_SUPPORT is not set +# CONFIG_ASH_EXPAND_PRMT is not set +# CONFIG_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_HUSH is not set +# CONFIG_FEATURE_SH_IS_NONE is not set +# CONFIG_FEATURE_BASH_IS_ASH is not set +# CONFIG_FEATURE_BASH_IS_HUSH is not set +CONFIG_FEATURE_BASH_IS_NONE=y +# CONFIG_LASH is not set +# CONFIG_MSH is not set +# CONFIG_SH_MATH_SUPPORT is not set +# CONFIG_SH_MATH_SUPPORT_64 is not set +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +# CONFIG_CTTYHACK is not set + +# +# System Logging Utilities +# +# CONFIG_SYSLOGD is not set +# CONFIG_FEATURE_ROTATE_LOGFILE is not set +# CONFIG_FEATURE_REMOTE_LOG is not set +# CONFIG_FEATURE_SYSLOGD_DUP is not set +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 +# CONFIG_FEATURE_IPC_SYSLOG is not set +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 +# CONFIG_LOGREAD is not set +# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set +# CONFIG_KLOGD is not set +# CONFIG_LOGGER is not set diff --git a/deps/uevalrun/.svn/text-base/busybox-1.17.3-config.svn-base b/deps/uevalrun/.svn/text-base/busybox-1.17.3-config.svn-base new file mode 100644 index 0000000..c1aa1d2 --- /dev/null +++ b/deps/uevalrun/.svn/text-base/busybox-1.17.3-config.svn-base @@ -0,0 +1,970 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.17.3 +# Tue Nov 23 23:43:09 2010 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_DESKTOP is not set +# CONFIG_EXTRA_COMPAT is not set +CONFIG_INCLUDE_SUSv2=y +# CONFIG_USE_PORTABLE_CODE is not set +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_SHOW_USAGE=y +CONFIG_FEATURE_VERBOSE_USAGE=y +# CONFIG_FEATURE_COMPRESS_USAGE is not set +CONFIG_FEATURE_INSTALLER=y +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_UNICODE_SUPPORT is not set +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +CONFIG_LONG_OPTS=y +CONFIG_FEATURE_DEVPTS=y +# CONFIG_FEATURE_CLEAN_UP is not set +CONFIG_FEATURE_UTMP=y +# CONFIG_FEATURE_WTMP is not set +CONFIG_FEATURE_PIDFILE=y +CONFIG_FEATURE_SUID=y +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_FEATURE_SYSLOG=y +CONFIG_FEATURE_HAVE_RPC=y + +# +# Build Options +# +CONFIG_STATIC=y +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_LFS=y +CONFIG_CROSS_COMPILER_PREFIX="/usr/src/cross-compiler-i686/bin/i686-" +CONFIG_EXTRA_CFLAGS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_WERROR is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Installation Options +# +# CONFIG_INSTALL_NO_USR is not set +# CONFIG_INSTALL_APPLET_SYMLINKS is not set +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +CONFIG_INSTALL_APPLET_DONT=y +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SIZE_VS_SPEED=2 +CONFIG_FEATURE_FAST_TOP=y +# CONFIG_FEATURE_ETC_NETWORKS is not set +CONFIG_FEATURE_EDITING=y +CONFIG_FEATURE_EDITING_MAX_LEN=4096 +# CONFIG_FEATURE_EDITING_VI is not set +CONFIG_FEATURE_EDITING_HISTORY=255 +CONFIG_FEATURE_EDITING_SAVEHISTORY=y +CONFIG_FEATURE_TAB_COMPLETION=y +# CONFIG_FEATURE_USERNAME_COMPLETION is not set +CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_FEATURE_COPYBUF_KB=4 +# CONFIG_MONOTONIC_SYSCALL is not set +CONFIG_IOCTL_HEX2STR_ERROR=y +# CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +CONFIG_FEATURE_SEAMLESS_XZ=y +CONFIG_FEATURE_SEAMLESS_LZMA=y +CONFIG_FEATURE_SEAMLESS_BZ2=y +CONFIG_FEATURE_SEAMLESS_GZ=y +# CONFIG_FEATURE_SEAMLESS_Z is not set +CONFIG_AR=y +CONFIG_FEATURE_AR_LONG_FILENAMES=y +CONFIG_FEATURE_AR_CREATE=y +CONFIG_BUNZIP2=y +CONFIG_BZIP2=y +CONFIG_CPIO=y +CONFIG_FEATURE_CPIO_O=y +CONFIG_FEATURE_CPIO_P=y +CONFIG_DPKG=y +CONFIG_DPKG_DEB=y +# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +CONFIG_GUNZIP=y +CONFIG_GZIP=y +CONFIG_FEATURE_GZIP_LONG_OPTIONS=y +CONFIG_LZOP=y +# CONFIG_LZOP_COMPR_HIGH is not set +CONFIG_RPM2CPIO=y +# CONFIG_RPM is not set +CONFIG_TAR=y +CONFIG_FEATURE_TAR_CREATE=y +CONFIG_FEATURE_TAR_AUTODETECT=y +CONFIG_FEATURE_TAR_FROM=y +CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y +CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +CONFIG_FEATURE_TAR_LONG_OPTIONS=y +CONFIG_FEATURE_TAR_TO_COMMAND=y +CONFIG_FEATURE_TAR_UNAME_GNAME=y +CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y +# CONFIG_FEATURE_TAR_SELINUX is not set +# CONFIG_UNCOMPRESS is not set +CONFIG_UNLZMA=y +# CONFIG_FEATURE_LZMA_FAST is not set +CONFIG_LZMA=y +CONFIG_UNXZ=y +CONFIG_XZ=y +CONFIG_UNZIP=y + +# +# Coreutils +# +CONFIG_BASENAME=y +CONFIG_CAT=y +CONFIG_DATE=y +CONFIG_FEATURE_DATE_ISOFMT=y +# CONFIG_FEATURE_DATE_NANO is not set +CONFIG_FEATURE_DATE_COMPAT=y +CONFIG_TEST=y +CONFIG_FEATURE_TEST_64=y +CONFIG_TR=y +CONFIG_FEATURE_TR_CLASSES=y +CONFIG_FEATURE_TR_EQUIV=y +CONFIG_CAL=y +CONFIG_CATV=y +CONFIG_CHGRP=y +CONFIG_CHMOD=y +CONFIG_CHOWN=y +CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y +CONFIG_CHROOT=y +CONFIG_CKSUM=y +CONFIG_COMM=y +CONFIG_CP=y +CONFIG_FEATURE_CP_LONG_OPTIONS=y +CONFIG_CUT=y +CONFIG_DD=y +CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y +CONFIG_FEATURE_DD_IBS_OBS=y +CONFIG_DF=y +CONFIG_FEATURE_DF_FANCY=y +CONFIG_DIRNAME=y +CONFIG_DOS2UNIX=y +CONFIG_UNIX2DOS=y +CONFIG_DU=y +CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_ENV=y +CONFIG_FEATURE_ENV_LONG_OPTIONS=y +CONFIG_EXPAND=y +CONFIG_FEATURE_EXPAND_LONG_OPTIONS=y +CONFIG_EXPR=y +CONFIG_EXPR_MATH_SUPPORT_64=y +CONFIG_FALSE=y +CONFIG_FOLD=y +CONFIG_FSYNC=y +CONFIG_HEAD=y +CONFIG_FEATURE_FANCY_HEAD=y +CONFIG_HOSTID=y +CONFIG_ID=y +CONFIG_INSTALL=y +CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y +CONFIG_LENGTH=y +CONFIG_LN=y +CONFIG_LOGNAME=y +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +CONFIG_FEATURE_LS_COLOR=y +CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y +CONFIG_MD5SUM=y +CONFIG_MKDIR=y +CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y +CONFIG_MKFIFO=y +CONFIG_MKNOD=y +CONFIG_MV=y +CONFIG_FEATURE_MV_LONG_OPTIONS=y +CONFIG_NICE=y +CONFIG_NOHUP=y +CONFIG_OD=y +CONFIG_PRINTENV=y +CONFIG_PRINTF=y +CONFIG_PWD=y +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +CONFIG_REALPATH=y +CONFIG_RM=y +CONFIG_RMDIR=y +CONFIG_FEATURE_RMDIR_LONG_OPTIONS=y +CONFIG_SEQ=y +CONFIG_SHA1SUM=y +CONFIG_SHA256SUM=y +CONFIG_SHA512SUM=y +CONFIG_SLEEP=y +CONFIG_FEATURE_FANCY_SLEEP=y +CONFIG_FEATURE_FLOAT_SLEEP=y +CONFIG_SORT=y +CONFIG_FEATURE_SORT_BIG=y +CONFIG_SPLIT=y +CONFIG_FEATURE_SPLIT_FANCY=y +CONFIG_STAT=y +CONFIG_FEATURE_STAT_FORMAT=y +CONFIG_STTY=y +CONFIG_SUM=y +CONFIG_SYNC=y +CONFIG_TAC=y +CONFIG_TAIL=y +CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_TEE=y +CONFIG_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_TOUCH=y +CONFIG_TRUE=y +CONFIG_TTY=y +CONFIG_UNAME=y +CONFIG_UNEXPAND=y +CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS=y +CONFIG_UNIQ=y +CONFIG_USLEEP=y +CONFIG_UUDECODE=y +CONFIG_UUENCODE=y +CONFIG_WC=y +CONFIG_FEATURE_WC_LARGE=y +CONFIG_WHO=y +CONFIG_WHOAMI=y +CONFIG_YES=y + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for ls, more and telnet +# +CONFIG_FEATURE_AUTOWIDTH=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum +# +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y + +# +# Console Utilities +# +CONFIG_CHVT=y +CONFIG_FGCONSOLE=y +CONFIG_CLEAR=y +CONFIG_DEALLOCVT=y +CONFIG_DUMPKMAP=y +CONFIG_KBD_MODE=y +CONFIG_LOADFONT=y +CONFIG_LOADKMAP=y +CONFIG_OPENVT=y +CONFIG_RESET=y +CONFIG_RESIZE=y +CONFIG_FEATURE_RESIZE_PRINT=y +CONFIG_SETCONSOLE=y +CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y +CONFIG_SETFONT=y +CONFIG_FEATURE_SETFONT_TEXTUAL_MAP=y +CONFIG_DEFAULT_SETFONT_DIR="" +CONFIG_SETKEYCODES=y +CONFIG_SETLOGCONS=y +CONFIG_SHOWKEY=y + +# +# Common options for loadfont and setfont +# +CONFIG_FEATURE_LOADFONT_PSF2=y +CONFIG_FEATURE_LOADFONT_RAW=y + +# +# Debian Utilities +# +CONFIG_MKTEMP=y +CONFIG_PIPE_PROGRESS=y +CONFIG_RUN_PARTS=y +CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y +CONFIG_FEATURE_RUN_PARTS_FANCY=y +CONFIG_START_STOP_DAEMON=y +CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y +CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y +CONFIG_WHICH=y + +# +# Editors +# +CONFIG_AWK=y +CONFIG_FEATURE_AWK_LIBM=y +CONFIG_CMP=y +CONFIG_DIFF=y +CONFIG_FEATURE_DIFF_LONG_OPTIONS=y +CONFIG_FEATURE_DIFF_DIR=y +CONFIG_ED=y +CONFIG_PATCH=y +CONFIG_SED=y +CONFIG_VI=y +CONFIG_FEATURE_VI_MAX_LEN=4096 +# CONFIG_FEATURE_VI_8BIT is not set +CONFIG_FEATURE_VI_COLON=y +CONFIG_FEATURE_VI_YANKMARK=y +CONFIG_FEATURE_VI_SEARCH=y +CONFIG_FEATURE_VI_USE_SIGNALS=y +CONFIG_FEATURE_VI_DOT_CMD=y +CONFIG_FEATURE_VI_READONLY=y +CONFIG_FEATURE_VI_SETOPTS=y +CONFIG_FEATURE_VI_SET=y +CONFIG_FEATURE_VI_WIN_RESIZE=y +CONFIG_FEATURE_VI_ASK_TERMINAL=y +CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y +CONFIG_FEATURE_ALLOW_EXEC=y + +# +# Finding Utilities +# +CONFIG_FIND=y +CONFIG_FEATURE_FIND_PRINT0=y +CONFIG_FEATURE_FIND_MTIME=y +CONFIG_FEATURE_FIND_MMIN=y +CONFIG_FEATURE_FIND_PERM=y +CONFIG_FEATURE_FIND_TYPE=y +CONFIG_FEATURE_FIND_XDEV=y +CONFIG_FEATURE_FIND_MAXDEPTH=y +CONFIG_FEATURE_FIND_NEWER=y +CONFIG_FEATURE_FIND_INUM=y +CONFIG_FEATURE_FIND_EXEC=y +CONFIG_FEATURE_FIND_USER=y +CONFIG_FEATURE_FIND_GROUP=y +CONFIG_FEATURE_FIND_NOT=y +CONFIG_FEATURE_FIND_DEPTH=y +CONFIG_FEATURE_FIND_PAREN=y +CONFIG_FEATURE_FIND_SIZE=y +CONFIG_FEATURE_FIND_PRUNE=y +CONFIG_FEATURE_FIND_DELETE=y +CONFIG_FEATURE_FIND_PATH=y +CONFIG_FEATURE_FIND_REGEX=y +# CONFIG_FEATURE_FIND_CONTEXT is not set +CONFIG_FEATURE_FIND_LINKS=y +CONFIG_GREP=y +CONFIG_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_FEATURE_GREP_FGREP_ALIAS=y +CONFIG_FEATURE_GREP_CONTEXT=y +CONFIG_XARGS=y +CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y +CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +CONFIG_INIT=y +CONFIG_FEATURE_USE_INITTAB=y +# CONFIG_FEATURE_KILL_REMOVED is not set +CONFIG_FEATURE_KILL_DELAY=0 +CONFIG_FEATURE_INIT_SCTTY=y +CONFIG_FEATURE_INIT_SYSLOG=y +CONFIG_FEATURE_EXTRA_QUIET=y +CONFIG_FEATURE_INIT_COREDUMPS=y +CONFIG_FEATURE_INITRD=y +CONFIG_HALT=y +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +CONFIG_MESG=y + +# +# Login/Password Management Utilities +# +CONFIG_FEATURE_SHADOWPASSWDS=y +CONFIG_USE_BB_PWD_GRP=y +CONFIG_USE_BB_SHADOW=y +CONFIG_USE_BB_CRYPT=y +CONFIG_USE_BB_CRYPT_SHA=y +CONFIG_ADDGROUP=y +CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS=y +CONFIG_FEATURE_ADDUSER_TO_GROUP=y +CONFIG_DELGROUP=y +CONFIG_FEATURE_DEL_USER_FROM_GROUP=y +# CONFIG_FEATURE_CHECK_NAMES is not set +CONFIG_ADDUSER=y +CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y +CONFIG_FIRST_SYSTEM_ID=100 +CONFIG_LAST_SYSTEM_ID=999 +CONFIG_DELUSER=y +CONFIG_GETTY=y +CONFIG_LOGIN=y +# CONFIG_PAM is not set +CONFIG_LOGIN_SCRIPTS=y +CONFIG_FEATURE_NOLOGIN=y +CONFIG_FEATURE_SECURETTY=y +CONFIG_PASSWD=y +CONFIG_FEATURE_PASSWD_WEAK_CHECK=y +CONFIG_CRYPTPW=y +CONFIG_CHPASSWD=y +CONFIG_SU=y +CONFIG_FEATURE_SU_SYSLOG=y +CONFIG_FEATURE_SU_CHECKS_SHELLS=y +CONFIG_SULOGIN=y +CONFIG_VLOCK=y + +# +# Linux Ext2 FS Progs +# +CONFIG_CHATTR=y +CONFIG_FSCK=y +CONFIG_LSATTR=y +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +CONFIG_MODINFO=y +CONFIG_MODPROBE_SMALL=y +CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y +CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y +# CONFIG_INSMOD is not set +# CONFIG_RMMOD is not set +# CONFIG_LSMOD is not set +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +# CONFIG_MODPROBE is not set +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +# CONFIG_DEPMOD is not set + +# +# Options common to multiple modutils +# +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set +# CONFIG_FEATURE_MODUTILS_ALIAS is not set +# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set +CONFIG_DEFAULT_MODULES_DIR="/lib/modules" +CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" + +# +# Linux System Utilities +# +CONFIG_REV=y +CONFIG_ACPID=y +CONFIG_FEATURE_ACPID_COMPAT=y +CONFIG_BLKID=y +CONFIG_DMESG=y +CONFIG_FEATURE_DMESG_PRETTY=y +CONFIG_FBSET=y +CONFIG_FEATURE_FBSET_FANCY=y +CONFIG_FEATURE_FBSET_READMODE=y +CONFIG_FDFLUSH=y +CONFIG_FDFORMAT=y +CONFIG_FDISK=y +CONFIG_FDISK_SUPPORT_LARGE_DISKS=y +CONFIG_FEATURE_FDISK_WRITABLE=y +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +CONFIG_FEATURE_FDISK_ADVANCED=y +CONFIG_FINDFS=y +CONFIG_FLOCK=y +CONFIG_FREERAMDISK=y +CONFIG_FSCK_MINIX=y +CONFIG_MKFS_EXT2=y +CONFIG_MKFS_MINIX=y +CONFIG_FEATURE_MINIX2=y +# CONFIG_MKFS_REISER is not set +CONFIG_MKFS_VFAT=y +CONFIG_GETOPT=y +CONFIG_FEATURE_GETOPT_LONG=y +CONFIG_HEXDUMP=y +CONFIG_FEATURE_HEXDUMP_REVERSE=y +CONFIG_HD=y +CONFIG_HWCLOCK=y +CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y +CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y +CONFIG_IPCRM=y +CONFIG_IPCS=y +CONFIG_LOSETUP=y +CONFIG_LSPCI=y +CONFIG_LSUSB=y +CONFIG_MDEV=y +CONFIG_FEATURE_MDEV_CONF=y +CONFIG_FEATURE_MDEV_RENAME=y +CONFIG_FEATURE_MDEV_RENAME_REGEXP=y +CONFIG_FEATURE_MDEV_EXEC=y +CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y +CONFIG_MKSWAP=y +CONFIG_FEATURE_MKSWAP_UUID=y +CONFIG_MORE=y +CONFIG_FEATURE_USE_TERMIOS=y +CONFIG_MOUNT=y +CONFIG_FEATURE_MOUNT_FAKE=y +CONFIG_FEATURE_MOUNT_VERBOSE=y +# CONFIG_FEATURE_MOUNT_HELPERS is not set +CONFIG_FEATURE_MOUNT_LABEL=y +CONFIG_FEATURE_MOUNT_NFS=y +CONFIG_FEATURE_MOUNT_CIFS=y +CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_FEATURE_MOUNT_FSTAB=y +CONFIG_PIVOT_ROOT=y +CONFIG_RDATE=y +CONFIG_RDEV=y +CONFIG_READPROFILE=y +CONFIG_RTCWAKE=y +CONFIG_SCRIPT=y +CONFIG_SCRIPTREPLAY=y +CONFIG_SETARCH=y +CONFIG_SWAPONOFF=y +CONFIG_FEATURE_SWAPON_PRI=y +CONFIG_SWITCH_ROOT=y +CONFIG_UMOUNT=y +CONFIG_FEATURE_UMOUNT_ALL=y + +# +# Common options for mount/umount +# +CONFIG_FEATURE_MOUNT_LOOP=y +CONFIG_FEATURE_MOUNT_LOOP_CREATE=y +# CONFIG_FEATURE_MTAB_SUPPORT is not set +CONFIG_VOLUMEID=y + +# +# Filesystem/Volume identification +# +CONFIG_FEATURE_VOLUMEID_EXT=y +CONFIG_FEATURE_VOLUMEID_BTRFS=y +CONFIG_FEATURE_VOLUMEID_REISERFS=y +CONFIG_FEATURE_VOLUMEID_FAT=y +CONFIG_FEATURE_VOLUMEID_HFS=y +CONFIG_FEATURE_VOLUMEID_JFS=y +CONFIG_FEATURE_VOLUMEID_XFS=y +CONFIG_FEATURE_VOLUMEID_NTFS=y +CONFIG_FEATURE_VOLUMEID_ISO9660=y +CONFIG_FEATURE_VOLUMEID_UDF=y +CONFIG_FEATURE_VOLUMEID_LUKS=y +CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y +CONFIG_FEATURE_VOLUMEID_CRAMFS=y +CONFIG_FEATURE_VOLUMEID_ROMFS=y +CONFIG_FEATURE_VOLUMEID_SYSV=y +CONFIG_FEATURE_VOLUMEID_OCFS2=y +CONFIG_FEATURE_VOLUMEID_LINUXRAID=y + +# +# Miscellaneous Utilities +# +# CONFIG_CONSPY is not set +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +CONFIG_ADJTIMEX=y +# CONFIG_BBCONFIG is not set +CONFIG_BEEP=y +CONFIG_FEATURE_BEEP_FREQ=4000 +CONFIG_FEATURE_BEEP_LENGTH_MS=30 +CONFIG_CHAT=y +CONFIG_FEATURE_CHAT_NOFAIL=y +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +CONFIG_FEATURE_CHAT_IMPLICIT_CR=y +CONFIG_FEATURE_CHAT_SWALLOW_OPTS=y +CONFIG_FEATURE_CHAT_SEND_ESCAPES=y +CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y +CONFIG_FEATURE_CHAT_CLR_ABORT=y +CONFIG_CHRT=y +CONFIG_CROND=y +CONFIG_FEATURE_CROND_D=y +CONFIG_FEATURE_CROND_CALL_SENDMAIL=y +CONFIG_FEATURE_CROND_DIR="/var/spool/cron" +CONFIG_CRONTAB=y +CONFIG_DC=y +CONFIG_FEATURE_DC_LIBM=y +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +CONFIG_DEVMEM=y +CONFIG_EJECT=y +CONFIG_FEATURE_EJECT_SCSI=y +CONFIG_FBSPLASH=y +# CONFIG_FLASHCP is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASH_ERASEALL is not set +CONFIG_IONICE=y +# CONFIG_INOTIFYD is not set +# CONFIG_LAST is not set +# CONFIG_FEATURE_LAST_SMALL is not set +# CONFIG_FEATURE_LAST_FANCY is not set +CONFIG_LESS=y +CONFIG_FEATURE_LESS_MAXLINES=9999999 +CONFIG_FEATURE_LESS_BRACKETS=y +CONFIG_FEATURE_LESS_FLAGS=y +CONFIG_FEATURE_LESS_MARKS=y +CONFIG_FEATURE_LESS_REGEXP=y +CONFIG_FEATURE_LESS_WINCH=y +CONFIG_FEATURE_LESS_DASHCMD=y +CONFIG_FEATURE_LESS_LINENUMS=y +CONFIG_HDPARM=y +CONFIG_FEATURE_HDPARM_GET_IDENTITY=y +CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y +CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF=y +CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET=y +CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF=y +CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA=y +CONFIG_MAKEDEVS=y +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +CONFIG_FEATURE_MAKEDEVS_TABLE=y +CONFIG_MAN=y +CONFIG_MICROCOM=y +CONFIG_MOUNTPOINT=y +CONFIG_MT=y +CONFIG_RAIDAUTORUN=y +CONFIG_READAHEAD=y +# CONFIG_RFKILL is not set +CONFIG_RUNLEVEL=y +CONFIG_RX=y +CONFIG_SETSID=y +CONFIG_STRINGS=y +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +CONFIG_TIME=y +CONFIG_TIMEOUT=y +CONFIG_TTYSIZE=y +CONFIG_VOLNAME=y +CONFIG_WALL=y +CONFIG_WATCHDOG=y + +# +# Networking Utilities +# +CONFIG_NC=y +CONFIG_NC_SERVER=y +CONFIG_NC_EXTRA=y +# CONFIG_NC_110_COMPAT is not set +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +CONFIG_ARP=y +CONFIG_ARPING=y +CONFIG_BRCTL=y +CONFIG_FEATURE_BRCTL_FANCY=y +CONFIG_FEATURE_BRCTL_SHOW=y +CONFIG_DNSD=y +CONFIG_ETHER_WAKE=y +CONFIG_FAKEIDENTD=y +CONFIG_FTPD=y +CONFIG_FEATURE_FTP_WRITE=y +CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST=y +CONFIG_FTPGET=y +CONFIG_FTPPUT=y +CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y +CONFIG_HOSTNAME=y +CONFIG_HTTPD=y +CONFIG_FEATURE_HTTPD_RANGES=y +CONFIG_FEATURE_HTTPD_USE_SENDFILE=y +CONFIG_FEATURE_HTTPD_SETUID=y +CONFIG_FEATURE_HTTPD_BASIC_AUTH=y +CONFIG_FEATURE_HTTPD_AUTH_MD5=y +CONFIG_FEATURE_HTTPD_CGI=y +CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y +CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y +CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y +CONFIG_FEATURE_HTTPD_ERROR_PAGES=y +CONFIG_FEATURE_HTTPD_PROXY=y +CONFIG_IFCONFIG=y +CONFIG_FEATURE_IFCONFIG_STATUS=y +CONFIG_FEATURE_IFCONFIG_SLIP=y +CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y +CONFIG_FEATURE_IFCONFIG_HW=y +CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y +CONFIG_IFENSLAVE=y +CONFIG_IFPLUGD=y +CONFIG_IFUPDOWN=y +CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate" +CONFIG_FEATURE_IFUPDOWN_IP=y +CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y +# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set +CONFIG_FEATURE_IFUPDOWN_IPV4=y +CONFIG_FEATURE_IFUPDOWN_IPV6=y +CONFIG_FEATURE_IFUPDOWN_MAPPING=y +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +CONFIG_INETD=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN=y +CONFIG_FEATURE_INETD_RPC=y +CONFIG_IP=y +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_ROUTE=y +CONFIG_FEATURE_IP_TUNNEL=y +CONFIG_FEATURE_IP_RULE=y +CONFIG_FEATURE_IP_SHORT_FORMS=y +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +CONFIG_IPADDR=y +CONFIG_IPLINK=y +CONFIG_IPROUTE=y +CONFIG_IPTUNNEL=y +CONFIG_IPRULE=y +CONFIG_IPCALC=y +CONFIG_FEATURE_IPCALC_FANCY=y +CONFIG_FEATURE_IPCALC_LONG_OPTIONS=y +CONFIG_NAMEIF=y +CONFIG_FEATURE_NAMEIF_EXTENDED=y +CONFIG_NETSTAT=y +CONFIG_FEATURE_NETSTAT_WIDE=y +CONFIG_FEATURE_NETSTAT_PRG=y +CONFIG_NSLOOKUP=y +CONFIG_NTPD=y +CONFIG_FEATURE_NTPD_SERVER=y +CONFIG_PING=y +CONFIG_PING6=y +CONFIG_FEATURE_FANCY_PING=y +CONFIG_PSCAN=y +CONFIG_ROUTE=y +CONFIG_SLATTACH=y +CONFIG_TCPSVD=y +CONFIG_TELNET=y +CONFIG_FEATURE_TELNET_TTYPE=y +CONFIG_FEATURE_TELNET_AUTOLOGIN=y +CONFIG_TELNETD=y +CONFIG_FEATURE_TELNETD_STANDALONE=y +CONFIG_FEATURE_TELNETD_INETD_WAIT=y +CONFIG_TFTP=y +CONFIG_TFTPD=y + +# +# Common options for tftp/tftpd +# +CONFIG_FEATURE_TFTP_GET=y +CONFIG_FEATURE_TFTP_PUT=y +CONFIG_FEATURE_TFTP_BLOCKSIZE=y +CONFIG_FEATURE_TFTP_PROGRESS_BAR=y +# CONFIG_TFTP_DEBUG is not set +CONFIG_TRACEROUTE=y +# CONFIG_TRACEROUTE6 is not set +CONFIG_FEATURE_TRACEROUTE_VERBOSE=y +# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +CONFIG_TUNCTL=y +CONFIG_FEATURE_TUNCTL_UG=y +CONFIG_UDHCPD=y +CONFIG_DHCPRELAY=y +CONFIG_DUMPLEASES=y +CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY=y +CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases" +CONFIG_UDHCPC=y +CONFIG_FEATURE_UDHCPC_ARPING=y +CONFIG_FEATURE_UDHCP_PORT=y +CONFIG_UDHCP_DEBUG=9 +CONFIG_FEATURE_UDHCP_RFC3397=y +CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n" +CONFIG_UDPSVD=y +CONFIG_VCONFIG=y +CONFIG_WGET=y +CONFIG_FEATURE_WGET_STATUSBAR=y +CONFIG_FEATURE_WGET_AUTHENTICATION=y +CONFIG_FEATURE_WGET_LONG_OPTIONS=y +CONFIG_ZCIP=y + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_MAKEMIME is not set +CONFIG_FEATURE_MIME_CHARSET="us-ascii" +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +CONFIG_SENDMAIL=y + +# +# Process Utilities +# +CONFIG_SMEMCAP=y +CONFIG_FREE=y +CONFIG_FUSER=y +CONFIG_KILL=y +CONFIG_KILLALL=y +CONFIG_KILLALL5=y +CONFIG_NMETER=y +CONFIG_PGREP=y +CONFIG_PIDOF=y +CONFIG_FEATURE_PIDOF_SINGLE=y +CONFIG_FEATURE_PIDOF_OMIT=y +CONFIG_PKILL=y +CONFIG_PS=y +CONFIG_FEATURE_PS_WIDE=y +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +CONFIG_RENICE=y +CONFIG_BB_SYSCTL=y +CONFIG_TOP=y +CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +CONFIG_FEATURE_TOP_SMP_CPU=y +CONFIG_FEATURE_TOP_DECIMALS=y +CONFIG_FEATURE_TOP_SMP_PROCESS=y +CONFIG_FEATURE_TOPMEM=y +CONFIG_FEATURE_SHOW_THREADS=y +CONFIG_UPTIME=y +CONFIG_WATCH=y + +# +# Runit Utilities +# +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVLOGD is not set +CONFIG_CHPST=y +CONFIG_SETUIDGID=y +CONFIG_ENVUIDGID=y +CONFIG_ENVDIR=y +CONFIG_SOFTLIMIT=y +# CONFIG_CHCON is not set +# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RESTORECON is not set +# CONFIG_RUNCON is not set +# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_SETSEBOOL is not set +# CONFIG_SESTATUS is not set + +# +# Shells +# +CONFIG_ASH=y +CONFIG_ASH_BASH_COMPAT=y +CONFIG_ASH_JOB_CONTROL=y +CONFIG_ASH_ALIAS=y +CONFIG_ASH_GETOPTS=y +CONFIG_ASH_BUILTIN_ECHO=y +CONFIG_ASH_BUILTIN_PRINTF=y +CONFIG_ASH_BUILTIN_TEST=y +CONFIG_ASH_CMDCMD=y +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +CONFIG_ASH_RANDOM_SUPPORT=y +CONFIG_ASH_EXPAND_PRMT=y +# CONFIG_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_HUSH is not set +# CONFIG_FEATURE_SH_IS_NONE is not set +# CONFIG_FEATURE_BASH_IS_ASH is not set +# CONFIG_FEATURE_BASH_IS_HUSH is not set +CONFIG_FEATURE_BASH_IS_NONE=y +# CONFIG_LASH is not set +# CONFIG_MSH is not set +CONFIG_SH_MATH_SUPPORT=y +CONFIG_SH_MATH_SUPPORT_64=y +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +CONFIG_CTTYHACK=y + +# +# System Logging Utilities +# +CONFIG_SYSLOGD=y +CONFIG_FEATURE_ROTATE_LOGFILE=y +CONFIG_FEATURE_REMOTE_LOG=y +CONFIG_FEATURE_SYSLOGD_DUP=y +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256 +CONFIG_FEATURE_IPC_SYSLOG=y +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16 +CONFIG_LOGREAD=y +CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y +CONFIG_KLOGD=y +CONFIG_LOGGER=y diff --git a/deps/uevalrun/.svn/text-base/busybox.mini.svn-base b/deps/uevalrun/.svn/text-base/busybox.mini.svn-base new file mode 100644 index 0000000..8ddfa4a Binary files /dev/null and b/deps/uevalrun/.svn/text-base/busybox.mini.svn-base differ diff --git a/deps/uevalrun/.svn/text-base/busybox.svn-base b/deps/uevalrun/.svn/text-base/busybox.svn-base new file mode 100644 index 0000000..dd9d191 Binary files /dev/null and b/deps/uevalrun/.svn/text-base/busybox.svn-base differ diff --git a/deps/uevalrun/.svn/text-base/download.sh.svn-base b/deps/uevalrun/.svn/text-base/download.sh.svn-base new file mode 100644 index 0000000..6f0064e --- /dev/null +++ b/deps/uevalrun/.svn/text-base/download.sh.svn-base @@ -0,0 +1,74 @@ +#! /bin/bash -- +# +# download.sh: Download external components for uevalrun. +# by pts@fazekas.hu at Sun Nov 28 12:08:05 CET 2010 +# + +download_stbx86_pkg() { + local F="$1.stbx86.tbz2" # e.g. F=gcc.stbx86.tbz2 + if ! test -f "$F.downloaded"; then + # TODO(pts): Don't fail if fully downloaded: wget: server returned error: HTTP/1.1 416 Requested Range Not Satisfiable + ./busybox wget -c -O "$F" \ + http://pts-mini-gpl.googlecode.com/svn/trunk/stbx86/"$F" + ./busybox touch "$F".downloaded + fi + test -s "$F" +} + +set +x -e + +test "${0%/*}" != "$0" && cd "${0%/*}" + +# Make sure we fail unless weuse ./busybox for all non-built-in commands. +export PATH=/dev/null + +if ! test -f busybox; then + echo "errnor: $PWD/busybox: not found" >&2 +fi + +for F in "$@"; do + if test -f "$F.downloaded"; then + if test -s "$F"; then + echo "info: already downloaded: $F" >&2 + continue + fi + ./busybox rm -f "$F" "$F.downloaded" # Remove empty file. + fi + echo "info: downloading: $F" >&2 + if test "${F%.stbx86.tbz2}" != "$F"; then + set -x + download_stbx86_pkg "${F%.stbx86.tbz2}" + set +x + elif test "$F" = php5.3 || + test "$F" = perl5.10 || + test "$F" = ruby1.8 || + test "$F" = ruby1.9 || + test "$F" = luajit1.1 || + test "$F" = smjs1.8 || + test "$F" = stackless2.7 || + test "$F" = python2.7; then + set -x + download_stbx86_pkg "$F" + ./busybox tar -Oxjf "$F".stbx86.tbz2 bin/"$F" >"$F" + ./busybox chmod +x "$F" + ./busybox touch "$F".downloaded + set +x + elif test "$F" = linux-2.6.36.1.tar.bz2 || + test "$F" = linux-2.6.31.tar.bz2; then + set -x + ./busybox wget -c -O "$F" http://www.kernel.org/pub/linux/kernel/v2.6/"$F" + ./busybox touch "$F".downloaded + set +x + else + set +x + echo "error: unknown download target: $F" >&2 + exit 2 + fi + if ! test -s "$F"; then + rm -f "$F" + echo "info: download failed: $F" >&2 + exit 3 + fi +done + +echo "info: all downloads OK" >&2 diff --git a/deps/uevalrun/.svn/text-base/guestinit.c.svn-base b/deps/uevalrun/.svn/text-base/guestinit.c.svn-base new file mode 100644 index 0000000..5b9c0ec --- /dev/null +++ b/deps/uevalrun/.svn/text-base/guestinit.c.svn-base @@ -0,0 +1,596 @@ +/* + * guestinit.c -- init(7) in the UML guest, for uevalrun + * by pts@fazekas.hu at Mon Nov 22 02:36:01 CET 2010 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void done(int exitcode) { + char buf[sizeof(int) * 3 + 1]; + sprintf(buf, "%d\n", exitcode); + if (exitcode != 0) + fprintf(stderr, "guestinit: failure, exitcode=%d\n", exitcode); + fflush(stdout); + fflush(stderr); + /* Make sure that con0 (/dev/tty0) is flushed to the UML host. */ + tcdrain(1); + sync(); + /* RB_POWER_OFF: System halted., because no power management in UML */ + /* RB_HALT_SYSTEM: System halted. */ + /* RB_AUTOBOOT: Restarting system., UML exits with SIGABRT */ + write(open("/proc/exitcode", O_WRONLY), buf, strlen(buf)); + reboot(RB_HALT_SYSTEM); +} + +static char rbuf[16 + 8192 + 1]; +static char wbuf[8192]; + +static pid_t child; +static int status; + +/** Returns 0 on success; -EINTR */ +static int copy_output(int outfd, char which, char *done_flag) { + int got = read(outfd, rbuf + 16, sizeof(rbuf) - 17); + int rgot; + char *p; + if (0 > got) { + if (errno == EINTR) { + return 0; + } else { + fprintf(stderr, "guestinit: %s read failed: %s\n", + which == STDOUT_FILENO ? "stdout" : "stderr", + strerror(errno)); + return 1; + } + } + if (0 == got) { + *done_flag = 1; + } else { + rgot = got; + p = rbuf + 16; + p[got] = '\0'; /* Just for extra safety. */ + *--p = which == STDOUT_FILENO ? '>' : '!'; + do { + *--p = rgot % 10 + '0'; + rgot /= 10; + } while (rgot > 0); + rgot = got + (rbuf + 16 - p); + if (p[rgot - 1] != '\n') + p[rgot++] = '\n'; + while (rgot > 0) { + /* We don't care if this operation is blocking. */ + got = write(1, p, rgot); + if (0 > got) { + if (errno != EINTR) { + fprintf(stderr, "guestinit: output write failed: %s\n", strerror(errno)); + return 1; + } + } else { + p += got; + rgot -= got; + } + } + } + return 0; +} + +/** Convert subprocess exit wait() status to guestinit UML guest exitcode */ +static int status_to_exitcode(int status) { + if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL) { + /* TODO(pts): Better detect out-of-memory, e.g. by analyzing ELF + * headers */ + return 2; + } else if (WIFSIGNALED(status) && WTERMSIG(status) == SIGXCPU) { + return 3; /* TODO(pts): Get rid of these magic exitcode constants */ + } + return 1; +} + +/** Returns an UML exitcode (0 on success, a positive value on failure). */ +static int work() { + struct rlimit rl; + fd_set rset; + fd_set wset; + int maxfd; + char is_stdout_done, is_stderr_done, is_input_done; + uint64_t fs, fsw; + struct termios ti; + int fd, got, wbufi, wbufl; + int pinfds[2], pstdoutfds[2], pstderrfds[2]; + char *p, *q; + char* env[] = { NULL }; + char* args[16]; + char is_ruby19 = 0; + char is_gcx = 0; + char *gcx_src_path = NULL; + + if (0 == tcgetattr(1, &ti)) { /* Almost always true. */ + /* Don't convert \n to \n when printing. */ + ti.c_oflag &= ~ONLCR; + if (0 != tcsetattr(1, TCSADRAIN, &ti)) { + fprintf(stderr, "guestinit: tcsetattr() failed\n"); + return 1; + } + } + fprintf(stderr, "guestinit: info: hello\n"); + if (0 != klogctl(8, NULL, 1)) { /* Disable kernel logging to console except for KERN_EMERG */ + fprintf(stderr, "guestinit: could not set kernel console loglevel\n"); + return 1; + } + if (0 != mount("dummy", "/proc", "proc", MS_MGC_VAL, NULL)) { + fprintf(stderr, "guestinit: mount /proc failed\n"); + return 1; + } + if (0 != setregid(1000, 1000)) { + fprintf(stderr, "guestinit: setregid() failed\n"); + return 1; + } + + if (0 > (fd = open("/proc/cmdline", O_RDONLY))) { /* command to run */ + fprintf(stderr, "guestinit: open(/proc/cmdline) failed: %s\n", + strerror(errno)); + return 1; + } + wbuf[0] = ' '; + wbufl = 1; + while (wbufl + 0U < sizeof wbuf - 1) { + got = read(fd, wbuf + wbufl, sizeof wbuf - 1 - wbufl); + if (got < 0) { + fprintf(stderr, "guestinit: read(/dev/ubde) failed: %s\n", + strerror(errno)); + return 1; + } + if (got == 0) + break; + wbufl += got; + } + close(fd); + wbuf[wbufl] = '\0'; + + p = strstr(wbuf, " solution_format="); + if (p == NULL) { + fprintf(stderr, "guestinit: missing solution_format="); + return 1; + } + p += sizeof(" solution_format=") - 1; + q = p; + while (*q != '\0' && *q != ' ' && *q != '\n' && *q != '\t') + ++q; + *q = '\0'; + + if (0 == strcmp(p, "elf")) { + args[0] = "/dev/ubdb"; + args[1] = NULL; + } else if (0 == strcmp(p, "ruby1.8")) { + args[0] = "/bin/ruby1.8"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "ruby1.9")) { + is_ruby19 = 1; + args[0] = "/bin/ruby1.9"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "ruby")) { + args[0] = "/bin/ruby"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "php")) { + args[0] = "/bin/php"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "perl")) { + args[0] = "/bin/perl"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "lua")) { + args[0] = "/bin/lua"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "javascript")) { + args[0] = "/bin/js"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "gcc")) { + is_gcx = 1; + gcx_src_path = "/tmp/prog.c"; + args[0] = "/bin/gcc"; /* This implies -static */ + /* This could be -o/proc/self/fd/1 , but we want to impose a size limit + * on the created executable (in addition to the source file and the + * assembly output). + */ + /* TODO(pts): Make uevalrun.c report `No space left on device' smarter. */ + args[1] = "-o/tmp/prog", + /* TODO(pts): Make these flags compatible. */ + /* Make sure that the args array is large enough. */ + args[2] = "-Wall"; + args[3] = "-W"; + args[4] = "-s"; + args[5] = "-O2"; + args[6] = gcx_src_path; + args[7] = NULL; + } else if (0 == strcmp(p, "gxx")) { + is_gcx = 1; + gcx_src_path = "/tmp/prog.cc"; + args[0] = "/bin/g++"; /* This implies -static */ + args[1] = "-o/tmp/prog", + args[2] = "-Wall"; + args[3] = "-W"; + args[4] = "-s"; + args[5] = "-O2"; + args[6] = gcx_src_path; + args[7] = NULL; + } else if (0 == strcmp(p, "python")) { + args[0] = "/bin/python"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else { + fprintf(stderr, "guestinit: unknown solution_format: %s\n", p); + return 1; + } + + if (is_gcx) { + if (0 > (fd = open("/dev/null", O_RDONLY))) { + fprintf(stderr, "guestinit: open(/dev/null) failed: %s\n", strerror(errno)); + return 1; + } + fs = 0; + } else { + /* UML pads the file with '\0' to 512-byte block boundary, but we'll work + * it around. + */ + if (0 > (fd = open(is_gcx ? "/dev/null" : "/dev/ubdc", O_RDONLY))) { /* input */ + fprintf(stderr, "guestinit: open(input) failed: %s\n", strerror(errno)); + return 1; + } + /* TIOCGPGRP works just in the UML patched by uevalrun. It's like + * BLKGETSIZE64, but it doesn't round up (i.e. it returns the proper file + * size). + */ + if (0 != ioctl(fd, TIOCGPGRP, &fs)) { + fprintf(stderr, "guestinit: size getting failed: %s\n", strerror(errno)); + return 1; + } + } + if (0 != pipe(pinfds)) { + fprintf(stderr, "guestinit: input pipe creation failed: %s\n", strerror(errno)); + return 1; + } + if (0 != pipe(pstdoutfds)) { + fprintf(stderr, "guestinit: stdout pipe creation failed: %s\n", strerror(errno)); + return 1; + } + if (0 != pipe(pstderrfds)) { + fprintf(stderr, "guestinit: stderr pipe creation failed: %s\n", strerror(errno)); + return 1; + } + + if (pinfds[0] != 0) { + if (0 != dup2(pinfds[0], 0)) { + fprintf(stderr, "guestinit: dup2() for input pipe failed: %s\n", strerror(errno)); + return 1; + } + close(pinfds[0]); + } + + if (is_gcx) { + int src_fd, tmp_fd, wgot; + uint64_t src_fs; + char* mkargs[] = { + "/bin/busybox", "mkfs.minix", "-n", "30", "-i", "8", "/dev/ubde", + NULL + }; + fflush(stdout); + fflush(stderr); + child = fork(); + if (child < 0) { + fprintf(stderr, "guestinit: mktmp fork() failed: %s\n", strerror(errno)); + return 1; + } + if (child == 0) { /* Child process. */ + status = execve(mkargs[0], mkargs, env); + fprintf(stderr, "mktmp execve() failed (%d): %s\n", + status, strerror(errno)); + exit(125); + } + while (child != waitpid(child, &status, 0)) {} + if (status != 0) { + fprintf(stderr, "guestinit: mktmp failed with status=0x%x\n", status); + return 1; + } + /* /tmp is a symlink to /fs */ + if (0 != mount("/dev/ubde", "/fs", "minix", MS_MGC_VAL, NULL)) { + fprintf(stderr, "guestinit: failed: mount /dev/ubde /fs -t minix: %s\n", + strerror(errno)); + return 1; + } + if (0 != chmod("/fs", 01777)) { + fprintf(stderr, "guestinit: chmod failed: /fs: %s\n", strerror(errno)); + return 1; + } + /* We can't just create a symlink (ln -s /dev/ubdb /tmp/prog.c), + * because GCC won't compile block devices. + */ + if (0 > (src_fd = open("/dev/ubdb", O_RDONLY))) { + fprintf(stderr, "guestinit: open(source) failed: %s\n", strerror(errno)); + return 1; + } + + if (0 != ioctl(src_fd, TIOCGPGRP, &src_fs)) { + fprintf(stderr, "guestinit: source size getting failed: %s\n", strerror(errno)); + return 1; + } + if (0 > (tmp_fd = open(gcx_src_path, O_WRONLY | O_CREAT | O_EXCL, 0644))) { + fprintf(stderr, "guestinit: open(%s) failed: %s\n", + gcx_src_path, strerror(errno)); + return 1; + } + while (src_fs > 0) { + got = read(src_fd, wbuf, src_fs > sizeof wbuf ? sizeof wbuf : src_fs); + if (got > 0) { + wgot = write(tmp_fd, wbuf, got); + if (wgot == got) { + } else if (wgot < 0) { + fprintf(stderr, "guestinit: source copy write failed: %s\n", + strerror(errno)); + return 1; + } else { + fprintf(stderr, "guestinit: source copy write too short\n"); + return 1; + } + } else if (got == 0) { + fprintf(stderr, "guestinit: source file too short\n"); + return 1; + } else { + fprintf(stderr, "guestinit: error reading source file: %s\n", + strerror(errno)); + return 1; + } + src_fs -= got; + } + close(tmp_fd); + close(src_fd); + } + + /* Not giving up root (setreuid) because we have to halt the guest later. */ + fprintf(stderr, "guestinit: info: running solution binary\n"); + fflush(stdout); + fflush(stderr); + child = fork(); + if (child < 0) { + fprintf(stderr, "guestinit: fork() failed: %s\n", strerror(errno)); + return 1; + } + if (child == 0) { /* Child process. */ + close(fd); + close(pinfds[1]); + close(pstdoutfds[0]); + close(pstderrfds[0]); + if (is_gcx) { /* Make the compiler stdout (if any) go to stderr */ + if (pstdoutfds[1] != pstderrfds[1]) { + close(pstdoutfds[1]); + pstdoutfds[1] = pstderrfds[1]; + } + } + fflush(stdout); + if (pstdoutfds[1] != 1) { + if (1 != dup2(pstdoutfds[1], 1)) { + fprintf(stderr, "guestinit: child: dup2() for stdout pipe failed: %s\n", strerror(errno)); + exit(124); + } + if (pstdoutfds[1] != pstderrfds[1]) + close(pstdoutfds[1]); + } + fflush(stderr); + if (pstderrfds[1] != 2) { + if (2 != dup2(pstderrfds[1], 2)) { + fprintf(stderr, "guestinit: child: dup2() for stderr pipe failed: %s\n", strerror(errno)); + exit(124); + } + close(pstderrfds[1]); + } + if (0 != setreuid(1000, 1000)) { + fprintf(stderr, "guestinit: child: setreuid() failed\n"); + exit(124); + } + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_CORE, &rl); + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_MEMLOCK, &rl); + rl.rlim_cur = rl.rlim_max = RLIM_INFINITY; + setrlimit(RLIMIT_STACK, &rl); + + if (is_gcx) { + /* 4 should be enough for gcc */ + rl.rlim_max = rl.rlim_cur = 10; + setrlimit(RLIMIT_NPROC, &rl); + } else { + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_FSIZE, &rl); + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_LOCKS, &rl); + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_MSGQUEUE, &rl); + rl.rlim_cur = 10; + rl.rlim_max = 10; + setrlimit(RLIMIT_NOFILE, &rl); + /* ruby1.9 needs 3 processes for its timer thread */ + rl.rlim_max = rl.rlim_cur = is_ruby19 ? 3 : 0; + setrlimit(RLIMIT_NPROC, &rl); + } + status = execve(args[0], args, env); + /* This will appear as the stderr of the child. */ + fprintf(stderr, "execve(%s) failed (%d): %s\n", + args[0], status, strerror(errno)); + exit(125); /* End of child process. */ + } + close(0); + close(pstdoutfds[1]); + close(pstderrfds[1]); + + /* Copy from fd (input file) to pinfds[1] (writable end of pipe input) */ + if (fs == 0) { + is_input_done = 1; + close(fd); + close(pinfds[1]); + } else { + is_input_done = 0; + } + is_stdout_done = 0; + is_stderr_done = 0; + if (is_gcx) { + close(pstdoutfds[0]); + is_stdout_done = 1; + } + maxfd = fd > pstdoutfds[0] ? fd : pstdoutfds[0]; + if (pstderrfds[0] > maxfd) maxfd = pstderrfds[0]; + ++maxfd; + wbufi = wbufl = 0; + fsw = fs; + while (!(is_input_done && is_stdout_done && is_stderr_done)) { + /* TODO(pts): Use poll to make it faster */ + FD_ZERO(&wset); + if (!is_input_done) + FD_SET(pinfds[1], &wset); + FD_ZERO(&rset); + if (!is_stdout_done) + FD_SET(pstdoutfds[0], &rset); + if (!is_stderr_done) + FD_SET(pstderrfds[0], &rset); + if (select(maxfd, &rset, &wset, NULL, NULL) == -1) { + if (errno == EINTR) { + continue; + } + fprintf(stderr, "guestinit: select() failed: %s\n", strerror(errno)); + return 1; + } + if (FD_ISSET(pinfds[1], &wset)) { + if (wbufi == wbufl) { /* No more data in write buffer. */ + if (fs == 0) { + fprintf(stderr, "guestinit: unexpected EOF in input block, need more: %ld\n", + (long)fs); + return 1; + } + wbufi = 0; + got = read(fd, wbuf, fs > sizeof wbuf ? sizeof wbuf : fs); + if (0 > got) { + if (errno != EINTR) { + fprintf(stderr, "guestinit: input read failed: %s\n", strerror(errno)); + return 1; + } + } else { + if (0 == got) { + fprintf(stderr, "guestinit: input EOF too early, need more: %ld\n", (long)fs); + return 1; + } + wbufl = got; + fs -= got; + if (fs == 0) + close(fd); + } + } + got = write(pinfds[1], wbuf + wbufi, wbufl - wbufi); + if (0 > got) { + if (errno != EINTR) { + fprintf(stderr, "guestinit: input pipe write failed: %s\n", + strerror(errno)); + return 1; + } + } else { + wbufi += got; + fsw -= got; + if (fsw == 0) { + is_input_done = 1; + close(pinfds[1]); + } + } + } + /* Process pstderr before pstdout. */ + if (FD_ISSET(pstderrfds[0], &rset)) { + if (0 != (got = copy_output(pstderrfds[0], STDERR_FILENO, &is_stderr_done))) + return got; + if (is_stderr_done && is_gcx) { /* Just received EOF. */ + struct stat st; + /* Wait for the compiler to finish. */ + while (child != waitpid(child, &status, 0)) {} + if (status != 0) { + fprintf(stderr, "\nguestinit: compiler failed with status=0x%x\n", + status); + return status_to_exitcode(status); + } + /* TODO(pts): Display how long compilation took -- maybe in the host */ + fprintf(stderr, "\nguestinit: compilation successful\n"); + if (0 > (pstdoutfds[0] = open("/tmp/prog", O_RDONLY))) { + fprintf(stderr, "guestinit: cannot open binary " + "created by the compiler: /tmp/prog: %s\n", strerror(errno)); + return 1; + } + if (0 != fstat(pstdoutfds[0], &st)) { + fprintf(stderr, "guestinit: fstat: %s\n", strerror(errno)); + return 1; + } + fprintf(stderr, "guestinit: compiled binary size is %d bytes\n", + (int)st.st_size); + is_stdout_done = 0; + if (maxfd <= pstdoutfds[0]) + maxfd = pstdoutfds[0] + 1; + } + } + if (FD_ISSET(pstdoutfds[0], &rset)) { + if (0 != (got = copy_output(pstdoutfds[0], STDOUT_FILENO, &is_stdout_done))) + return got; + } + } + close(fd); + close(pinfds[1]); + close(pstdoutfds[0]); + close(pstderrfds[0]); + if (!is_gcx) { + /* We wait only this late (even for other processes closing the pipe) to + * avoid the race condition between SIGCHLD and reading the output of the + * child. We still won't receive the last few error messages. + */ + while (child != waitpid(child, &status, 0)) {} + if (status != 0) { + fprintf(stderr, "\nguestinit: solution child failed with status=0x%x.\n", status); + return status_to_exitcode(status); + } + fprintf(stderr, "\nguestinit: solution child successful\n"); + } + return 0; +} + +int main(int argc, char** argv) { + (void)argc; (void)argv; + if (getpid() != 1) { + fprintf(stderr, "guestinit: run me as init (PID 1)!\n"); + return 2; + } + done(work()); + return 0; /* Unreached. */ +} diff --git a/deps/uevalrun/.svn/text-base/linux-2.6.36-uevalrun.patch.svn-base b/deps/uevalrun/.svn/text-base/linux-2.6.36-uevalrun.patch.svn-base new file mode 100644 index 0000000..a0deb58 --- /dev/null +++ b/deps/uevalrun/.svn/text-base/linux-2.6.36-uevalrun.patch.svn-base @@ -0,0 +1,1869 @@ +This is the patch against vanilla linux-2.6.36 so that the UML (User-mode Linux) +kernel for uevalrun can be built. See make_kernel.sh for a complete script +which builds the kernel (ELF 32-bit executable uevalrun.linux.uml). + +Here is how this patch file was generated. + + for F in `cat linux-2.6.36/diff.list`; do + diff -Nu -U10 linux-2.6.36{.orig,}/"$F"; done >linux-2.6.36-uevalrun.patch + +This patch applies cleanly to the following kernels: + +* http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.tar.bz2 +* http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.1.tar.bz2 + +--- linux-2.6.36.orig/.config 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.36/.config 2010-11-24 00:16:02.000000000 +0100 +@@ -0,0 +1,411 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.36 ++# Wed Nov 24 00:07:42 2010 ++# ++CONFIG_DEFCONFIG_LIST="arch/$ARCH/defconfig" ++CONFIG_GENERIC_HARDIRQS=y ++CONFIG_UML=y ++CONFIG_MMU=y ++CONFIG_NO_IOMEM=y ++# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set ++CONFIG_LOCKDEP_SUPPORT=y ++# CONFIG_STACKTRACE_SUPPORT is not set ++CONFIG_GENERIC_CALIBRATE_DELAY=y ++CONFIG_GENERIC_BUG=y ++CONFIG_GENERIC_CLOCKEVENTS=y ++CONFIG_IRQ_RELEASE_METHOD=y ++CONFIG_HZ=100 ++ ++# ++# UML-specific options ++# ++ ++# ++# Host processor type and features ++# ++# CONFIG_M486 is not set ++# CONFIG_M586 is not set ++# CONFIG_M586TSC is not set ++# CONFIG_M586MMX is not set ++# CONFIG_M686 is not set ++# CONFIG_MPENTIUMII is not set ++CONFIG_MPENTIUMIII=y ++# CONFIG_MPENTIUMM is not set ++# CONFIG_MPENTIUM4 is not set ++# CONFIG_MK6 is not set ++# CONFIG_MK7 is not set ++# CONFIG_MK8 is not set ++# CONFIG_MCRUSOE is not set ++# CONFIG_MEFFICEON is not set ++# CONFIG_MWINCHIPC6 is not set ++# CONFIG_MWINCHIP3D is not set ++# CONFIG_MGEODEGX1 is not set ++# CONFIG_MGEODE_LX is not set ++# CONFIG_MCYRIXIII is not set ++# CONFIG_MVIAC3_2 is not set ++# CONFIG_MVIAC7 is not set ++# CONFIG_MCORE2 is not set ++# CONFIG_MATOM is not set ++CONFIG_X86_GENERIC=y ++CONFIG_X86_CPU=y ++CONFIG_X86_INTERNODE_CACHE_SHIFT=6 ++CONFIG_X86_CMPXCHG=y ++CONFIG_X86_L1_CACHE_SHIFT=6 ++CONFIG_X86_XADD=y ++CONFIG_X86_WP_WORKS_OK=y ++CONFIG_X86_INVLPG=y ++CONFIG_X86_BSWAP=y ++CONFIG_X86_POPAD_OK=y ++CONFIG_X86_INTEL_USERCOPY=y ++CONFIG_X86_USE_PPRO_CHECKSUM=y ++CONFIG_X86_TSC=y ++CONFIG_X86_CMPXCHG64=y ++CONFIG_X86_CMOV=y ++CONFIG_X86_MINIMUM_CPU_FAMILY=5 ++CONFIG_CPU_SUP_INTEL=y ++CONFIG_CPU_SUP_CYRIX_32=y ++CONFIG_CPU_SUP_AMD=y ++CONFIG_CPU_SUP_CENTAUR=y ++CONFIG_CPU_SUP_TRANSMETA_32=y ++CONFIG_CPU_SUP_UMC_32=y ++CONFIG_UML_X86=y ++# CONFIG_64BIT is not set ++CONFIG_X86_32=y ++CONFIG_RWSEM_XCHGADD_ALGORITHM=y ++# CONFIG_RWSEM_GENERIC_SPINLOCK is not set ++# CONFIG_3_LEVEL_PGTABLES is not set ++CONFIG_ARCH_HAS_SC_SIGNALS=y ++CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y ++# CONFIG_SMP_BROKEN is not set ++CONFIG_GENERIC_HWEIGHT=y ++# CONFIG_STATIC_LINK is not set ++CONFIG_SELECT_MEMORY_MODEL=y ++CONFIG_FLATMEM_MANUAL=y ++CONFIG_FLATMEM=y ++CONFIG_FLAT_NODE_MEM_MAP=y ++CONFIG_PAGEFLAGS_EXTENDED=y ++CONFIG_SPLIT_PTLOCK_CPUS=4 ++# CONFIG_PHYS_ADDR_T_64BIT is not set ++CONFIG_ZONE_DMA_FLAG=0 ++CONFIG_VIRT_TO_BUS=y ++# CONFIG_KSM is not set ++CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 ++CONFIG_TICK_ONESHOT=y ++CONFIG_NO_HZ=y ++CONFIG_HIGH_RES_TIMERS=y ++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y ++CONFIG_LD_SCRIPT_DYN=y ++CONFIG_BINFMT_ELF=y ++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set ++CONFIG_HAVE_AOUT=y ++# CONFIG_BINFMT_AOUT is not set ++# CONFIG_BINFMT_MISC is not set ++# CONFIG_HOSTFS is not set ++# CONFIG_HPPFS is not set ++# CONFIG_MCONSOLE is not set ++# CONFIG_HIGHMEM is not set ++CONFIG_KERNEL_STACK_ORDER=0 ++ ++# ++# General setup ++# ++CONFIG_EXPERIMENTAL=y ++CONFIG_BROKEN_ON_SMP=y ++CONFIG_INIT_ENV_ARG_LIMIT=128 ++CONFIG_CROSS_COMPILE="" ++CONFIG_LOCALVERSION="" ++CONFIG_LOCALVERSION_AUTO=y ++# CONFIG_SWAP is not set ++# CONFIG_SYSVIPC is not set ++# CONFIG_BSD_PROCESS_ACCT is not set ++ ++# ++# RCU Subsystem ++# ++CONFIG_TREE_RCU=y ++# CONFIG_TINY_RCU is not set ++# CONFIG_RCU_TRACE is not set ++CONFIG_RCU_FANOUT=32 ++# CONFIG_RCU_FANOUT_EXACT is not set ++# CONFIG_TREE_RCU_TRACE is not set ++# CONFIG_IKCONFIG is not set ++CONFIG_LOG_BUF_SHIFT=14 ++# CONFIG_CGROUPS is not set ++# CONFIG_SYSFS_DEPRECATED_V2 is not set ++# CONFIG_RELAY is not set ++CONFIG_NAMESPACES=y ++# CONFIG_UTS_NS is not set ++# CONFIG_USER_NS is not set ++# CONFIG_PID_NS is not set ++# CONFIG_BLK_DEV_INITRD is not set ++CONFIG_CC_OPTIMIZE_FOR_SIZE=y ++CONFIG_SYSCTL=y ++CONFIG_ANON_INODES=y ++# CONFIG_EMBEDDED is not set ++CONFIG_UID16=y ++CONFIG_SYSCTL_SYSCALL=y ++CONFIG_KALLSYMS=y ++CONFIG_KALLSYMS_EXTRA_PASS=y ++CONFIG_HOTPLUG=y ++CONFIG_PRINTK=y ++CONFIG_BUG=y ++CONFIG_ELF_CORE=y ++CONFIG_BASE_FULL=y ++CONFIG_FUTEX=y ++CONFIG_EPOLL=y ++CONFIG_SIGNALFD=y ++CONFIG_TIMERFD=y ++CONFIG_EVENTFD=y ++CONFIG_SHMEM=y ++CONFIG_AIO=y ++ ++# ++# Kernel Performance Events And Counters ++# ++CONFIG_VM_EVENT_COUNTERS=y ++CONFIG_COMPAT_BRK=y ++CONFIG_SLAB=y ++# CONFIG_SLUB is not set ++# CONFIG_PROFILING is not set ++ ++# ++# GCOV-based kernel profiling ++# ++# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set ++CONFIG_SLABINFO=y ++CONFIG_RT_MUTEXES=y ++CONFIG_BASE_SMALL=0 ++# CONFIG_MODULES is not set ++CONFIG_BLOCK=y ++# CONFIG_LBDAF is not set ++# CONFIG_BLK_DEV_BSG is not set ++# CONFIG_BLK_DEV_INTEGRITY is not set ++ ++# ++# IO Schedulers ++# ++CONFIG_IOSCHED_NOOP=y ++# CONFIG_IOSCHED_DEADLINE is not set ++CONFIG_IOSCHED_CFQ=y ++CONFIG_DEFAULT_CFQ=y ++# CONFIG_DEFAULT_NOOP is not set ++CONFIG_DEFAULT_IOSCHED="cfq" ++# CONFIG_INLINE_SPIN_TRYLOCK is not set ++# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set ++# CONFIG_INLINE_SPIN_LOCK is not set ++# CONFIG_INLINE_SPIN_LOCK_BH is not set ++# CONFIG_INLINE_SPIN_LOCK_IRQ is not set ++# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set ++CONFIG_INLINE_SPIN_UNLOCK=y ++# CONFIG_INLINE_SPIN_UNLOCK_BH is not set ++CONFIG_INLINE_SPIN_UNLOCK_IRQ=y ++# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set ++# CONFIG_INLINE_READ_TRYLOCK is not set ++# CONFIG_INLINE_READ_LOCK is not set ++# CONFIG_INLINE_READ_LOCK_BH is not set ++# CONFIG_INLINE_READ_LOCK_IRQ is not set ++# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set ++CONFIG_INLINE_READ_UNLOCK=y ++# CONFIG_INLINE_READ_UNLOCK_BH is not set ++CONFIG_INLINE_READ_UNLOCK_IRQ=y ++# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set ++# CONFIG_INLINE_WRITE_TRYLOCK is not set ++# CONFIG_INLINE_WRITE_LOCK is not set ++# CONFIG_INLINE_WRITE_LOCK_BH is not set ++# CONFIG_INLINE_WRITE_LOCK_IRQ is not set ++# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set ++CONFIG_INLINE_WRITE_UNLOCK=y ++# CONFIG_INLINE_WRITE_UNLOCK_BH is not set ++CONFIG_INLINE_WRITE_UNLOCK_IRQ=y ++# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set ++# CONFIG_MUTEX_SPIN_ON_OWNER is not set ++# CONFIG_FREEZER is not set ++CONFIG_BLK_DEV=y ++CONFIG_BLK_DEV_UBD=y ++# CONFIG_BLK_DEV_UBD_SYNC is not set ++CONFIG_BLK_DEV_COW_COMMON=y ++# CONFIG_BLK_DEV_LOOP is not set ++ ++# ++# DRBD disabled because PROC_FS, INET or CONNECTOR not selected ++# ++# CONFIG_BLK_DEV_RAM is not set ++ ++# ++# Character Devices ++# ++CONFIG_STDERR_CONSOLE=y ++CONFIG_STDIO_CONSOLE=y ++CONFIG_SSL=y ++CONFIG_NULL_CHAN=y ++# CONFIG_PORT_CHAN is not set ++# CONFIG_PTY_CHAN is not set ++# CONFIG_TTY_CHAN is not set ++# CONFIG_XTERM_CHAN is not set ++CONFIG_NOCONFIG_CHAN=y ++CONFIG_CON_ZERO_CHAN="fd:0,fd:1" ++CONFIG_CON_CHAN="xterm" ++CONFIG_SSL_CHAN="pts" ++# CONFIG_UNIX98_PTYS is not set ++# CONFIG_LEGACY_PTYS is not set ++# CONFIG_RAW_DRIVER is not set ++# CONFIG_WATCHDOG is not set ++# CONFIG_UML_SOUND is not set ++# CONFIG_SOUND is not set ++# CONFIG_SOUND_OSS_CORE is not set ++# CONFIG_HOSTAUDIO is not set ++# CONFIG_HW_RANDOM is not set ++CONFIG_UML_RANDOM=y ++# CONFIG_MMAPPER is not set ++ ++# ++# Generic Driver Options ++# ++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" ++# CONFIG_DEVTMPFS is not set ++CONFIG_STANDALONE=y ++CONFIG_PREVENT_FIRMWARE_BUILD=y ++CONFIG_FW_LOADER=y ++# CONFIG_FIRMWARE_IN_KERNEL is not set ++CONFIG_EXTRA_FIRMWARE="" ++# CONFIG_SYS_HYPERVISOR is not set ++# CONFIG_NET is not set ++ ++# ++# File systems ++# ++CONFIG_MINIX_FS=y ++# CONFIG_ADFS_FS is not set ++# CONFIG_AFFS_FS is not set ++# CONFIG_HFS_FS is not set ++# CONFIG_HFSPLUS_FS is not set ++# CONFIG_BEFS_FS is not set ++# CONFIG_BFS_FS is not set ++# CONFIG_EFS_FS is not set ++# CONFIG_LOGFS is not set ++# CONFIG_CRAMFS is not set ++# CONFIG_SQUASHFS is not set ++# CONFIG_VXFS_FS is not set ++# CONFIG_OMFS_FS is not set ++# CONFIG_HPFS_FS is not set ++# CONFIG_QNX4FS_FS is not set ++# CONFIG_ROMFS_FS is not set ++# CONFIG_SYSV_FS is not set ++# CONFIG_UFS_FS is not set ++# CONFIG_EXT2_FS is not set ++# CONFIG_EXT2_FS_XATTR is not set ++# CONFIG_EXT2_FS_XIP is not set ++# CONFIG_EXT3_FS is not set ++# CONFIG_EXT4_FS is not set ++# CONFIG_REISERFS_FS is not set ++# CONFIG_JFS_FS is not set ++# CONFIG_FS_POSIX_ACL is not set ++# CONFIG_XFS_FS is not set ++# CONFIG_BTRFS_FS is not set ++# CONFIG_NILFS2_FS is not set ++CONFIG_FILE_LOCKING=y ++# CONFIG_FSNOTIFY is not set ++# CONFIG_DNOTIFY is not set ++# CONFIG_INOTIFY_USER is not set ++# CONFIG_QUOTA is not set ++# CONFIG_AUTOFS_FS is not set ++# CONFIG_AUTOFS4_FS is not set ++# CONFIG_FUSE_FS is not set ++ ++# ++# Caches ++# ++# CONFIG_FSCACHE is not set ++ ++# ++# CD-ROM/DVD Filesystems ++# ++# CONFIG_ISO9660_FS is not set ++# CONFIG_UDF_FS is not set ++ ++# ++# DOS/FAT/NT Filesystems ++# ++# CONFIG_MSDOS_FS is not set ++# CONFIG_VFAT_FS is not set ++# CONFIG_NTFS_FS is not set ++ ++# ++# Pseudo filesystems ++# ++CONFIG_PROC_FS=y ++# CONFIG_PROC_KCORE is not set ++CONFIG_PROC_SYSCTL=y ++CONFIG_PROC_PAGE_MONITOR=y ++CONFIG_SYSFS=y ++CONFIG_TMPFS=y ++# CONFIG_TMPFS_POSIX_ACL is not set ++# CONFIG_HUGETLB_PAGE is not set ++# CONFIG_CONFIGFS_FS is not set ++CONFIG_MISC_FILESYSTEMS=y ++ ++# ++# Partition Types ++# ++# CONFIG_PARTITION_ADVANCED is not set ++CONFIG_MSDOS_PARTITION=y ++# CONFIG_NLS is not set ++ ++# ++# Security options ++# ++# CONFIG_KEYS is not set ++# CONFIG_SECURITY is not set ++# CONFIG_SECURITYFS is not set ++CONFIG_DEFAULT_SECURITY_DAC=y ++CONFIG_DEFAULT_SECURITY="" ++# CONFIG_CRYPTO is not set ++# CONFIG_BINARY_PRINTF is not set ++ ++# ++# Library routines ++# ++CONFIG_GENERIC_FIND_FIRST_BIT=y ++CONFIG_GENERIC_FIND_NEXT_BIT=y ++CONFIG_GENERIC_FIND_LAST_BIT=y ++# CONFIG_CRC_CCITT is not set ++# CONFIG_CRC16 is not set ++# CONFIG_CRC_T10DIF is not set ++# CONFIG_CRC_ITU_T is not set ++# CONFIG_CRC32 is not set ++# CONFIG_CRC7 is not set ++# CONFIG_LIBCRC32C is not set ++CONFIG_HAS_DMA=y ++ ++# ++# SCSI device support ++# ++CONFIG_SCSI_MOD=y ++# CONFIG_RAID_ATTRS is not set ++# CONFIG_SCSI is not set ++# CONFIG_SCSI_DMA is not set ++# CONFIG_SCSI_NETLINK is not set ++# CONFIG_MD is not set ++# CONFIG_NEW_LEDS is not set ++# CONFIG_INPUT is not set ++ ++# ++# Kernel hacking ++# ++CONFIG_PRINTK_TIME=y ++CONFIG_ENABLE_WARN_DEPRECATED=y ++CONFIG_ENABLE_MUST_CHECK=y ++CONFIG_FRAME_WARN=1024 ++# CONFIG_STRIP_ASM_SYMS is not set ++# CONFIG_UNUSED_SYMBOLS is not set ++# CONFIG_DEBUG_FS is not set ++# CONFIG_DEBUG_KERNEL is not set ++# CONFIG_HARDLOCKUP_DETECTOR is not set ++CONFIG_DEBUG_BUGVERBOSE=y ++CONFIG_DEBUG_MEMORY_INIT=y ++# CONFIG_RCU_CPU_STALL_DETECTOR is not set ++# CONFIG_SYSCTL_SYSCALL_CHECK is not set ++# CONFIG_ATOMIC64_SELFTEST is not set ++# CONFIG_SAMPLES is not set ++# CONFIG_DEBUG_STACK_USAGE is not set +--- linux-2.6.36.orig/arch/um/Makefile 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/Makefile 2010-11-24 00:06:56.000000000 +0100 +@@ -99,21 +99,21 @@ + # Options used by linker script + export LDS_START := $(START) + export LDS_ELF_ARCH := $(ELF_ARCH) + export LDS_ELF_FORMAT := $(ELF_FORMAT) + + # The wrappers will select whether using "malloc" or the kernel allocator. + LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc + + LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt)) + +-CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) ++CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) $(LD_XFLAGS) + define cmd_vmlinux__ + $(CC) $(CFLAGS_vmlinux) -o $@ \ + -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ + -Wl,--start-group $(vmlinux-main) -Wl,--end-group \ + -lutil \ + $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o \ + FORCE ,$^) ; rm -f linux + endef + + # When cleaning we don't include .config, so we don't include +--- linux-2.6.36.orig/arch/um/os-Linux/util.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/util.c 2010-11-21 19:35:30.000000000 +0100 +@@ -68,24 +68,31 @@ + + void setup_hostinfo(char *buf, int len) + { + struct utsname host; + + uname(&host); + snprintf(buf, len, "%s %s %s %s %s", host.sysname, host.nodename, + host.release, host.version, host.machine); + } + ++ + void os_dump_core(void) + { + int pid; + ++ /* Call tcsetattr to restore termios of con=fd:... devices */ ++ /* TODO(pts): Also restore ssl= */ ++ /* TODO(pts): Only restore fd: */ ++ extern void console_exit(void); ++ console_exit(); ++ + signal(SIGSEGV, SIG_DFL); + + /* + * We are about to SIGTERM this entire process group to ensure that + * nothing is around to run after the kernel exits. The + * kernel wants to abort, not die through SIGTERM, so we + * ignore it here. + */ + + signal(SIGTERM, SIG_IGN); + +--- linux-2.6.36.orig/arch/um/drivers/stdio_console.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/drivers/stdio_console.c 2010-11-21 19:35:30.000000000 +0100 +@@ -173,21 +173,21 @@ + opts.xterm_title = new_title; + + lines_init(vts, ARRAY_SIZE(vts), &opts); + + con_init_done = 1; + register_console(&stdiocons); + return 0; + } + late_initcall(stdio_init); + +-static void console_exit(void) ++void console_exit(void) + { + if (!con_init_done) + return; + close_lines(vts, ARRAY_SIZE(vts)); + } + __uml_exitcall(console_exit); + + static int console_chan_setup(char *str) + { + char *error; +--- linux-2.6.36.orig/arch/um/drivers/fd.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/drivers/fd.c 2010-11-21 19:35:30.000000000 +0100 +@@ -1,29 +1,31 @@ + /* + * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com) + * Licensed under the GPL + */ + + #include + #include + #include + #include + #include ++#include ++#include + #include "chan_user.h" + #include "kern_constants.h" + #include "os.h" + #include "um_malloc.h" + #include "user.h" + + struct fd_chan { + int fd; +- int raw; ++ char raw, is_tty; + struct termios tt; + char str[sizeof("1234567890\0")]; + }; + + static void *fd_init(char *str, int device, const struct chan_opts *opts) + { + struct fd_chan *data; + char *end; + int n; + +@@ -38,49 +40,99 @@ + printk(UM_KERN_ERR "fd_init : couldn't parse file descriptor " + "'%s'\n", str); + return NULL; + } + + data = uml_kmalloc(sizeof(*data), UM_GFP_KERNEL); + if (data == NULL) + return NULL; + + *data = ((struct fd_chan) { .fd = n, +- .raw = opts->raw }); ++ .raw = opts->raw, ++ .is_tty = 0 }); + return data; + } + ++int create_pty_pair(int *master_fd, int *slave_fd) { ++ int retval; ++ char *p; ++ ++ *master_fd = posix_openpt(O_RDWR | O_NOCTTY); ++ if (*master_fd == -1) ++ return -errno; ++ ++ if (grantpt(*master_fd) == -1) { ++ retval = -errno; ++ close(*master_fd); /* Might change 'errno' */ ++ return retval; ++ } ++ ++ if (unlockpt(*master_fd) == -1) { ++ retval = -errno; ++ close(*master_fd); /* Might change 'errno' */ ++ return retval; ++ } ++ ++ p = ptsname(*master_fd); ++ if (p == NULL) { ++ retval = -errno; ++ close(*master_fd); /* Might change 'errno' */ ++ return retval; ++ } ++ *slave_fd = open64(p, O_RDWR | O_NOCTTY); ++ if (*slave_fd == -1) { ++ retval = -errno; ++ close(*master_fd); ++ return retval; ++ } ++ return 0; ++} ++ ++ + static int fd_open(int input, int output, int primary, void *d, char **dev_out) + { + struct fd_chan *data = d; + int err; + +- if (data->raw && isatty(data->fd)) { +- CATCH_EINTR(err = tcgetattr(data->fd, &data->tt)); +- if (err) ++ if (data->fd == -1) { ++ int master_fd, slave_fd; ++ err = create_pty_pair(&master_fd, &slave_fd); ++ if (err) { ++ printk(UM_KERN_ERR "Cannot crete PTY pair (%d)\n", err); + return err; ++ } ++ /* TODO(pts): Close the master eventually. */ ++ data->fd = slave_fd; ++ } + +- err = raw(data->fd); +- if (err) +- return err; ++ if (data->raw) { ++ CATCH_EINTR(err = tcgetattr(data->fd, &data->tt)); ++ if (!err || (errno != ENOTTY && errno != EINVAL)) { ++ if (err) ++ return -errno; ++ data->is_tty = 1; ++ err = raw(data->fd); ++ if (err) ++ return err; ++ } + } + sprintf(data->str, "%d", data->fd); + *dev_out = data->str; + return data->fd; + } + + static void fd_close(int fd, void *d) + { + struct fd_chan *data = d; + int err; + +- if (!data->raw || !isatty(fd)) ++ if (!data->is_tty) + return; + + CATCH_EINTR(err = tcsetattr(fd, TCSAFLUSH, &data->tt)); + if (err) + printk(UM_KERN_ERR "Failed to restore terminal state - " + "errno = %d\n", -err); + data->raw = 0; + } + + const struct chan_ops fd_ops = { +--- linux-2.6.36.orig/arch/um/drivers/ubd_kern.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/drivers/ubd_kern.c 2010-11-21 17:45:19.000000000 +0100 +@@ -833,42 +833,40 @@ + + if(ubd_dev->file == NULL) + goto out; + + err = ubd_file_size(ubd_dev, &ubd_dev->size); + if(err < 0){ + *error_out = "Couldn't determine size of device's file"; + goto out; + } + +- ubd_dev->size = ROUND_BLOCK(ubd_dev->size); +- + INIT_LIST_HEAD(&ubd_dev->restart); + sg_init_table(ubd_dev->sg, MAX_SG); + + err = -ENOMEM; + ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock); + if (ubd_dev->queue == NULL) { + *error_out = "Failed to initialize device queue"; + goto out; + } + ubd_dev->queue->queuedata = ubd_dev; + + blk_queue_max_segments(ubd_dev->queue, MAX_SG); +- err = ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, &ubd_gendisk[n]); ++ err = ubd_disk_register(UBD_MAJOR, ROUND_BLOCK(ubd_dev->size), n, &ubd_gendisk[n]); + if(err){ + *error_out = "Failed to register device"; + goto out_cleanup; + } + + if (fake_major != UBD_MAJOR) +- ubd_disk_register(fake_major, ubd_dev->size, n, ++ ubd_disk_register(fake_major, ROUND_BLOCK(ubd_dev->size), n, + &fake_gendisk[n]); + + /* + * Perhaps this should also be under the "if (fake_major)" above + * using the fake_disk->disk_name + */ + if (fake_ide) + make_ide_entries(ubd_gendisk[n]->disk_name); + + err = 0; +@@ -1279,35 +1277,37 @@ + dev->request = NULL; + } + } + + static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo) + { + struct ubd *ubd_dev = bdev->bd_disk->private_data; + + geo->heads = 128; + geo->sectors = 32; +- geo->cylinders = ubd_dev->size / (128 * 32 * 512); ++ geo->cylinders = ROUND_BLOCK(ubd_dev->size) / (128 * 32 * 512); + return 0; + } + + static int ubd_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) + { + struct ubd *ubd_dev = bdev->bd_disk->private_data; + u16 ubd_id[ATA_ID_WORDS]; + + switch (cmd) { + struct cdrom_volctrl volume; ++ case 0x540F/*TIOCGPGRP*/: /**** pts ****/ ++ return put_user(ubd_dev->size, (u64 __user*)arg); + case HDIO_GET_IDENTITY: + memset(&ubd_id, 0, ATA_ID_WORDS * 2); +- ubd_id[ATA_ID_CYLS] = ubd_dev->size / (128 * 32 * 512); ++ ubd_id[ATA_ID_CYLS] = ROUND_BLOCK(ubd_dev->size) / (128 * 32 * 512); + ubd_id[ATA_ID_HEADS] = 128; + ubd_id[ATA_ID_SECTORS] = 32; + if(copy_to_user((char __user *) arg, (char *) &ubd_id, + sizeof(ubd_id))) + return -EFAULT; + return 0; + + case CDROMVOLREAD: + if(copy_from_user(&volume, (char __user *) arg, sizeof(volume))) + return -EFAULT; +--- linux-2.6.36.orig/arch/um/include/asm/string.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.36/arch/um/include/asm/string.h 2010-11-20 22:21:04.000000000 +0100 +@@ -0,0 +1,56 @@ ++/**** pts ****/ ++#ifndef _ASM_X86_STRING_32_H ++#define _ASM_X86_STRING_32_H ++ ++#ifdef __KERNEL__ ++ ++/* Let gcc decide whether to inline or use the out of line functions */ ++ ++#define __HAVE_ARCH_STRCPY ++extern char *strcpy(char *dest, const char *src); ++ ++#define __HAVE_ARCH_STRNCPY ++extern char *strncpy(char *dest, const char *src, size_t count); ++ ++#define __HAVE_ARCH_STRCAT ++extern char *strcat(char *dest, const char *src); ++ ++#define __HAVE_ARCH_STRNCAT ++extern char *strncat(char *dest, const char *src, size_t count); ++ ++#define __HAVE_ARCH_STRCMP ++extern int strcmp(const char *cs, const char *ct); ++ ++#define __HAVE_ARCH_STRNCMP ++extern int strncmp(const char *cs, const char *ct, size_t count); ++ ++#define __HAVE_ARCH_STRCHR ++extern char *strchr(const char *s, int c); ++ ++#define __HAVE_ARCH_STRLEN ++extern size_t strlen(const char *s); ++ ++#define __HAVE_ARCH_MEMCPY ++extern void *memcpy(void *dest, const void *src, size_t n); ++ ++#define __HAVE_ARCH_MEMMOVE ++void *memmove(void *dest, const void *src, size_t n); ++ ++#define __HAVE_ARCH_MEMCHR ++extern void *memchr(const void *cs, int c, size_t count); ++ ++#define __HAVE_ARCH_STRNLEN ++extern size_t strnlen(const char *s, size_t count); ++ ++#define __HAVE_ARCH_STRSTR ++extern char *strstr(const char *cs, const char *ct); ++ ++#define __HAVE_ARCH_MEMSET ++extern void *memset(void *s, int c, size_t n); ++ ++#define __HAVE_ARCH_MEMSCAN ++extern void *memscan(void *addr, int c, size_t size); ++ ++#endif /* __KERNEL__ */ ++ ++#endif /* _ASM_X86_STRING_32_H */ +--- linux-2.6.36.orig/arch/um/include/shared/kern_util.h 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/include/shared/kern_util.h 2010-11-22 01:00:53.000000000 +0100 +@@ -56,14 +56,14 @@ + + extern unsigned long to_irq_stack(unsigned long *mask_out); + extern unsigned long from_irq_stack(int nested); + + extern void syscall_trace(struct uml_pt_regs *regs, int entryexit); + extern int singlestepping(void *t); + + extern void segv_handler(int sig, struct uml_pt_regs *regs); + extern void bus_handler(int sig, struct uml_pt_regs *regs); + extern void winch(int sig, struct uml_pt_regs *regs); +-extern void fatal_sigsegv(void) __attribute__ ((noreturn)); ++extern void fatal_sigsegv(int sig) __attribute__ ((noreturn)); + + + #endif +--- linux-2.6.36.orig/arch/um/kernel/reboot.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/kernel/reboot.c 2010-11-21 22:22:38.000000000 +0100 +@@ -41,18 +41,19 @@ + } + + void machine_restart(char * __unused) + { + uml_cleanup(); + reboot_skas(); + } + + void machine_power_off(void) + { ++ /* printk(KERN_ERR "machine_power_off\n"); */ + uml_cleanup(); + halt_skas(); + } + + void machine_halt(void) + { + machine_power_off(); + } +--- linux-2.6.36.orig/arch/um/kernel/trap.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/kernel/trap.c 2010-11-22 01:07:23.000000000 +0100 +@@ -117,23 +117,26 @@ + { + struct siginfo si; + + si.si_signo = SIGSEGV; + si.si_code = SEGV_ACCERR; + si.si_addr = (void __user *) FAULT_ADDRESS(fi); + current->thread.arch.faultinfo = fi; + force_sig_info(SIGSEGV, &si, current); + } + +-void fatal_sigsegv(void) ++void fatal_sigsegv(int sig) + { +- force_sigsegv(SIGSEGV, current); ++ if (sig == SIGSEGV) ++ force_sigsegv(sig, current); ++ else ++ force_sig(sig, current); + do_signal(); + /* + * This is to tell gcc that we're not returning - do_signal + * can, in general, return, but in this case, it's not, since + * we just got a fatal SIGSEGV queued. + */ + os_dump_core(); + } + + void segv_handler(int sig, struct uml_pt_regs *regs) +--- linux-2.6.36.orig/arch/um/os-Linux/main.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/main.c 2010-11-21 23:44:02.000000000 +0100 +@@ -1,22 +1,25 @@ + /* + * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) + * Licensed under the GPL + */ + ++#include + #include + #include + #include + #include + #include + #include + #include ++#include ++#include "asm/param.h" /* HZ */ + #include "as-layout.h" + #include "init.h" + #include "kern_constants.h" + #include "kern_util.h" + #include "os.h" + #include "um_malloc.h" + + #define PGD_BOUND (4 * 1024 * 1024) + #define STACKSIZE (8 * 1024 * 1024) + #define THREAD_NAME_LEN (256) +@@ -44,22 +47,30 @@ + + call = &__uml_initcall_start; + while (call < &__uml_initcall_end) { + (*call)(); + call++; + } + } + + static void last_ditch_exit(int sig) + { ++ int pid; + uml_cleanup(); +- exit(1); ++ signal(SIGTERM, SIG_IGN); ++ kill(0, SIGTERM); /* Kill everybody else in the process group. */ ++ kill(0, SIGCONT); /* Let them see the signal. */ ++ while ((pid = waitpid(-1, NULL, WNOHANG | __WALL)) > 0) ++ os_kill_ptraced_process(pid, 0); ++ signal(sig, SIG_DFL); ++ kill(0, sig); ++ exit(1); /* Not reached. */ + } + + static void install_fatal_handler(int sig) + { + struct sigaction action; + + /* All signals are enabled in this handler ... */ + sigemptyset(&action.sa_mask); + + /* +@@ -106,20 +117,73 @@ + } + snprintf(new_path, path_len, "PATH=%s" UML_LIB_PATH, old_path); + if (putenv(new_path)) { + perror("couldn't putenv to set a new PATH"); + free(new_path); + } + } + + extern void scan_elf_aux( char **envp); + ++#define PTS_ISDIGIT(c) ((c) - '0' + 0U <= 9) ++extern unsigned long preset_lpj; ++void delay_loop_speed(void) { /**** pts ****/ ++ int int_part, fraction_nom, fraction_den; ++ double bogomips; ++ char buf[1024], *p; ++ int got; ++ int fd = open64("/proc/cpuinfo", O_RDONLY); ++ if (fd < 0) ++ return; ++ got = read(fd, buf, sizeof buf - 1); ++ close(fd); ++ if (got < 0) ++ return; ++ buf[got] = '\0'; ++ /* Find the bogomips of the first CPU. */ ++ if (NULL == (p = strstr(buf, "\nbogomips"))) ++ return; ++ p += 9; ++ while (*p == ' ' || *p == '\t') ++ ++p; ++ if (*p++ != ':') ++ return; ++ /* sscanf(p, "%lf", &bogomips) doesn't seem to work (maybe no float ++ * support?), so we're scanning the float manually. ++ */ ++ while (*p == ' ' || *p == '\t') ++ ++p; ++ if (!PTS_ISDIGIT(*p)) ++ return; ++ int_part = *p++ - '0'; ++ fraction_nom = 0; ++ fraction_den = 1; ++ while (PTS_ISDIGIT(*p)) ++ int_part = 10 * int_part + *p++ - '0'; ++ if (*p == '.') { ++ ++p; ++ if (!PTS_ISDIGIT(*p)) ++ return; ++ while (PTS_ISDIGIT(*p)) { ++ fraction_nom = 10 * fraction_nom + *p++ - '0'; ++ fraction_den *= 10; ++ } ++ } ++ if (*p != '\n' && *p != '\r' && *p != '\0' && *p != ' ' && *p != '\t') ++ return; ++ bogomips = int_part + (fraction_nom + 0.0) / fraction_den; ++ preset_lpj = bogomips * (500000 / HZ); ++ printf("Got from host /proc/cpuinfo: bogomips=%lu.%02lu lpj=%lu\n", ++ (long)bogomips, (long)(bogomips * 100) % 100, preset_lpj); ++ return; ++} ++ + int __init main(int argc, char **argv, char **envp) + { + char **new_argv; + int ret, i, err; + + set_stklim(); + + setup_env_path(); + + new_argv = malloc((argc + 1) * sizeof(char *)); +@@ -136,23 +200,27 @@ + } + new_argv[argc] = NULL; + + /* + * Allow these signals to bring down a UML if all other + * methods of control fail. + */ + install_fatal_handler(SIGINT); + install_fatal_handler(SIGTERM); + install_fatal_handler(SIGHUP); ++ install_fatal_handler(SIGALRM); ++ install_fatal_handler(SIGPIPE); ++ install_fatal_handler(SIGXCPU); + + scan_elf_aux(envp); + ++ delay_loop_speed(); + do_uml_initcalls(); + ret = linux_main(argc, argv); + + /* + * Disable SIGPROF - I have no idea why libc doesn't do this or turn + * off the profiling time, but UML dies with a SIGPROF just before + * exiting when profiling is active. + */ + change_sig(SIGPROF, 0); + +@@ -178,21 +246,21 @@ + */ + unblock_signals(); + + /* Reboot */ + if (ret) { + printf("\n"); + execvp(new_argv[0], new_argv); + perror("Failed to exec kernel"); + ret = 1; + } +- printf("\n"); ++ fflush(stdout); + return uml_exitcode; + } + + extern void *__real_malloc(int); + + void *__wrap_malloc(int size) + { + void *ret; + + if (!kmalloc_ok) +--- linux-2.6.36.orig/arch/um/os-Linux/skas/process.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/skas/process.c 2010-11-22 01:02:19.000000000 +0100 +@@ -69,139 +69,139 @@ + if ((n < 0) || !WIFSTOPPED(status)) + goto bad_wait; + + if (((1 << WSTOPSIG(status)) & STUB_SIG_MASK) == 0) + break; + + err = ptrace(PTRACE_CONT, pid, 0, 0); + if (err) { + printk(UM_KERN_ERR "wait_stub_done : continue failed, " + "errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + } + + if (((1 << WSTOPSIG(status)) & STUB_DONE_MASK) != 0) + return; + + bad_wait: + err = ptrace_dump_regs(pid); + if (err) + printk(UM_KERN_ERR "Failed to get registers from stub, " + "errno = %d\n", -err); + printk(UM_KERN_ERR "wait_stub_done : failed to wait for SIGTRAP, " + "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno, + status); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + extern unsigned long current_stub_stack(void); + + static void get_skas_faultinfo(int pid, struct faultinfo *fi) + { + int err; + + if (ptrace_faultinfo) { + err = ptrace(PTRACE_FAULTINFO, pid, 0, fi); + if (err) { + printk(UM_KERN_ERR "get_skas_faultinfo - " + "PTRACE_FAULTINFO failed, errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + /* Special handling for i386, which has different structs */ + if (sizeof(struct ptrace_faultinfo) < sizeof(struct faultinfo)) + memset((char *)fi + sizeof(struct ptrace_faultinfo), 0, + sizeof(struct faultinfo) - + sizeof(struct ptrace_faultinfo)); + } + else { + unsigned long fpregs[FP_SIZE]; + + err = get_fp_registers(pid, fpregs); + if (err < 0) { + printk(UM_KERN_ERR "save_fp_registers returned %d\n", + err); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + err = ptrace(PTRACE_CONT, pid, 0, SIGSEGV); + if (err) { + printk(UM_KERN_ERR "Failed to continue stub, pid = %d, " + "errno = %d\n", pid, errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + wait_stub_done(pid); + + /* + * faultinfo is prepared by the stub-segv-handler at start of + * the stub stack page. We just have to copy it. + */ + memcpy(fi, (void *)current_stub_stack(), sizeof(*fi)); + + err = put_fp_registers(pid, fpregs); + if (err < 0) { + printk(UM_KERN_ERR "put_fp_registers returned %d\n", + err); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + } + } + + static void handle_segv(int pid, struct uml_pt_regs * regs) + { + get_skas_faultinfo(pid, ®s->faultinfo); + segv(regs->faultinfo, 0, 1, NULL); + } + + /* + * To use the same value of using_sysemu as the caller, ask it that value + * (in local_using_sysemu + */ + static void handle_trap(int pid, struct uml_pt_regs *regs, + int local_using_sysemu) + { + int err, status; + + if ((UPT_IP(regs) >= STUB_START) && (UPT_IP(regs) < STUB_END)) +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + + /* Mark this as a syscall */ + UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->gp); + + if (!local_using_sysemu) + { + err = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_NR_OFFSET, + __NR_getpid); + if (err < 0) { + printk(UM_KERN_ERR "handle_trap - nullifying syscall " + "failed, errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + err = ptrace(PTRACE_SYSCALL, pid, 0, 0); + if (err < 0) { + printk(UM_KERN_ERR "handle_trap - continuing to end of " + "syscall failed, errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); + if ((err < 0) || !WIFSTOPPED(status) || + (WSTOPSIG(status) != SIGTRAP + 0x80)) { + err = ptrace_dump_regs(pid); + if (err) + printk(UM_KERN_ERR "Failed to get registers " + "from process, errno = %d\n", -err); + printk(UM_KERN_ERR "handle_trap - failed to wait at " + "end of syscall, errno = %d, status = %d\n", + errno, status); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + } + + handle_syscall(regs); + } + + extern int __syscall_stub_start; + + static int userspace_tramp(void *stack) + { +@@ -364,46 +364,46 @@ + while (1) { + /* + * This can legitimately fail if the process loads a + * bogus value into a segment register. It will + * segfault and PTRACE_GETREGS will read that value + * out of the process. However, PTRACE_SETREGS will + * fail. In this case, there is nothing to do but + * just kill the process. + */ + if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + + /* Now we set local_using_sysemu to be used for one loop */ + local_using_sysemu = get_using_sysemu(); + + op = SELECT_PTRACE_OPERATION(local_using_sysemu, + singlestepping(NULL)); + + if (ptrace(op, pid, 0, 0)) { + printk(UM_KERN_ERR "userspace - ptrace continue " + "failed, op = %d, errno = %d\n", op, errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); + if (err < 0) { + printk(UM_KERN_ERR "userspace - wait failed, " + "errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + regs->is_user = 1; + if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) { + printk(UM_KERN_ERR "userspace - PTRACE_GETREGS failed, " + "errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */ + + if (WIFSTOPPED(status)) { + int sig = WSTOPSIG(status); + switch (sig) { + case SIGSEGV: + if (PTRACE_FULL_FAULTINFO || + !ptrace_faultinfo) { +@@ -434,24 +434,27 @@ + break; + case SIGIO: + case SIGILL: + case SIGBUS: + case SIGFPE: + case SIGWINCH: + block_signals(); + (*sig_info[sig])(sig, regs); + unblock_signals(); + break; ++ case SIGXCPU: ++ fatal_sigsegv(SIGXCPU); ++ break; + default: + printk(UM_KERN_ERR "userspace - child stopped " + "with signal %d\n", sig); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + pid = userspace_pid[0]; + interrupt_end(); + + /* Avoid -ERESTARTSYS handling in host */ + if (PT_SYSCALL_NR_OFFSET != PT_SYSCALL_RET_OFFSET) + PT_SYSCALL_NR(regs->gp) = -1; + } + } + } +@@ -668,21 +671,21 @@ + break; + case INIT_JMP_HALT: + kmalloc_ok = 0; + return 0; + case INIT_JMP_REBOOT: + kmalloc_ok = 0; + return 1; + default: + printk(UM_KERN_ERR "Bad sigsetjmp return in " + "start_idle_thread - %d\n", n); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + longjmp(*switch_buf, 1); + } + + void initial_thread_cb_skas(void (*proc)(void *), void *arg) + { + jmp_buf here; + + cb_proc = proc; + cb_arg = arg; +@@ -714,15 +717,15 @@ + { + int err; + + /* FIXME: need cpu pid in __switch_mm */ + if (proc_mm) { + err = ptrace(PTRACE_SWITCH_MM, userspace_pid[0], 0, + mm_idp->u.mm_fd); + if (err) { + printk(UM_KERN_ERR "__switch_mm - PTRACE_SWITCH_MM " + "failed, errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + } + else userspace_pid[0] = mm_idp->u.pid; + } +--- linux-2.6.36.orig/arch/um/os-Linux/start_up.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/start_up.c 2010-11-20 21:26:43.000000000 +0100 +@@ -80,21 +80,21 @@ + va_end(list); + + exit(1); + } + + static void non_fatal(char *fmt, ...) + { + va_list list; + + va_start(list, fmt); +- vfprintf(stderr, fmt, list); ++ vfprintf(stdout, fmt, list); + va_end(list); + } + + static int start_ptraced_child(void) + { + int pid, n, status; + + pid = fork(); + if (pid == 0) + ptrace_child(); +@@ -463,21 +463,21 @@ + } + + stop_ptraced_child(pid, 1, 1); + #endif + } + + static inline void check_skas3_proc_mm(void) + { + non_fatal(" - /proc/mm..."); + if (access("/proc/mm", W_OK) < 0) +- perror("not found"); ++ non_fatal("not found"); + else if (disable_proc_mm) + non_fatal("found but disabled on command line\n"); + else { + proc_mm = 1; + non_fatal("found\n"); + } + } + + void can_do_skas(void) + { +--- linux-2.6.36.orig/arch/um/os-Linux/umid.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/umid.c 2010-11-21 23:06:02.000000000 +0100 +@@ -10,31 +10,32 @@ + #include + #include + #include + #include + #include + #include "init.h" + #include "kern_constants.h" + #include "os.h" + #include "user.h" + +-#define UML_DIR "~/.uml/" ++/* TODO(pts): why is make_uml_dir called with the defaults? -- disabled anyway because of strange effect on getenv("HOME") upon UML process exit */ ++#define UML_DIR "-~/.uml/" + + #define UMID_LEN 64 + + /* Changed by set_umid, which is run early in boot */ + static char umid[UMID_LEN] = { 0 }; + + /* Changed by set_uml_dir and make_uml_dir, which are run early in boot */ + static char *uml_dir = UML_DIR; + +-static int __init make_uml_dir(void) ++static int make_uml_dir(void) + { + char dir[512] = { '\0' }; + int len, err; + + if (*uml_dir == '~') { + char *home = getenv("HOME"); + + err = -ENOENT; + if (home == NULL) { + printk(UM_KERN_ERR "make_uml_dir : no value in " +@@ -243,20 +244,22 @@ + } + + /* Changed in make_umid, which is called during early boot */ + static int umid_setup = 0; + + static int __init make_umid(void) + { + int fd, err; + char tmp[256]; + ++ if (uml_dir[0] == '-') return 0; ++ + if (umid_setup) + return 0; + + make_uml_dir(); + + if (*umid == '\0') { + strlcpy(tmp, uml_dir, sizeof(tmp)); + strlcat(tmp, "XXXXXX", sizeof(tmp)); + fd = mkstemp(tmp); + if (fd < 0) { +@@ -379,18 +382,20 @@ + + __uml_setup("uml_dir=", set_uml_dir, + "uml_dir=\n" + " The location to place the pid and umid files.\n\n" + ); + + static void remove_umid_dir(void) + { + char dir[strlen(uml_dir) + UMID_LEN + 1], err; + ++ if (uml_dir[0] == '-') return; ++ + sprintf(dir, "%s%s", uml_dir, umid); + err = remove_files_and_dir(dir); + if (err) + printf("remove_umid_dir - remove_files_and_dir failed with " + "err = %d\n", err); + } + + __uml_exitcall(remove_umid_dir); +--- linux-2.6.36.orig/arch/x86/lib/string_32.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/x86/lib/string_32.c 2010-11-20 22:27:19.000000000 +0100 +@@ -6,20 +6,21 @@ + * used through-out, making for "slightly" unclear code :-) + * + * AK: On P4 and K7 using non string instruction implementations might be faster + * for large memory blocks. But most of them are unlikely to be used on large + * strings. + */ + + #include + #include + ++#if 0 /**** pts ****/ + #ifdef __HAVE_ARCH_STRCPY + char *strcpy(char *dest, const char *src) + { + int d0, d1, d2; + asm volatile("1:\tlodsb\n\t" + "stosb\n\t" + "testb %%al,%%al\n\t" + "jne 1b" + : "=&S" (d0), "=&D" (d1), "=&a" (d2) + : "0" (src), "1" (dest) : "memory"); +@@ -190,37 +191,20 @@ + "movl $1,%0\n" + "1:\tdecl %0" + : "=D" (res), "=&c" (d0) + : "a" (c), "0" (cs), "1" (count) + : "memory"); + return res; + } + EXPORT_SYMBOL(memchr); + #endif + +-#ifdef __HAVE_ARCH_MEMSCAN +-void *memscan(void *addr, int c, size_t size) +-{ +- if (!size) +- return addr; +- asm volatile("repnz; scasb\n\t" +- "jnz 1f\n\t" +- "dec %%edi\n" +- "1:" +- : "=D" (addr), "=c" (size) +- : "0" (addr), "1" (size), "a" (c) +- : "memory"); +- return addr; +-} +-EXPORT_SYMBOL(memscan); +-#endif +- + #ifdef __HAVE_ARCH_STRNLEN + size_t strnlen(const char *s, size_t count) + { + int d0; + int res; + asm volatile("movl %2,%0\n\t" + "jmp 2f\n" + "1:\tcmpb $0,(%0)\n\t" + "je 3f\n\t" + "incl %0\n" +@@ -228,10 +212,29 @@ + "cmpl $-1,%1\n\t" + "jne 1b\n" + "3:\tsubl %2,%0" + : "=a" (res), "=&d" (d0) + : "c" (s), "1" (count) + : "memory"); + return res; + } + EXPORT_SYMBOL(strnlen); + #endif ++#endif ++ ++#ifdef __HAVE_ARCH_MEMSCAN ++void *memscan(void *addr, int c, size_t size) ++{ ++ if (!size) ++ return addr; ++ asm volatile("repnz; scasb\n\t" ++ "jnz 1f\n\t" ++ "dec %%edi\n" ++ "1:" ++ : "=D" (addr), "=c" (size) ++ : "0" (addr), "1" (size), "a" (c) ++ : "memory"); ++ return addr; ++} ++EXPORT_SYMBOL(memscan); ++#endif ++ +--- linux-2.6.36.orig/fs/exec.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/fs/exec.c 2010-11-21 00:35:05.000000000 +0100 +@@ -685,25 +685,27 @@ + struct file *file; + int err; + + file = do_filp_open(AT_FDCWD, name, + O_LARGEFILE | O_RDONLY | FMODE_EXEC, 0, + MAY_EXEC | MAY_OPEN); + if (IS_ERR(file)) + goto out; + + err = -EACCES; ++ if (!S_ISBLK(file->f_path.dentry->d_inode->i_mode)) { + if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) + goto exit; + + if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) + goto exit; ++ } + + fsnotify_open(file); + + err = deny_write_access(file); + if (err) + goto exit; + + out: + return file; + +--- linux-2.6.36.orig/kernel/sys.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/kernel/sys.c 2010-11-21 02:24:06.000000000 +0100 +@@ -302,62 +302,62 @@ + * @cmd: pointer to buffer containing command to execute for restart + * or %NULL + * + * Shutdown everything and perform a clean reboot. + * This is not safe to call in interrupt context. + */ + void kernel_restart(char *cmd) + { + kernel_restart_prepare(cmd); + if (!cmd) +- printk(KERN_EMERG "Restarting system.\n"); ++ printk(KERN_ALERT "Restarting system.\n"); + else +- printk(KERN_EMERG "Restarting system with command '%s'.\n", cmd); ++ printk(KERN_ALERT "Restarting system with command '%s'.\n", cmd); + machine_restart(cmd); + } + EXPORT_SYMBOL_GPL(kernel_restart); + + static void kernel_shutdown_prepare(enum system_states state) + { + blocking_notifier_call_chain(&reboot_notifier_list, + (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL); + system_state = state; + device_shutdown(); + } + /** + * kernel_halt - halt the system + * + * Shutdown everything and perform a clean system halt. + */ + void kernel_halt(void) + { + kernel_shutdown_prepare(SYSTEM_HALT); + sysdev_shutdown(); +- printk(KERN_EMERG "System halted.\n"); ++ printk(KERN_ALERT "System halted.\n"); + machine_halt(); + } + + EXPORT_SYMBOL_GPL(kernel_halt); + + /** + * kernel_power_off - power_off the system + * + * Shutdown everything and perform a clean system power_off. + */ + void kernel_power_off(void) + { + kernel_shutdown_prepare(SYSTEM_POWER_OFF); + if (pm_power_off_prepare) + pm_power_off_prepare(); + disable_nonboot_cpus(); + sysdev_shutdown(); +- printk(KERN_EMERG "Power down.\n"); ++ printk(KERN_ALERT "Power down.\n"); + machine_power_off(); + } + EXPORT_SYMBOL_GPL(kernel_power_off); + + static DEFINE_MUTEX(reboot_mutex); + + /* + * Reboot system call: for obvious reasons only root may call it, + * and even root needs to set up some magic numbers in the registers + * so that some mistake won't make this reboot the whole machine. +--- linux-2.6.36.orig/lib/string.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/lib/string.c 2010-11-20 21:58:48.000000000 +0100 +@@ -77,21 +77,21 @@ + + do { + c1 = tolower(*s1++); + c2 = tolower(*s2++); + } while ((--n > 0) && c1 == c2 && c1 != 0); + return c1 - c2; + } + EXPORT_SYMBOL(strncasecmp); + #endif + +-#ifndef __HAVE_ARCH_STRCPY ++#if 0 /*#ifndef __HAVE_ARCH_STRCPY*/ + /** + * strcpy - Copy a %NUL terminated string + * @dest: Where to copy the string to + * @src: Where to copy the string from + */ + #undef strcpy + char *strcpy(char *dest, const char *src) + { + char *tmp = dest; + +@@ -698,21 +698,21 @@ + len--; + if (!memcmp(s1, s2, l2)) + return (char *)s1; + s1++; + } + return NULL; + } + EXPORT_SYMBOL(strnstr); + #endif + +-#ifndef __HAVE_ARCH_MEMCHR ++#if 0 /*#ifndef __HAVE_ARCH_MEMCHR*/ + /** + * memchr - Find a character in an area of memory. + * @s: The memory area + * @c: The byte to search for + * @n: The size of the area. + * + * returns the address of the first occurrence of @c, or %NULL + * if @c is not found + */ + void *memchr(const void *s, int c, size_t n) +--- linux-2.6.36.orig/lib/vsprintf.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/lib/vsprintf.c 2010-11-20 22:30:17.000000000 +0100 +@@ -1231,20 +1231,21 @@ + } else { + if (spec->flags & SIGN) + spec->type = FORMAT_TYPE_INT; + else + spec->type = FORMAT_TYPE_UINT; + } + + return ++fmt - start; + } + ++#if 0 /**** pts ****/ + /** + * vsnprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @size: The size of the buffer, including the trailing null space + * @fmt: The format string to use + * @args: Arguments for the format string + * + * This function follows C99 vsnprintf, but has some extensions: + * %pS output the name of a text symbol with offset + * %ps output the name of a text symbol without offset +@@ -1428,20 +1429,21 @@ + *str = '\0'; + else + end[-1] = '\0'; + } + + /* the trailing null byte doesn't count towards the total */ + return str-buf; + + } + EXPORT_SYMBOL(vsnprintf); ++#endif + + /** + * vscnprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @size: The size of the buffer, including the trailing null space + * @fmt: The format string to use + * @args: Arguments for the format string + * + * The return value is the number of characters which have been written into + * the @buf not including the trailing '\0'. If @size is <= 0 the function +@@ -1527,20 +1529,21 @@ + * You probably want sprintf() instead. + * + * See the vsnprintf() documentation for format string extensions over C99. + */ + int vsprintf(char *buf, const char *fmt, va_list args) + { + return vsnprintf(buf, INT_MAX, fmt, args); + } + EXPORT_SYMBOL(vsprintf); + ++#if 0 /**** pts ****/ + /** + * sprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @fmt: The format string to use + * @...: Arguments for the format string + * + * The function returns the number of characters written + * into @buf. Use snprintf() or scnprintf() in order to avoid + * buffer overflows. + * +@@ -1551,20 +1554,21 @@ + va_list args; + int i; + + va_start(args, fmt); + i = vsnprintf(buf, INT_MAX, fmt, args); + va_end(args); + + return i; + } + EXPORT_SYMBOL(sprintf); ++#endif + + #ifdef CONFIG_BINARY_PRINTF + /* + * bprintf service: + * vbin_printf() - VA arguments to binary data + * bstr_printf() - Binary data to text string + */ + + /** + * vbin_printf - Parse a format string and place args' binary value in a buffer +--- linux-2.6.36.orig/scripts/mod/modpost.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/scripts/mod/modpost.c 2010-11-20 21:38:08.000000000 +0100 +@@ -19,20 +19,22 @@ + #include "../../include/generated/autoconf.h" + #include "../../include/linux/license.h" + + /* Some toolchains use a `_' prefix for all user symbols. */ + #ifdef CONFIG_SYMBOL_PREFIX + #define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX + #else + #define MODULE_SYMBOL_PREFIX "" + #endif + ++void __stack_chk_fail(void) {} ++ + + /* Are we using CONFIG_MODVERSIONS? */ + int modversions = 0; + /* Warn about undefined symbols? (do so if we have vmlinux) */ + int have_vmlinux = 0; + /* Is CONFIG_MODULE_SRCVERSION_ALL set? */ + static int all_versions = 0; + /* If we are modposting external module set to 1 */ + static int external_module = 0; + /* Warn about section mismatch in vmlinux if set to 1 */ +--- linux-2.6.36.orig/kernel/timeconst.h.fixed 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.36/kernel/timeconst.h.fixed 2010-11-25 00:34:44.000000000 +0100 +@@ -0,0 +1,35 @@ ++/* Automatically generated by kernel/timeconst.pl */ ++/* Conversion constants for HZ == 100 */ ++ ++#ifndef KERNEL_TIMECONST_H ++#define KERNEL_TIMECONST_H ++ ++#include ++#include ++ ++#if HZ != 100 ++#error "kernel/timeconst.h has the wrong HZ value!" ++#endif ++ ++#define HZ_TO_MSEC_MUL32 U64_C(0xa0000000) ++#define HZ_TO_MSEC_ADJ32 U64_C(0x0) ++#define HZ_TO_MSEC_SHR32 28 ++#define HZ_TO_MSEC_NUM U64_C(10) ++#define HZ_TO_MSEC_DEN U64_C(1) ++#define MSEC_TO_HZ_MUL32 U64_C(0xcccccccd) ++#define MSEC_TO_HZ_ADJ32 U64_C(0x733333333) ++#define MSEC_TO_HZ_SHR32 35 ++#define MSEC_TO_HZ_NUM U64_C(1) ++#define MSEC_TO_HZ_DEN U64_C(10) ++#define HZ_TO_USEC_MUL32 U64_C(0x9c400000) ++#define HZ_TO_USEC_ADJ32 U64_C(0x0) ++#define HZ_TO_USEC_SHR32 18 ++#define HZ_TO_USEC_NUM U64_C(10000) ++#define HZ_TO_USEC_DEN U64_C(1) ++#define USEC_TO_HZ_MUL32 U64_C(0xd1b71759) ++#define USEC_TO_HZ_ADJ32 U64_C(0x1fff2e48e8a7) ++#define USEC_TO_HZ_SHR32 45 ++#define USEC_TO_HZ_NUM U64_C(1) ++#define USEC_TO_HZ_DEN U64_C(10000) ++ ++#endif /* KERNEL_TIMECONST_H */ +--- linux-2.6.36.orig/kernel/Makefile.orig 2010-11-25 00:32:16.000000000 +0100 ++++ linux-2.6.36/kernel/Makefile 2010-11-25 00:33:05.000000000 +0100 +@@ -124,14 +124,14 @@ + + quiet_cmd_ikconfiggz = IKCFG $@ + cmd_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@ + targets += config_data.h + $(obj)/config_data.h: $(obj)/config_data.gz FORCE + $(call if_changed,ikconfiggz) + + $(obj)/time.o: $(obj)/timeconst.h + + quiet_cmd_timeconst = TIMEC $@ +- cmd_timeconst = $(PERL) $< $(CONFIG_HZ) > $@ ++ cmd_timeconst = cp $(src)/timeconst.h.fixed $@ + targets += timeconst.h + $(obj)/timeconst.h: $(src)/timeconst.pl FORCE + $(call if_changed,timeconst) diff --git a/deps/uevalrun/.svn/text-base/make.svn-base b/deps/uevalrun/.svn/text-base/make.svn-base new file mode 100644 index 0000000..4a02fe9 Binary files /dev/null and b/deps/uevalrun/.svn/text-base/make.svn-base differ diff --git a/deps/uevalrun/.svn/text-base/make_kernel.sh.svn-base b/deps/uevalrun/.svn/text-base/make_kernel.sh.svn-base new file mode 100644 index 0000000..05ff56a --- /dev/null +++ b/deps/uevalrun/.svn/text-base/make_kernel.sh.svn-base @@ -0,0 +1,104 @@ +#! /bin/bash -- +# +# make_kernel.sh: build the uevalrun.linux.uml kernel +# by pts@fazekas.hu at Wed Nov 24 00:26:59 CET 2010 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +set -ex + +# Make sure we fail unless weuse ./busybox for all non-built-in commands. +export PATH=/dev/null + +test "${0%/*}" != "$0" && cd "${0%/*}" + +KERNEL_TBZ2="${KERNEL_TBZ2:-linux-2.6.36.1.tar.bz2}" + +./busybox sh ./download.sh "$KERNEL_TBZ2" gcxbase.stbx86.tbz2 gcc.stbx86.tbz2 gcctool.stbx86.tbz2 gcxtool.stbx86.tbz2 + +./busybox rm -rf make_kernel.tmp +./busybox mkdir make_kernel.tmp + +./busybox mkdir make_kernel.tmp/cross-compiler +for P in gcxbase gcc gcctool gcxtool; do + : Extracting "$P" + (cd make_kernel.tmp/cross-compiler && ../../busybox tar xj) <"$P.stbx86.tbz2" || exit "$?" +done + +: Extracting "$KERNEL_TBZ2" +(cd make_kernel.tmp && ../busybox tar xj) <"$KERNEL_TBZ2" || exit "$?" +./busybox mv make_kernel.tmp/linux-* make_kernel.tmp/kernel +: Applying linux-2.6.36-uevalrun.patch +# TODO(pts): Make ``busybox patch'' not talk to the user. +(cd make_kernel.tmp/kernel && ../../busybox patch -p1) make_kernel.tmp/out + ./busybox cat make_kernel.tmp/out >"$F" +done + +./busybox mkdir make_kernel.tmp/bin +./busybox cp busybox make make_kernel.tmp/bin/ +for F in cat cmp cp cut date echo expr grep hostname mkdir mv rm \ + sed sh tail uname wc whoami \ +; do + ./busybox ln -s busybox make_kernel.tmp/bin/"$F" +done + +# TODO(pts): Auto-detect non-i686 prefixes. +CROSS="$PWD/make_kernel.tmp/cross-compiler/bin/i686-" +test "${CROSS}gcc" + +( unset LANG LANGUAGE LC_ALL LC_CTYPE LC_MONETARY LC_TIME LC_NUMERIC \ + LC_COLLATE LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE \ + LC_MEASUREMENT LC_IDENTIFICATION + export SHELL="$PWD/make_kernel.tmp/bin/sh" + export PATH="$PWD/make_kernel.tmp/bin" + cd make_kernel.tmp/kernel && + SHELL="$SHELL" PATH="$PATH" \ + make \ + ARCH=um \ + CROSS_COMPILE="$CROSS" \ + HOSTCC="${CROSS}gcc -static" \ + LD_XFLAGS=-static \ + vmlinux) +./busybox ls -l make_kernel.tmp/kernel/vmlinux +${CROSS}strip make_kernel.tmp/kernel/vmlinux +./busybox ls -l make_kernel.tmp/kernel/vmlinux +./busybox rm -f uevalrun.linux.uml.tmp +./busybox cp make_kernel.tmp/kernel/vmlinux uevalrun.linux.uml.tmp +./busybox mv uevalrun.linux.uml.tmp uevalrun.linux.uml # Atomic replace. +./busybox ls -l uevalrun.linux.uml + +# Full compile and extract time on narancs: +# 118.13user 14.18system 2:24.38elapsed 91%CPU (0avgtext+0avgdata 80528maxresident)k +# 4936inputs+1118032outputs (58major+2190404minor)pagefaults 0swaps + +# TODO(pts): Cleanup: ./busybox rm -rf make_kernel.tmp + +: All OK. diff --git a/deps/uevalrun/.svn/text-base/make_rootfs.sh.svn-base b/deps/uevalrun/.svn/text-base/make_rootfs.sh.svn-base new file mode 100644 index 0000000..bca961d --- /dev/null +++ b/deps/uevalrun/.svn/text-base/make_rootfs.sh.svn-base @@ -0,0 +1,131 @@ +#! /bin/bash -- +# +# make_rootfs.sh: Create the root filesystem for uevalrun UML guests +# by pts@fazekas.hu at Sat Nov 20 16:42:03 CET 2010 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +set -ex + +test "${0%/*}" != "$0" && cd "${0%/*}" + +# Make sure we fail unless weuse ./busybox for all non-built-in commands. +export PATH=/dev/null + +test -f busybox +# TODO(pts): Make it configurable so some of these won't be needed. +DPROGS="perl5.10 php5.3 ruby1.8 ruby1.9 stackless2.7 luajit1.1 smjs1.8" +./busybox sh ./download.sh $DPROGS +PROGS="$DPROGS busybox" +PROGS_KB=$(./busybox ls -l $PROGS | ./busybox awk '{s+=(($5+1023)/1024)}END{printf"%d\n",s}') +test "$PROGS_KB" +# TODO(pts): Give a better estimate. +let MINIX_KB=12+PROGS_KB+PROGS_KB/256 + +./busybox rm -f uevalrun.rootfs.minix.img # Make sure it's not mounted. +./busybox dd if=/dev/zero of=uevalrun.rootfs.minix.img bs=${MINIX_KB}K count=1 +# Increase `-i 100' here to increase the file size limit if you get a +# `No space left on device' when running this script. +./busybox mkfs.minix -n 14 -i 115 uevalrun.rootfs.minix.img + +./busybox tar cvf mkroot.tmp.tar $PROGS +./busybox cat >mkroot.tmp.sh <<'ENDMKROOT' +#! /bin/sh +# Don't autorun /sbin/minihalt, so we'll get a kernel panic in the UML guest, +# thus we'll get a nonzero exit code in the UML host if this script fails. +#trap /sbin/minihalt EXIT +set -ex +echo "Hello, World!" +#ls /proc # Works. + +mkdir /fs/dev /fs/bin /fs/sbin /fs/proc /fs/etc +mkdir /fs/etc/init.d +cat >/fs/etc/init.d/rcS <<'END' +#! /bin/sh +/bin/mount proc /proc -t proc +END +chmod +x /fs/etc/init.d/rcS +cp -a /dev/console /fs/dev/ +cp -a /dev/ttyS0 /fs/dev/ +cp -a /dev/ttyS1 /fs/dev/ +cp -a /dev/tty0 /fs/dev/ +cp -a /dev/tty1 /fs/dev/ +cp -a /dev/tty2 /fs/dev/ +cp -a /dev/tty3 /fs/dev/ +cp -a /dev/tty4 /fs/dev/ +cp -a /dev/null /fs/dev/ +cp -a /dev/zero /fs/dev/ +mknod /fs/dev/ubdb b 98 16 +mknod /fs/dev/ubdc b 98 32 +mknod /fs/dev/ubdd b 98 48 +mknod /fs/dev/ubde b 98 64 +# Grant read permission for the user: it migh be a script. +chmod 755 /fs/dev/ubdb +chmod 600 /fs/dev/ubdc +chmod 700 /fs/dev/ubdd +chmod 600 /fs/dev/ubde +mknod /fs/dev/random c 1 8 +chmod 666 /fs/dev/random +mknod /fs/dev/urandom c 1 9 +chmod 666 /fs/dev/urandom + +(cd /fs && tar xf /dev/ubdd) || exit "$?" # creates /fs/busybox /fs/ruby1.8 +chmod 755 /fs/perl5.10 /fs/php5.3 /fs/ruby1.8 /fs/ruby1.9 /fs/stackless2.7 /fs/luajit1.1 /fs/smjs1.8 /fs/busybox +mv /fs/ruby1.8 /fs/bin/ruby1.8 +ln -s ruby1.8 /fs/bin/ruby +mv /fs/ruby1.9 /fs/bin/ruby1.9 +mv /fs/php5.3 /fs/bin/php +mv /fs/perl5.10 /fs/bin/perl +mv /fs/luajit1.1 /fs/bin/luajit1.1 +ln -s luajit1.1 /fs/bin/luajit +ln -s luajit1.1 /fs/bin/lua +mv /fs/smjs1.8 /fs/bin/smjs1.8 +ln -s smjs1.8 /fs/bin/smjs +ln -s smjs1.8 /fs/bin/js +mv /fs/stackless2.7 /fs/bin/stackless2.7 +ln -s stackless2.7 /fs/bin/python +ln -s stackless2.7 /fs/bin/stackless +mv /fs/busybox /fs/bin/busybox +# cp hello bincat /fs/bin # Custom binaries. +ln -s ../bin/busybox /fs/sbin/init +ln -s ../bin/busybox /fs/sbin/halt +ln -s ../bin/busybox /fs/sbin/reboot +ln -s ../bin/busybox /fs/sbin/swapoff +ln -s ../bin/busybox /fs/bin/mount +ln -s ../bin/busybox /fs/bin/umount +ln -s ../bin/busybox /fs/bin/sh +ln -s ../bin/busybox /fs/bin/ls +ln -s ../bin/busybox /fs/bin/mkdir +ln -s ../bin/busybox /fs/bin/rmdir +ln -s ../bin/busybox /fs/bin/cp +ln -s ../bin/busybox /fs/bin/mv +ln -s ../bin/busybox /fs/bin/rm +ln -s ../bin/busybox /fs/bin/du +ln -s ../bin/busybox /fs/bin/df +ln -s ../bin/busybox /fs/bin/awk +ln -s ../bin/busybox /fs/bin/sed +ln -s ../bin/busybox /fs/bin/cat +ln -s ../bin/busybox /fs/bin/vi +ln -s ../bin/busybox /fs/bin/stty + +: guest-creator script OK, halting. +/sbin/minihalt +ENDMKROOT + +# Use the minix driver in uevalrun.linux.uml to populate our rootfs +# (uevalrun.rootfs.minix.img). +./uevalrun.linux.uml con=null ssl=null con0=fd:-1,fd:1 mem=10M \ + ubda=uevalrun.rootfs.mini.minix.img ubdb=uevalrun.rootfs.minix.img \ + ubdc=mkroot.tmp.sh ubdd=mkroot.tmp.tar init=/sbin/minihalt \ + mkrootgcxpkg.tmp.sh <mkrootgcx.tmp.sh <<'ENDMKROOT' +#! /bin/sh +# Don't autorun /sbin/minihalt, so we'll get a kernel panic in the UML guest, +# thus we'll get a nonzero exit code in the UML host if this script fails. +#trap /sbin/minihalt EXIT +set -ex +echo "Hello, World!" +echo +#ls /proc # Works. +mkdir -p /fs/bin +mkdir /fs/dev /fs/sbin /fs/proc /fs/etc /fs/fs +mkdir /fs/etc/init.d +cat >/fs/etc/init.d/rcS <<'END' +#! /bin/sh +/bin/mount proc /proc -t proc +END +chmod +x /fs/etc/init.d/rcS +ln -s /fs /fs/tmp +cp -a /dev/console /fs/dev/ +cp -a /dev/ttyS0 /fs/dev/ +cp -a /dev/ttyS1 /fs/dev/ +cp -a /dev/tty0 /fs/dev/ +cp -a /dev/tty1 /fs/dev/ +cp -a /dev/tty2 /fs/dev/ +cp -a /dev/tty3 /fs/dev/ +cp -a /dev/tty4 /fs/dev/ +cp -a /dev/null /fs/dev/ +cp -a /dev/zero /fs/dev/ +mknod /fs/dev/ubdb b 98 16 +mknod /fs/dev/ubdc b 98 32 +mknod /fs/dev/ubdd b 98 48 +mknod /fs/dev/ubde b 98 64 +# Grant read permission for the user: it migh be a script. +chmod 755 /fs/dev/ubdb +chmod 600 /fs/dev/ubdc +chmod 700 /fs/dev/ubdd +chmod 600 /fs/dev/ubde +mknod /fs/dev/random c 1 8 +chmod 666 /fs/dev/random +mknod /fs/dev/urandom c 1 9 +chmod 666 /fs/dev/urandom + +(cd /fs && tar xf /dev/ubdd) || exit "$?" # creates /fs/busybox +mv /fs/busybox /fs/bin/busybox +cp /sbin/minihalt /fs/sbin/minihalt +# TODO(pts): Get +(echo '#include '; echo 'int main() { return printf("HIX\n"); }') >/fs/hello.c +(echo '#include '; echo 'using namespace std;'; echo 'int main() { cout << "HIX" << endl; }') >/fs/hello.cc +# ln -s wouldn't work, gcc tries to find itself based on its argv[0]. +#ln -s ../compact-compiler-i686/bin/i686-gcc fs/bin/gcc +cat >fs/bin/gcc <<'END' +#! /bin/sh +export PATH=/ +set -ex +exec /bin/i686-gcc -static "$@" +END +chmod +x fs/bin/gcc +cat >fs/bin/g++ <<'END' +#! /bin/sh +export PATH=/ +set -ex +exec /bin/i686-g++ -static "$@" +END +chmod +x fs/bin/g++ +ln -s ../bin/busybox /fs/sbin/init +ln -s ../bin/busybox /fs/sbin/halt +ln -s ../bin/busybox /fs/sbin/reboot +ln -s ../bin/busybox /fs/sbin/swapoff +ln -s ../bin/busybox /fs/bin/mount +ln -s ../bin/busybox /fs/bin/umount +ln -s ../bin/busybox /fs/bin/sh +ln -s ../bin/busybox /fs/bin/ls +ln -s ../bin/busybox /fs/bin/mkdir +ln -s ../bin/busybox /fs/bin/rmdir +ln -s ../bin/busybox /fs/bin/cp +ln -s ../bin/busybox /fs/bin/mv +ln -s ../bin/busybox /fs/bin/rm +ln -s ../bin/busybox /fs/bin/du +ln -s ../bin/busybox /fs/bin/df +ln -s ../bin/busybox /fs/bin/awk +ln -s ../bin/busybox /fs/bin/sed +ln -s ../bin/busybox /fs/bin/cat +ln -s ../bin/busybox /fs/bin/vi +ln -s ../bin/busybox /fs/bin/stty + +/fs/bin/busybox df +: guest-creator script OK, halting. +/sbin/minihalt +ENDMKROOT + +./uevalrun.linux.uml con=null ssl=null con0=fd:-1,fd:1 mem=10M \ + ubda=uevalrun.rootfs.mini.minix.img ubdb=uevalrun.rootfs.gcx.minix.img \ + ubdc=mkrootgcx.tmp.sh ubdd=mkrootgcx.tmp.tar init=/sbin/minihalt \ + mkrootmini.tmp.sh <<'ENDMKROOT' +#! /bin/sh +# Don't autorun /sbin/minihalt, so we'll get a kernel panic in the UML guest, +# thus we'll get a nonzero exit code in the UML host if this script fails. +#trap /sbin/halt EXIT +set -ex +echo "Hello, World!" +#ls /proc # Works. + +mkdir /fs/dev /fs/bin /fs/sbin /fs/proc /fs/fs +cp -a /dev/console /fs/dev/ +cp -a /dev/ttyS0 /fs/dev/ +cp -a /dev/ttyS1 /fs/dev/ +cp -a /dev/tty0 /fs/dev/ +cp -a /dev/tty1 /fs/dev/ +cp -a /dev/tty2 /fs/dev/ +cp -a /dev/tty3 /fs/dev/ +cp -a /dev/tty4 /fs/dev/ +cp -a /dev/null /fs/dev/ +cp -a /dev/zero /fs/dev/ +mknod /fs/dev/ubdb b 98 16 +mknod /fs/dev/ubdc b 98 32 +mknod /fs/dev/ubdd b 98 48 +chmod 711 /fs/dev/ubdb +chmod 600 /fs/dev/ubdc +chmod 700 /fs/dev/ubdd + +(cd /fs && tar xf /dev/ubdd) || exit "$?" # creates /fs/busybox.mini and /fs/minihalt +mv /fs/busybox.mini /fs/bin/busybox +mv /fs/minihalt /fs/sbin/minihalt +ln -s minihalt /fs/sbin/halt +ln -s ../bin/busybox /fs/bin/[ +ln -s ../bin/busybox /fs/bin/[[ +ln -s ../bin/busybox /fs/bin/ash +ln -s ../bin/busybox /fs/bin/awk +ln -s ../bin/busybox /fs/bin/cat +ln -s ../bin/busybox /fs/bin/chgrp +ln -s ../bin/busybox /fs/bin/chmod +ln -s ../bin/busybox /fs/bin/chown +ln -s ../bin/busybox /fs/bin/cmp +ln -s ../bin/busybox /fs/bin/cp +ln -s ../bin/busybox /fs/bin/dd +ln -s ../bin/busybox /fs/bin/echo +ln -s ../bin/busybox /fs/bin/egrep +ln -s ../bin/busybox /fs/bin/expr +ln -s ../bin/busybox /fs/bin/false +ln -s ../bin/busybox /fs/bin/fgrep +ln -s ../bin/busybox /fs/bin/grep +ln -s ../bin/busybox /fs/bin/install +ln -s ../bin/busybox /fs/bin/ls +ln -s ../bin/busybox /fs/bin/ln +ln -s ../bin/busybox /fs/bin/mkdir +ln -s ../bin/busybox /fs/bin/mkfifo +ln -s ../bin/busybox /fs/bin/mknod +ln -s ../bin/busybox /fs/bin/mv +ln -s ../bin/busybox /fs/bin/pwd +ln -s ../bin/busybox /fs/bin/readlink +ln -s ../bin/busybox /fs/bin/realpath +ln -s ../bin/busybox /fs/bin/rm +ln -s ../bin/busybox /fs/bin/rmdir +ln -s ../bin/busybox /fs/bin/sh +ln -s ../bin/busybox /fs/bin/sync +ln -s ../bin/busybox /fs/bin/tar +ln -s ../bin/busybox /fs/bin/test +ln -s ../bin/busybox /fs/bin/true +ln -s ../bin/busybox /fs/bin/uncompress +ln -s ../bin/busybox /fs/bin/wc +ln -s ../bin/busybox /fs/bin/xargs +ln -s ../bin/busybox /fs/bin/yes + +: guest-creator script OK, halting. +/sbin/minihalt +ENDMKROOT + +./uevalrun.linux.uml con=null ssl=null con0=fd:-1,fd:1 mem=10M \ + ubda=uevalrun.rootfs.mini.minix.img \ + ubdb=uevalrun.rootfs.newmini.minix.img \ + ubdc=mkrootmini.tmp.sh ubdd=mkrootmini.tmp.tar init=/sbin/minihalt \ + +#include +#include +#include +#include +#include + +#define ERRMSG(msg) write(2, msg, sizeof msg - 1) + +int main(int argc, char **argv, char **environ) { + (void)argc; (void)argv; + if (getpid() == 1) { + char *args[] = { "/bin/sh", "/dev/ubdc", NULL }; + int fd; + if (0 != mount("dummy", "/proc", "proc", MS_MGC_VAL, NULL)) { + ERRMSG("minihalt: failed: mount dummy /proc -t proc\n"); + return 2; + } + if (0 != mount("/dev/ubdb", "/fs", "minix", MS_MGC_VAL, NULL)) { + ERRMSG("minihalt: failed: mount /dev/ubdb /fs -t minix\n"); + return 2; + } + if (0 <= (fd = open(args[1], O_RDONLY))) { + close(fd); + } else { + args[1] = NULL; /* just /bin/sh */ + } + return execve(args[0], args, environ); + } + /* EINVAL is returned if /fs is not mounted */ + if (0 != umount("/fs") && errno != EINVAL) { + ERRMSG("minihalt: failed: umount /fs\n"); + return 2; + } + /* Make sure that con0 (/dev/tty0) is flushed to the UML host. */ + tcdrain(1); + sync(); + return reboot(RB_HALT_SYSTEM); +} diff --git a/deps/uevalrun/.svn/text-base/repeat.c.svn-base b/deps/uevalrun/.svn/text-base/repeat.c.svn-base new file mode 100644 index 0000000..7f0ae42 --- /dev/null +++ b/deps/uevalrun/.svn/text-base/repeat.c.svn-base @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) { + pid_t child; + int status, count; + (void)argc; + if (argv[1] == NULL || 1 != sscanf(argv[1], "%i", &count) || + argv[2] == NULL) { + fprintf(stderr, "Usage: %s [ ...]\n", argv[0]); + return 1; + } + while (count != 0) { + if (0 > (child = fork())) { + fprintf(stderr, "error: fork failed: %s\n", strerror(errno)); + return 2; + } + if (child == 0) { + execve(argv[2], argv + 2, NULL); + fprintf(stderr, "error: child: %s: %s\n", argv[2], strerror(errno)); + return 125; + } + while (child != waitpid(child, &status, 0)) {} + if (status != 0) { + fprintf(stderr, "error: child failed with status=0x%x\n", status); + return 3; + } + if (count > 0) + --count; + } + return 0; +} diff --git a/deps/uevalrun/.svn/text-base/ruby-1.8-Makefile.svn-base b/deps/uevalrun/.svn/text-base/ruby-1.8-Makefile.svn-base new file mode 100644 index 0000000..be23e93 --- /dev/null +++ b/deps/uevalrun/.svn/text-base/ruby-1.8-Makefile.svn-base @@ -0,0 +1,56 @@ +/* by pts@fazekas.hu at Thu Nov 25 14:15:38 CET 2010 */ + +#define _(x) x + +extern void rb_provide(const char *feature); + +void Init_bigdecimal _((void)); +void Init_curses _((void)); +void Init_digest _((void)); +void Init_etc _((void)); +void Init_fcntl _((void)); +void Init_nkf _((void)); +void Init_pty _((void)); +void Init_readline _((void)); +void Init_sdbm _((void)); +void Init_socket _((void)); +void Init_stringio _((void)); +void Init_strscan _((void)); +void Init_syck _((void)); +void Init_syslog _((void)); +void Init_zlib _((void)); + +void +Init_ext() +{ + Init_bigdecimal(); + rb_provide("bigdecimal.so"); + Init_curses(); + rb_provide("curses.so"); + Init_digest(); + rb_provide("digest.so"); + Init_etc(); + rb_provide("etc.so"); + Init_fcntl(); + rb_provide("fcntl.so"); + Init_nkf(); + rb_provide("nkf.so"); + Init_pty(); + rb_provide("pty.so"); + Init_readline(); + rb_provide("readline.so"); + Init_sdbm(); + rb_provide("sdbm.so"); + Init_socket(); + rb_provide("socket.so"); + Init_stringio(); + rb_provide("stringio.so"); + Init_strscan(); + rb_provide("strscan.so"); + Init_syck(); + rb_provide("syck.so"); + Init_syslog(); + rb_provide("syslog.so"); + Init_zlib(); + rb_provide("zlib.so"); +} diff --git a/deps/uevalrun/.svn/text-base/ruby-1.8-configure.svn-base b/deps/uevalrun/.svn/text-base/ruby-1.8-configure.svn-base new file mode 100644 index 0000000..690ea65 --- /dev/null +++ b/deps/uevalrun/.svn/text-base/ruby-1.8-configure.svn-base @@ -0,0 +1,2 @@ +wget ftp://ftp.ruby-lang.org//pub/ruby/1.8/ruby-1.8.7-p302.tar.gz +./configure --disable-largefile --disable-fastthread --disable-rpath --disable-shared --enable-frame-address diff --git a/deps/uevalrun/.svn/text-base/ruby-1.8-dmyext.c.svn-base b/deps/uevalrun/.svn/text-base/ruby-1.8-dmyext.c.svn-base new file mode 100644 index 0000000..be23e93 --- /dev/null +++ b/deps/uevalrun/.svn/text-base/ruby-1.8-dmyext.c.svn-base @@ -0,0 +1,56 @@ +/* by pts@fazekas.hu at Thu Nov 25 14:15:38 CET 2010 */ + +#define _(x) x + +extern void rb_provide(const char *feature); + +void Init_bigdecimal _((void)); +void Init_curses _((void)); +void Init_digest _((void)); +void Init_etc _((void)); +void Init_fcntl _((void)); +void Init_nkf _((void)); +void Init_pty _((void)); +void Init_readline _((void)); +void Init_sdbm _((void)); +void Init_socket _((void)); +void Init_stringio _((void)); +void Init_strscan _((void)); +void Init_syck _((void)); +void Init_syslog _((void)); +void Init_zlib _((void)); + +void +Init_ext() +{ + Init_bigdecimal(); + rb_provide("bigdecimal.so"); + Init_curses(); + rb_provide("curses.so"); + Init_digest(); + rb_provide("digest.so"); + Init_etc(); + rb_provide("etc.so"); + Init_fcntl(); + rb_provide("fcntl.so"); + Init_nkf(); + rb_provide("nkf.so"); + Init_pty(); + rb_provide("pty.so"); + Init_readline(); + rb_provide("readline.so"); + Init_sdbm(); + rb_provide("sdbm.so"); + Init_socket(); + rb_provide("socket.so"); + Init_stringio(); + rb_provide("stringio.so"); + Init_strscan(); + rb_provide("strscan.so"); + Init_syck(); + rb_provide("syck.so"); + Init_syslog(); + rb_provide("syslog.so"); + Init_zlib(); + rb_provide("zlib.so"); +} diff --git a/deps/uevalrun/.svn/text-base/uevalrun.c.svn-base b/deps/uevalrun/.svn/text-base/uevalrun.c.svn-base new file mode 100644 index 0000000..fc53d4b --- /dev/null +++ b/deps/uevalrun/.svn/text-base/uevalrun.c.svn-base @@ -0,0 +1,1033 @@ +/* + * uevalrun.c: Entry point executable for running solutions sandboxed. + * + * by pts@fazekas.hu at Sun Nov 21 20:00:22 CET 2010 + * --- Mon Nov 22 01:44:59 CET 2010 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * TODO(pts): What error message do we report if the solution wants to + * write a very long wrong answer? + * TODO(pts): make error messages more useful if the compilation fails + * TODO(pts): Is there a 64MB limit (or just df?) for minix filesystems? + * TODO(pts): move auxilary files like *-config to another dir + * TODO(pts): Benchmark UML speed by running g++ hello.cc and g++ all.cc + * inside and outside UML (6x slower) + * TODO(pts): Benchmark CPU-intensive calculations inside and outside UML. + * (1x slower). + * * overhead: + * Intel(R) Core(TM)2 Duo CPU T6600 @ 2.20GHz, 4GB RAM. + * Just the UML kernel with a hello-world C binary: 50.0625 per second. + * Answer verification (uevalrun) for hello-world C binary: 43.3163 per second. + * * we have to set: CONFIG_HIGH_RES_TIMERS=y + * to avoid this kernel syslog message: Switched to NOHz mode on CPU #0 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ELF_SHF_ALLOC (1 << 1) + +enum { + ST_MIDLINE = 1, + ST_BOL = 2, +}; + +#define PTS_ISDIGIT(c) ((c) - '0' + 0U <= 9U) + +static void out_of_memory() { + printf("@ error: out of memory\n"); + exit(2); +} + +static char *xstrcat(char const *s1, char const *s2) { + size_t ss1 = strlen(s1); + char *t = malloc(ss1 + strlen(s2) + 1); + if (t == NULL) + out_of_memory(); + memcpy(t, s1, ss1); + strcpy(t + ss1, s2); + return t; +} + +static char *xstrcat3(char const *s1, char const *s2, char const *s3) { + size_t ss1 = strlen(s1); + size_t ss2 = strlen(s2); + char *t = malloc(ss1 + ss2 + strlen(s3) + 1); + if (t == NULL) + out_of_memory(); + memcpy(t, s1, ss1); + memcpy(t + ss1, s2, ss2); + strcpy(t + ss1 + ss2, s3); + return t; +} + +static char *xslice(const char *s, size_t slen) { + char *t = malloc(slen + 1); + if (t == NULL) + out_of_memory(); + memcpy(t, s, slen); + t[slen] = '\0'; + return t; +} + +/* Example command: "python", "php", "perl", "ruby", "ruby1.8", "ruby1.9", + * "lua". + * + * The command "lua" matches "luajit" etc. + */ +static char shebang_has_command(const char *shebang, const char *command) { + const char *p = shebang; + int command_size = strlen(command); + while (1) { + while (*p != ' ' && *p !='\t' && *p != '/' && *p != '\0' && *p != '\n') + ++p; + if (*p == '\0' || *p == '\n') + return 0; + ++p; + if (0 == strncmp(p, command, command_size)) + return 1; + } +} + +static void usage(const char* argv0) { + printf("@ info: usage: %s -M -T " + "-E -s " + "[-C -N -U " + "-o ] " + "[-t -e ]\n", argv0); +} + +/* --- Read buffering */ + +/** Characters read from the stdout of the UML process */ +static char rbuf[8192]; +static int rbuf_fd; +static char *rbuf_p, *rbuf_end; +fd_set rbuf_rset; + +static void rbuf_init(int fd) { + long flags; + flags = fcntl(fd, F_GETFL); + if (flags < 0) { + printf("@ error: fcntl F_GETFL: %s\n", strerror(errno)); + exit(2); + } + if (0 != fcntl(fd, F_SETFL, flags | O_NONBLOCK)) { + printf("@ error: fcntl F_SETFL: %s\n", strerror(errno)); + exit(2); + } + rbuf_fd = fd; + rbuf_p = rbuf_end = rbuf; + FD_ZERO(&rbuf_rset); +} + +/** @return -1 on EOF */ +static int rbuf_getc_heavy() { + int got; + if (rbuf_p == NULL) + return -1; /* EOF */ + if (rbuf_p != rbuf_end) + return *(unsigned char*)rbuf_p++; + while (1) { + got = read(rbuf_fd, rbuf, sizeof rbuf); + if (got > 0) { + rbuf_p = rbuf; + rbuf_end = rbuf + got; + return *(unsigned char*)rbuf_p++; + } else if (got == 0) { + rbuf_p = rbuf_end = NULL; + return -1; /* EOF */ + } else if (errno == EAGAIN) { + /* This fflush(stdout) is the only reason why we are doing input + * buffering manually instead of using a FILE*. + */ + fflush(stdout); + FD_SET(rbuf_fd, &rbuf_rset); + got = select(rbuf_fd + 1, &rbuf_rset, NULL, NULL, NULL); + if (got < 0 && got != EINTR) { + printf("\n error: error selecting for solution output pipe: %s\n", + strerror(errno)); + exit(2); + } + } else if (errno != EINTR) { + printf("\n@ error: error reading from solution output pipe: %s\n", + strerror(errno)); + exit(2); + } + } +} + +static inline int rbuf_getc() { + if (rbuf_p != rbuf_end) + return *(unsigned char*)rbuf_p++; + return rbuf_getc_heavy(); +} + +/* --- */ + +#define IS_LCALPHA(c) ((c) - 'a' + 0U <= 'z' - 'a' + 0U) +#define IS_WSPACE(c) ( \ + (c) == ' ' || (c) == '\r' || (c) == '\n' || (c) == '\t' || (c) == '\0' || \ + (c) == '\f' || (c) == '\v') + +/* This must return false for C code (which doesn't use C++ features). */ +static char is_cplusplus_header(const char *hdr, int hdr_size) { + /* TODO(pts): Do a more sophisticated matching, find `namespace', `using', + * #include without a .h etc */ + while (hdr_size > 0 && IS_WSPACE(hdr[0])) { + --hdr_size; + ++hdr; + } + /* TODO(pts): Support `# include' */ + return hdr_size >= 2 && hdr[0] == '/' && hdr[1] == '/'; +} + +static char is_c_header(const char *hdr, int hdr_size) { + /* TODO(pts): Do a more sophisticated matching. */ + while (hdr_size > 0 && IS_WSPACE(hdr[0])) { + --hdr_size; + ++hdr; + } + /* TODO(pts): Support `# include' */ + return (hdr_size >= 2 && hdr[0] == '/' && hdr[1] == '*') || + (hdr_size >= 2 && hdr[0] == '#' && IS_LCALPHA(hdr[1])); +} + +typedef struct { + /* TODO(pts): Disallow too small values for the limit options. */ + int mem_mb; /* -M */ + int timeout; /* -T */ + int excess_answer_limit_kb; /* -E */ + /* Total maximum file size (+ minix filesystem overhead) of the source + * file, the assembly output file (.s) and the binary (executable) file + * produced by the compiler. + */ + int compiler_disk_mb; /* -C */ + int compiler_mem_mb; /* -N */ + int compiler_timeout; /* -U */ + char *solution_binary; /* -s */ + char *test_input; /* -t */ + char *binary_output; /* -o */ + char *expected_output; /* -e */ + + char *prog_dir; + char *argv0; + char *gcxtmp_path; + char is_binary_output_tmp; +} flags_s; + +static int parse_cmdline(int argc, char** argv, flags_s *flags) { + int opt, i; + + flags->mem_mb = -1; + flags->compiler_mem_mb = -1; + flags->timeout = -1; + flags->compiler_timeout = -1; + flags->excess_answer_limit_kb = -1; + flags->compiler_disk_mb = -1; + flags->solution_binary = NULL; + flags->test_input = NULL; + flags->binary_output = NULL; + flags->expected_output = NULL; + flags->prog_dir = NULL; + flags->argv0 = argv[0]; + flags->is_binary_output_tmp = 0; + flags->gcxtmp_path = NULL; + + if (argv[1] == NULL) { + usage(argv[0]); + return 1; + } + if (0 == strcmp(argv[1], "--help")) { + usage(argv[0]); + return 0; + } + + while ((opt = getopt(argc, argv, "M:N:T:U:E:C:s:t:e:h:o:")) != -1) { + if (opt == 'M') { + if (1 != sscanf(optarg, "%i", &flags->mem_mb)) { + printf("@ error: bad -M syntax\n"); + return 1; + } + } else if (opt == 'N') { + if (1 != sscanf(optarg, "%i", &flags->compiler_mem_mb)) { + printf("@ error: bad -N syntax\n"); + return 1; + } + } else if (opt == 'T') { + if (1 != sscanf(optarg, "%i", &flags->timeout)) { + printf("@ error: bad -T syntax\n"); + return 1; + } + } else if (opt == 'U') { + if (1 != sscanf(optarg, "%i", &flags->compiler_timeout)) { + printf("@ error: bad -U syntax\n"); + return 1; + } + } else if (opt == 'E') { + if (1 != sscanf(optarg, "%i", &flags->excess_answer_limit_kb)) { + printf("@ error: bad -E syntax\n"); + return 1; + } + } else if (opt == 'C') { + if (1 != sscanf(optarg, "%i", &flags->compiler_disk_mb)) { + printf("@ error: bad -C syntax\n"); + return 1; + } + } else if (opt == 's') { + if (optarg[0] == '\0') { + printf("@ error: bad -s syntax\n"); + return 1; + } + flags->solution_binary = optarg; + } else if (opt == 't') { + if (optarg[0] == '\0') { + printf("@ error: bad -t syntax\n"); + return 1; + } + flags->test_input = optarg; + } else if (opt == 'o') { + if (optarg[0] == '\0') { + printf("@ error: bad -o syntax\n"); + return 1; + } + flags->binary_output = optarg; + } else if (opt == 'e') { + if (optarg[0] == '\0') { + printf("@ error: bad -t syntax\n"); + return 1; + } + flags->expected_output = optarg; + } else { + printf("@ error: unknown command-line flag\n"); + usage(argv[0]); + return 1; + } + } + if (optind < argc) { + printf("@ error: too many command-line arguments\n"); + usage(argv[0]); + return 1; + } + if (flags->mem_mb >= 0 || + flags->timeout >= 0 || + flags->excess_answer_limit_kb >= 0) { + if (flags->mem_mb < 0) { + printf("@ error: missing -M\n"); + usage(argv[0]); + return 1; + } + if (flags->timeout < 0) { + printf("@ error: missing -T\n"); + usage(argv[0]); + return 1; + } + if (flags->excess_answer_limit_kb < 0) { + printf("@ error: missing -E\n"); + usage(argv[0]); + return 1; + } + if (flags->mem_mb == 0 || flags->mem_mb > 2000) { + /* 4096MB is the absolute hard limit, since our UML is a 32-bit binary. */ + printf("@ error: expected 1 <= mem_mb <= 2000, got %d\n", flags->mem_mb); + return 1; + } + if (flags->timeout == 0) { + printf("@ error: expected 1 <= timeout, got %d\n", flags->timeout); + return 1; + } + } + if (flags->compiler_mem_mb >= 0 || + flags->compiler_timeout >= 0 || + flags->compiler_disk_mb >= 0) { + if (flags->compiler_mem_mb < 0) { + printf("@ error: missing -N\n"); + usage(argv[0]); + return 1; + } + if (flags->compiler_timeout < 0) { + printf("@ error: missing -U\n"); + usage(argv[0]); + return 1; + } + if (flags->compiler_disk_mb < 0) { + printf("@ error: missing -C\n"); + usage(argv[0]); + return 1; + } + if (flags->compiler_mem_mb == 0 || flags->compiler_mem_mb > 2000) { + /* 4096MB is the absolute hard limit, since our UML is a 32-bit binary. */ + printf("@ error: expected 1 <= compiler_mem_mb <= 2000, got %d\n", flags->compiler_mem_mb); + return 2; + } + if (flags->compiler_timeout == 0) { + printf("@ error: expected 1 <= compiler_timeout, got %d\n", flags->compiler_timeout); + return 1; + } + if (flags->compiler_disk_mb == 0) { + printf("@ error: expected 1 <= compiler_disk_mb, got %d\n", + flags->compiler_disk_mb); + return 1; + } + } + if (flags->solution_binary == NULL) { + printf("@ error: missing -s\n"); + usage(argv[0]); + return 1; + } + + i = strlen(argv[0]); + while (i > 0 && argv[0][i - 1] != '/') + --i; + if (i > 0) { /* prog_dir = "" means "/" */ + flags->prog_dir = xslice(argv[0], i - 1); + } else { + flags->prog_dir = "."; + } + + return 0; +} + +static int work(flags_s *flags) { + char hdr[128]; /* Should be at least 52, for reading ELF */ + int hdr_size; + char mismatch_msg[128]; + char state; + int pfd[2]; + int status; + pid_t child; + FILE *f, *fexp, *fout; + int i, j, n, line, col; + char is_gcx; + char is_rootfs_missing; + int answer_remaining; + char *args[16]; + char *envs[] = {NULL}; + char mem_used; + char memarg[16]; + char *uml_linux_path; + char *uml_rootfs_path; + char *guestinit_path; + char *solution_format; + + if (NULL == (f = fopen(flags->solution_binary, "r"))) { + printf("@ error: open solution binary: %s: %s\n", flags->solution_binary, + strerror(errno)); + return 2; + } + memset(hdr, '\0', sizeof hdr); + if (0 > (hdr_size = fread(hdr, 1, sizeof hdr - 1, f))) { + printf("@ error: cannot read from solution binary: %s: %s\n", + flags->solution_binary, strerror(errno)); + return 2; + } + hdr[hdr_size] = '\0'; + is_gcx = 0; + if (hdr_size >= 4 && 0 == memcmp(hdr, "\177ELF", 4)) { + unsigned char *u; + unsigned long sh_ofs; /* Section header table offset */ + unsigned long uflags; + unsigned long long total_memsize; + int sh_entsize; /* Section header table entry size */ + int sh_num; /* Section header table entry count */ + if (flags->mem_mb < 0) { + printf("@ error: missing -M\n"); + usage(flags->argv0); + } + if (hdr_size < 52) { + printf("@ error: solution binary too small, cannot be ELF: %s\n", + flags->solution_binary); + /* TODO(pts): fclose(f); fclose(fexp); everywhere */ + return 2; + } + if (hdr[4] != 1) { + printf("@ error: solution binary not for 32-bit architecture: %s\n", + flags->solution_binary); + return 2; + } + if (hdr[5] != 1) { + printf("@ error: solution binary not for LSB architecture: %s\n", + flags->solution_binary); + return 2; + } + if (hdr[16] != 2 || hdr[17] != 0) { + printf("@ error: solution binary not an executable: %s\n", + flags->solution_binary); + return 2; + } + if (hdr[18] != 3 || hdr[19] != 0) { + printf("@ error: solution binary not for x86 architecture: %s\n", + flags->solution_binary); + return 2; + } + if (hdr[20] != 1) { + printf("@ error: solution binary not version 1: %s\n", + flags->solution_binary); + return 2; + } + if ((hdr[7] != 0 && hdr[7] != 3) || hdr[8] != 0) { + printf("@ error: solution binary not for Linux: %s\n", + flags->solution_binary); + return 2; + } + u = (unsigned char*)hdr + 32; + sh_ofs = u[0] | (u[1] << 8) | (u[2] << 16) | (u[3] << 24); + u = (unsigned char*)hdr + 46; + sh_entsize = u[0] | (u[1] << 8); + sh_num = u[2] | (u[3] << 8); + printf("@ info: sh_ofs=%lu sh_entsize=%d sh_num=%d\n", + sh_ofs, sh_entsize, sh_num); + if (sh_entsize + 0U > sizeof(hdr)) { + printf("@ error: solution binary sh_entsize too large: %s: %d\n", + flags->solution_binary, sh_entsize); + return 2; + } + if (sh_num < 1) { + printf("@ error: solution binary sh_num too small: %s: %d\n", + flags->solution_binary, sh_num); + return 2; + } + if (0 != fseek(f, sh_ofs, SEEK_SET)) { + printf("@ error: cannot seek to sh_ofs: %s: %lu: %s\n", + flags->solution_binary, sh_ofs, strerror(errno)); + return 2; + } + total_memsize = 0; + for (i = 0; i < sh_num; ++i) { + if (sh_entsize + 0U != fread(hdr, 1, sh_entsize, f)) { + printf("@ error: cannot read section header in solution binary: " + "%s: %d/%d: %s\n", + flags->solution_binary, i, sh_num, strerror(errno)); + return 2; + } + u = (unsigned char*)hdr + 8; + uflags = u[0] | (u[1] << 8) | (u[2] << 16) | (u[3] << 24); + if ((uflags & ELF_SHF_ALLOC) != 0) { + u = (unsigned char*)hdr + 20; + total_memsize += u[0] | (u[1] << 8) | (u[2] << 16) | (u[3] << 24); + } + } + if ((total_memsize >> 31) != 0) { + printf("@ result: memory exceeded, needs way too static memory\n"); + return 3; + } + if (((total_memsize + ((1 << 20) - 1)) >> 20) >= flags->mem_mb + 0U) { + printf("@ result: memory exceeded, needs too much static memory: %ldMB\n", + (long)((total_memsize + ((1 << 20) - 1)) >> 20)); + return 3; + } + printf("@ info: total_memsize=%ldM\n", + (long)((total_memsize + ((1 << 20) - 1)) >> 20)); + solution_format = "elf"; + } else if (hdr[0] == '#' && hdr[1] == '!') { + if (shebang_has_command(hdr, "python")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "python"; + } else if (shebang_has_command(hdr, "ruby1.8")) { /* Before "ruby". */ + /* Having \0 characters at the end of the file is OK */ + solution_format = "ruby1.8"; + } else if (shebang_has_command(hdr, "ruby1.9")) { /* Before "ruby". */ + /* Having \0 characters at the end of the file is OK */ + solution_format = "ruby1.9"; + } else if (shebang_has_command(hdr, "ruby")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "ruby"; + } else if (shebang_has_command(hdr, "php")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "php"; + } else if (shebang_has_command(hdr, "perl")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "perl"; + } else if (shebang_has_command(hdr, "lua")) { /* Also matches "luajit". */ + /* Having \0 characters at the end of the file is OK */ + solution_format = "lua"; + } else if (shebang_has_command(hdr, "js")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "javascript"; + } else if (shebang_has_command(hdr, "smjs")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "javascript"; + } else { + printf("@ result: file format error: unknown shebang\n"); + return 2; + } + } else if (hdr_size > 5 && 0 == memcmp(hdr, "expected_output != NULL || + flags->test_input != NULL || + !is_gcx) { + if (flags->test_input == NULL) { + printf("@ error: missing -t\n"); + usage(flags->argv0); + return 1; + } + if (flags->expected_output == NULL) { + printf("@ error: missing -e\n"); + usage(flags->argv0); + return 1; + } + } + + if (is_gcx) { + if (flags->compiler_mem_mb == -1) { + /* TODO(pts): Better error reporting if this is reached int the 2nd + * phase, after compilation. + */ + printf("@ error: missing -U\n"); + usage(flags->argv0); + return 1; + } + if (flags->binary_output == NULL) { + sprintf(mismatch_msg, "%d", (int)getpid()); + flags->is_binary_output_tmp = 1; + /* TODO(pts): Clean up even on signal exit. */ + flags->binary_output = xstrcat3( + flags->prog_dir, "/uevalrun.tmp.bin.", mismatch_msg); + } + } else { + if (flags->binary_output != NULL) { + printf("@ error: unexpected -o\n"); + usage(flags->argv0); + return 1; + } + } + + if (flags->binary_output == NULL) { + fout = NULL; + } else if (NULL == (fout = fopen(flags->binary_output, "w"))) { + printf("@ error: open binary output: %s: %s\n", flags->expected_output, + strerror(errno)); + return 2; + } + + if (is_gcx || flags->expected_output == NULL) { + fexp = NULL; + } else if (NULL == (fexp = fopen(flags->expected_output, "r"))) { + printf("@ error: open expected output: %s: %s\n", flags->expected_output, + strerror(errno)); + return 2; + } + + if (is_gcx) { + int fd; + if (flags->compiler_disk_mb == -1) { + printf("@ error: missing -C\n"); + usage(flags->argv0); + return 1; + } + sprintf(mismatch_msg, "%d", (int)getpid()); + flags->gcxtmp_path = xstrcat3( + flags->prog_dir, "/uevalrun.tmp.gccimg.", mismatch_msg); + if (0 > (fd = open(flags->gcxtmp_path, O_WRONLY | O_CREAT, 0644))) { + printf("@ error: cannot create gcxtmp: %s: %s\n", + flags->gcxtmp_path, strerror(errno)); + return 2; + } + if (0 != ftruncate(fd, (off_t)flags->compiler_disk_mb << 20)) { + printf("@ error: cannot set size of gcxtmp: %s: %s\n", + flags->gcxtmp_path, strerror(errno)); + return 2; + } + /* No need to clear previous contents, the user won't be able + * to read within the UML guest. + */ + close(fd); + /* TODO(pts): Security: remove this temporary image file when uevalrun + * exits, so others won't be able to find it in the future. + */ + } + + /* We don't care about free()ig the strings created by xstrcat etc., + * because they are small, and we don't allocate much. + * TODO(pts): Revisit or validate this policy. + */ + guestinit_path = xstrcat(flags->prog_dir, "/uevalrun.guestinit"); + if (NULL == (f = fopen(guestinit_path, "r"))) { + printf("@ error: guestinit not found: %s: %s\n", + guestinit_path, strerror(errno)); + return 2; + } + fclose(f); + + uml_linux_path = xstrcat(flags->prog_dir, "/uevalrun.linux.uml"); + if (NULL == (f = fopen(uml_linux_path, "r"))) { + printf("@ error: uml_linux not found: %s: %s\n", + uml_linux_path, strerror(errno)); + return 2; + } + fclose(f); + + is_rootfs_missing = 0; + uml_rootfs_path = xstrcat(flags->prog_dir, "/uevalrun.rootfs.minix.img"); + if (NULL == (f = fopen(uml_rootfs_path, "r"))) { + printf("@ error: uml rootfs not found: %s: %s\n", + uml_rootfs_path, strerror(errno)); + printf("@ advice: run this first: (cd '%s' && ./make rootfs)\n", + flags->prog_dir); + is_rootfs_missing = 1; + } + + if (is_gcx) { + if (f != NULL) + fclose(f); + uml_rootfs_path = xstrcat(flags->prog_dir, "/uevalrun.rootfs.gcx.minix.img"); + if (NULL == (f = fopen(uml_rootfs_path, "r"))) { + printf("@ error: uml_rootfs not found: %s: %s\n", + uml_rootfs_path, strerror(errno)); + if (is_rootfs_missing) { + printf("@ advice: run this first: (cd '%s' && " + "./make rootfs rootfs_gcx)\n", flags->prog_dir); + } else { + printf("@ advice: run this first: (cd '%s' && ./make rootfs_gcx)\n", + flags->prog_dir); + } + return 2; + } + } else if (is_rootfs_missing) { + return 2; + } + fclose(f); + + /* 6MB is needed by the UML kernel and its buffers. It wouldn't work with + * 5MB (probed). + */ + mem_used = (is_gcx ? flags->compiler_mem_mb : flags->mem_mb) + 6; + /* UML is unreliable with mem=9M, it crashes soon after printing + * ``UML running in SKAS0 mode'' + * TODO(pts): Report this bug, find the root cause. + */ + if (mem_used < 10) + mem_used = 10; + sprintf(memarg, "mem=%dM", mem_used); + + i = 0; + args[i++] = uml_linux_path; + args[i++] = "con=null"; + args[i++] = "ssl=null"; + args[i++] = "con0=fd:-1,fd:1"; + args[i++] = memarg; + /* `r' means read-only, see 'r' in ubd_kern.c. We specify it so multiple + * processes can concurrently open it. + */ + args[i++] = xstrcat("ubdar=", uml_rootfs_path); + args[i++] = xstrcat("ubdbr=", flags->solution_binary); + /* TODO(pts): Verify that flags->test_input etc. don't contain comma, space or + * something UML would interpret. + */ + if (flags->test_input != NULL) + args[i++] = xstrcat("ubdcr=", flags->test_input); + args[i++] = xstrcat("ubddr=", guestinit_path); + if (is_gcx) + args[i++] = xstrcat("ubde=", flags->gcxtmp_path); + args[i++] = xstrcat("solution_format=", solution_format); + args[i++] = "init=/dev/ubdd"; + args[i] = NULL; + + if (0 != pipe(pfd)) { + printf("@ error: pipe: %s\n", strerror(errno)); + return 2; + } + + child = fork(); + if (child < 0) { + printf("@ error: fork: %s\n", strerror(errno)); + return 2; + } + if (child == 0) { /* Child */ + int fd; + struct rlimit rl; + int timeout_used = is_gcx ? flags->compiler_timeout : flags->timeout; + close(0); + close(pfd[0]); + if (fexp != NULL) + close(fileno(fexp)); + if (fout != NULL) + close(fileno(fout)); + close(1); + close(2); /* TODO(pts): Report the errors nevertheless */ + if (0 <= (fd = open("/dev/tty", O_RDWR))) { + ioctl(fd, TIOCNOTTY, 0); + close(fd); + } + if ((pid_t)-1 == setsid()) /* Create a new process group (UML needs it). */ + exit(122); + fd = open("/dev/null", O_RDONLY); + if (fd != 0) { + dup2(fd, 0); + close(fd); + } + fd = open("/dev/null", O_WRONLY); + if (fd != 2) { + dup2(fd, 2); + close(fd); + } + if (pfd[1] != 1) { + if (1 != dup2(pfd[1], 1)) { + printf("@ error: child: dup2: %s\n", strerror(errno)); + exit(121); + } + close(pfd[1]); + } + alarm(timeout_used + 3 + timeout_used / 10); + /* UML needs more than 300 processes. This will be restricted to 0 + * just before the execve(...) to the temp binary. + */ + rl.rlim_cur = 400; + rl.rlim_max = 400; /* hard limit */ + setrlimit(RLIMIT_NPROC, &rl); + rl.rlim_cur = 0; + rl.rlim_max = 0; + setrlimit(RLIMIT_CORE, &rl); + rl.rlim_cur = timeout_used; + rl.rlim_max = timeout_used + 2; + /* This applies to all UML host subprocesses, but most of them don't + * consume much CPU time, so this global limit should be fine. + * + * We don't want to impose this limit in the guest, because its timer + * might not be accurate enough. + */ + setrlimit(RLIMIT_CPU, &rl); + execve(args[0], args, envs); + printf("@ error: child: execve: %s\n", strerror(errno)); + exit(121); + } + close(pfd[1]); + rbuf_init(pfd[0]); + + state = ST_MIDLINE; + mismatch_msg[0] = '\0'; + line = 1; + col = 1; + answer_remaining = -1; + /* TODO(pts): Limit the size of the answer */ + while (0 <= (i = rbuf_getc())) { + if (state == ST_MIDLINE) { + while (i != '\n') { + putchar(i); + if (0 > (i = rbuf_getc())) + goto at_eof; + } + state = ST_BOL; + } + if (state == ST_BOL) { + while (i == '\n') { + putchar(i); + if (0 > (i = rbuf_getc())) + goto at_eof; + } + state = ST_MIDLINE; + if (!PTS_ISDIGIT(i) || i == '0') { + at_badhead: + putchar(i); + state = i == '\n' ? ST_BOL : ST_MIDLINE; + continue; + } + putchar(i); + n = i - '0'; + while (1) { + if (0 > (i = rbuf_getc())) + goto at_eof; + if (!PTS_ISDIGIT(i)) + break; + if (n > 9999) + goto at_badhead; /* Buffer size too long (would be >= 100000) */ + putchar(i); + n = n * 10 + i - '0'; + } + if (i != '>') + goto at_badhead; + if (is_gcx) { + putchar('#'); /* Print '#' instead of '>' for compilation */ + } else { + putchar(i); + } + if (fexp == NULL) { + for (; n > 0; --n) { + if (0 > (i = rbuf_getc())) { + if (mismatch_msg[0] == '\0') + sprintf(mismatch_msg, "@ error: truncated binary\n"); + goto at_eof; + } + if (fout != NULL) + putc(i, fout); + if (i == '\n') { + state = ST_BOL; + ++line; + col = 1; + } else { + state = ST_MIDLINE; + ++col; + } + } + } else { + /* Now read n bytes as the output of the solution. */ + for (; n > 0; --n) { + if (0 > (i = rbuf_getc())) + goto at_eof; + if (mismatch_msg[0] == '\0') { + answer_remaining = flags->excess_answer_limit_kb << 10; + if (0 > (j = getc(fexp))) { + sprintf(mismatch_msg, "@ result: wrong answer, .exp is shorter at %d:%d\n", line, col); + } else if (i != j) { + sprintf(mismatch_msg, "@ result: wrong answer, first mismatch at %d:%d\n", line, col); + } + } + if (answer_remaining >= 0) { + if (answer_remaining-- == 0) { + /* TODO(pts): Limit the length> already emitted. */ + printf("\n@ info: excess answer limit exceeded\n"); + goto at_eof_nl; + } + } + putchar(i); + if (fout != NULL) + putc(i, fout); + if (i == '\n') { + state = ST_BOL; + ++line; + col = 1; + } else { + state = ST_MIDLINE; + ++col; + } + } + } + state = ST_BOL; + } + } + at_eof: + if (state == ST_MIDLINE) + putchar('\n'); + at_eof_nl: + if (fexp != NULL) { + if (mismatch_msg[0] == '\0' && !feof(fexp) && 0 <= (j = getc(fexp))) { + sprintf(mismatch_msg, + "@ result: wrong answer, .exp is longer at %d:%d\n", line, col); + } + if (ferror(fexp)) { + printf("@ error: error reading expected output file\n"); + return 2; + } + fclose(fexp); + } + if (fout != NULL) { + if (ferror(fout)) { + printf("@ error: error writing binary output file\n"); + return 2; + } + fclose(fout); + } + close(pfd[0]); /* rbuf_fd */ + if (child != waitpid(child, &status, WNOHANG)) { + fflush(stdout); + while (child != waitpid(child, &status, 0)) {} + } + + if (status != 0) { + if (mismatch_msg[0] == '\0') { + printf("@ FYI, output matches\n"); + } else { + memcpy(mismatch_msg, "@ FYI ", 8); + fputs(mismatch_msg, stdout); /* emit previous mismatch */ + } + if (WIFSIGNALED(status) && WTERMSIG(status) == SIGALRM) { + printf("@ result: time limit exceeded, wall time\n"); + } else if (status == 0x300) { + printf("@ result: time limit exceeded, user time\n"); + } else if (status == 0x200) { + printf("@ result: static memory limit exceeded\n"); + } else if (status == 0x100) { + /* Non-zero exit code or killed by signal. */ + if (is_gcx) { + printf("@ result: compile error\n"); + } else { + printf("@ result: runtime error\n"); + } + } else { + printf("@ result: framework error, status: 0x%x\n", status); + } + return 3; + } + if (mismatch_msg[0] != '\0') { + fputs(mismatch_msg, stdout); + return 3; + } + if (is_gcx) { + if (flags->expected_output != NULL) { + printf("@ info: compilation successful\n"); + fflush(stdout); + return -2; + } else { + printf("@ result: compilation successful\n"); + } + } else if (fexp == NULL) { + printf("@ result: success\n"); /* Should never happen, is_gcx is true */ + } else { + printf("@ result: pass\n"); /* Actual output matches expected output. */ + } + return 0; +} + +int main(int argc, char** argv) { + flags_s flags; + int ret; + + ret = parse_cmdline(argc, argv, &flags); + if (ret != 0) + return ret; + + /* Disable line buffering, to make writing the output faster. */ + setvbuf(stdout, NULL, _IOFBF, 8192); + + ret = work(&flags); + if (flags.gcxtmp_path != NULL) + unlink(flags.gcxtmp_path); + /* TODO(pts): Get rid of magic constants for ret. */ + if (ret == -2) { /* Run the binary after a successful compilation. */ + fflush(stdout); + flags.solution_binary = flags.binary_output; + flags.binary_output = NULL; + flags.compiler_mem_mb = -1; + flags.compiler_disk_mb = -1; + flags.compiler_timeout = -1; + ret = work(&flags); + if (flags.is_binary_output_tmp) + unlink(flags.solution_binary); + } else { + if (flags.is_binary_output_tmp) + unlink(flags.binary_output); + } + return ret; +} diff --git a/deps/uevalrun/.svn/text-base/uevalrun.linux.uml.svn-base b/deps/uevalrun/.svn/text-base/uevalrun.linux.uml.svn-base new file mode 100644 index 0000000..89da312 Binary files /dev/null and b/deps/uevalrun/.svn/text-base/uevalrun.linux.uml.svn-base differ diff --git a/deps/uevalrun/.svn/text-base/uevalrun.rootfs.mini.minix.img.svn-base b/deps/uevalrun/.svn/text-base/uevalrun.rootfs.mini.minix.img.svn-base new file mode 100644 index 0000000..1018b45 Binary files /dev/null and b/deps/uevalrun/.svn/text-base/uevalrun.rootfs.mini.minix.img.svn-base differ diff --git a/deps/uevalrun/Makefile b/deps/uevalrun/Makefile new file mode 100644 index 0000000..e0a7cc2 --- /dev/null +++ b/deps/uevalrun/Makefile @@ -0,0 +1,77 @@ +# +# Makefile for uevalrun +# by pts@fazekas.hu at Mon Nov 22 02:19:12 CET 2010 +# +# TODO(pts): Add `make mrproper' to clean up all temporary files and dirs. + +SHELL = ./busybox sh +export SHELL +PATH = /dev/null # Busybox doesn't need it. +export PATH + +# This must be a 32-bit compiler. +# TODO(pts): How to enforce 32-bit output for GCC? +CCBIN = cross-compiler/bin/i686-gcc +CFLAGS = -s -O2 -static -W -Wall +CC = $(CCBIN) + +# TODO(pts): Configure that some of these features are not needed. +ALL = uevalrun uevalrun.guestinit minihalt uevalrun.rootfs.minix.img uevalrun.rootfs.gcx.minix.img +AUX = repeat + +.PHONY: all clean run_sys run_mini_sys run_gcx_sys rootfs rootfs_gcx + +all: $(ALL) + +clean: + ./busybox rm -f $(ALL) $(AUX) + +# Cancel some implicit rules of GNU make. +%: %.c +%.o: %.c +%.o: %.s + +$(CCBIN): + ./busybox sh download.sh gcxbase.stbx86.tbz2 gcc.stbx86.tbz2 + ./busybox mkdir -p cross-compiler + cd cross-compiler && ../busybox tar xjf ../gcxbase.stbx86.tbz2 + cd cross-compiler && ../busybox tar xjf ../gcc.stbx86.tbz2 + test -x $(CCBIN) + +uevalrun: uevalrun.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +repeat: repeat.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +minihalt: minihalt.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +uevalrun.guestinit: guestinit.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +# Easier to manage the binary here (e.g. with cp precompiled/* .) +xcat: examples/xcat.c $(CCBIN) + $(CC) $(CFLAGS) -o $@ $< + +# TODO(pts): Maybe add dependency on ruby1.8 etc. later +rootfs uevalrun.rootfs.minix.img: ./busybox make_rootfs.sh + ./busybox sh ./make_rootfs.sh + +rootfs_gcx uevalrun.rootfs.gcx.minix.img: ./busybox make_rootfs_gcx.sh + ./busybox sh ./make_rootfs_gcx.sh + +run_sys: uevalrun.rootfs.minix.img + ./uevalrun.linux.uml con=null ssl=null con0=fd:0,fd:1 mem=30M ubda=uevalrun.rootfs.minix.img rw + +run_mini_sys: uevalrun.rootfs.mini.minix.img + ./uevalrun.linux.uml con=null ssl=null con0=fd:0,fd:1 mem=30M ubda=uevalrun.rootfs.mini.minix.img init=/bin/sh rw + +run_gcx_sys: uevalrun.rootfs.gcx.minix.img + ./busybox dd if=/dev/zero of=uevalrun.rootfs.gcxtmp.minix.img bs=2000K count=1 + ./busybox mkfs.minix -n 30 -i 20 uevalrun.rootfs.gcxtmp.minix.img + ./uevalrun.linux.uml con=null ssl=null con0=fd:0,fd:1 mem=60M ubda=uevalrun.rootfs.gcx.minix.img ubdb=uevalrun.rootfs.gcxtmp.minix.img init=/sbin/minihalt rw ubde=hello.c + +precompile: uevalrun uevalrun.guestinit minihalt xcat + ./busybox sh ./make_rootfs_mini.sh + ./busybox cp $^ precompiled/ diff --git a/deps/uevalrun/busybox b/deps/uevalrun/busybox new file mode 100755 index 0000000..dd9d191 Binary files /dev/null and b/deps/uevalrun/busybox differ diff --git a/deps/uevalrun/busybox-1.17.3-config b/deps/uevalrun/busybox-1.17.3-config new file mode 100644 index 0000000..c1aa1d2 --- /dev/null +++ b/deps/uevalrun/busybox-1.17.3-config @@ -0,0 +1,970 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.17.3 +# Tue Nov 23 23:43:09 2010 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_DESKTOP is not set +# CONFIG_EXTRA_COMPAT is not set +CONFIG_INCLUDE_SUSv2=y +# CONFIG_USE_PORTABLE_CODE is not set +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_SHOW_USAGE=y +CONFIG_FEATURE_VERBOSE_USAGE=y +# CONFIG_FEATURE_COMPRESS_USAGE is not set +CONFIG_FEATURE_INSTALLER=y +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_UNICODE_SUPPORT is not set +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +CONFIG_LONG_OPTS=y +CONFIG_FEATURE_DEVPTS=y +# CONFIG_FEATURE_CLEAN_UP is not set +CONFIG_FEATURE_UTMP=y +# CONFIG_FEATURE_WTMP is not set +CONFIG_FEATURE_PIDFILE=y +CONFIG_FEATURE_SUID=y +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_FEATURE_SYSLOG=y +CONFIG_FEATURE_HAVE_RPC=y + +# +# Build Options +# +CONFIG_STATIC=y +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_LFS=y +CONFIG_CROSS_COMPILER_PREFIX="/usr/src/cross-compiler-i686/bin/i686-" +CONFIG_EXTRA_CFLAGS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_WERROR is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Installation Options +# +# CONFIG_INSTALL_NO_USR is not set +# CONFIG_INSTALL_APPLET_SYMLINKS is not set +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +CONFIG_INSTALL_APPLET_DONT=y +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SIZE_VS_SPEED=2 +CONFIG_FEATURE_FAST_TOP=y +# CONFIG_FEATURE_ETC_NETWORKS is not set +CONFIG_FEATURE_EDITING=y +CONFIG_FEATURE_EDITING_MAX_LEN=4096 +# CONFIG_FEATURE_EDITING_VI is not set +CONFIG_FEATURE_EDITING_HISTORY=255 +CONFIG_FEATURE_EDITING_SAVEHISTORY=y +CONFIG_FEATURE_TAB_COMPLETION=y +# CONFIG_FEATURE_USERNAME_COMPLETION is not set +CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_FEATURE_COPYBUF_KB=4 +# CONFIG_MONOTONIC_SYSCALL is not set +CONFIG_IOCTL_HEX2STR_ERROR=y +# CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +CONFIG_FEATURE_SEAMLESS_XZ=y +CONFIG_FEATURE_SEAMLESS_LZMA=y +CONFIG_FEATURE_SEAMLESS_BZ2=y +CONFIG_FEATURE_SEAMLESS_GZ=y +# CONFIG_FEATURE_SEAMLESS_Z is not set +CONFIG_AR=y +CONFIG_FEATURE_AR_LONG_FILENAMES=y +CONFIG_FEATURE_AR_CREATE=y +CONFIG_BUNZIP2=y +CONFIG_BZIP2=y +CONFIG_CPIO=y +CONFIG_FEATURE_CPIO_O=y +CONFIG_FEATURE_CPIO_P=y +CONFIG_DPKG=y +CONFIG_DPKG_DEB=y +# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +CONFIG_GUNZIP=y +CONFIG_GZIP=y +CONFIG_FEATURE_GZIP_LONG_OPTIONS=y +CONFIG_LZOP=y +# CONFIG_LZOP_COMPR_HIGH is not set +CONFIG_RPM2CPIO=y +# CONFIG_RPM is not set +CONFIG_TAR=y +CONFIG_FEATURE_TAR_CREATE=y +CONFIG_FEATURE_TAR_AUTODETECT=y +CONFIG_FEATURE_TAR_FROM=y +CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y +CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +CONFIG_FEATURE_TAR_LONG_OPTIONS=y +CONFIG_FEATURE_TAR_TO_COMMAND=y +CONFIG_FEATURE_TAR_UNAME_GNAME=y +CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y +# CONFIG_FEATURE_TAR_SELINUX is not set +# CONFIG_UNCOMPRESS is not set +CONFIG_UNLZMA=y +# CONFIG_FEATURE_LZMA_FAST is not set +CONFIG_LZMA=y +CONFIG_UNXZ=y +CONFIG_XZ=y +CONFIG_UNZIP=y + +# +# Coreutils +# +CONFIG_BASENAME=y +CONFIG_CAT=y +CONFIG_DATE=y +CONFIG_FEATURE_DATE_ISOFMT=y +# CONFIG_FEATURE_DATE_NANO is not set +CONFIG_FEATURE_DATE_COMPAT=y +CONFIG_TEST=y +CONFIG_FEATURE_TEST_64=y +CONFIG_TR=y +CONFIG_FEATURE_TR_CLASSES=y +CONFIG_FEATURE_TR_EQUIV=y +CONFIG_CAL=y +CONFIG_CATV=y +CONFIG_CHGRP=y +CONFIG_CHMOD=y +CONFIG_CHOWN=y +CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y +CONFIG_CHROOT=y +CONFIG_CKSUM=y +CONFIG_COMM=y +CONFIG_CP=y +CONFIG_FEATURE_CP_LONG_OPTIONS=y +CONFIG_CUT=y +CONFIG_DD=y +CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y +CONFIG_FEATURE_DD_IBS_OBS=y +CONFIG_DF=y +CONFIG_FEATURE_DF_FANCY=y +CONFIG_DIRNAME=y +CONFIG_DOS2UNIX=y +CONFIG_UNIX2DOS=y +CONFIG_DU=y +CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_ENV=y +CONFIG_FEATURE_ENV_LONG_OPTIONS=y +CONFIG_EXPAND=y +CONFIG_FEATURE_EXPAND_LONG_OPTIONS=y +CONFIG_EXPR=y +CONFIG_EXPR_MATH_SUPPORT_64=y +CONFIG_FALSE=y +CONFIG_FOLD=y +CONFIG_FSYNC=y +CONFIG_HEAD=y +CONFIG_FEATURE_FANCY_HEAD=y +CONFIG_HOSTID=y +CONFIG_ID=y +CONFIG_INSTALL=y +CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y +CONFIG_LENGTH=y +CONFIG_LN=y +CONFIG_LOGNAME=y +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +CONFIG_FEATURE_LS_COLOR=y +CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y +CONFIG_MD5SUM=y +CONFIG_MKDIR=y +CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y +CONFIG_MKFIFO=y +CONFIG_MKNOD=y +CONFIG_MV=y +CONFIG_FEATURE_MV_LONG_OPTIONS=y +CONFIG_NICE=y +CONFIG_NOHUP=y +CONFIG_OD=y +CONFIG_PRINTENV=y +CONFIG_PRINTF=y +CONFIG_PWD=y +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +CONFIG_REALPATH=y +CONFIG_RM=y +CONFIG_RMDIR=y +CONFIG_FEATURE_RMDIR_LONG_OPTIONS=y +CONFIG_SEQ=y +CONFIG_SHA1SUM=y +CONFIG_SHA256SUM=y +CONFIG_SHA512SUM=y +CONFIG_SLEEP=y +CONFIG_FEATURE_FANCY_SLEEP=y +CONFIG_FEATURE_FLOAT_SLEEP=y +CONFIG_SORT=y +CONFIG_FEATURE_SORT_BIG=y +CONFIG_SPLIT=y +CONFIG_FEATURE_SPLIT_FANCY=y +CONFIG_STAT=y +CONFIG_FEATURE_STAT_FORMAT=y +CONFIG_STTY=y +CONFIG_SUM=y +CONFIG_SYNC=y +CONFIG_TAC=y +CONFIG_TAIL=y +CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_TEE=y +CONFIG_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_TOUCH=y +CONFIG_TRUE=y +CONFIG_TTY=y +CONFIG_UNAME=y +CONFIG_UNEXPAND=y +CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS=y +CONFIG_UNIQ=y +CONFIG_USLEEP=y +CONFIG_UUDECODE=y +CONFIG_UUENCODE=y +CONFIG_WC=y +CONFIG_FEATURE_WC_LARGE=y +CONFIG_WHO=y +CONFIG_WHOAMI=y +CONFIG_YES=y + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for ls, more and telnet +# +CONFIG_FEATURE_AUTOWIDTH=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum +# +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y + +# +# Console Utilities +# +CONFIG_CHVT=y +CONFIG_FGCONSOLE=y +CONFIG_CLEAR=y +CONFIG_DEALLOCVT=y +CONFIG_DUMPKMAP=y +CONFIG_KBD_MODE=y +CONFIG_LOADFONT=y +CONFIG_LOADKMAP=y +CONFIG_OPENVT=y +CONFIG_RESET=y +CONFIG_RESIZE=y +CONFIG_FEATURE_RESIZE_PRINT=y +CONFIG_SETCONSOLE=y +CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y +CONFIG_SETFONT=y +CONFIG_FEATURE_SETFONT_TEXTUAL_MAP=y +CONFIG_DEFAULT_SETFONT_DIR="" +CONFIG_SETKEYCODES=y +CONFIG_SETLOGCONS=y +CONFIG_SHOWKEY=y + +# +# Common options for loadfont and setfont +# +CONFIG_FEATURE_LOADFONT_PSF2=y +CONFIG_FEATURE_LOADFONT_RAW=y + +# +# Debian Utilities +# +CONFIG_MKTEMP=y +CONFIG_PIPE_PROGRESS=y +CONFIG_RUN_PARTS=y +CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y +CONFIG_FEATURE_RUN_PARTS_FANCY=y +CONFIG_START_STOP_DAEMON=y +CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y +CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y +CONFIG_WHICH=y + +# +# Editors +# +CONFIG_AWK=y +CONFIG_FEATURE_AWK_LIBM=y +CONFIG_CMP=y +CONFIG_DIFF=y +CONFIG_FEATURE_DIFF_LONG_OPTIONS=y +CONFIG_FEATURE_DIFF_DIR=y +CONFIG_ED=y +CONFIG_PATCH=y +CONFIG_SED=y +CONFIG_VI=y +CONFIG_FEATURE_VI_MAX_LEN=4096 +# CONFIG_FEATURE_VI_8BIT is not set +CONFIG_FEATURE_VI_COLON=y +CONFIG_FEATURE_VI_YANKMARK=y +CONFIG_FEATURE_VI_SEARCH=y +CONFIG_FEATURE_VI_USE_SIGNALS=y +CONFIG_FEATURE_VI_DOT_CMD=y +CONFIG_FEATURE_VI_READONLY=y +CONFIG_FEATURE_VI_SETOPTS=y +CONFIG_FEATURE_VI_SET=y +CONFIG_FEATURE_VI_WIN_RESIZE=y +CONFIG_FEATURE_VI_ASK_TERMINAL=y +CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y +CONFIG_FEATURE_ALLOW_EXEC=y + +# +# Finding Utilities +# +CONFIG_FIND=y +CONFIG_FEATURE_FIND_PRINT0=y +CONFIG_FEATURE_FIND_MTIME=y +CONFIG_FEATURE_FIND_MMIN=y +CONFIG_FEATURE_FIND_PERM=y +CONFIG_FEATURE_FIND_TYPE=y +CONFIG_FEATURE_FIND_XDEV=y +CONFIG_FEATURE_FIND_MAXDEPTH=y +CONFIG_FEATURE_FIND_NEWER=y +CONFIG_FEATURE_FIND_INUM=y +CONFIG_FEATURE_FIND_EXEC=y +CONFIG_FEATURE_FIND_USER=y +CONFIG_FEATURE_FIND_GROUP=y +CONFIG_FEATURE_FIND_NOT=y +CONFIG_FEATURE_FIND_DEPTH=y +CONFIG_FEATURE_FIND_PAREN=y +CONFIG_FEATURE_FIND_SIZE=y +CONFIG_FEATURE_FIND_PRUNE=y +CONFIG_FEATURE_FIND_DELETE=y +CONFIG_FEATURE_FIND_PATH=y +CONFIG_FEATURE_FIND_REGEX=y +# CONFIG_FEATURE_FIND_CONTEXT is not set +CONFIG_FEATURE_FIND_LINKS=y +CONFIG_GREP=y +CONFIG_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_FEATURE_GREP_FGREP_ALIAS=y +CONFIG_FEATURE_GREP_CONTEXT=y +CONFIG_XARGS=y +CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y +CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +CONFIG_INIT=y +CONFIG_FEATURE_USE_INITTAB=y +# CONFIG_FEATURE_KILL_REMOVED is not set +CONFIG_FEATURE_KILL_DELAY=0 +CONFIG_FEATURE_INIT_SCTTY=y +CONFIG_FEATURE_INIT_SYSLOG=y +CONFIG_FEATURE_EXTRA_QUIET=y +CONFIG_FEATURE_INIT_COREDUMPS=y +CONFIG_FEATURE_INITRD=y +CONFIG_HALT=y +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +CONFIG_MESG=y + +# +# Login/Password Management Utilities +# +CONFIG_FEATURE_SHADOWPASSWDS=y +CONFIG_USE_BB_PWD_GRP=y +CONFIG_USE_BB_SHADOW=y +CONFIG_USE_BB_CRYPT=y +CONFIG_USE_BB_CRYPT_SHA=y +CONFIG_ADDGROUP=y +CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS=y +CONFIG_FEATURE_ADDUSER_TO_GROUP=y +CONFIG_DELGROUP=y +CONFIG_FEATURE_DEL_USER_FROM_GROUP=y +# CONFIG_FEATURE_CHECK_NAMES is not set +CONFIG_ADDUSER=y +CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y +CONFIG_FIRST_SYSTEM_ID=100 +CONFIG_LAST_SYSTEM_ID=999 +CONFIG_DELUSER=y +CONFIG_GETTY=y +CONFIG_LOGIN=y +# CONFIG_PAM is not set +CONFIG_LOGIN_SCRIPTS=y +CONFIG_FEATURE_NOLOGIN=y +CONFIG_FEATURE_SECURETTY=y +CONFIG_PASSWD=y +CONFIG_FEATURE_PASSWD_WEAK_CHECK=y +CONFIG_CRYPTPW=y +CONFIG_CHPASSWD=y +CONFIG_SU=y +CONFIG_FEATURE_SU_SYSLOG=y +CONFIG_FEATURE_SU_CHECKS_SHELLS=y +CONFIG_SULOGIN=y +CONFIG_VLOCK=y + +# +# Linux Ext2 FS Progs +# +CONFIG_CHATTR=y +CONFIG_FSCK=y +CONFIG_LSATTR=y +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +CONFIG_MODINFO=y +CONFIG_MODPROBE_SMALL=y +CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y +CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y +# CONFIG_INSMOD is not set +# CONFIG_RMMOD is not set +# CONFIG_LSMOD is not set +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +# CONFIG_MODPROBE is not set +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +# CONFIG_DEPMOD is not set + +# +# Options common to multiple modutils +# +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set +# CONFIG_FEATURE_MODUTILS_ALIAS is not set +# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set +CONFIG_DEFAULT_MODULES_DIR="/lib/modules" +CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" + +# +# Linux System Utilities +# +CONFIG_REV=y +CONFIG_ACPID=y +CONFIG_FEATURE_ACPID_COMPAT=y +CONFIG_BLKID=y +CONFIG_DMESG=y +CONFIG_FEATURE_DMESG_PRETTY=y +CONFIG_FBSET=y +CONFIG_FEATURE_FBSET_FANCY=y +CONFIG_FEATURE_FBSET_READMODE=y +CONFIG_FDFLUSH=y +CONFIG_FDFORMAT=y +CONFIG_FDISK=y +CONFIG_FDISK_SUPPORT_LARGE_DISKS=y +CONFIG_FEATURE_FDISK_WRITABLE=y +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +CONFIG_FEATURE_FDISK_ADVANCED=y +CONFIG_FINDFS=y +CONFIG_FLOCK=y +CONFIG_FREERAMDISK=y +CONFIG_FSCK_MINIX=y +CONFIG_MKFS_EXT2=y +CONFIG_MKFS_MINIX=y +CONFIG_FEATURE_MINIX2=y +# CONFIG_MKFS_REISER is not set +CONFIG_MKFS_VFAT=y +CONFIG_GETOPT=y +CONFIG_FEATURE_GETOPT_LONG=y +CONFIG_HEXDUMP=y +CONFIG_FEATURE_HEXDUMP_REVERSE=y +CONFIG_HD=y +CONFIG_HWCLOCK=y +CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y +CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y +CONFIG_IPCRM=y +CONFIG_IPCS=y +CONFIG_LOSETUP=y +CONFIG_LSPCI=y +CONFIG_LSUSB=y +CONFIG_MDEV=y +CONFIG_FEATURE_MDEV_CONF=y +CONFIG_FEATURE_MDEV_RENAME=y +CONFIG_FEATURE_MDEV_RENAME_REGEXP=y +CONFIG_FEATURE_MDEV_EXEC=y +CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y +CONFIG_MKSWAP=y +CONFIG_FEATURE_MKSWAP_UUID=y +CONFIG_MORE=y +CONFIG_FEATURE_USE_TERMIOS=y +CONFIG_MOUNT=y +CONFIG_FEATURE_MOUNT_FAKE=y +CONFIG_FEATURE_MOUNT_VERBOSE=y +# CONFIG_FEATURE_MOUNT_HELPERS is not set +CONFIG_FEATURE_MOUNT_LABEL=y +CONFIG_FEATURE_MOUNT_NFS=y +CONFIG_FEATURE_MOUNT_CIFS=y +CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_FEATURE_MOUNT_FSTAB=y +CONFIG_PIVOT_ROOT=y +CONFIG_RDATE=y +CONFIG_RDEV=y +CONFIG_READPROFILE=y +CONFIG_RTCWAKE=y +CONFIG_SCRIPT=y +CONFIG_SCRIPTREPLAY=y +CONFIG_SETARCH=y +CONFIG_SWAPONOFF=y +CONFIG_FEATURE_SWAPON_PRI=y +CONFIG_SWITCH_ROOT=y +CONFIG_UMOUNT=y +CONFIG_FEATURE_UMOUNT_ALL=y + +# +# Common options for mount/umount +# +CONFIG_FEATURE_MOUNT_LOOP=y +CONFIG_FEATURE_MOUNT_LOOP_CREATE=y +# CONFIG_FEATURE_MTAB_SUPPORT is not set +CONFIG_VOLUMEID=y + +# +# Filesystem/Volume identification +# +CONFIG_FEATURE_VOLUMEID_EXT=y +CONFIG_FEATURE_VOLUMEID_BTRFS=y +CONFIG_FEATURE_VOLUMEID_REISERFS=y +CONFIG_FEATURE_VOLUMEID_FAT=y +CONFIG_FEATURE_VOLUMEID_HFS=y +CONFIG_FEATURE_VOLUMEID_JFS=y +CONFIG_FEATURE_VOLUMEID_XFS=y +CONFIG_FEATURE_VOLUMEID_NTFS=y +CONFIG_FEATURE_VOLUMEID_ISO9660=y +CONFIG_FEATURE_VOLUMEID_UDF=y +CONFIG_FEATURE_VOLUMEID_LUKS=y +CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y +CONFIG_FEATURE_VOLUMEID_CRAMFS=y +CONFIG_FEATURE_VOLUMEID_ROMFS=y +CONFIG_FEATURE_VOLUMEID_SYSV=y +CONFIG_FEATURE_VOLUMEID_OCFS2=y +CONFIG_FEATURE_VOLUMEID_LINUXRAID=y + +# +# Miscellaneous Utilities +# +# CONFIG_CONSPY is not set +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +CONFIG_ADJTIMEX=y +# CONFIG_BBCONFIG is not set +CONFIG_BEEP=y +CONFIG_FEATURE_BEEP_FREQ=4000 +CONFIG_FEATURE_BEEP_LENGTH_MS=30 +CONFIG_CHAT=y +CONFIG_FEATURE_CHAT_NOFAIL=y +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +CONFIG_FEATURE_CHAT_IMPLICIT_CR=y +CONFIG_FEATURE_CHAT_SWALLOW_OPTS=y +CONFIG_FEATURE_CHAT_SEND_ESCAPES=y +CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y +CONFIG_FEATURE_CHAT_CLR_ABORT=y +CONFIG_CHRT=y +CONFIG_CROND=y +CONFIG_FEATURE_CROND_D=y +CONFIG_FEATURE_CROND_CALL_SENDMAIL=y +CONFIG_FEATURE_CROND_DIR="/var/spool/cron" +CONFIG_CRONTAB=y +CONFIG_DC=y +CONFIG_FEATURE_DC_LIBM=y +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +CONFIG_DEVMEM=y +CONFIG_EJECT=y +CONFIG_FEATURE_EJECT_SCSI=y +CONFIG_FBSPLASH=y +# CONFIG_FLASHCP is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASH_ERASEALL is not set +CONFIG_IONICE=y +# CONFIG_INOTIFYD is not set +# CONFIG_LAST is not set +# CONFIG_FEATURE_LAST_SMALL is not set +# CONFIG_FEATURE_LAST_FANCY is not set +CONFIG_LESS=y +CONFIG_FEATURE_LESS_MAXLINES=9999999 +CONFIG_FEATURE_LESS_BRACKETS=y +CONFIG_FEATURE_LESS_FLAGS=y +CONFIG_FEATURE_LESS_MARKS=y +CONFIG_FEATURE_LESS_REGEXP=y +CONFIG_FEATURE_LESS_WINCH=y +CONFIG_FEATURE_LESS_DASHCMD=y +CONFIG_FEATURE_LESS_LINENUMS=y +CONFIG_HDPARM=y +CONFIG_FEATURE_HDPARM_GET_IDENTITY=y +CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y +CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF=y +CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET=y +CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF=y +CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA=y +CONFIG_MAKEDEVS=y +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +CONFIG_FEATURE_MAKEDEVS_TABLE=y +CONFIG_MAN=y +CONFIG_MICROCOM=y +CONFIG_MOUNTPOINT=y +CONFIG_MT=y +CONFIG_RAIDAUTORUN=y +CONFIG_READAHEAD=y +# CONFIG_RFKILL is not set +CONFIG_RUNLEVEL=y +CONFIG_RX=y +CONFIG_SETSID=y +CONFIG_STRINGS=y +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +CONFIG_TIME=y +CONFIG_TIMEOUT=y +CONFIG_TTYSIZE=y +CONFIG_VOLNAME=y +CONFIG_WALL=y +CONFIG_WATCHDOG=y + +# +# Networking Utilities +# +CONFIG_NC=y +CONFIG_NC_SERVER=y +CONFIG_NC_EXTRA=y +# CONFIG_NC_110_COMPAT is not set +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +CONFIG_ARP=y +CONFIG_ARPING=y +CONFIG_BRCTL=y +CONFIG_FEATURE_BRCTL_FANCY=y +CONFIG_FEATURE_BRCTL_SHOW=y +CONFIG_DNSD=y +CONFIG_ETHER_WAKE=y +CONFIG_FAKEIDENTD=y +CONFIG_FTPD=y +CONFIG_FEATURE_FTP_WRITE=y +CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST=y +CONFIG_FTPGET=y +CONFIG_FTPPUT=y +CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y +CONFIG_HOSTNAME=y +CONFIG_HTTPD=y +CONFIG_FEATURE_HTTPD_RANGES=y +CONFIG_FEATURE_HTTPD_USE_SENDFILE=y +CONFIG_FEATURE_HTTPD_SETUID=y +CONFIG_FEATURE_HTTPD_BASIC_AUTH=y +CONFIG_FEATURE_HTTPD_AUTH_MD5=y +CONFIG_FEATURE_HTTPD_CGI=y +CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y +CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y +CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y +CONFIG_FEATURE_HTTPD_ERROR_PAGES=y +CONFIG_FEATURE_HTTPD_PROXY=y +CONFIG_IFCONFIG=y +CONFIG_FEATURE_IFCONFIG_STATUS=y +CONFIG_FEATURE_IFCONFIG_SLIP=y +CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y +CONFIG_FEATURE_IFCONFIG_HW=y +CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y +CONFIG_IFENSLAVE=y +CONFIG_IFPLUGD=y +CONFIG_IFUPDOWN=y +CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate" +CONFIG_FEATURE_IFUPDOWN_IP=y +CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y +# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set +CONFIG_FEATURE_IFUPDOWN_IPV4=y +CONFIG_FEATURE_IFUPDOWN_IPV6=y +CONFIG_FEATURE_IFUPDOWN_MAPPING=y +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +CONFIG_INETD=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN=y +CONFIG_FEATURE_INETD_RPC=y +CONFIG_IP=y +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_ROUTE=y +CONFIG_FEATURE_IP_TUNNEL=y +CONFIG_FEATURE_IP_RULE=y +CONFIG_FEATURE_IP_SHORT_FORMS=y +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +CONFIG_IPADDR=y +CONFIG_IPLINK=y +CONFIG_IPROUTE=y +CONFIG_IPTUNNEL=y +CONFIG_IPRULE=y +CONFIG_IPCALC=y +CONFIG_FEATURE_IPCALC_FANCY=y +CONFIG_FEATURE_IPCALC_LONG_OPTIONS=y +CONFIG_NAMEIF=y +CONFIG_FEATURE_NAMEIF_EXTENDED=y +CONFIG_NETSTAT=y +CONFIG_FEATURE_NETSTAT_WIDE=y +CONFIG_FEATURE_NETSTAT_PRG=y +CONFIG_NSLOOKUP=y +CONFIG_NTPD=y +CONFIG_FEATURE_NTPD_SERVER=y +CONFIG_PING=y +CONFIG_PING6=y +CONFIG_FEATURE_FANCY_PING=y +CONFIG_PSCAN=y +CONFIG_ROUTE=y +CONFIG_SLATTACH=y +CONFIG_TCPSVD=y +CONFIG_TELNET=y +CONFIG_FEATURE_TELNET_TTYPE=y +CONFIG_FEATURE_TELNET_AUTOLOGIN=y +CONFIG_TELNETD=y +CONFIG_FEATURE_TELNETD_STANDALONE=y +CONFIG_FEATURE_TELNETD_INETD_WAIT=y +CONFIG_TFTP=y +CONFIG_TFTPD=y + +# +# Common options for tftp/tftpd +# +CONFIG_FEATURE_TFTP_GET=y +CONFIG_FEATURE_TFTP_PUT=y +CONFIG_FEATURE_TFTP_BLOCKSIZE=y +CONFIG_FEATURE_TFTP_PROGRESS_BAR=y +# CONFIG_TFTP_DEBUG is not set +CONFIG_TRACEROUTE=y +# CONFIG_TRACEROUTE6 is not set +CONFIG_FEATURE_TRACEROUTE_VERBOSE=y +# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +CONFIG_TUNCTL=y +CONFIG_FEATURE_TUNCTL_UG=y +CONFIG_UDHCPD=y +CONFIG_DHCPRELAY=y +CONFIG_DUMPLEASES=y +CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY=y +CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases" +CONFIG_UDHCPC=y +CONFIG_FEATURE_UDHCPC_ARPING=y +CONFIG_FEATURE_UDHCP_PORT=y +CONFIG_UDHCP_DEBUG=9 +CONFIG_FEATURE_UDHCP_RFC3397=y +CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n" +CONFIG_UDPSVD=y +CONFIG_VCONFIG=y +CONFIG_WGET=y +CONFIG_FEATURE_WGET_STATUSBAR=y +CONFIG_FEATURE_WGET_AUTHENTICATION=y +CONFIG_FEATURE_WGET_LONG_OPTIONS=y +CONFIG_ZCIP=y + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_MAKEMIME is not set +CONFIG_FEATURE_MIME_CHARSET="us-ascii" +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +CONFIG_SENDMAIL=y + +# +# Process Utilities +# +CONFIG_SMEMCAP=y +CONFIG_FREE=y +CONFIG_FUSER=y +CONFIG_KILL=y +CONFIG_KILLALL=y +CONFIG_KILLALL5=y +CONFIG_NMETER=y +CONFIG_PGREP=y +CONFIG_PIDOF=y +CONFIG_FEATURE_PIDOF_SINGLE=y +CONFIG_FEATURE_PIDOF_OMIT=y +CONFIG_PKILL=y +CONFIG_PS=y +CONFIG_FEATURE_PS_WIDE=y +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +CONFIG_RENICE=y +CONFIG_BB_SYSCTL=y +CONFIG_TOP=y +CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +CONFIG_FEATURE_TOP_SMP_CPU=y +CONFIG_FEATURE_TOP_DECIMALS=y +CONFIG_FEATURE_TOP_SMP_PROCESS=y +CONFIG_FEATURE_TOPMEM=y +CONFIG_FEATURE_SHOW_THREADS=y +CONFIG_UPTIME=y +CONFIG_WATCH=y + +# +# Runit Utilities +# +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVLOGD is not set +CONFIG_CHPST=y +CONFIG_SETUIDGID=y +CONFIG_ENVUIDGID=y +CONFIG_ENVDIR=y +CONFIG_SOFTLIMIT=y +# CONFIG_CHCON is not set +# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RESTORECON is not set +# CONFIG_RUNCON is not set +# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_SETSEBOOL is not set +# CONFIG_SESTATUS is not set + +# +# Shells +# +CONFIG_ASH=y +CONFIG_ASH_BASH_COMPAT=y +CONFIG_ASH_JOB_CONTROL=y +CONFIG_ASH_ALIAS=y +CONFIG_ASH_GETOPTS=y +CONFIG_ASH_BUILTIN_ECHO=y +CONFIG_ASH_BUILTIN_PRINTF=y +CONFIG_ASH_BUILTIN_TEST=y +CONFIG_ASH_CMDCMD=y +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +CONFIG_ASH_RANDOM_SUPPORT=y +CONFIG_ASH_EXPAND_PRMT=y +# CONFIG_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_HUSH is not set +# CONFIG_FEATURE_SH_IS_NONE is not set +# CONFIG_FEATURE_BASH_IS_ASH is not set +# CONFIG_FEATURE_BASH_IS_HUSH is not set +CONFIG_FEATURE_BASH_IS_NONE=y +# CONFIG_LASH is not set +# CONFIG_MSH is not set +CONFIG_SH_MATH_SUPPORT=y +CONFIG_SH_MATH_SUPPORT_64=y +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +CONFIG_CTTYHACK=y + +# +# System Logging Utilities +# +CONFIG_SYSLOGD=y +CONFIG_FEATURE_ROTATE_LOGFILE=y +CONFIG_FEATURE_REMOTE_LOG=y +CONFIG_FEATURE_SYSLOGD_DUP=y +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256 +CONFIG_FEATURE_IPC_SYSLOG=y +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16 +CONFIG_LOGREAD=y +CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y +CONFIG_KLOGD=y +CONFIG_LOGGER=y diff --git a/deps/uevalrun/busybox-1.17.3-config.mini b/deps/uevalrun/busybox-1.17.3-config.mini new file mode 100644 index 0000000..2b0b6c9 --- /dev/null +++ b/deps/uevalrun/busybox-1.17.3-config.mini @@ -0,0 +1,950 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.17.3 +# Wed Nov 24 23:23:51 2010 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_DESKTOP is not set +# CONFIG_EXTRA_COMPAT is not set +# CONFIG_INCLUDE_SUSv2 is not set +# CONFIG_USE_PORTABLE_CODE is not set +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +# CONFIG_SHOW_USAGE is not set +# CONFIG_FEATURE_VERBOSE_USAGE is not set +# CONFIG_FEATURE_COMPRESS_USAGE is not set +# CONFIG_FEATURE_INSTALLER is not set +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_UNICODE_SUPPORT is not set +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +# CONFIG_LONG_OPTS is not set +CONFIG_FEATURE_DEVPTS=y +# CONFIG_FEATURE_CLEAN_UP is not set +CONFIG_FEATURE_UTMP=y +# CONFIG_FEATURE_WTMP is not set +# CONFIG_FEATURE_PIDFILE is not set +CONFIG_FEATURE_SUID=y +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +# CONFIG_FEATURE_SYSLOG is not set +# CONFIG_FEATURE_HAVE_RPC is not set + +# +# Build Options +# +CONFIG_STATIC=y +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_LFS=y +CONFIG_CROSS_COMPILER_PREFIX="/usr/src/cross-compiler-i686/bin/i686-" +CONFIG_EXTRA_CFLAGS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_WERROR is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Installation Options +# +# CONFIG_INSTALL_NO_USR is not set +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SIZE_VS_SPEED=2 +CONFIG_FEATURE_FAST_TOP=y +# CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_FEATURE_EDITING is not set +CONFIG_FEATURE_EDITING_MAX_LEN=0 +# CONFIG_FEATURE_EDITING_VI is not set +CONFIG_FEATURE_EDITING_HISTORY=0 +# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set +# CONFIG_FEATURE_TAB_COMPLETION is not set +# CONFIG_FEATURE_USERNAME_COMPLETION is not set +# CONFIG_FEATURE_EDITING_FANCY_PROMPT is not set +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_FEATURE_COPYBUF_KB=4 +CONFIG_MONOTONIC_SYSCALL=y +# CONFIG_IOCTL_HEX2STR_ERROR is not set +# CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +# CONFIG_FEATURE_SEAMLESS_XZ is not set +# CONFIG_FEATURE_SEAMLESS_LZMA is not set +CONFIG_FEATURE_SEAMLESS_BZ2=y +# CONFIG_FEATURE_SEAMLESS_GZ is not set +# CONFIG_FEATURE_SEAMLESS_Z is not set +# CONFIG_AR is not set +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_FEATURE_AR_CREATE is not set +# CONFIG_BUNZIP2 is not set +# CONFIG_BZIP2 is not set +# CONFIG_CPIO is not set +# CONFIG_FEATURE_CPIO_O is not set +# CONFIG_FEATURE_CPIO_P is not set +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +# CONFIG_GUNZIP is not set +# CONFIG_GZIP is not set +# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +# CONFIG_LZOP is not set +# CONFIG_LZOP_COMPR_HIGH is not set +# CONFIG_RPM2CPIO is not set +# CONFIG_RPM is not set +CONFIG_TAR=y +# CONFIG_FEATURE_TAR_CREATE is not set +# CONFIG_FEATURE_TAR_AUTODETECT is not set +# CONFIG_FEATURE_TAR_FROM is not set +# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_FEATURE_TAR_TO_COMMAND is not set +# CONFIG_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_FEATURE_TAR_SELINUX is not set +CONFIG_UNCOMPRESS=y +# CONFIG_UNLZMA is not set +# CONFIG_FEATURE_LZMA_FAST is not set +# CONFIG_LZMA is not set +# CONFIG_UNXZ is not set +# CONFIG_XZ is not set +# CONFIG_UNZIP is not set + +# +# Coreutils +# +# CONFIG_BASENAME is not set +CONFIG_CAT=y +# CONFIG_DATE is not set +# CONFIG_FEATURE_DATE_ISOFMT is not set +# CONFIG_FEATURE_DATE_NANO is not set +# CONFIG_FEATURE_DATE_COMPAT is not set +CONFIG_TEST=y +CONFIG_FEATURE_TEST_64=y +# CONFIG_TR is not set +# CONFIG_FEATURE_TR_CLASSES is not set +# CONFIG_FEATURE_TR_EQUIV is not set +# CONFIG_CAL is not set +# CONFIG_CATV is not set +CONFIG_CHGRP=y +CONFIG_CHMOD=y +CONFIG_CHOWN=y +# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +# CONFIG_CHROOT is not set +# CONFIG_CKSUM is not set +# CONFIG_COMM is not set +CONFIG_CP=y +# CONFIG_FEATURE_CP_LONG_OPTIONS is not set +# CONFIG_CUT is not set +CONFIG_DD=y +# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set +# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set +# CONFIG_FEATURE_DD_IBS_OBS is not set +# CONFIG_DF is not set +# CONFIG_FEATURE_DF_FANCY is not set +# CONFIG_DIRNAME is not set +# CONFIG_DOS2UNIX is not set +# CONFIG_UNIX2DOS is not set +# CONFIG_DU is not set +# CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K is not set +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +# CONFIG_ENV is not set +# CONFIG_FEATURE_ENV_LONG_OPTIONS is not set +# CONFIG_EXPAND is not set +# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set +CONFIG_EXPR=y +CONFIG_EXPR_MATH_SUPPORT_64=y +CONFIG_FALSE=y +# CONFIG_FOLD is not set +# CONFIG_FSYNC is not set +# CONFIG_HEAD is not set +# CONFIG_FEATURE_FANCY_HEAD is not set +# CONFIG_HOSTID is not set +# CONFIG_ID is not set +CONFIG_INSTALL=y +# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set +# CONFIG_LENGTH is not set +CONFIG_LN=y +# CONFIG_LOGNAME is not set +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +# CONFIG_FEATURE_LS_COLOR is not set +# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set +# CONFIG_MD5SUM is not set +CONFIG_MKDIR=y +# CONFIG_FEATURE_MKDIR_LONG_OPTIONS is not set +CONFIG_MKFIFO=y +CONFIG_MKNOD=y +CONFIG_MV=y +# CONFIG_FEATURE_MV_LONG_OPTIONS is not set +# CONFIG_NICE is not set +# CONFIG_NOHUP is not set +# CONFIG_OD is not set +# CONFIG_PRINTENV is not set +# CONFIG_PRINTF is not set +CONFIG_PWD=y +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +CONFIG_REALPATH=y +CONFIG_RM=y +CONFIG_RMDIR=y +# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set +# CONFIG_SEQ is not set +# CONFIG_SHA1SUM is not set +# CONFIG_SHA256SUM is not set +# CONFIG_SHA512SUM is not set +# CONFIG_SLEEP is not set +# CONFIG_FEATURE_FANCY_SLEEP is not set +# CONFIG_FEATURE_FLOAT_SLEEP is not set +# CONFIG_SORT is not set +# CONFIG_FEATURE_SORT_BIG is not set +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +# CONFIG_STAT is not set +# CONFIG_FEATURE_STAT_FORMAT is not set +# CONFIG_STTY is not set +# CONFIG_SUM is not set +CONFIG_SYNC=y +# CONFIG_TAC is not set +# CONFIG_TAIL is not set +# CONFIG_FEATURE_FANCY_TAIL is not set +# CONFIG_TEE is not set +# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set +# CONFIG_TOUCH is not set +CONFIG_TRUE=y +# CONFIG_TTY is not set +# CONFIG_UNAME is not set +# CONFIG_UNEXPAND is not set +# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set +# CONFIG_UNIQ is not set +# CONFIG_USLEEP is not set +# CONFIG_UUDECODE is not set +# CONFIG_UUENCODE is not set +CONFIG_WC=y +# CONFIG_FEATURE_WC_LARGE is not set +# CONFIG_WHO is not set +# CONFIG_WHOAMI is not set +CONFIG_YES=y + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for ls, more and telnet +# +# CONFIG_FEATURE_AUTOWIDTH is not set + +# +# Common options for df, du, ls +# +# CONFIG_FEATURE_HUMAN_READABLE is not set +# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set + +# +# Console Utilities +# +# CONFIG_CHVT is not set +# CONFIG_FGCONSOLE is not set +# CONFIG_CLEAR is not set +# CONFIG_DEALLOCVT is not set +# CONFIG_DUMPKMAP is not set +# CONFIG_KBD_MODE is not set +# CONFIG_LOADFONT is not set +# CONFIG_LOADKMAP is not set +# CONFIG_OPENVT is not set +# CONFIG_RESET is not set +# CONFIG_RESIZE is not set +# CONFIG_FEATURE_RESIZE_PRINT is not set +# CONFIG_SETCONSOLE is not set +# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +# CONFIG_SETFONT is not set +# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_DEFAULT_SETFONT_DIR="" +# CONFIG_SETKEYCODES is not set +# CONFIG_SETLOGCONS is not set +# CONFIG_SHOWKEY is not set +# CONFIG_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_FEATURE_LOADFONT_RAW is not set + +# +# Debian Utilities +# +# CONFIG_MKTEMP is not set +# CONFIG_PIPE_PROGRESS is not set +# CONFIG_RUN_PARTS is not set +# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +# CONFIG_START_STOP_DAEMON is not set +# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set +# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set +# CONFIG_WHICH is not set + +# +# Editors +# +CONFIG_AWK=y +# CONFIG_FEATURE_AWK_LIBM is not set +CONFIG_CMP=y +# CONFIG_DIFF is not set +# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set +# CONFIG_FEATURE_DIFF_DIR is not set +# CONFIG_ED is not set +# CONFIG_PATCH is not set +# CONFIG_SED is not set +# CONFIG_VI is not set +CONFIG_FEATURE_VI_MAX_LEN=0 +# CONFIG_FEATURE_VI_8BIT is not set +# CONFIG_FEATURE_VI_COLON is not set +# CONFIG_FEATURE_VI_YANKMARK is not set +# CONFIG_FEATURE_VI_SEARCH is not set +# CONFIG_FEATURE_VI_USE_SIGNALS is not set +# CONFIG_FEATURE_VI_DOT_CMD is not set +# CONFIG_FEATURE_VI_READONLY is not set +# CONFIG_FEATURE_VI_SETOPTS is not set +# CONFIG_FEATURE_VI_SET is not set +# CONFIG_FEATURE_VI_WIN_RESIZE is not set +# CONFIG_FEATURE_VI_ASK_TERMINAL is not set +# CONFIG_FEATURE_VI_OPTIMIZE_CURSOR is not set +# CONFIG_FEATURE_ALLOW_EXEC is not set + +# +# Finding Utilities +# +# CONFIG_FIND is not set +# CONFIG_FEATURE_FIND_PRINT0 is not set +# CONFIG_FEATURE_FIND_MTIME is not set +# CONFIG_FEATURE_FIND_MMIN is not set +# CONFIG_FEATURE_FIND_PERM is not set +# CONFIG_FEATURE_FIND_TYPE is not set +# CONFIG_FEATURE_FIND_XDEV is not set +# CONFIG_FEATURE_FIND_MAXDEPTH is not set +# CONFIG_FEATURE_FIND_NEWER is not set +# CONFIG_FEATURE_FIND_INUM is not set +# CONFIG_FEATURE_FIND_EXEC is not set +# CONFIG_FEATURE_FIND_USER is not set +# CONFIG_FEATURE_FIND_GROUP is not set +# CONFIG_FEATURE_FIND_NOT is not set +# CONFIG_FEATURE_FIND_DEPTH is not set +# CONFIG_FEATURE_FIND_PAREN is not set +# CONFIG_FEATURE_FIND_SIZE is not set +# CONFIG_FEATURE_FIND_PRUNE is not set +# CONFIG_FEATURE_FIND_DELETE is not set +# CONFIG_FEATURE_FIND_PATH is not set +# CONFIG_FEATURE_FIND_REGEX is not set +# CONFIG_FEATURE_FIND_CONTEXT is not set +# CONFIG_FEATURE_FIND_LINKS is not set +CONFIG_GREP=y +CONFIG_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_FEATURE_GREP_FGREP_ALIAS=y +# CONFIG_FEATURE_GREP_CONTEXT is not set +CONFIG_XARGS=y +# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set +CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +# CONFIG_INIT is not set +# CONFIG_FEATURE_USE_INITTAB is not set +# CONFIG_FEATURE_KILL_REMOVED is not set +CONFIG_FEATURE_KILL_DELAY=0 +# CONFIG_FEATURE_INIT_SCTTY is not set +# CONFIG_FEATURE_INIT_SYSLOG is not set +# CONFIG_FEATURE_EXTRA_QUIET is not set +# CONFIG_FEATURE_INIT_COREDUMPS is not set +# CONFIG_FEATURE_INITRD is not set +CONFIG_HALT=y +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +# CONFIG_MESG is not set + +# +# Login/Password Management Utilities +# +# CONFIG_FEATURE_SHADOWPASSWDS is not set +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_USE_BB_SHADOW is not set +# CONFIG_USE_BB_CRYPT is not set +# CONFIG_USE_BB_CRYPT_SHA is not set +# CONFIG_ADDGROUP is not set +# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_DELGROUP is not set +# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set +# CONFIG_FEATURE_CHECK_NAMES is not set +# CONFIG_ADDUSER is not set +# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set +CONFIG_FIRST_SYSTEM_ID=0 +CONFIG_LAST_SYSTEM_ID=0 +# CONFIG_DELUSER is not set +# CONFIG_GETTY is not set +# CONFIG_LOGIN is not set +# CONFIG_PAM is not set +# CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_FEATURE_SECURETTY is not set +# CONFIG_PASSWD is not set +# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set +# CONFIG_CRYPTPW is not set +# CONFIG_CHPASSWD is not set +# CONFIG_SU is not set +# CONFIG_FEATURE_SU_SYSLOG is not set +# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_SULOGIN is not set +# CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +# CONFIG_CHATTR is not set +# CONFIG_FSCK is not set +# CONFIG_LSATTR is not set +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_MODINFO is not set +# CONFIG_MODPROBE_SMALL is not set +# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set +# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +# CONFIG_INSMOD is not set +# CONFIG_RMMOD is not set +# CONFIG_LSMOD is not set +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +# CONFIG_MODPROBE is not set +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +# CONFIG_DEPMOD is not set + +# +# Options common to multiple modutils +# +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set +# CONFIG_FEATURE_MODUTILS_ALIAS is not set +# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set +CONFIG_DEFAULT_MODULES_DIR="" +CONFIG_DEFAULT_DEPMOD_FILE="" + +# +# Linux System Utilities +# +# CONFIG_REV is not set +# CONFIG_ACPID is not set +# CONFIG_FEATURE_ACPID_COMPAT is not set +# CONFIG_BLKID is not set +# CONFIG_DMESG is not set +# CONFIG_FEATURE_DMESG_PRETTY is not set +# CONFIG_FBSET is not set +# CONFIG_FEATURE_FBSET_FANCY is not set +# CONFIG_FEATURE_FBSET_READMODE is not set +# CONFIG_FDFLUSH is not set +# CONFIG_FDFORMAT is not set +# CONFIG_FDISK is not set +CONFIG_FDISK_SUPPORT_LARGE_DISKS=y +# CONFIG_FEATURE_FDISK_WRITABLE is not set +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +# CONFIG_FEATURE_FDISK_ADVANCED is not set +# CONFIG_FINDFS is not set +# CONFIG_FLOCK is not set +# CONFIG_FREERAMDISK is not set +# CONFIG_FSCK_MINIX is not set +# CONFIG_MKFS_EXT2 is not set +# CONFIG_MKFS_MINIX is not set +# CONFIG_FEATURE_MINIX2 is not set +# CONFIG_MKFS_REISER is not set +# CONFIG_MKFS_VFAT is not set +# CONFIG_GETOPT is not set +# CONFIG_FEATURE_GETOPT_LONG is not set +# CONFIG_HEXDUMP is not set +# CONFIG_FEATURE_HEXDUMP_REVERSE is not set +# CONFIG_HD is not set +# CONFIG_HWCLOCK is not set +# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set +# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_IPCRM is not set +# CONFIG_IPCS is not set +# CONFIG_LOSETUP is not set +# CONFIG_LSPCI is not set +# CONFIG_LSUSB is not set +# CONFIG_MDEV is not set +# CONFIG_FEATURE_MDEV_CONF is not set +# CONFIG_FEATURE_MDEV_RENAME is not set +# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set +# CONFIG_FEATURE_MDEV_EXEC is not set +# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set +# CONFIG_MKSWAP is not set +# CONFIG_FEATURE_MKSWAP_UUID is not set +# CONFIG_MORE is not set +# CONFIG_FEATURE_USE_TERMIOS is not set +# CONFIG_MOUNT is not set +# CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_FEATURE_MOUNT_VERBOSE is not set +# CONFIG_FEATURE_MOUNT_HELPERS is not set +# CONFIG_FEATURE_MOUNT_LABEL is not set +# CONFIG_FEATURE_MOUNT_NFS is not set +# CONFIG_FEATURE_MOUNT_CIFS is not set +# CONFIG_FEATURE_MOUNT_FLAGS is not set +# CONFIG_FEATURE_MOUNT_FSTAB is not set +# CONFIG_PIVOT_ROOT is not set +# CONFIG_RDATE is not set +# CONFIG_RDEV is not set +# CONFIG_READPROFILE is not set +# CONFIG_RTCWAKE is not set +# CONFIG_SCRIPT is not set +# CONFIG_SCRIPTREPLAY is not set +# CONFIG_SETARCH is not set +# CONFIG_SWAPONOFF is not set +# CONFIG_FEATURE_SWAPON_PRI is not set +# CONFIG_SWITCH_ROOT is not set +# CONFIG_UMOUNT is not set +# CONFIG_FEATURE_UMOUNT_ALL is not set +# CONFIG_FEATURE_MOUNT_LOOP is not set +# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set +# CONFIG_FEATURE_MTAB_SUPPORT is not set +# CONFIG_VOLUMEID is not set +# CONFIG_FEATURE_VOLUMEID_EXT is not set +# CONFIG_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_FEATURE_VOLUMEID_FAT is not set +# CONFIG_FEATURE_VOLUMEID_HFS is not set +# CONFIG_FEATURE_VOLUMEID_JFS is not set +# CONFIG_FEATURE_VOLUMEID_XFS is not set +# CONFIG_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_FEATURE_VOLUMEID_UDF is not set +# CONFIG_FEATURE_VOLUMEID_LUKS is not set +# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set +# CONFIG_FEATURE_VOLUMEID_ROMFS is not set +# CONFIG_FEATURE_VOLUMEID_SYSV is not set +# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set + +# +# Miscellaneous Utilities +# +# CONFIG_CONSPY is not set +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +# CONFIG_ADJTIMEX is not set +# CONFIG_BBCONFIG is not set +# CONFIG_BEEP is not set +CONFIG_FEATURE_BEEP_FREQ=0 +CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_CHRT is not set +# CONFIG_CROND is not set +# CONFIG_FEATURE_CROND_D is not set +# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_FEATURE_CROND_DIR="" +# CONFIG_CRONTAB is not set +# CONFIG_DC is not set +# CONFIG_FEATURE_DC_LIBM is not set +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +# CONFIG_DEVMEM is not set +# CONFIG_EJECT is not set +# CONFIG_FEATURE_EJECT_SCSI is not set +# CONFIG_FBSPLASH is not set +# CONFIG_FLASHCP is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASH_ERASEALL is not set +# CONFIG_IONICE is not set +# CONFIG_INOTIFYD is not set +# CONFIG_LAST is not set +# CONFIG_FEATURE_LAST_SMALL is not set +# CONFIG_FEATURE_LAST_FANCY is not set +# CONFIG_LESS is not set +CONFIG_FEATURE_LESS_MAXLINES=0 +# CONFIG_FEATURE_LESS_BRACKETS is not set +# CONFIG_FEATURE_LESS_FLAGS is not set +# CONFIG_FEATURE_LESS_MARKS is not set +# CONFIG_FEATURE_LESS_REGEXP is not set +# CONFIG_FEATURE_LESS_WINCH is not set +# CONFIG_FEATURE_LESS_DASHCMD is not set +# CONFIG_FEATURE_LESS_LINENUMS is not set +# CONFIG_HDPARM is not set +# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +# CONFIG_MAKEDEVS is not set +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_MAN is not set +# CONFIG_MICROCOM is not set +# CONFIG_MOUNTPOINT is not set +# CONFIG_MT is not set +# CONFIG_RAIDAUTORUN is not set +# CONFIG_READAHEAD is not set +# CONFIG_RFKILL is not set +# CONFIG_RUNLEVEL is not set +# CONFIG_RX is not set +# CONFIG_SETSID is not set +# CONFIG_STRINGS is not set +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +# CONFIG_TIME is not set +# CONFIG_TIMEOUT is not set +# CONFIG_TTYSIZE is not set +# CONFIG_VOLNAME is not set +# CONFIG_WALL is not set +# CONFIG_WATCHDOG is not set + +# +# Networking Utilities +# +# CONFIG_NC is not set +# CONFIG_NC_SERVER is not set +# CONFIG_NC_EXTRA is not set +# CONFIG_NC_110_COMPAT is not set +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_ARP is not set +# CONFIG_ARPING is not set +# CONFIG_BRCTL is not set +# CONFIG_FEATURE_BRCTL_FANCY is not set +# CONFIG_FEATURE_BRCTL_SHOW is not set +# CONFIG_DNSD is not set +# CONFIG_ETHER_WAKE is not set +# CONFIG_FAKEIDENTD is not set +# CONFIG_FTPD is not set +# CONFIG_FEATURE_FTP_WRITE is not set +# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +# CONFIG_HOSTNAME is not set +# CONFIG_HTTPD is not set +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +# CONFIG_IFCONFIG is not set +# CONFIG_FEATURE_IFCONFIG_STATUS is not set +# CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +# CONFIG_FEATURE_IFCONFIG_HW is not set +# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set +# CONFIG_IFENSLAVE is not set +# CONFIG_IFPLUGD is not set +# CONFIG_IFUPDOWN is not set +CONFIG_IFUPDOWN_IFSTATE_PATH="" +# CONFIG_FEATURE_IFUPDOWN_IP is not set +# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set +# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set +# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set +# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set +# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +# CONFIG_INETD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_FEATURE_INETD_RPC is not set +# CONFIG_IP is not set +# CONFIG_FEATURE_IP_ADDRESS is not set +# CONFIG_FEATURE_IP_LINK is not set +# CONFIG_FEATURE_IP_ROUTE is not set +# CONFIG_FEATURE_IP_TUNNEL is not set +# CONFIG_FEATURE_IP_RULE is not set +# CONFIG_FEATURE_IP_SHORT_FORMS is not set +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_IPADDR is not set +# CONFIG_IPLINK is not set +# CONFIG_IPROUTE is not set +# CONFIG_IPTUNNEL is not set +# CONFIG_IPRULE is not set +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +# CONFIG_NAMEIF is not set +# CONFIG_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_NETSTAT is not set +# CONFIG_FEATURE_NETSTAT_WIDE is not set +# CONFIG_FEATURE_NETSTAT_PRG is not set +# CONFIG_NSLOOKUP is not set +# CONFIG_NTPD is not set +# CONFIG_FEATURE_NTPD_SERVER is not set +# CONFIG_PING is not set +# CONFIG_PING6 is not set +# CONFIG_FEATURE_FANCY_PING is not set +# CONFIG_PSCAN is not set +# CONFIG_ROUTE is not set +# CONFIG_SLATTACH is not set +# CONFIG_TCPSVD is not set +# CONFIG_TELNET is not set +# CONFIG_FEATURE_TELNET_TTYPE is not set +# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set +# CONFIG_TELNETD is not set +# CONFIG_FEATURE_TELNETD_STANDALONE is not set +# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set +# CONFIG_TFTP is not set +# CONFIG_TFTPD is not set +# CONFIG_FEATURE_TFTP_GET is not set +# CONFIG_FEATURE_TFTP_PUT is not set +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_TFTP_DEBUG is not set +# CONFIG_TRACEROUTE is not set +# CONFIG_TRACEROUTE6 is not set +# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set +# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_TUNCTL is not set +# CONFIG_FEATURE_TUNCTL_UG is not set +# CONFIG_UDHCPD is not set +# CONFIG_DHCPRELAY is not set +# CONFIG_DUMPLEASES is not set +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +CONFIG_DHCPD_LEASES_FILE="" +# CONFIG_UDHCPC is not set +# CONFIG_FEATURE_UDHCPC_ARPING is not set +# CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_UDHCP_DEBUG=0 +# CONFIG_FEATURE_UDHCP_RFC3397 is not set +CONFIG_UDHCPC_DEFAULT_SCRIPT="" +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0 +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="" +# CONFIG_UDPSVD is not set +# CONFIG_VCONFIG is not set +# CONFIG_WGET is not set +# CONFIG_FEATURE_WGET_STATUSBAR is not set +# CONFIG_FEATURE_WGET_AUTHENTICATION is not set +# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set +# CONFIG_ZCIP is not set + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_MAKEMIME is not set +CONFIG_FEATURE_MIME_CHARSET="" +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_SENDMAIL is not set + +# +# Process Utilities +# +# CONFIG_SMEMCAP is not set +# CONFIG_FREE is not set +# CONFIG_FUSER is not set +# CONFIG_KILL is not set +# CONFIG_KILLALL is not set +# CONFIG_KILLALL5 is not set +# CONFIG_NMETER is not set +# CONFIG_PGREP is not set +# CONFIG_PIDOF is not set +# CONFIG_FEATURE_PIDOF_SINGLE is not set +# CONFIG_FEATURE_PIDOF_OMIT is not set +# CONFIG_PKILL is not set +# CONFIG_PS is not set +# CONFIG_FEATURE_PS_WIDE is not set +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +# CONFIG_RENICE is not set +# CONFIG_BB_SYSCTL is not set +# CONFIG_TOP is not set +# CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set +# CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS is not set +# CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_FEATURE_TOPMEM is not set +# CONFIG_FEATURE_SHOW_THREADS is not set +# CONFIG_UPTIME is not set +# CONFIG_WATCH is not set + +# +# Runit Utilities +# +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVLOGD is not set +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_CHCON is not set +# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RESTORECON is not set +# CONFIG_RUNCON is not set +# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_SETSEBOOL is not set +# CONFIG_SESTATUS is not set + +# +# Shells +# +CONFIG_ASH=y +CONFIG_ASH_BASH_COMPAT=y +CONFIG_ASH_JOB_CONTROL=y +# CONFIG_ASH_ALIAS is not set +# CONFIG_ASH_GETOPTS is not set +CONFIG_ASH_BUILTIN_ECHO=y +CONFIG_ASH_BUILTIN_PRINTF=y +CONFIG_ASH_BUILTIN_TEST=y +CONFIG_ASH_CMDCMD=y +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +# CONFIG_ASH_RANDOM_SUPPORT is not set +# CONFIG_ASH_EXPAND_PRMT is not set +# CONFIG_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_HUSH is not set +# CONFIG_FEATURE_SH_IS_NONE is not set +# CONFIG_FEATURE_BASH_IS_ASH is not set +# CONFIG_FEATURE_BASH_IS_HUSH is not set +CONFIG_FEATURE_BASH_IS_NONE=y +# CONFIG_LASH is not set +# CONFIG_MSH is not set +# CONFIG_SH_MATH_SUPPORT is not set +# CONFIG_SH_MATH_SUPPORT_64 is not set +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +# CONFIG_CTTYHACK is not set + +# +# System Logging Utilities +# +# CONFIG_SYSLOGD is not set +# CONFIG_FEATURE_ROTATE_LOGFILE is not set +# CONFIG_FEATURE_REMOTE_LOG is not set +# CONFIG_FEATURE_SYSLOGD_DUP is not set +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 +# CONFIG_FEATURE_IPC_SYSLOG is not set +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 +# CONFIG_LOGREAD is not set +# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set +# CONFIG_KLOGD is not set +# CONFIG_LOGGER is not set diff --git a/deps/uevalrun/busybox.mini b/deps/uevalrun/busybox.mini new file mode 100755 index 0000000..8ddfa4a Binary files /dev/null and b/deps/uevalrun/busybox.mini differ diff --git a/deps/uevalrun/doc/.svn/all-wcprops b/deps/uevalrun/doc/.svn/all-wcprops new file mode 100644 index 0000000..f84c89a --- /dev/null +++ b/deps/uevalrun/doc/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 36 +/svn/!svn/ver/186/trunk/uevalrun/doc +END +uevalrun.html +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/!svn/ver/186/trunk/uevalrun/doc/uevalrun.html +END +uevalrun.gadget.xml +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/!svn/ver/147/trunk/uevalrun/doc/uevalrun.gadget.xml +END diff --git a/deps/uevalrun/doc/.svn/entries b/deps/uevalrun/doc/.svn/entries new file mode 100644 index 0000000..ec7e386 --- /dev/null +++ b/deps/uevalrun/doc/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +207 +http://pts-mini-gpl.googlecode.com/svn/trunk/uevalrun/doc +http://pts-mini-gpl.googlecode.com/svn + + + +2011-01-16T10:48:56.311806Z +186 +ptspts + + + + + + + + + + + + + + +5875f506-4f57-11de-a3de-f74ccfcb021d + +uevalrun.html +file + + + + +2011-04-01T20:18:26.681106Z +b375cbeedd498c94ca5f174e620df42c +2011-01-16T10:48:56.311806Z +186 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +17584 + +uevalrun.gadget.xml +file + + + + +2011-04-01T20:18:26.681106Z +7d65f35eee162c3e07d7097a4afe4065 +2010-11-28T14:54:15.374069Z +147 +ptspts + + + + + + + + + + + + + + + + + + + + + +266 + diff --git a/deps/uevalrun/doc/.svn/prop-base/uevalrun.html.svn-base b/deps/uevalrun/doc/.svn/prop-base/uevalrun.html.svn-base new file mode 100644 index 0000000..631b68a --- /dev/null +++ b/deps/uevalrun/doc/.svn/prop-base/uevalrun.html.svn-base @@ -0,0 +1,9 @@ +K 11 +svn:charset +V 5 +utf-8 +K 13 +svn:mime-type +V 24 +text/html; charset=utf-8 +END diff --git a/deps/uevalrun/doc/.svn/text-base/uevalrun.gadget.xml.svn-base b/deps/uevalrun/doc/.svn/text-base/uevalrun.gadget.xml.svn-base new file mode 100644 index 0000000..7b62476 --- /dev/null +++ b/deps/uevalrun/doc/.svn/text-base/uevalrun.gadget.xml.svn-base @@ -0,0 +1,7 @@ + + + + + + + diff --git a/deps/uevalrun/doc/.svn/text-base/uevalrun.html.svn-base b/deps/uevalrun/doc/.svn/text-base/uevalrun.html.svn-base new file mode 100644 index 0000000..bc11c44 --- /dev/null +++ b/deps/uevalrun/doc/.svn/text-base/uevalrun.html.svn-base @@ -0,0 +1,405 @@ + + +uevalrun: self-contained computation sandbox for Linux + + + + + +

Documentation of uevalrun

+ +

uevalrun is a self-contained computation sandbox for Linux, using +User-mode Linux for both compilation and execution of the program to be +sandboxed. The program can be written in C, C++, Python, Ruby, Perl, +JavaScript, Lua or PHP. uevanrun enforces memory limits, timeouts and output +size limits in the sandbox. The primary use case for uevalrun is evaluation +of solution programs submitted by contestants of programming contests: +uevalrun compiles the solution, runs it with the test input, compares its +output against the expected output, and writes a status report. + +

Installation

+ +

A 32-bit (x86, i386) or 64-bit (x86_64, amd64) Linux system is required +with enough RAM for both compilation and execution, plus 6 MB memory +overhead. The Linux distribution doesn't matter, because uevalrun uses +statically linked binaries, and it's self-contained: it contains all the +tools it needs, including the C and C++ compilers (from the uClibc gcc-4.1.2 +toolchain). + +

uevalrun doesn't need root privileges: it runs as a simple user. + +

uevalrun needs about 160MB of disk space, most of which is consumed by +the C compiler (31MB extracted + 17MB compressed), the scripting language +interpreters (9MB compressed), and the virtual disk images (77MB, +uncompressed). After removing all temporary files, 80MB will be enough. + +

Download and compile: + +

$ svn co http://pts-mini-gpl.googlecode.com/svn/trunk/uevalrun uevalrun
+$ cd uevalrun
+$ ./make  # This downloads some more files during compilation.
+ +

Try it (the italic parts are displayed by the program): + +

$ (echo '#! perl'; echo 'print "Hello"x2, "\n"') >foo.pl
+$ echo HelloHello >expected.txt
+$ ./uevalrun -M 10 -T 9 -E 9 -s foo.pl -t /dev/null -e expected.txt
+...
+@ result: pass
+$ echo '/**/ int main() { return!printf("HelloHello\n"); }' >foo.c
+$ ./uevalrun -M 10 -T 9 -E 9 -U 19 -N 32 -C 9 \
+  -s foo.c -t /dev/null -e expected.txt
+...
+@ result: pass
+ +

How to use

+ +

TODO(pts): Write this section. + +

Requirements

+ +

Security is the most important requirement of uevalrun, followed by high +performance and usability. + +

The sandboxing must be secure, more specifically: + +

    +
  • Programs inside the sandbox must not be able to communicate with + the outside world, except for their stdin and stdout. So they don't have + access to the filesystem (except for some read-only access to some + whitelisted system libraries and binaries), and they can't do network + I/O. If uevalrun is used for programming contest submission evaluation, + this restriction prevents the program from finding and reading the file + containing the expected output. +
  • Sandboxed programs must not be able to use more system resources (memory, + disk, CPU) than what was allocated for them. +
  • Sandboxed programs must not be running for a longer period of time than + what was allocated. +
  • Even the compilation of programs to be run (executed) inside the sandbox + must be sandboxed (possibly with different system resource allocation), + to prevent the attacker from submitting a program source code which + exploits a bug in the compiler. +
  • The sandbox must be reverted to its initial state before each compilation + and execution, so sandboxed programs won't be able to gather information + about previous compilations and executions. For programming contests, + this restriction prevents the program from reading other contestants' + submissions or their output. +
  • Timeouts (both real time and user time) must be enforced outside the + sandbox, so the program will be reliably killed if it runs for too long + time, even if it tampers with time measurement inside the sandbox. +
  • Sanboxed programs must not be able to lie about their success, their + performance or the correctness of their output by writing special marker + characters to their stdout or stderr. +
+ +

The sandbox must be fast and waste few resources, more specifically: + +

    +
  • Reverting the sandbox to its initial, empty state must be very fast + (preferably faster than 1 second). +
  • Starting a program inside the sandbox must be very fast (preferably + faster than 1 second). +
  • Running a program inside the sandbox must not be much slower than running + the same program outside the sandbox. If the program is CPU-intensive, + it may run 1.1 times slower (i.e. 10% slower) inside than outside. If + the program is I/O-intensive, it may run 10 times slower inside than + outside. This requirement is intentionally quite loose on I/O + virtualization performance. +
  • Running a program inside the sandbox must not need more than 10MB more + memory than running the same program outside. +
  • Running a program inside the sandbox must not need any disk space, + except for the disk space needed by the program binary, the test input + and the expected output, all stored as files outside the sandbox. +
  • Compilation inside the sandbox must require only a reasonable amount of + temporary disk space (for the file to be compiled, the temporary files, + and the output binary). +
+ +

The sandbox must be easy to use and versatile, more specifically: + +

    +
  • Sandboxed programs must be able to accept any 8-bit binary input (stdin). +
  • Sandboxed programs must be able to write any 8-bit binary output to + their stdout. +
  • Multiple sandboxed programs must be able to run at the same time on the + same host system, without affecting each other. +
  • If a sandboxed program fails (e.g. because it writes to its stdout + different from what was expected, or it does a memory access violation, + it reaches a timeout, it exceeds its allocated memory etc.), the proper + failure reason has to be reported (e.g. ``wrong answer'' must not be + reported if the program times out or vice versa). +
  • The sandboxing software must have as little few system dependencies as + possible. It must be able to run in a restricted (e.g. chroot) + environment, it must not depend on system libraries or configuration. + It must work on 32-bit (x86, i386) and 64-bit (x86_64, amd64) Linux + systems, on any Linux distirubution. +
  • Sandboxed programs can be written in C, C++, Python, Ruby, Perl, + JavaScript, Lua and PHP, + or in any language whose compiler can produce a 32-bit (i386) Linux + statically linked executable binary. +
+ +

Design

+ +

To fullfill the requirements, the following fundamental building blocks +are used. + +

User-mode Linux +(UML) is used for virutalization: both compilation and execution is +performed in a UML guest, reading data from the host system using virtual +block devices (ubd), and writing its output to its +/dev/tty1 (con0), which can be read by a process +on the host. A UML guest kernel (currently 2.6.31.1) tailered to the +sandboxing requirements (security and performance) is configured and +compiled. Some kernel patches are applied to increase security, reliability +and performance. (Please note that these patches apply to the UML guest +kernel only, so the host remains unpatched, and rebooting is not needed +either.) Networking and the virtual file system are disabled in the UML +guest kernel for increased security. All unnecessary drivers and features +are removed from the UML guest kernel to get fast boot times and to reduce +the overhead. + +

The underlying virtualization technology used by UML is +ptrace(), which doesn't need +root privileges or a kernel module or kernel modifications in the host. As +an alternative to UML, Seccomp could be used for +sendboxing, but that's quite cumbersome, because the sandboxed process +cannot allocate memory for itself (see the Google Chrome Seccomp +sandbox for a generic solution), but it's still prohibitively cumbersome +to sandbox GCC this way (with its requirements for forking and creating +temporary files). Most sandboxing approaches on Linux require root +privileges for a short amount of time (for chroot, PID namespaces (see +clone(2)) and other +namespaces). Most virtualization approaches (like KVM, Xen, VirtualBox, except possibly for +QEMU) need loading of kernel modules or +patching the kernel, and support only slow guest boot times. + +

With UML, it's possibly to boot the UML guest, run a hello-world binary, +and halt the UML guest in less than 0.02 second (sustained). For that speed, +one needs a (guest) kernel patch (included and automatically applied in +uevalrun) which skips the Calibrating delay loop kernel startup step, +which usually takes 0.33 second. The memory overhead of UML is also quite +low (6 MB with a stripped-down kernel). + +

All software running inside and outside UML is written in C (for high +performance) and compiled with uClibc +and linked statically to avoid depending on the libc on the host, and to +avoid the need for installing a libc in the guest. (The total size of these +custom-built binaries is less than 100kB.) There is no Linux distribution +installed the guest – only a few custom binaries are copied, like a +custom /sbin/init, which mounts /proc, sets up +file descriptors and resource limits, and starts the sandboxed program, and +then halts the guest. The /lib directory in the guest is empty, +except for compilation, where /lib contains +libc.a, libstdc++.a etc. + +

BusyBox (statically linked with +uClibc) is used as a Swiss Army Knife tool for scripting and automation (of +the build and the setup process), both inside and outside UML. Please note, +however, that once all the binaries are built and the filesystem images are +created, BusyBox is not used anymore for running sandboxed programs and +evaluating their output (except for temporary filesystem creation) because +of performance reasons, but work is done by the small and fast custom C +tools just compiled. + +

Sandboxed program sources can be written in C (using a large subset of +uClibc as the system library), C++ +(using uClibc and +libstdc++), Python (using +all the built-in Python modules), Ruby (using just the built-in Ruby +modules and classes which are implemented in C), Perl (using only the +few dozen most common modules), +JavaScript (with + SpiderMonkey + 1.8 + smjs-1.8.0, containing readline and print), +Lua (with the full luajit-1.1.6 available), +or PHP (using just the built-in PHP +functions which are implemented in C). + +

For C and C++ compilation, a GCC 4.1.2 +toolchain is used which is based on +uClibc and produces statically linked +executables. + +

Interpreters for Python, Ruby, Perl, JavaScript, Lua and PHP are provided as +precompiled, self-contained, single, statically linked, 32-bit (i386) Linux +executables. It's easy to copy them to the /bin directory of +the UML guest. + +

All tools used for building the software are either shipped with the +software, or the software downloads them during compilation. All binary +tools are statically linked, 32-bit (i386) Linux executables. This provides +maximum host system compatibility and reproducible behavior across systems. + +

In our speed measurements, CPU-intensive programs running inside UML run +1% slower than outside UML, but I/O-intensive programs (such as C++ +compilation with GCC) can be about 15 times slower. + +

The +Minix filesystem +is used in the UML guests for both read-only filesystems (e.g. the +root filesystem with the scripting language interpreters) and read-write +filesystems (such as /tmp for the temporary assembly files +created by GCC). The Minix filesystem was chosen instead of ext2 and other +usual Linux filesystem, because it has less size overhead, it's codebase is +smaller, and it has equally good performance for the small and mostly +read-only filesystems it is used for. + +

How to make it faster?

+ +

User-mode Linux runs CPU-bound programs only a few percent slower than how +fast they run natively on the host. But for programs that do lots of I/O +(such as compiling a C++ hello-world program containing #include +<iostream> with g++), User-mode Linux can be about +15 times slower than native execution. (On some machines, the same bechmark +is only 6 time slower.) + +

For sandboxing C and C++ compilation with GCC we could use a method which +less overhead than User-mode Linux to reduce the slowdown factor of 15. +One direction is to use a more lightweight ptrace()-based +approach (thus running everything in userspace), and another direction is to +use a Linux kernel module (such as apparmor) for sandboxing. + +

We've tried sydbox for +sandboxing, and measured its speed versus native execution and User-mode +Linux. The result is surprising: User-Mode Linux is faster. Here are the +details: + +

$ cat scat.cc
+//
+#include <iostream>
+using namespace std;
+int main() {
+  (cerr << "error1\n").flush();
+  cout << "Hi!\nHello, C++ World!\n";
+  cerr << "error2" << endl;
+  return 0;
+}
+
+$ time $CXX -static -o /tmp/prog -W -Wall -s -O2 scat.cc 
+real    0m0.326s
+user    0m0.310s
+sys     0m0.030s
+
+$ ls -l sydbox
+-rwxr-x--- 1 pts eng 525804 Jan  1 17:20 sydbox
+# sydbox and pinktrace downloaded from their GIT repo on 2011-01-01.
+$ file sydbox
+sydbox: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
+$ time ./sydbox -c t.conf -- $CXX -static -o /tmp/prog2 -W -Wall -s -O2 scat.cc 
+real    0m6.576s
+user    0m1.790s
+sys     0m1.880s
+
+$ ls -l uevalrun.linux.uml
+-rwxr-x--- 1 pts eng 1087212 Jan  1 15:02 ../uevalrun.linux.uml
+$ file uevalrun.linux.uml
+uevalrun.linux.uml: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
+$ time ./uevalrun.linux.uml con=null ssl=null con0=fd:-1,fd:1 mem=38M \
+  ubdar=uevalrun.rootfs.gcx.minix.img ubdbr=scat.cc ubdcr=answer.in \
+  ubddr=uevalrun.guestinit ubde=tmp.minix.img solution_format=gxx \
+  init=/dev/ubdd root=98:0 >/tmp/t.bin
+real    0m4.833s
+user    0m0.920s
+sys     0m1.760s
+ +

Our conclusion is that it would be hard to beat the speed decrease of 15 +provided by User-mode Linux — maybe we would have to write a +speed-optimized ptrace()-based sandbox in C from scratch. In +theory, this can work, because strace -f -e getppid g++ is +only about 2.64 times slower than regular g++, so our optimized +implementation can be 3 times slower. We +should also measure G++ with another ptrace()-based sandboxing +method first. + + +

Similar software

+ +codepad is similar to uevalrun: it +compiles and runs arbitrary user-submitted code in many languages. It uses a +custom sandboxing based on ptrace(), implemented in Haskell +(User-mode Linux used by uevalrun is also based in ptrace()). + +

License

+ +

uevanrun has been released under the GNU GPL v2. + +

Bugs? Problems? Contact the author. Send feedback!

+ +

Please add your feedback to the issue tracker. +All feedbacks are welcome. + + diff --git a/deps/uevalrun/doc/uevalrun.gadget.xml b/deps/uevalrun/doc/uevalrun.gadget.xml new file mode 100644 index 0000000..7b62476 --- /dev/null +++ b/deps/uevalrun/doc/uevalrun.gadget.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/deps/uevalrun/doc/uevalrun.html b/deps/uevalrun/doc/uevalrun.html new file mode 100644 index 0000000..bc11c44 --- /dev/null +++ b/deps/uevalrun/doc/uevalrun.html @@ -0,0 +1,405 @@ + + +uevalrun: self-contained computation sandbox for Linux + + + + + +

Documentation of uevalrun

+ +

uevalrun is a self-contained computation sandbox for Linux, using +User-mode Linux for both compilation and execution of the program to be +sandboxed. The program can be written in C, C++, Python, Ruby, Perl, +JavaScript, Lua or PHP. uevanrun enforces memory limits, timeouts and output +size limits in the sandbox. The primary use case for uevalrun is evaluation +of solution programs submitted by contestants of programming contests: +uevalrun compiles the solution, runs it with the test input, compares its +output against the expected output, and writes a status report. + +

Installation

+ +

A 32-bit (x86, i386) or 64-bit (x86_64, amd64) Linux system is required +with enough RAM for both compilation and execution, plus 6 MB memory +overhead. The Linux distribution doesn't matter, because uevalrun uses +statically linked binaries, and it's self-contained: it contains all the +tools it needs, including the C and C++ compilers (from the uClibc gcc-4.1.2 +toolchain). + +

uevalrun doesn't need root privileges: it runs as a simple user. + +

uevalrun needs about 160MB of disk space, most of which is consumed by +the C compiler (31MB extracted + 17MB compressed), the scripting language +interpreters (9MB compressed), and the virtual disk images (77MB, +uncompressed). After removing all temporary files, 80MB will be enough. + +

Download and compile: + +

$ svn co http://pts-mini-gpl.googlecode.com/svn/trunk/uevalrun uevalrun
+$ cd uevalrun
+$ ./make  # This downloads some more files during compilation.
+ +

Try it (the italic parts are displayed by the program): + +

$ (echo '#! perl'; echo 'print "Hello"x2, "\n"') >foo.pl
+$ echo HelloHello >expected.txt
+$ ./uevalrun -M 10 -T 9 -E 9 -s foo.pl -t /dev/null -e expected.txt
+...
+@ result: pass
+$ echo '/**/ int main() { return!printf("HelloHello\n"); }' >foo.c
+$ ./uevalrun -M 10 -T 9 -E 9 -U 19 -N 32 -C 9 \
+  -s foo.c -t /dev/null -e expected.txt
+...
+@ result: pass
+ +

How to use

+ +

TODO(pts): Write this section. + +

Requirements

+ +

Security is the most important requirement of uevalrun, followed by high +performance and usability. + +

The sandboxing must be secure, more specifically: + +

    +
  • Programs inside the sandbox must not be able to communicate with + the outside world, except for their stdin and stdout. So they don't have + access to the filesystem (except for some read-only access to some + whitelisted system libraries and binaries), and they can't do network + I/O. If uevalrun is used for programming contest submission evaluation, + this restriction prevents the program from finding and reading the file + containing the expected output. +
  • Sandboxed programs must not be able to use more system resources (memory, + disk, CPU) than what was allocated for them. +
  • Sandboxed programs must not be running for a longer period of time than + what was allocated. +
  • Even the compilation of programs to be run (executed) inside the sandbox + must be sandboxed (possibly with different system resource allocation), + to prevent the attacker from submitting a program source code which + exploits a bug in the compiler. +
  • The sandbox must be reverted to its initial state before each compilation + and execution, so sandboxed programs won't be able to gather information + about previous compilations and executions. For programming contests, + this restriction prevents the program from reading other contestants' + submissions or their output. +
  • Timeouts (both real time and user time) must be enforced outside the + sandbox, so the program will be reliably killed if it runs for too long + time, even if it tampers with time measurement inside the sandbox. +
  • Sanboxed programs must not be able to lie about their success, their + performance or the correctness of their output by writing special marker + characters to their stdout or stderr. +
+ +

The sandbox must be fast and waste few resources, more specifically: + +

    +
  • Reverting the sandbox to its initial, empty state must be very fast + (preferably faster than 1 second). +
  • Starting a program inside the sandbox must be very fast (preferably + faster than 1 second). +
  • Running a program inside the sandbox must not be much slower than running + the same program outside the sandbox. If the program is CPU-intensive, + it may run 1.1 times slower (i.e. 10% slower) inside than outside. If + the program is I/O-intensive, it may run 10 times slower inside than + outside. This requirement is intentionally quite loose on I/O + virtualization performance. +
  • Running a program inside the sandbox must not need more than 10MB more + memory than running the same program outside. +
  • Running a program inside the sandbox must not need any disk space, + except for the disk space needed by the program binary, the test input + and the expected output, all stored as files outside the sandbox. +
  • Compilation inside the sandbox must require only a reasonable amount of + temporary disk space (for the file to be compiled, the temporary files, + and the output binary). +
+ +

The sandbox must be easy to use and versatile, more specifically: + +

    +
  • Sandboxed programs must be able to accept any 8-bit binary input (stdin). +
  • Sandboxed programs must be able to write any 8-bit binary output to + their stdout. +
  • Multiple sandboxed programs must be able to run at the same time on the + same host system, without affecting each other. +
  • If a sandboxed program fails (e.g. because it writes to its stdout + different from what was expected, or it does a memory access violation, + it reaches a timeout, it exceeds its allocated memory etc.), the proper + failure reason has to be reported (e.g. ``wrong answer'' must not be + reported if the program times out or vice versa). +
  • The sandboxing software must have as little few system dependencies as + possible. It must be able to run in a restricted (e.g. chroot) + environment, it must not depend on system libraries or configuration. + It must work on 32-bit (x86, i386) and 64-bit (x86_64, amd64) Linux + systems, on any Linux distirubution. +
  • Sandboxed programs can be written in C, C++, Python, Ruby, Perl, + JavaScript, Lua and PHP, + or in any language whose compiler can produce a 32-bit (i386) Linux + statically linked executable binary. +
+ +

Design

+ +

To fullfill the requirements, the following fundamental building blocks +are used. + +

User-mode Linux +(UML) is used for virutalization: both compilation and execution is +performed in a UML guest, reading data from the host system using virtual +block devices (ubd), and writing its output to its +/dev/tty1 (con0), which can be read by a process +on the host. A UML guest kernel (currently 2.6.31.1) tailered to the +sandboxing requirements (security and performance) is configured and +compiled. Some kernel patches are applied to increase security, reliability +and performance. (Please note that these patches apply to the UML guest +kernel only, so the host remains unpatched, and rebooting is not needed +either.) Networking and the virtual file system are disabled in the UML +guest kernel for increased security. All unnecessary drivers and features +are removed from the UML guest kernel to get fast boot times and to reduce +the overhead. + +

The underlying virtualization technology used by UML is +ptrace(), which doesn't need +root privileges or a kernel module or kernel modifications in the host. As +an alternative to UML, Seccomp could be used for +sendboxing, but that's quite cumbersome, because the sandboxed process +cannot allocate memory for itself (see the Google Chrome Seccomp +sandbox for a generic solution), but it's still prohibitively cumbersome +to sandbox GCC this way (with its requirements for forking and creating +temporary files). Most sandboxing approaches on Linux require root +privileges for a short amount of time (for chroot, PID namespaces (see +clone(2)) and other +namespaces). Most virtualization approaches (like KVM, Xen, VirtualBox, except possibly for +QEMU) need loading of kernel modules or +patching the kernel, and support only slow guest boot times. + +

With UML, it's possibly to boot the UML guest, run a hello-world binary, +and halt the UML guest in less than 0.02 second (sustained). For that speed, +one needs a (guest) kernel patch (included and automatically applied in +uevalrun) which skips the Calibrating delay loop kernel startup step, +which usually takes 0.33 second. The memory overhead of UML is also quite +low (6 MB with a stripped-down kernel). + +

All software running inside and outside UML is written in C (for high +performance) and compiled with uClibc +and linked statically to avoid depending on the libc on the host, and to +avoid the need for installing a libc in the guest. (The total size of these +custom-built binaries is less than 100kB.) There is no Linux distribution +installed the guest – only a few custom binaries are copied, like a +custom /sbin/init, which mounts /proc, sets up +file descriptors and resource limits, and starts the sandboxed program, and +then halts the guest. The /lib directory in the guest is empty, +except for compilation, where /lib contains +libc.a, libstdc++.a etc. + +

BusyBox (statically linked with +uClibc) is used as a Swiss Army Knife tool for scripting and automation (of +the build and the setup process), both inside and outside UML. Please note, +however, that once all the binaries are built and the filesystem images are +created, BusyBox is not used anymore for running sandboxed programs and +evaluating their output (except for temporary filesystem creation) because +of performance reasons, but work is done by the small and fast custom C +tools just compiled. + +

Sandboxed program sources can be written in C (using a large subset of +uClibc as the system library), C++ +(using uClibc and +libstdc++), Python (using +all the built-in Python modules), Ruby (using just the built-in Ruby +modules and classes which are implemented in C), Perl (using only the +few dozen most common modules), +JavaScript (with + SpiderMonkey + 1.8 + smjs-1.8.0, containing readline and print), +Lua (with the full luajit-1.1.6 available), +or PHP (using just the built-in PHP +functions which are implemented in C). + +

For C and C++ compilation, a GCC 4.1.2 +toolchain is used which is based on +uClibc and produces statically linked +executables. + +

Interpreters for Python, Ruby, Perl, JavaScript, Lua and PHP are provided as +precompiled, self-contained, single, statically linked, 32-bit (i386) Linux +executables. It's easy to copy them to the /bin directory of +the UML guest. + +

All tools used for building the software are either shipped with the +software, or the software downloads them during compilation. All binary +tools are statically linked, 32-bit (i386) Linux executables. This provides +maximum host system compatibility and reproducible behavior across systems. + +

In our speed measurements, CPU-intensive programs running inside UML run +1% slower than outside UML, but I/O-intensive programs (such as C++ +compilation with GCC) can be about 15 times slower. + +

The +Minix filesystem +is used in the UML guests for both read-only filesystems (e.g. the +root filesystem with the scripting language interpreters) and read-write +filesystems (such as /tmp for the temporary assembly files +created by GCC). The Minix filesystem was chosen instead of ext2 and other +usual Linux filesystem, because it has less size overhead, it's codebase is +smaller, and it has equally good performance for the small and mostly +read-only filesystems it is used for. + +

How to make it faster?

+ +

User-mode Linux runs CPU-bound programs only a few percent slower than how +fast they run natively on the host. But for programs that do lots of I/O +(such as compiling a C++ hello-world program containing #include +<iostream> with g++), User-mode Linux can be about +15 times slower than native execution. (On some machines, the same bechmark +is only 6 time slower.) + +

For sandboxing C and C++ compilation with GCC we could use a method which +less overhead than User-mode Linux to reduce the slowdown factor of 15. +One direction is to use a more lightweight ptrace()-based +approach (thus running everything in userspace), and another direction is to +use a Linux kernel module (such as apparmor) for sandboxing. + +

We've tried sydbox for +sandboxing, and measured its speed versus native execution and User-mode +Linux. The result is surprising: User-Mode Linux is faster. Here are the +details: + +

$ cat scat.cc
+//
+#include <iostream>
+using namespace std;
+int main() {
+  (cerr << "error1\n").flush();
+  cout << "Hi!\nHello, C++ World!\n";
+  cerr << "error2" << endl;
+  return 0;
+}
+
+$ time $CXX -static -o /tmp/prog -W -Wall -s -O2 scat.cc 
+real    0m0.326s
+user    0m0.310s
+sys     0m0.030s
+
+$ ls -l sydbox
+-rwxr-x--- 1 pts eng 525804 Jan  1 17:20 sydbox
+# sydbox and pinktrace downloaded from their GIT repo on 2011-01-01.
+$ file sydbox
+sydbox: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
+$ time ./sydbox -c t.conf -- $CXX -static -o /tmp/prog2 -W -Wall -s -O2 scat.cc 
+real    0m6.576s
+user    0m1.790s
+sys     0m1.880s
+
+$ ls -l uevalrun.linux.uml
+-rwxr-x--- 1 pts eng 1087212 Jan  1 15:02 ../uevalrun.linux.uml
+$ file uevalrun.linux.uml
+uevalrun.linux.uml: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
+$ time ./uevalrun.linux.uml con=null ssl=null con0=fd:-1,fd:1 mem=38M \
+  ubdar=uevalrun.rootfs.gcx.minix.img ubdbr=scat.cc ubdcr=answer.in \
+  ubddr=uevalrun.guestinit ubde=tmp.minix.img solution_format=gxx \
+  init=/dev/ubdd root=98:0 >/tmp/t.bin
+real    0m4.833s
+user    0m0.920s
+sys     0m1.760s
+ +

Our conclusion is that it would be hard to beat the speed decrease of 15 +provided by User-mode Linux — maybe we would have to write a +speed-optimized ptrace()-based sandbox in C from scratch. In +theory, this can work, because strace -f -e getppid g++ is +only about 2.64 times slower than regular g++, so our optimized +implementation can be 3 times slower. We +should also measure G++ with another ptrace()-based sandboxing +method first. + + +

Similar software

+ +codepad is similar to uevalrun: it +compiles and runs arbitrary user-submitted code in many languages. It uses a +custom sandboxing based on ptrace(), implemented in Haskell +(User-mode Linux used by uevalrun is also based in ptrace()). + +

License

+ +

uevanrun has been released under the GNU GPL v2. + +

Bugs? Problems? Contact the author. Send feedback!

+ +

Please add your feedback to the issue tracker. +All feedbacks are welcome. + + diff --git a/deps/uevalrun/download.sh b/deps/uevalrun/download.sh new file mode 100755 index 0000000..6f0064e --- /dev/null +++ b/deps/uevalrun/download.sh @@ -0,0 +1,74 @@ +#! /bin/bash -- +# +# download.sh: Download external components for uevalrun. +# by pts@fazekas.hu at Sun Nov 28 12:08:05 CET 2010 +# + +download_stbx86_pkg() { + local F="$1.stbx86.tbz2" # e.g. F=gcc.stbx86.tbz2 + if ! test -f "$F.downloaded"; then + # TODO(pts): Don't fail if fully downloaded: wget: server returned error: HTTP/1.1 416 Requested Range Not Satisfiable + ./busybox wget -c -O "$F" \ + http://pts-mini-gpl.googlecode.com/svn/trunk/stbx86/"$F" + ./busybox touch "$F".downloaded + fi + test -s "$F" +} + +set +x -e + +test "${0%/*}" != "$0" && cd "${0%/*}" + +# Make sure we fail unless weuse ./busybox for all non-built-in commands. +export PATH=/dev/null + +if ! test -f busybox; then + echo "errnor: $PWD/busybox: not found" >&2 +fi + +for F in "$@"; do + if test -f "$F.downloaded"; then + if test -s "$F"; then + echo "info: already downloaded: $F" >&2 + continue + fi + ./busybox rm -f "$F" "$F.downloaded" # Remove empty file. + fi + echo "info: downloading: $F" >&2 + if test "${F%.stbx86.tbz2}" != "$F"; then + set -x + download_stbx86_pkg "${F%.stbx86.tbz2}" + set +x + elif test "$F" = php5.3 || + test "$F" = perl5.10 || + test "$F" = ruby1.8 || + test "$F" = ruby1.9 || + test "$F" = luajit1.1 || + test "$F" = smjs1.8 || + test "$F" = stackless2.7 || + test "$F" = python2.7; then + set -x + download_stbx86_pkg "$F" + ./busybox tar -Oxjf "$F".stbx86.tbz2 bin/"$F" >"$F" + ./busybox chmod +x "$F" + ./busybox touch "$F".downloaded + set +x + elif test "$F" = linux-2.6.36.1.tar.bz2 || + test "$F" = linux-2.6.31.tar.bz2; then + set -x + ./busybox wget -c -O "$F" http://www.kernel.org/pub/linux/kernel/v2.6/"$F" + ./busybox touch "$F".downloaded + set +x + else + set +x + echo "error: unknown download target: $F" >&2 + exit 2 + fi + if ! test -s "$F"; then + rm -f "$F" + echo "info: download failed: $F" >&2 + exit 3 + fi +done + +echo "info: all downloads OK" >&2 diff --git a/deps/uevalrun/examples/.svn/all-wcprops b/deps/uevalrun/examples/.svn/all-wcprops new file mode 100644 index 0000000..c91b6a8 --- /dev/null +++ b/deps/uevalrun/examples/.svn/all-wcprops @@ -0,0 +1,89 @@ +K 25 +svn:wc:ra_dav:version-url +V 41 +/svn/!svn/ver/177/trunk/uevalrun/examples +END +answer.bad.exp +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/!svn/ver/111/trunk/uevalrun/examples/answer.bad.exp +END +scat.php +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/!svn/ver/123/trunk/uevalrun/examples/scat.php +END +xcat.c +K 25 +svn:wc:ra_dav:version-url +V 48 +/svn/!svn/ver/111/trunk/uevalrun/examples/xcat.c +END +scat.py +K 25 +svn:wc:ra_dav:version-url +V 49 +/svn/!svn/ver/122/trunk/uevalrun/examples/scat.py +END +answer.in +K 25 +svn:wc:ra_dav:version-url +V 51 +/svn/!svn/ver/111/trunk/uevalrun/examples/answer.in +END +scat.pl +K 25 +svn:wc:ra_dav:version-url +V 49 +/svn/!svn/ver/124/trunk/uevalrun/examples/scat.pl +END +scatlong.pl +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/!svn/ver/130/trunk/uevalrun/examples/scatlong.pl +END +scat.js +K 25 +svn:wc:ra_dav:version-url +V 49 +/svn/!svn/ver/177/trunk/uevalrun/examples/scat.js +END +scat.lua +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/!svn/ver/175/trunk/uevalrun/examples/scat.lua +END +answer.exp +K 25 +svn:wc:ra_dav:version-url +V 52 +/svn/!svn/ver/111/trunk/uevalrun/examples/answer.exp +END +scat.c +K 25 +svn:wc:ra_dav:version-url +V 48 +/svn/!svn/ver/134/trunk/uevalrun/examples/scat.c +END +scat.rb +K 25 +svn:wc:ra_dav:version-url +V 49 +/svn/!svn/ver/127/trunk/uevalrun/examples/scat.rb +END +run.sh +K 25 +svn:wc:ra_dav:version-url +V 48 +/svn/!svn/ver/177/trunk/uevalrun/examples/run.sh +END +scat.cc +K 25 +svn:wc:ra_dav:version-url +V 49 +/svn/!svn/ver/134/trunk/uevalrun/examples/scat.cc +END diff --git a/deps/uevalrun/examples/.svn/entries b/deps/uevalrun/examples/.svn/entries new file mode 100644 index 0000000..64b4c9c --- /dev/null +++ b/deps/uevalrun/examples/.svn/entries @@ -0,0 +1,504 @@ +10 + +dir +207 +http://pts-mini-gpl.googlecode.com/svn/trunk/uevalrun/examples +http://pts-mini-gpl.googlecode.com/svn + + + +2010-12-07T23:11:22.235080Z +177 +ptspts + + + + + + + + + + + + + + +5875f506-4f57-11de-a3de-f74ccfcb021d + +answer.bad.exp +file + + + + +2011-04-01T20:18:26.911106Z +ce2f89dc6c64e1defe83dc71c5557d5c +2010-11-22T03:06:27.169117Z +111 +ptspts + + + + + + + + + + + + + + + + + + + + + +38 + +scat.php +file + + + + +2011-04-01T20:18:26.911106Z +bf89f8dd23dc6cd44532045f6e9e5a61 +2010-11-26T17:46:12.905073Z +123 +ptspts + + + + + + + + + + + + + + + + + + + + + +49 + +xcat.c +file + + + + +2011-04-01T20:18:26.911106Z +205f2cd722a7f3c1671e89c9750da4a0 +2010-11-22T03:06:27.169117Z +111 +ptspts + + + + + + + + + + + + + + + + + + + + + +564 + +scat.py +file + + + + +2011-04-01T20:18:26.911106Z +b1290e53ab3ef9f4760c6e32701bc40d +2010-11-25T18:09:42.600245Z +122 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +89 + +answer.in +file + + + + +2011-04-01T20:18:26.911106Z +9f3c174c30978f1e287fa908f2d40a7c +2010-11-22T03:06:27.169117Z +111 +ptspts + + + + + + + + + + + + + + + + + + + + + +17 + +scat.pl +file + + + + +2011-04-01T20:18:26.911106Z +49d351fc9f7b2548d6e36f9511bd2285 +2010-11-26T21:42:06.375919Z +124 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +56 + +scatlong.pl +file + + + + +2011-04-01T20:18:26.911106Z +ddacca6e74d5a5b4710014beca53e734 +2010-11-27T12:32:35.278287Z +130 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +119 + +scat.js +file + + + + +2011-04-01T20:18:26.911106Z +b636cb8e96c3399093d488dfe3038fd8 +2010-12-07T23:11:22.235080Z +177 +ptspts + + + + + + + + + + + + + + + + + + + + + +124 + +scat.lua +file + + + + +2011-04-01T20:18:26.911106Z +56172fcf63137c81451694eed947ab28 +2010-12-07T22:25:49.884953Z +175 +ptspts + + + + + + + + + + + + + + + + + + + + + +55 + +answer.exp +file + + + + +2011-04-01T20:18:26.911106Z +e058fc7227fe2351868123a7f21a322d +2010-11-22T03:06:27.169117Z +111 +ptspts + + + + + + + + + + + + + + + + + + + + + +38 + +scat.c +file + + + + +2011-04-01T20:18:26.911106Z +a2b9d0ad0f8ba127ac33be2868eb0891 +2010-11-28T00:39:45.526146Z +134 +ptspts + + + + + + + + + + + + + + + + + + + + + +172 + +scat.rb +file + + + + +2011-04-01T20:18:26.911106Z +981083db661433d7abf7304253d9f7ac +2010-11-27T11:04:18.822911Z +127 +ptspts + + + + + + + + + + + + + + + + + + + + + +120 + +run.sh +file + + + + +2011-04-01T20:18:26.911106Z +3d873aa970db13514b82e9de112333e2 +2010-12-07T23:11:22.235080Z +177 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +2201 + +scat.cc +file + + + + +2011-04-01T20:18:26.911106Z +63e653e647af4d2b9a7ba95eb37b21eb +2010-11-28T00:39:45.526146Z +134 +ptspts + + + + + + + + + + + + + + + + + + + + + +171 + diff --git a/deps/uevalrun/examples/.svn/prop-base/run.sh.svn-base b/deps/uevalrun/examples/.svn/prop-base/run.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/uevalrun/examples/.svn/prop-base/run.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/uevalrun/examples/.svn/prop-base/scat.pl.svn-base b/deps/uevalrun/examples/.svn/prop-base/scat.pl.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/deps/uevalrun/examples/.svn/prop-base/scat.pl.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/examples/.svn/prop-base/scat.py.svn-base b/deps/uevalrun/examples/.svn/prop-base/scat.py.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/deps/uevalrun/examples/.svn/prop-base/scat.py.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/examples/.svn/prop-base/scatlong.pl.svn-base b/deps/uevalrun/examples/.svn/prop-base/scatlong.pl.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/deps/uevalrun/examples/.svn/prop-base/scatlong.pl.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/deps/uevalrun/examples/.svn/text-base/answer.bad.exp.svn-base b/deps/uevalrun/examples/.svn/text-base/answer.bad.exp.svn-base new file mode 100644 index 0000000..3177b03 --- /dev/null +++ b/deps/uevalrun/examples/.svn/text-base/answer.bad.exp.svn-base @@ -0,0 +1,2 @@ +Hi! +:T:hUe: :a:n:s:w:e:r: :i:s: :4:2:. \ No newline at end of file diff --git a/deps/uevalrun/examples/.svn/text-base/answer.exp.svn-base b/deps/uevalrun/examples/.svn/text-base/answer.exp.svn-base new file mode 100644 index 0000000..e8380b3 --- /dev/null +++ b/deps/uevalrun/examples/.svn/text-base/answer.exp.svn-base @@ -0,0 +1,2 @@ +Hi! +:T:h:e: :a:n:s:w:e:r: :i:s: :4:2:. \ No newline at end of file diff --git a/deps/uevalrun/examples/.svn/text-base/answer.in.svn-base b/deps/uevalrun/examples/.svn/text-base/answer.in.svn-base new file mode 100644 index 0000000..83daf0a --- /dev/null +++ b/deps/uevalrun/examples/.svn/text-base/answer.in.svn-base @@ -0,0 +1 @@ +The answer is 42. \ No newline at end of file diff --git a/deps/uevalrun/examples/.svn/text-base/run.sh.svn-base b/deps/uevalrun/examples/.svn/text-base/run.sh.svn-base new file mode 100644 index 0000000..598a517 --- /dev/null +++ b/deps/uevalrun/examples/.svn/text-base/run.sh.svn-base @@ -0,0 +1,49 @@ +#! /bin/bash -- +# +# examples/run.sh: Run uevalrun with some preconfigured settings. +# by pts@fazekas.hu at Sun Nov 28 13:17:28 CET 2010 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +set -ex +# Make sure we fail unless weuse ./busybox for all non-built-in commands. +export PATH=/dev/null +test "${0%/*}" != "$0" && cd "${0%/*}" +../make -C .. +if test "$1" = python; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.py -t answer.in -e answer.exp +elif test "$1" = ruby; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.rb -t answer.in -e answer.exp +elif test "$1" = php; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.php -t answer.in -e answer.exp +elif test "$1" = perl; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.pl -t answer.in -e answer.exp +elif test "$1" = lua; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.lua -t answer.in -e answer.exp +elif test "$1" = javascript; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.js -t answer.in -e answer.exp +elif test "$1" = perl.ok; then + ../uevalrun -M 32 -T 3 -E 20 -s scatok.pl -t answer.in -e answer.exp +elif test "$1" = c; then + ../uevalrun -M 3 -T 9 -E 20 -s scatc -C 2 -N 32 -U 10 -t answer.in -e answer.scatc.exp +elif test "$1" = gcc; then + ../uevalrun -M 3 -T 9 -E 20 -s scat.c -C 2 -N 32 -U 10 -t answer.in -e answer.exp +elif test "$1" = gxx; then + ../uevalrun -M 3 -T 9 -E 20 -s scat.cc -C 2 -N 32 -U 20 -t answer.in -e answer.exp +elif test "$1" = long; then + perl scatlong.pl >long.exp # TODO(pts): Do this without Perl. + ../uevalrun -M 32 -T 3 -E 20 -s scatlong.pl -t answer.in -e long.exp +elif test "$#" = 1; then + ../make -C .. xcat + ../uevalrun -M 26 -T 3 -E 20 -s ../xcat -t answer.in -e answer.bad.exp +else + ../make -C .. xcat + ../uevalrun -M 26 -T 3 -E 20 -s ../xcat -t answer.in -e answer.exp +fi diff --git a/deps/uevalrun/examples/.svn/text-base/scat.c.svn-base b/deps/uevalrun/examples/.svn/text-base/scat.c.svn-base new file mode 100644 index 0000000..bb7ee24 --- /dev/null +++ b/deps/uevalrun/examples/.svn/text-base/scat.c.svn-base @@ -0,0 +1,9 @@ +#include + +int main() { + fprintf(stderr, "error1\n"); + fflush(stderr); + fprintf(stdout, "Hi!\nHello, C World!\n"); + fprintf(stderr, "error2\n"); + return 0; +} diff --git a/deps/uevalrun/examples/.svn/text-base/scat.cc.svn-base b/deps/uevalrun/examples/.svn/text-base/scat.cc.svn-base new file mode 100644 index 0000000..8ec4ffe --- /dev/null +++ b/deps/uevalrun/examples/.svn/text-base/scat.cc.svn-base @@ -0,0 +1,11 @@ +// +#include + +using namespace std; + +int main() { + (cerr << "error1\n").flush(); + cout << "Hi!\nHello, C++ World!\n"; + cerr << "error2" << endl; + return 0; +} diff --git a/deps/uevalrun/examples/.svn/text-base/scat.js.svn-base b/deps/uevalrun/examples/.svn/text-base/scat.js.svn-base new file mode 100644 index 0000000..76839c8 --- /dev/null +++ b/deps/uevalrun/examples/.svn/text-base/scat.js.svn-base @@ -0,0 +1,4 @@ +#! smjs +// Use readline() to read a line from stdin, see also print(help()). +print('Hi!') +print('Hello, JavaScript World!') diff --git a/deps/uevalrun/examples/.svn/text-base/scat.lua.svn-base b/deps/uevalrun/examples/.svn/text-base/scat.lua.svn-base new file mode 100644 index 0000000..c9416a0 --- /dev/null +++ b/deps/uevalrun/examples/.svn/text-base/scat.lua.svn-base @@ -0,0 +1,4 @@ +#! lua +print("Hi!"); +io.write("Hello, Lua World!\n"); + diff --git a/deps/uevalrun/examples/.svn/text-base/scat.php.svn-base b/deps/uevalrun/examples/.svn/text-base/scat.php.svn-base new file mode 100644 index 0000000..a43b882 --- /dev/null +++ b/deps/uevalrun/examples/.svn/text-base/scat.php.svn-base @@ -0,0 +1,3 @@ + +#include +#include + +char t[24 << 20]; /* 24MB -- give 6MB to the kernel and others -- 5MB is not enough */ +/* char t[1 << 28] */ /* 256MB */ + +#if 0 +static int rec() { + return 1 + rec(); +} +#endif + +int main() { + int i; + printf("Hi!\n"); + fflush(stdout); + fprintf(stderr, "Output to stderr ignored.\n"); + fflush(stderr); +#if 0 + rec(); /* Causes SIGSEGV --> runtime error */ +#endif +#if 0 + for (;;) {} +#endif +#if 0 + sleep(2); +#endif + while (0 <= (i = getchar())) { + putchar(':'); + putchar(i); + } + return 0; +} diff --git a/deps/uevalrun/examples/answer.bad.exp b/deps/uevalrun/examples/answer.bad.exp new file mode 100644 index 0000000..3177b03 --- /dev/null +++ b/deps/uevalrun/examples/answer.bad.exp @@ -0,0 +1,2 @@ +Hi! +:T:hUe: :a:n:s:w:e:r: :i:s: :4:2:. \ No newline at end of file diff --git a/deps/uevalrun/examples/answer.exp b/deps/uevalrun/examples/answer.exp new file mode 100644 index 0000000..e8380b3 --- /dev/null +++ b/deps/uevalrun/examples/answer.exp @@ -0,0 +1,2 @@ +Hi! +:T:h:e: :a:n:s:w:e:r: :i:s: :4:2:. \ No newline at end of file diff --git a/deps/uevalrun/examples/answer.in b/deps/uevalrun/examples/answer.in new file mode 100644 index 0000000..83daf0a --- /dev/null +++ b/deps/uevalrun/examples/answer.in @@ -0,0 +1 @@ +The answer is 42. \ No newline at end of file diff --git a/deps/uevalrun/examples/run.sh b/deps/uevalrun/examples/run.sh new file mode 100755 index 0000000..598a517 --- /dev/null +++ b/deps/uevalrun/examples/run.sh @@ -0,0 +1,49 @@ +#! /bin/bash -- +# +# examples/run.sh: Run uevalrun with some preconfigured settings. +# by pts@fazekas.hu at Sun Nov 28 13:17:28 CET 2010 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +set -ex +# Make sure we fail unless weuse ./busybox for all non-built-in commands. +export PATH=/dev/null +test "${0%/*}" != "$0" && cd "${0%/*}" +../make -C .. +if test "$1" = python; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.py -t answer.in -e answer.exp +elif test "$1" = ruby; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.rb -t answer.in -e answer.exp +elif test "$1" = php; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.php -t answer.in -e answer.exp +elif test "$1" = perl; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.pl -t answer.in -e answer.exp +elif test "$1" = lua; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.lua -t answer.in -e answer.exp +elif test "$1" = javascript; then + ../uevalrun -M 32 -T 3 -E 20 -s scat.js -t answer.in -e answer.exp +elif test "$1" = perl.ok; then + ../uevalrun -M 32 -T 3 -E 20 -s scatok.pl -t answer.in -e answer.exp +elif test "$1" = c; then + ../uevalrun -M 3 -T 9 -E 20 -s scatc -C 2 -N 32 -U 10 -t answer.in -e answer.scatc.exp +elif test "$1" = gcc; then + ../uevalrun -M 3 -T 9 -E 20 -s scat.c -C 2 -N 32 -U 10 -t answer.in -e answer.exp +elif test "$1" = gxx; then + ../uevalrun -M 3 -T 9 -E 20 -s scat.cc -C 2 -N 32 -U 20 -t answer.in -e answer.exp +elif test "$1" = long; then + perl scatlong.pl >long.exp # TODO(pts): Do this without Perl. + ../uevalrun -M 32 -T 3 -E 20 -s scatlong.pl -t answer.in -e long.exp +elif test "$#" = 1; then + ../make -C .. xcat + ../uevalrun -M 26 -T 3 -E 20 -s ../xcat -t answer.in -e answer.bad.exp +else + ../make -C .. xcat + ../uevalrun -M 26 -T 3 -E 20 -s ../xcat -t answer.in -e answer.exp +fi diff --git a/deps/uevalrun/examples/scat.c b/deps/uevalrun/examples/scat.c new file mode 100644 index 0000000..bb7ee24 --- /dev/null +++ b/deps/uevalrun/examples/scat.c @@ -0,0 +1,9 @@ +#include + +int main() { + fprintf(stderr, "error1\n"); + fflush(stderr); + fprintf(stdout, "Hi!\nHello, C World!\n"); + fprintf(stderr, "error2\n"); + return 0; +} diff --git a/deps/uevalrun/examples/scat.cc b/deps/uevalrun/examples/scat.cc new file mode 100644 index 0000000..8ec4ffe --- /dev/null +++ b/deps/uevalrun/examples/scat.cc @@ -0,0 +1,11 @@ +// +#include + +using namespace std; + +int main() { + (cerr << "error1\n").flush(); + cout << "Hi!\nHello, C++ World!\n"; + cerr << "error2" << endl; + return 0; +} diff --git a/deps/uevalrun/examples/scat.js b/deps/uevalrun/examples/scat.js new file mode 100644 index 0000000..76839c8 --- /dev/null +++ b/deps/uevalrun/examples/scat.js @@ -0,0 +1,4 @@ +#! smjs +// Use readline() to read a line from stdin, see also print(help()). +print('Hi!') +print('Hello, JavaScript World!') diff --git a/deps/uevalrun/examples/scat.lua b/deps/uevalrun/examples/scat.lua new file mode 100644 index 0000000..c9416a0 --- /dev/null +++ b/deps/uevalrun/examples/scat.lua @@ -0,0 +1,4 @@ +#! lua +print("Hi!"); +io.write("Hello, Lua World!\n"); + diff --git a/deps/uevalrun/examples/scat.php b/deps/uevalrun/examples/scat.php new file mode 100644 index 0000000..a43b882 --- /dev/null +++ b/deps/uevalrun/examples/scat.php @@ -0,0 +1,3 @@ + +#include +#include + +char t[24 << 20]; /* 24MB -- give 6MB to the kernel and others -- 5MB is not enough */ +/* char t[1 << 28] */ /* 256MB */ + +#if 0 +static int rec() { + return 1 + rec(); +} +#endif + +int main() { + int i; + printf("Hi!\n"); + fflush(stdout); + fprintf(stderr, "Output to stderr ignored.\n"); + fflush(stderr); +#if 0 + rec(); /* Causes SIGSEGV --> runtime error */ +#endif +#if 0 + for (;;) {} +#endif +#if 0 + sleep(2); +#endif + while (0 <= (i = getchar())) { + putchar(':'); + putchar(i); + } + return 0; +} diff --git a/deps/uevalrun/guestinit.c b/deps/uevalrun/guestinit.c new file mode 100644 index 0000000..5b9c0ec --- /dev/null +++ b/deps/uevalrun/guestinit.c @@ -0,0 +1,596 @@ +/* + * guestinit.c -- init(7) in the UML guest, for uevalrun + * by pts@fazekas.hu at Mon Nov 22 02:36:01 CET 2010 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void done(int exitcode) { + char buf[sizeof(int) * 3 + 1]; + sprintf(buf, "%d\n", exitcode); + if (exitcode != 0) + fprintf(stderr, "guestinit: failure, exitcode=%d\n", exitcode); + fflush(stdout); + fflush(stderr); + /* Make sure that con0 (/dev/tty0) is flushed to the UML host. */ + tcdrain(1); + sync(); + /* RB_POWER_OFF: System halted., because no power management in UML */ + /* RB_HALT_SYSTEM: System halted. */ + /* RB_AUTOBOOT: Restarting system., UML exits with SIGABRT */ + write(open("/proc/exitcode", O_WRONLY), buf, strlen(buf)); + reboot(RB_HALT_SYSTEM); +} + +static char rbuf[16 + 8192 + 1]; +static char wbuf[8192]; + +static pid_t child; +static int status; + +/** Returns 0 on success; -EINTR */ +static int copy_output(int outfd, char which, char *done_flag) { + int got = read(outfd, rbuf + 16, sizeof(rbuf) - 17); + int rgot; + char *p; + if (0 > got) { + if (errno == EINTR) { + return 0; + } else { + fprintf(stderr, "guestinit: %s read failed: %s\n", + which == STDOUT_FILENO ? "stdout" : "stderr", + strerror(errno)); + return 1; + } + } + if (0 == got) { + *done_flag = 1; + } else { + rgot = got; + p = rbuf + 16; + p[got] = '\0'; /* Just for extra safety. */ + *--p = which == STDOUT_FILENO ? '>' : '!'; + do { + *--p = rgot % 10 + '0'; + rgot /= 10; + } while (rgot > 0); + rgot = got + (rbuf + 16 - p); + if (p[rgot - 1] != '\n') + p[rgot++] = '\n'; + while (rgot > 0) { + /* We don't care if this operation is blocking. */ + got = write(1, p, rgot); + if (0 > got) { + if (errno != EINTR) { + fprintf(stderr, "guestinit: output write failed: %s\n", strerror(errno)); + return 1; + } + } else { + p += got; + rgot -= got; + } + } + } + return 0; +} + +/** Convert subprocess exit wait() status to guestinit UML guest exitcode */ +static int status_to_exitcode(int status) { + if (WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL) { + /* TODO(pts): Better detect out-of-memory, e.g. by analyzing ELF + * headers */ + return 2; + } else if (WIFSIGNALED(status) && WTERMSIG(status) == SIGXCPU) { + return 3; /* TODO(pts): Get rid of these magic exitcode constants */ + } + return 1; +} + +/** Returns an UML exitcode (0 on success, a positive value on failure). */ +static int work() { + struct rlimit rl; + fd_set rset; + fd_set wset; + int maxfd; + char is_stdout_done, is_stderr_done, is_input_done; + uint64_t fs, fsw; + struct termios ti; + int fd, got, wbufi, wbufl; + int pinfds[2], pstdoutfds[2], pstderrfds[2]; + char *p, *q; + char* env[] = { NULL }; + char* args[16]; + char is_ruby19 = 0; + char is_gcx = 0; + char *gcx_src_path = NULL; + + if (0 == tcgetattr(1, &ti)) { /* Almost always true. */ + /* Don't convert \n to \n when printing. */ + ti.c_oflag &= ~ONLCR; + if (0 != tcsetattr(1, TCSADRAIN, &ti)) { + fprintf(stderr, "guestinit: tcsetattr() failed\n"); + return 1; + } + } + fprintf(stderr, "guestinit: info: hello\n"); + if (0 != klogctl(8, NULL, 1)) { /* Disable kernel logging to console except for KERN_EMERG */ + fprintf(stderr, "guestinit: could not set kernel console loglevel\n"); + return 1; + } + if (0 != mount("dummy", "/proc", "proc", MS_MGC_VAL, NULL)) { + fprintf(stderr, "guestinit: mount /proc failed\n"); + return 1; + } + if (0 != setregid(1000, 1000)) { + fprintf(stderr, "guestinit: setregid() failed\n"); + return 1; + } + + if (0 > (fd = open("/proc/cmdline", O_RDONLY))) { /* command to run */ + fprintf(stderr, "guestinit: open(/proc/cmdline) failed: %s\n", + strerror(errno)); + return 1; + } + wbuf[0] = ' '; + wbufl = 1; + while (wbufl + 0U < sizeof wbuf - 1) { + got = read(fd, wbuf + wbufl, sizeof wbuf - 1 - wbufl); + if (got < 0) { + fprintf(stderr, "guestinit: read(/dev/ubde) failed: %s\n", + strerror(errno)); + return 1; + } + if (got == 0) + break; + wbufl += got; + } + close(fd); + wbuf[wbufl] = '\0'; + + p = strstr(wbuf, " solution_format="); + if (p == NULL) { + fprintf(stderr, "guestinit: missing solution_format="); + return 1; + } + p += sizeof(" solution_format=") - 1; + q = p; + while (*q != '\0' && *q != ' ' && *q != '\n' && *q != '\t') + ++q; + *q = '\0'; + + if (0 == strcmp(p, "elf")) { + args[0] = "/dev/ubdb"; + args[1] = NULL; + } else if (0 == strcmp(p, "ruby1.8")) { + args[0] = "/bin/ruby1.8"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "ruby1.9")) { + is_ruby19 = 1; + args[0] = "/bin/ruby1.9"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "ruby")) { + args[0] = "/bin/ruby"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "php")) { + args[0] = "/bin/php"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "perl")) { + args[0] = "/bin/perl"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "lua")) { + args[0] = "/bin/lua"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "javascript")) { + args[0] = "/bin/js"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else if (0 == strcmp(p, "gcc")) { + is_gcx = 1; + gcx_src_path = "/tmp/prog.c"; + args[0] = "/bin/gcc"; /* This implies -static */ + /* This could be -o/proc/self/fd/1 , but we want to impose a size limit + * on the created executable (in addition to the source file and the + * assembly output). + */ + /* TODO(pts): Make uevalrun.c report `No space left on device' smarter. */ + args[1] = "-o/tmp/prog", + /* TODO(pts): Make these flags compatible. */ + /* Make sure that the args array is large enough. */ + args[2] = "-Wall"; + args[3] = "-W"; + args[4] = "-s"; + args[5] = "-O2"; + args[6] = gcx_src_path; + args[7] = NULL; + } else if (0 == strcmp(p, "gxx")) { + is_gcx = 1; + gcx_src_path = "/tmp/prog.cc"; + args[0] = "/bin/g++"; /* This implies -static */ + args[1] = "-o/tmp/prog", + args[2] = "-Wall"; + args[3] = "-W"; + args[4] = "-s"; + args[5] = "-O2"; + args[6] = gcx_src_path; + args[7] = NULL; + } else if (0 == strcmp(p, "python")) { + args[0] = "/bin/python"; + args[1] = "/dev/ubdb"; + args[2] = NULL; + } else { + fprintf(stderr, "guestinit: unknown solution_format: %s\n", p); + return 1; + } + + if (is_gcx) { + if (0 > (fd = open("/dev/null", O_RDONLY))) { + fprintf(stderr, "guestinit: open(/dev/null) failed: %s\n", strerror(errno)); + return 1; + } + fs = 0; + } else { + /* UML pads the file with '\0' to 512-byte block boundary, but we'll work + * it around. + */ + if (0 > (fd = open(is_gcx ? "/dev/null" : "/dev/ubdc", O_RDONLY))) { /* input */ + fprintf(stderr, "guestinit: open(input) failed: %s\n", strerror(errno)); + return 1; + } + /* TIOCGPGRP works just in the UML patched by uevalrun. It's like + * BLKGETSIZE64, but it doesn't round up (i.e. it returns the proper file + * size). + */ + if (0 != ioctl(fd, TIOCGPGRP, &fs)) { + fprintf(stderr, "guestinit: size getting failed: %s\n", strerror(errno)); + return 1; + } + } + if (0 != pipe(pinfds)) { + fprintf(stderr, "guestinit: input pipe creation failed: %s\n", strerror(errno)); + return 1; + } + if (0 != pipe(pstdoutfds)) { + fprintf(stderr, "guestinit: stdout pipe creation failed: %s\n", strerror(errno)); + return 1; + } + if (0 != pipe(pstderrfds)) { + fprintf(stderr, "guestinit: stderr pipe creation failed: %s\n", strerror(errno)); + return 1; + } + + if (pinfds[0] != 0) { + if (0 != dup2(pinfds[0], 0)) { + fprintf(stderr, "guestinit: dup2() for input pipe failed: %s\n", strerror(errno)); + return 1; + } + close(pinfds[0]); + } + + if (is_gcx) { + int src_fd, tmp_fd, wgot; + uint64_t src_fs; + char* mkargs[] = { + "/bin/busybox", "mkfs.minix", "-n", "30", "-i", "8", "/dev/ubde", + NULL + }; + fflush(stdout); + fflush(stderr); + child = fork(); + if (child < 0) { + fprintf(stderr, "guestinit: mktmp fork() failed: %s\n", strerror(errno)); + return 1; + } + if (child == 0) { /* Child process. */ + status = execve(mkargs[0], mkargs, env); + fprintf(stderr, "mktmp execve() failed (%d): %s\n", + status, strerror(errno)); + exit(125); + } + while (child != waitpid(child, &status, 0)) {} + if (status != 0) { + fprintf(stderr, "guestinit: mktmp failed with status=0x%x\n", status); + return 1; + } + /* /tmp is a symlink to /fs */ + if (0 != mount("/dev/ubde", "/fs", "minix", MS_MGC_VAL, NULL)) { + fprintf(stderr, "guestinit: failed: mount /dev/ubde /fs -t minix: %s\n", + strerror(errno)); + return 1; + } + if (0 != chmod("/fs", 01777)) { + fprintf(stderr, "guestinit: chmod failed: /fs: %s\n", strerror(errno)); + return 1; + } + /* We can't just create a symlink (ln -s /dev/ubdb /tmp/prog.c), + * because GCC won't compile block devices. + */ + if (0 > (src_fd = open("/dev/ubdb", O_RDONLY))) { + fprintf(stderr, "guestinit: open(source) failed: %s\n", strerror(errno)); + return 1; + } + + if (0 != ioctl(src_fd, TIOCGPGRP, &src_fs)) { + fprintf(stderr, "guestinit: source size getting failed: %s\n", strerror(errno)); + return 1; + } + if (0 > (tmp_fd = open(gcx_src_path, O_WRONLY | O_CREAT | O_EXCL, 0644))) { + fprintf(stderr, "guestinit: open(%s) failed: %s\n", + gcx_src_path, strerror(errno)); + return 1; + } + while (src_fs > 0) { + got = read(src_fd, wbuf, src_fs > sizeof wbuf ? sizeof wbuf : src_fs); + if (got > 0) { + wgot = write(tmp_fd, wbuf, got); + if (wgot == got) { + } else if (wgot < 0) { + fprintf(stderr, "guestinit: source copy write failed: %s\n", + strerror(errno)); + return 1; + } else { + fprintf(stderr, "guestinit: source copy write too short\n"); + return 1; + } + } else if (got == 0) { + fprintf(stderr, "guestinit: source file too short\n"); + return 1; + } else { + fprintf(stderr, "guestinit: error reading source file: %s\n", + strerror(errno)); + return 1; + } + src_fs -= got; + } + close(tmp_fd); + close(src_fd); + } + + /* Not giving up root (setreuid) because we have to halt the guest later. */ + fprintf(stderr, "guestinit: info: running solution binary\n"); + fflush(stdout); + fflush(stderr); + child = fork(); + if (child < 0) { + fprintf(stderr, "guestinit: fork() failed: %s\n", strerror(errno)); + return 1; + } + if (child == 0) { /* Child process. */ + close(fd); + close(pinfds[1]); + close(pstdoutfds[0]); + close(pstderrfds[0]); + if (is_gcx) { /* Make the compiler stdout (if any) go to stderr */ + if (pstdoutfds[1] != pstderrfds[1]) { + close(pstdoutfds[1]); + pstdoutfds[1] = pstderrfds[1]; + } + } + fflush(stdout); + if (pstdoutfds[1] != 1) { + if (1 != dup2(pstdoutfds[1], 1)) { + fprintf(stderr, "guestinit: child: dup2() for stdout pipe failed: %s\n", strerror(errno)); + exit(124); + } + if (pstdoutfds[1] != pstderrfds[1]) + close(pstdoutfds[1]); + } + fflush(stderr); + if (pstderrfds[1] != 2) { + if (2 != dup2(pstderrfds[1], 2)) { + fprintf(stderr, "guestinit: child: dup2() for stderr pipe failed: %s\n", strerror(errno)); + exit(124); + } + close(pstderrfds[1]); + } + if (0 != setreuid(1000, 1000)) { + fprintf(stderr, "guestinit: child: setreuid() failed\n"); + exit(124); + } + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_CORE, &rl); + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_MEMLOCK, &rl); + rl.rlim_cur = rl.rlim_max = RLIM_INFINITY; + setrlimit(RLIMIT_STACK, &rl); + + if (is_gcx) { + /* 4 should be enough for gcc */ + rl.rlim_max = rl.rlim_cur = 10; + setrlimit(RLIMIT_NPROC, &rl); + } else { + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_FSIZE, &rl); + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_LOCKS, &rl); + rl.rlim_cur = rl.rlim_max = 0; + setrlimit(RLIMIT_MSGQUEUE, &rl); + rl.rlim_cur = 10; + rl.rlim_max = 10; + setrlimit(RLIMIT_NOFILE, &rl); + /* ruby1.9 needs 3 processes for its timer thread */ + rl.rlim_max = rl.rlim_cur = is_ruby19 ? 3 : 0; + setrlimit(RLIMIT_NPROC, &rl); + } + status = execve(args[0], args, env); + /* This will appear as the stderr of the child. */ + fprintf(stderr, "execve(%s) failed (%d): %s\n", + args[0], status, strerror(errno)); + exit(125); /* End of child process. */ + } + close(0); + close(pstdoutfds[1]); + close(pstderrfds[1]); + + /* Copy from fd (input file) to pinfds[1] (writable end of pipe input) */ + if (fs == 0) { + is_input_done = 1; + close(fd); + close(pinfds[1]); + } else { + is_input_done = 0; + } + is_stdout_done = 0; + is_stderr_done = 0; + if (is_gcx) { + close(pstdoutfds[0]); + is_stdout_done = 1; + } + maxfd = fd > pstdoutfds[0] ? fd : pstdoutfds[0]; + if (pstderrfds[0] > maxfd) maxfd = pstderrfds[0]; + ++maxfd; + wbufi = wbufl = 0; + fsw = fs; + while (!(is_input_done && is_stdout_done && is_stderr_done)) { + /* TODO(pts): Use poll to make it faster */ + FD_ZERO(&wset); + if (!is_input_done) + FD_SET(pinfds[1], &wset); + FD_ZERO(&rset); + if (!is_stdout_done) + FD_SET(pstdoutfds[0], &rset); + if (!is_stderr_done) + FD_SET(pstderrfds[0], &rset); + if (select(maxfd, &rset, &wset, NULL, NULL) == -1) { + if (errno == EINTR) { + continue; + } + fprintf(stderr, "guestinit: select() failed: %s\n", strerror(errno)); + return 1; + } + if (FD_ISSET(pinfds[1], &wset)) { + if (wbufi == wbufl) { /* No more data in write buffer. */ + if (fs == 0) { + fprintf(stderr, "guestinit: unexpected EOF in input block, need more: %ld\n", + (long)fs); + return 1; + } + wbufi = 0; + got = read(fd, wbuf, fs > sizeof wbuf ? sizeof wbuf : fs); + if (0 > got) { + if (errno != EINTR) { + fprintf(stderr, "guestinit: input read failed: %s\n", strerror(errno)); + return 1; + } + } else { + if (0 == got) { + fprintf(stderr, "guestinit: input EOF too early, need more: %ld\n", (long)fs); + return 1; + } + wbufl = got; + fs -= got; + if (fs == 0) + close(fd); + } + } + got = write(pinfds[1], wbuf + wbufi, wbufl - wbufi); + if (0 > got) { + if (errno != EINTR) { + fprintf(stderr, "guestinit: input pipe write failed: %s\n", + strerror(errno)); + return 1; + } + } else { + wbufi += got; + fsw -= got; + if (fsw == 0) { + is_input_done = 1; + close(pinfds[1]); + } + } + } + /* Process pstderr before pstdout. */ + if (FD_ISSET(pstderrfds[0], &rset)) { + if (0 != (got = copy_output(pstderrfds[0], STDERR_FILENO, &is_stderr_done))) + return got; + if (is_stderr_done && is_gcx) { /* Just received EOF. */ + struct stat st; + /* Wait for the compiler to finish. */ + while (child != waitpid(child, &status, 0)) {} + if (status != 0) { + fprintf(stderr, "\nguestinit: compiler failed with status=0x%x\n", + status); + return status_to_exitcode(status); + } + /* TODO(pts): Display how long compilation took -- maybe in the host */ + fprintf(stderr, "\nguestinit: compilation successful\n"); + if (0 > (pstdoutfds[0] = open("/tmp/prog", O_RDONLY))) { + fprintf(stderr, "guestinit: cannot open binary " + "created by the compiler: /tmp/prog: %s\n", strerror(errno)); + return 1; + } + if (0 != fstat(pstdoutfds[0], &st)) { + fprintf(stderr, "guestinit: fstat: %s\n", strerror(errno)); + return 1; + } + fprintf(stderr, "guestinit: compiled binary size is %d bytes\n", + (int)st.st_size); + is_stdout_done = 0; + if (maxfd <= pstdoutfds[0]) + maxfd = pstdoutfds[0] + 1; + } + } + if (FD_ISSET(pstdoutfds[0], &rset)) { + if (0 != (got = copy_output(pstdoutfds[0], STDOUT_FILENO, &is_stdout_done))) + return got; + } + } + close(fd); + close(pinfds[1]); + close(pstdoutfds[0]); + close(pstderrfds[0]); + if (!is_gcx) { + /* We wait only this late (even for other processes closing the pipe) to + * avoid the race condition between SIGCHLD and reading the output of the + * child. We still won't receive the last few error messages. + */ + while (child != waitpid(child, &status, 0)) {} + if (status != 0) { + fprintf(stderr, "\nguestinit: solution child failed with status=0x%x.\n", status); + return status_to_exitcode(status); + } + fprintf(stderr, "\nguestinit: solution child successful\n"); + } + return 0; +} + +int main(int argc, char** argv) { + (void)argc; (void)argv; + if (getpid() != 1) { + fprintf(stderr, "guestinit: run me as init (PID 1)!\n"); + return 2; + } + done(work()); + return 0; /* Unreached. */ +} diff --git a/deps/uevalrun/linux-2.6.36-uevalrun.patch b/deps/uevalrun/linux-2.6.36-uevalrun.patch new file mode 100644 index 0000000..a0deb58 --- /dev/null +++ b/deps/uevalrun/linux-2.6.36-uevalrun.patch @@ -0,0 +1,1869 @@ +This is the patch against vanilla linux-2.6.36 so that the UML (User-mode Linux) +kernel for uevalrun can be built. See make_kernel.sh for a complete script +which builds the kernel (ELF 32-bit executable uevalrun.linux.uml). + +Here is how this patch file was generated. + + for F in `cat linux-2.6.36/diff.list`; do + diff -Nu -U10 linux-2.6.36{.orig,}/"$F"; done >linux-2.6.36-uevalrun.patch + +This patch applies cleanly to the following kernels: + +* http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.tar.bz2 +* http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.1.tar.bz2 + +--- linux-2.6.36.orig/.config 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.36/.config 2010-11-24 00:16:02.000000000 +0100 +@@ -0,0 +1,411 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.36 ++# Wed Nov 24 00:07:42 2010 ++# ++CONFIG_DEFCONFIG_LIST="arch/$ARCH/defconfig" ++CONFIG_GENERIC_HARDIRQS=y ++CONFIG_UML=y ++CONFIG_MMU=y ++CONFIG_NO_IOMEM=y ++# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set ++CONFIG_LOCKDEP_SUPPORT=y ++# CONFIG_STACKTRACE_SUPPORT is not set ++CONFIG_GENERIC_CALIBRATE_DELAY=y ++CONFIG_GENERIC_BUG=y ++CONFIG_GENERIC_CLOCKEVENTS=y ++CONFIG_IRQ_RELEASE_METHOD=y ++CONFIG_HZ=100 ++ ++# ++# UML-specific options ++# ++ ++# ++# Host processor type and features ++# ++# CONFIG_M486 is not set ++# CONFIG_M586 is not set ++# CONFIG_M586TSC is not set ++# CONFIG_M586MMX is not set ++# CONFIG_M686 is not set ++# CONFIG_MPENTIUMII is not set ++CONFIG_MPENTIUMIII=y ++# CONFIG_MPENTIUMM is not set ++# CONFIG_MPENTIUM4 is not set ++# CONFIG_MK6 is not set ++# CONFIG_MK7 is not set ++# CONFIG_MK8 is not set ++# CONFIG_MCRUSOE is not set ++# CONFIG_MEFFICEON is not set ++# CONFIG_MWINCHIPC6 is not set ++# CONFIG_MWINCHIP3D is not set ++# CONFIG_MGEODEGX1 is not set ++# CONFIG_MGEODE_LX is not set ++# CONFIG_MCYRIXIII is not set ++# CONFIG_MVIAC3_2 is not set ++# CONFIG_MVIAC7 is not set ++# CONFIG_MCORE2 is not set ++# CONFIG_MATOM is not set ++CONFIG_X86_GENERIC=y ++CONFIG_X86_CPU=y ++CONFIG_X86_INTERNODE_CACHE_SHIFT=6 ++CONFIG_X86_CMPXCHG=y ++CONFIG_X86_L1_CACHE_SHIFT=6 ++CONFIG_X86_XADD=y ++CONFIG_X86_WP_WORKS_OK=y ++CONFIG_X86_INVLPG=y ++CONFIG_X86_BSWAP=y ++CONFIG_X86_POPAD_OK=y ++CONFIG_X86_INTEL_USERCOPY=y ++CONFIG_X86_USE_PPRO_CHECKSUM=y ++CONFIG_X86_TSC=y ++CONFIG_X86_CMPXCHG64=y ++CONFIG_X86_CMOV=y ++CONFIG_X86_MINIMUM_CPU_FAMILY=5 ++CONFIG_CPU_SUP_INTEL=y ++CONFIG_CPU_SUP_CYRIX_32=y ++CONFIG_CPU_SUP_AMD=y ++CONFIG_CPU_SUP_CENTAUR=y ++CONFIG_CPU_SUP_TRANSMETA_32=y ++CONFIG_CPU_SUP_UMC_32=y ++CONFIG_UML_X86=y ++# CONFIG_64BIT is not set ++CONFIG_X86_32=y ++CONFIG_RWSEM_XCHGADD_ALGORITHM=y ++# CONFIG_RWSEM_GENERIC_SPINLOCK is not set ++# CONFIG_3_LEVEL_PGTABLES is not set ++CONFIG_ARCH_HAS_SC_SIGNALS=y ++CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y ++# CONFIG_SMP_BROKEN is not set ++CONFIG_GENERIC_HWEIGHT=y ++# CONFIG_STATIC_LINK is not set ++CONFIG_SELECT_MEMORY_MODEL=y ++CONFIG_FLATMEM_MANUAL=y ++CONFIG_FLATMEM=y ++CONFIG_FLAT_NODE_MEM_MAP=y ++CONFIG_PAGEFLAGS_EXTENDED=y ++CONFIG_SPLIT_PTLOCK_CPUS=4 ++# CONFIG_PHYS_ADDR_T_64BIT is not set ++CONFIG_ZONE_DMA_FLAG=0 ++CONFIG_VIRT_TO_BUS=y ++# CONFIG_KSM is not set ++CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 ++CONFIG_TICK_ONESHOT=y ++CONFIG_NO_HZ=y ++CONFIG_HIGH_RES_TIMERS=y ++CONFIG_GENERIC_CLOCKEVENTS_BUILD=y ++CONFIG_LD_SCRIPT_DYN=y ++CONFIG_BINFMT_ELF=y ++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set ++CONFIG_HAVE_AOUT=y ++# CONFIG_BINFMT_AOUT is not set ++# CONFIG_BINFMT_MISC is not set ++# CONFIG_HOSTFS is not set ++# CONFIG_HPPFS is not set ++# CONFIG_MCONSOLE is not set ++# CONFIG_HIGHMEM is not set ++CONFIG_KERNEL_STACK_ORDER=0 ++ ++# ++# General setup ++# ++CONFIG_EXPERIMENTAL=y ++CONFIG_BROKEN_ON_SMP=y ++CONFIG_INIT_ENV_ARG_LIMIT=128 ++CONFIG_CROSS_COMPILE="" ++CONFIG_LOCALVERSION="" ++CONFIG_LOCALVERSION_AUTO=y ++# CONFIG_SWAP is not set ++# CONFIG_SYSVIPC is not set ++# CONFIG_BSD_PROCESS_ACCT is not set ++ ++# ++# RCU Subsystem ++# ++CONFIG_TREE_RCU=y ++# CONFIG_TINY_RCU is not set ++# CONFIG_RCU_TRACE is not set ++CONFIG_RCU_FANOUT=32 ++# CONFIG_RCU_FANOUT_EXACT is not set ++# CONFIG_TREE_RCU_TRACE is not set ++# CONFIG_IKCONFIG is not set ++CONFIG_LOG_BUF_SHIFT=14 ++# CONFIG_CGROUPS is not set ++# CONFIG_SYSFS_DEPRECATED_V2 is not set ++# CONFIG_RELAY is not set ++CONFIG_NAMESPACES=y ++# CONFIG_UTS_NS is not set ++# CONFIG_USER_NS is not set ++# CONFIG_PID_NS is not set ++# CONFIG_BLK_DEV_INITRD is not set ++CONFIG_CC_OPTIMIZE_FOR_SIZE=y ++CONFIG_SYSCTL=y ++CONFIG_ANON_INODES=y ++# CONFIG_EMBEDDED is not set ++CONFIG_UID16=y ++CONFIG_SYSCTL_SYSCALL=y ++CONFIG_KALLSYMS=y ++CONFIG_KALLSYMS_EXTRA_PASS=y ++CONFIG_HOTPLUG=y ++CONFIG_PRINTK=y ++CONFIG_BUG=y ++CONFIG_ELF_CORE=y ++CONFIG_BASE_FULL=y ++CONFIG_FUTEX=y ++CONFIG_EPOLL=y ++CONFIG_SIGNALFD=y ++CONFIG_TIMERFD=y ++CONFIG_EVENTFD=y ++CONFIG_SHMEM=y ++CONFIG_AIO=y ++ ++# ++# Kernel Performance Events And Counters ++# ++CONFIG_VM_EVENT_COUNTERS=y ++CONFIG_COMPAT_BRK=y ++CONFIG_SLAB=y ++# CONFIG_SLUB is not set ++# CONFIG_PROFILING is not set ++ ++# ++# GCOV-based kernel profiling ++# ++# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set ++CONFIG_SLABINFO=y ++CONFIG_RT_MUTEXES=y ++CONFIG_BASE_SMALL=0 ++# CONFIG_MODULES is not set ++CONFIG_BLOCK=y ++# CONFIG_LBDAF is not set ++# CONFIG_BLK_DEV_BSG is not set ++# CONFIG_BLK_DEV_INTEGRITY is not set ++ ++# ++# IO Schedulers ++# ++CONFIG_IOSCHED_NOOP=y ++# CONFIG_IOSCHED_DEADLINE is not set ++CONFIG_IOSCHED_CFQ=y ++CONFIG_DEFAULT_CFQ=y ++# CONFIG_DEFAULT_NOOP is not set ++CONFIG_DEFAULT_IOSCHED="cfq" ++# CONFIG_INLINE_SPIN_TRYLOCK is not set ++# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set ++# CONFIG_INLINE_SPIN_LOCK is not set ++# CONFIG_INLINE_SPIN_LOCK_BH is not set ++# CONFIG_INLINE_SPIN_LOCK_IRQ is not set ++# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set ++CONFIG_INLINE_SPIN_UNLOCK=y ++# CONFIG_INLINE_SPIN_UNLOCK_BH is not set ++CONFIG_INLINE_SPIN_UNLOCK_IRQ=y ++# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set ++# CONFIG_INLINE_READ_TRYLOCK is not set ++# CONFIG_INLINE_READ_LOCK is not set ++# CONFIG_INLINE_READ_LOCK_BH is not set ++# CONFIG_INLINE_READ_LOCK_IRQ is not set ++# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set ++CONFIG_INLINE_READ_UNLOCK=y ++# CONFIG_INLINE_READ_UNLOCK_BH is not set ++CONFIG_INLINE_READ_UNLOCK_IRQ=y ++# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set ++# CONFIG_INLINE_WRITE_TRYLOCK is not set ++# CONFIG_INLINE_WRITE_LOCK is not set ++# CONFIG_INLINE_WRITE_LOCK_BH is not set ++# CONFIG_INLINE_WRITE_LOCK_IRQ is not set ++# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set ++CONFIG_INLINE_WRITE_UNLOCK=y ++# CONFIG_INLINE_WRITE_UNLOCK_BH is not set ++CONFIG_INLINE_WRITE_UNLOCK_IRQ=y ++# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set ++# CONFIG_MUTEX_SPIN_ON_OWNER is not set ++# CONFIG_FREEZER is not set ++CONFIG_BLK_DEV=y ++CONFIG_BLK_DEV_UBD=y ++# CONFIG_BLK_DEV_UBD_SYNC is not set ++CONFIG_BLK_DEV_COW_COMMON=y ++# CONFIG_BLK_DEV_LOOP is not set ++ ++# ++# DRBD disabled because PROC_FS, INET or CONNECTOR not selected ++# ++# CONFIG_BLK_DEV_RAM is not set ++ ++# ++# Character Devices ++# ++CONFIG_STDERR_CONSOLE=y ++CONFIG_STDIO_CONSOLE=y ++CONFIG_SSL=y ++CONFIG_NULL_CHAN=y ++# CONFIG_PORT_CHAN is not set ++# CONFIG_PTY_CHAN is not set ++# CONFIG_TTY_CHAN is not set ++# CONFIG_XTERM_CHAN is not set ++CONFIG_NOCONFIG_CHAN=y ++CONFIG_CON_ZERO_CHAN="fd:0,fd:1" ++CONFIG_CON_CHAN="xterm" ++CONFIG_SSL_CHAN="pts" ++# CONFIG_UNIX98_PTYS is not set ++# CONFIG_LEGACY_PTYS is not set ++# CONFIG_RAW_DRIVER is not set ++# CONFIG_WATCHDOG is not set ++# CONFIG_UML_SOUND is not set ++# CONFIG_SOUND is not set ++# CONFIG_SOUND_OSS_CORE is not set ++# CONFIG_HOSTAUDIO is not set ++# CONFIG_HW_RANDOM is not set ++CONFIG_UML_RANDOM=y ++# CONFIG_MMAPPER is not set ++ ++# ++# Generic Driver Options ++# ++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" ++# CONFIG_DEVTMPFS is not set ++CONFIG_STANDALONE=y ++CONFIG_PREVENT_FIRMWARE_BUILD=y ++CONFIG_FW_LOADER=y ++# CONFIG_FIRMWARE_IN_KERNEL is not set ++CONFIG_EXTRA_FIRMWARE="" ++# CONFIG_SYS_HYPERVISOR is not set ++# CONFIG_NET is not set ++ ++# ++# File systems ++# ++CONFIG_MINIX_FS=y ++# CONFIG_ADFS_FS is not set ++# CONFIG_AFFS_FS is not set ++# CONFIG_HFS_FS is not set ++# CONFIG_HFSPLUS_FS is not set ++# CONFIG_BEFS_FS is not set ++# CONFIG_BFS_FS is not set ++# CONFIG_EFS_FS is not set ++# CONFIG_LOGFS is not set ++# CONFIG_CRAMFS is not set ++# CONFIG_SQUASHFS is not set ++# CONFIG_VXFS_FS is not set ++# CONFIG_OMFS_FS is not set ++# CONFIG_HPFS_FS is not set ++# CONFIG_QNX4FS_FS is not set ++# CONFIG_ROMFS_FS is not set ++# CONFIG_SYSV_FS is not set ++# CONFIG_UFS_FS is not set ++# CONFIG_EXT2_FS is not set ++# CONFIG_EXT2_FS_XATTR is not set ++# CONFIG_EXT2_FS_XIP is not set ++# CONFIG_EXT3_FS is not set ++# CONFIG_EXT4_FS is not set ++# CONFIG_REISERFS_FS is not set ++# CONFIG_JFS_FS is not set ++# CONFIG_FS_POSIX_ACL is not set ++# CONFIG_XFS_FS is not set ++# CONFIG_BTRFS_FS is not set ++# CONFIG_NILFS2_FS is not set ++CONFIG_FILE_LOCKING=y ++# CONFIG_FSNOTIFY is not set ++# CONFIG_DNOTIFY is not set ++# CONFIG_INOTIFY_USER is not set ++# CONFIG_QUOTA is not set ++# CONFIG_AUTOFS_FS is not set ++# CONFIG_AUTOFS4_FS is not set ++# CONFIG_FUSE_FS is not set ++ ++# ++# Caches ++# ++# CONFIG_FSCACHE is not set ++ ++# ++# CD-ROM/DVD Filesystems ++# ++# CONFIG_ISO9660_FS is not set ++# CONFIG_UDF_FS is not set ++ ++# ++# DOS/FAT/NT Filesystems ++# ++# CONFIG_MSDOS_FS is not set ++# CONFIG_VFAT_FS is not set ++# CONFIG_NTFS_FS is not set ++ ++# ++# Pseudo filesystems ++# ++CONFIG_PROC_FS=y ++# CONFIG_PROC_KCORE is not set ++CONFIG_PROC_SYSCTL=y ++CONFIG_PROC_PAGE_MONITOR=y ++CONFIG_SYSFS=y ++CONFIG_TMPFS=y ++# CONFIG_TMPFS_POSIX_ACL is not set ++# CONFIG_HUGETLB_PAGE is not set ++# CONFIG_CONFIGFS_FS is not set ++CONFIG_MISC_FILESYSTEMS=y ++ ++# ++# Partition Types ++# ++# CONFIG_PARTITION_ADVANCED is not set ++CONFIG_MSDOS_PARTITION=y ++# CONFIG_NLS is not set ++ ++# ++# Security options ++# ++# CONFIG_KEYS is not set ++# CONFIG_SECURITY is not set ++# CONFIG_SECURITYFS is not set ++CONFIG_DEFAULT_SECURITY_DAC=y ++CONFIG_DEFAULT_SECURITY="" ++# CONFIG_CRYPTO is not set ++# CONFIG_BINARY_PRINTF is not set ++ ++# ++# Library routines ++# ++CONFIG_GENERIC_FIND_FIRST_BIT=y ++CONFIG_GENERIC_FIND_NEXT_BIT=y ++CONFIG_GENERIC_FIND_LAST_BIT=y ++# CONFIG_CRC_CCITT is not set ++# CONFIG_CRC16 is not set ++# CONFIG_CRC_T10DIF is not set ++# CONFIG_CRC_ITU_T is not set ++# CONFIG_CRC32 is not set ++# CONFIG_CRC7 is not set ++# CONFIG_LIBCRC32C is not set ++CONFIG_HAS_DMA=y ++ ++# ++# SCSI device support ++# ++CONFIG_SCSI_MOD=y ++# CONFIG_RAID_ATTRS is not set ++# CONFIG_SCSI is not set ++# CONFIG_SCSI_DMA is not set ++# CONFIG_SCSI_NETLINK is not set ++# CONFIG_MD is not set ++# CONFIG_NEW_LEDS is not set ++# CONFIG_INPUT is not set ++ ++# ++# Kernel hacking ++# ++CONFIG_PRINTK_TIME=y ++CONFIG_ENABLE_WARN_DEPRECATED=y ++CONFIG_ENABLE_MUST_CHECK=y ++CONFIG_FRAME_WARN=1024 ++# CONFIG_STRIP_ASM_SYMS is not set ++# CONFIG_UNUSED_SYMBOLS is not set ++# CONFIG_DEBUG_FS is not set ++# CONFIG_DEBUG_KERNEL is not set ++# CONFIG_HARDLOCKUP_DETECTOR is not set ++CONFIG_DEBUG_BUGVERBOSE=y ++CONFIG_DEBUG_MEMORY_INIT=y ++# CONFIG_RCU_CPU_STALL_DETECTOR is not set ++# CONFIG_SYSCTL_SYSCALL_CHECK is not set ++# CONFIG_ATOMIC64_SELFTEST is not set ++# CONFIG_SAMPLES is not set ++# CONFIG_DEBUG_STACK_USAGE is not set +--- linux-2.6.36.orig/arch/um/Makefile 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/Makefile 2010-11-24 00:06:56.000000000 +0100 +@@ -99,21 +99,21 @@ + # Options used by linker script + export LDS_START := $(START) + export LDS_ELF_ARCH := $(ELF_ARCH) + export LDS_ELF_FORMAT := $(ELF_FORMAT) + + # The wrappers will select whether using "malloc" or the kernel allocator. + LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc + + LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt)) + +-CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) ++CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) $(LD_XFLAGS) + define cmd_vmlinux__ + $(CC) $(CFLAGS_vmlinux) -o $@ \ + -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ + -Wl,--start-group $(vmlinux-main) -Wl,--end-group \ + -lutil \ + $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o \ + FORCE ,$^) ; rm -f linux + endef + + # When cleaning we don't include .config, so we don't include +--- linux-2.6.36.orig/arch/um/os-Linux/util.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/util.c 2010-11-21 19:35:30.000000000 +0100 +@@ -68,24 +68,31 @@ + + void setup_hostinfo(char *buf, int len) + { + struct utsname host; + + uname(&host); + snprintf(buf, len, "%s %s %s %s %s", host.sysname, host.nodename, + host.release, host.version, host.machine); + } + ++ + void os_dump_core(void) + { + int pid; + ++ /* Call tcsetattr to restore termios of con=fd:... devices */ ++ /* TODO(pts): Also restore ssl= */ ++ /* TODO(pts): Only restore fd: */ ++ extern void console_exit(void); ++ console_exit(); ++ + signal(SIGSEGV, SIG_DFL); + + /* + * We are about to SIGTERM this entire process group to ensure that + * nothing is around to run after the kernel exits. The + * kernel wants to abort, not die through SIGTERM, so we + * ignore it here. + */ + + signal(SIGTERM, SIG_IGN); + +--- linux-2.6.36.orig/arch/um/drivers/stdio_console.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/drivers/stdio_console.c 2010-11-21 19:35:30.000000000 +0100 +@@ -173,21 +173,21 @@ + opts.xterm_title = new_title; + + lines_init(vts, ARRAY_SIZE(vts), &opts); + + con_init_done = 1; + register_console(&stdiocons); + return 0; + } + late_initcall(stdio_init); + +-static void console_exit(void) ++void console_exit(void) + { + if (!con_init_done) + return; + close_lines(vts, ARRAY_SIZE(vts)); + } + __uml_exitcall(console_exit); + + static int console_chan_setup(char *str) + { + char *error; +--- linux-2.6.36.orig/arch/um/drivers/fd.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/drivers/fd.c 2010-11-21 19:35:30.000000000 +0100 +@@ -1,29 +1,31 @@ + /* + * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com) + * Licensed under the GPL + */ + + #include + #include + #include + #include + #include ++#include ++#include + #include "chan_user.h" + #include "kern_constants.h" + #include "os.h" + #include "um_malloc.h" + #include "user.h" + + struct fd_chan { + int fd; +- int raw; ++ char raw, is_tty; + struct termios tt; + char str[sizeof("1234567890\0")]; + }; + + static void *fd_init(char *str, int device, const struct chan_opts *opts) + { + struct fd_chan *data; + char *end; + int n; + +@@ -38,49 +40,99 @@ + printk(UM_KERN_ERR "fd_init : couldn't parse file descriptor " + "'%s'\n", str); + return NULL; + } + + data = uml_kmalloc(sizeof(*data), UM_GFP_KERNEL); + if (data == NULL) + return NULL; + + *data = ((struct fd_chan) { .fd = n, +- .raw = opts->raw }); ++ .raw = opts->raw, ++ .is_tty = 0 }); + return data; + } + ++int create_pty_pair(int *master_fd, int *slave_fd) { ++ int retval; ++ char *p; ++ ++ *master_fd = posix_openpt(O_RDWR | O_NOCTTY); ++ if (*master_fd == -1) ++ return -errno; ++ ++ if (grantpt(*master_fd) == -1) { ++ retval = -errno; ++ close(*master_fd); /* Might change 'errno' */ ++ return retval; ++ } ++ ++ if (unlockpt(*master_fd) == -1) { ++ retval = -errno; ++ close(*master_fd); /* Might change 'errno' */ ++ return retval; ++ } ++ ++ p = ptsname(*master_fd); ++ if (p == NULL) { ++ retval = -errno; ++ close(*master_fd); /* Might change 'errno' */ ++ return retval; ++ } ++ *slave_fd = open64(p, O_RDWR | O_NOCTTY); ++ if (*slave_fd == -1) { ++ retval = -errno; ++ close(*master_fd); ++ return retval; ++ } ++ return 0; ++} ++ ++ + static int fd_open(int input, int output, int primary, void *d, char **dev_out) + { + struct fd_chan *data = d; + int err; + +- if (data->raw && isatty(data->fd)) { +- CATCH_EINTR(err = tcgetattr(data->fd, &data->tt)); +- if (err) ++ if (data->fd == -1) { ++ int master_fd, slave_fd; ++ err = create_pty_pair(&master_fd, &slave_fd); ++ if (err) { ++ printk(UM_KERN_ERR "Cannot crete PTY pair (%d)\n", err); + return err; ++ } ++ /* TODO(pts): Close the master eventually. */ ++ data->fd = slave_fd; ++ } + +- err = raw(data->fd); +- if (err) +- return err; ++ if (data->raw) { ++ CATCH_EINTR(err = tcgetattr(data->fd, &data->tt)); ++ if (!err || (errno != ENOTTY && errno != EINVAL)) { ++ if (err) ++ return -errno; ++ data->is_tty = 1; ++ err = raw(data->fd); ++ if (err) ++ return err; ++ } + } + sprintf(data->str, "%d", data->fd); + *dev_out = data->str; + return data->fd; + } + + static void fd_close(int fd, void *d) + { + struct fd_chan *data = d; + int err; + +- if (!data->raw || !isatty(fd)) ++ if (!data->is_tty) + return; + + CATCH_EINTR(err = tcsetattr(fd, TCSAFLUSH, &data->tt)); + if (err) + printk(UM_KERN_ERR "Failed to restore terminal state - " + "errno = %d\n", -err); + data->raw = 0; + } + + const struct chan_ops fd_ops = { +--- linux-2.6.36.orig/arch/um/drivers/ubd_kern.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/drivers/ubd_kern.c 2010-11-21 17:45:19.000000000 +0100 +@@ -833,42 +833,40 @@ + + if(ubd_dev->file == NULL) + goto out; + + err = ubd_file_size(ubd_dev, &ubd_dev->size); + if(err < 0){ + *error_out = "Couldn't determine size of device's file"; + goto out; + } + +- ubd_dev->size = ROUND_BLOCK(ubd_dev->size); +- + INIT_LIST_HEAD(&ubd_dev->restart); + sg_init_table(ubd_dev->sg, MAX_SG); + + err = -ENOMEM; + ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock); + if (ubd_dev->queue == NULL) { + *error_out = "Failed to initialize device queue"; + goto out; + } + ubd_dev->queue->queuedata = ubd_dev; + + blk_queue_max_segments(ubd_dev->queue, MAX_SG); +- err = ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, &ubd_gendisk[n]); ++ err = ubd_disk_register(UBD_MAJOR, ROUND_BLOCK(ubd_dev->size), n, &ubd_gendisk[n]); + if(err){ + *error_out = "Failed to register device"; + goto out_cleanup; + } + + if (fake_major != UBD_MAJOR) +- ubd_disk_register(fake_major, ubd_dev->size, n, ++ ubd_disk_register(fake_major, ROUND_BLOCK(ubd_dev->size), n, + &fake_gendisk[n]); + + /* + * Perhaps this should also be under the "if (fake_major)" above + * using the fake_disk->disk_name + */ + if (fake_ide) + make_ide_entries(ubd_gendisk[n]->disk_name); + + err = 0; +@@ -1279,35 +1277,37 @@ + dev->request = NULL; + } + } + + static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo) + { + struct ubd *ubd_dev = bdev->bd_disk->private_data; + + geo->heads = 128; + geo->sectors = 32; +- geo->cylinders = ubd_dev->size / (128 * 32 * 512); ++ geo->cylinders = ROUND_BLOCK(ubd_dev->size) / (128 * 32 * 512); + return 0; + } + + static int ubd_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) + { + struct ubd *ubd_dev = bdev->bd_disk->private_data; + u16 ubd_id[ATA_ID_WORDS]; + + switch (cmd) { + struct cdrom_volctrl volume; ++ case 0x540F/*TIOCGPGRP*/: /**** pts ****/ ++ return put_user(ubd_dev->size, (u64 __user*)arg); + case HDIO_GET_IDENTITY: + memset(&ubd_id, 0, ATA_ID_WORDS * 2); +- ubd_id[ATA_ID_CYLS] = ubd_dev->size / (128 * 32 * 512); ++ ubd_id[ATA_ID_CYLS] = ROUND_BLOCK(ubd_dev->size) / (128 * 32 * 512); + ubd_id[ATA_ID_HEADS] = 128; + ubd_id[ATA_ID_SECTORS] = 32; + if(copy_to_user((char __user *) arg, (char *) &ubd_id, + sizeof(ubd_id))) + return -EFAULT; + return 0; + + case CDROMVOLREAD: + if(copy_from_user(&volume, (char __user *) arg, sizeof(volume))) + return -EFAULT; +--- linux-2.6.36.orig/arch/um/include/asm/string.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.36/arch/um/include/asm/string.h 2010-11-20 22:21:04.000000000 +0100 +@@ -0,0 +1,56 @@ ++/**** pts ****/ ++#ifndef _ASM_X86_STRING_32_H ++#define _ASM_X86_STRING_32_H ++ ++#ifdef __KERNEL__ ++ ++/* Let gcc decide whether to inline or use the out of line functions */ ++ ++#define __HAVE_ARCH_STRCPY ++extern char *strcpy(char *dest, const char *src); ++ ++#define __HAVE_ARCH_STRNCPY ++extern char *strncpy(char *dest, const char *src, size_t count); ++ ++#define __HAVE_ARCH_STRCAT ++extern char *strcat(char *dest, const char *src); ++ ++#define __HAVE_ARCH_STRNCAT ++extern char *strncat(char *dest, const char *src, size_t count); ++ ++#define __HAVE_ARCH_STRCMP ++extern int strcmp(const char *cs, const char *ct); ++ ++#define __HAVE_ARCH_STRNCMP ++extern int strncmp(const char *cs, const char *ct, size_t count); ++ ++#define __HAVE_ARCH_STRCHR ++extern char *strchr(const char *s, int c); ++ ++#define __HAVE_ARCH_STRLEN ++extern size_t strlen(const char *s); ++ ++#define __HAVE_ARCH_MEMCPY ++extern void *memcpy(void *dest, const void *src, size_t n); ++ ++#define __HAVE_ARCH_MEMMOVE ++void *memmove(void *dest, const void *src, size_t n); ++ ++#define __HAVE_ARCH_MEMCHR ++extern void *memchr(const void *cs, int c, size_t count); ++ ++#define __HAVE_ARCH_STRNLEN ++extern size_t strnlen(const char *s, size_t count); ++ ++#define __HAVE_ARCH_STRSTR ++extern char *strstr(const char *cs, const char *ct); ++ ++#define __HAVE_ARCH_MEMSET ++extern void *memset(void *s, int c, size_t n); ++ ++#define __HAVE_ARCH_MEMSCAN ++extern void *memscan(void *addr, int c, size_t size); ++ ++#endif /* __KERNEL__ */ ++ ++#endif /* _ASM_X86_STRING_32_H */ +--- linux-2.6.36.orig/arch/um/include/shared/kern_util.h 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/include/shared/kern_util.h 2010-11-22 01:00:53.000000000 +0100 +@@ -56,14 +56,14 @@ + + extern unsigned long to_irq_stack(unsigned long *mask_out); + extern unsigned long from_irq_stack(int nested); + + extern void syscall_trace(struct uml_pt_regs *regs, int entryexit); + extern int singlestepping(void *t); + + extern void segv_handler(int sig, struct uml_pt_regs *regs); + extern void bus_handler(int sig, struct uml_pt_regs *regs); + extern void winch(int sig, struct uml_pt_regs *regs); +-extern void fatal_sigsegv(void) __attribute__ ((noreturn)); ++extern void fatal_sigsegv(int sig) __attribute__ ((noreturn)); + + + #endif +--- linux-2.6.36.orig/arch/um/kernel/reboot.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/kernel/reboot.c 2010-11-21 22:22:38.000000000 +0100 +@@ -41,18 +41,19 @@ + } + + void machine_restart(char * __unused) + { + uml_cleanup(); + reboot_skas(); + } + + void machine_power_off(void) + { ++ /* printk(KERN_ERR "machine_power_off\n"); */ + uml_cleanup(); + halt_skas(); + } + + void machine_halt(void) + { + machine_power_off(); + } +--- linux-2.6.36.orig/arch/um/kernel/trap.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/kernel/trap.c 2010-11-22 01:07:23.000000000 +0100 +@@ -117,23 +117,26 @@ + { + struct siginfo si; + + si.si_signo = SIGSEGV; + si.si_code = SEGV_ACCERR; + si.si_addr = (void __user *) FAULT_ADDRESS(fi); + current->thread.arch.faultinfo = fi; + force_sig_info(SIGSEGV, &si, current); + } + +-void fatal_sigsegv(void) ++void fatal_sigsegv(int sig) + { +- force_sigsegv(SIGSEGV, current); ++ if (sig == SIGSEGV) ++ force_sigsegv(sig, current); ++ else ++ force_sig(sig, current); + do_signal(); + /* + * This is to tell gcc that we're not returning - do_signal + * can, in general, return, but in this case, it's not, since + * we just got a fatal SIGSEGV queued. + */ + os_dump_core(); + } + + void segv_handler(int sig, struct uml_pt_regs *regs) +--- linux-2.6.36.orig/arch/um/os-Linux/main.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/main.c 2010-11-21 23:44:02.000000000 +0100 +@@ -1,22 +1,25 @@ + /* + * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) + * Licensed under the GPL + */ + ++#include + #include + #include + #include + #include + #include + #include + #include ++#include ++#include "asm/param.h" /* HZ */ + #include "as-layout.h" + #include "init.h" + #include "kern_constants.h" + #include "kern_util.h" + #include "os.h" + #include "um_malloc.h" + + #define PGD_BOUND (4 * 1024 * 1024) + #define STACKSIZE (8 * 1024 * 1024) + #define THREAD_NAME_LEN (256) +@@ -44,22 +47,30 @@ + + call = &__uml_initcall_start; + while (call < &__uml_initcall_end) { + (*call)(); + call++; + } + } + + static void last_ditch_exit(int sig) + { ++ int pid; + uml_cleanup(); +- exit(1); ++ signal(SIGTERM, SIG_IGN); ++ kill(0, SIGTERM); /* Kill everybody else in the process group. */ ++ kill(0, SIGCONT); /* Let them see the signal. */ ++ while ((pid = waitpid(-1, NULL, WNOHANG | __WALL)) > 0) ++ os_kill_ptraced_process(pid, 0); ++ signal(sig, SIG_DFL); ++ kill(0, sig); ++ exit(1); /* Not reached. */ + } + + static void install_fatal_handler(int sig) + { + struct sigaction action; + + /* All signals are enabled in this handler ... */ + sigemptyset(&action.sa_mask); + + /* +@@ -106,20 +117,73 @@ + } + snprintf(new_path, path_len, "PATH=%s" UML_LIB_PATH, old_path); + if (putenv(new_path)) { + perror("couldn't putenv to set a new PATH"); + free(new_path); + } + } + + extern void scan_elf_aux( char **envp); + ++#define PTS_ISDIGIT(c) ((c) - '0' + 0U <= 9) ++extern unsigned long preset_lpj; ++void delay_loop_speed(void) { /**** pts ****/ ++ int int_part, fraction_nom, fraction_den; ++ double bogomips; ++ char buf[1024], *p; ++ int got; ++ int fd = open64("/proc/cpuinfo", O_RDONLY); ++ if (fd < 0) ++ return; ++ got = read(fd, buf, sizeof buf - 1); ++ close(fd); ++ if (got < 0) ++ return; ++ buf[got] = '\0'; ++ /* Find the bogomips of the first CPU. */ ++ if (NULL == (p = strstr(buf, "\nbogomips"))) ++ return; ++ p += 9; ++ while (*p == ' ' || *p == '\t') ++ ++p; ++ if (*p++ != ':') ++ return; ++ /* sscanf(p, "%lf", &bogomips) doesn't seem to work (maybe no float ++ * support?), so we're scanning the float manually. ++ */ ++ while (*p == ' ' || *p == '\t') ++ ++p; ++ if (!PTS_ISDIGIT(*p)) ++ return; ++ int_part = *p++ - '0'; ++ fraction_nom = 0; ++ fraction_den = 1; ++ while (PTS_ISDIGIT(*p)) ++ int_part = 10 * int_part + *p++ - '0'; ++ if (*p == '.') { ++ ++p; ++ if (!PTS_ISDIGIT(*p)) ++ return; ++ while (PTS_ISDIGIT(*p)) { ++ fraction_nom = 10 * fraction_nom + *p++ - '0'; ++ fraction_den *= 10; ++ } ++ } ++ if (*p != '\n' && *p != '\r' && *p != '\0' && *p != ' ' && *p != '\t') ++ return; ++ bogomips = int_part + (fraction_nom + 0.0) / fraction_den; ++ preset_lpj = bogomips * (500000 / HZ); ++ printf("Got from host /proc/cpuinfo: bogomips=%lu.%02lu lpj=%lu\n", ++ (long)bogomips, (long)(bogomips * 100) % 100, preset_lpj); ++ return; ++} ++ + int __init main(int argc, char **argv, char **envp) + { + char **new_argv; + int ret, i, err; + + set_stklim(); + + setup_env_path(); + + new_argv = malloc((argc + 1) * sizeof(char *)); +@@ -136,23 +200,27 @@ + } + new_argv[argc] = NULL; + + /* + * Allow these signals to bring down a UML if all other + * methods of control fail. + */ + install_fatal_handler(SIGINT); + install_fatal_handler(SIGTERM); + install_fatal_handler(SIGHUP); ++ install_fatal_handler(SIGALRM); ++ install_fatal_handler(SIGPIPE); ++ install_fatal_handler(SIGXCPU); + + scan_elf_aux(envp); + ++ delay_loop_speed(); + do_uml_initcalls(); + ret = linux_main(argc, argv); + + /* + * Disable SIGPROF - I have no idea why libc doesn't do this or turn + * off the profiling time, but UML dies with a SIGPROF just before + * exiting when profiling is active. + */ + change_sig(SIGPROF, 0); + +@@ -178,21 +246,21 @@ + */ + unblock_signals(); + + /* Reboot */ + if (ret) { + printf("\n"); + execvp(new_argv[0], new_argv); + perror("Failed to exec kernel"); + ret = 1; + } +- printf("\n"); ++ fflush(stdout); + return uml_exitcode; + } + + extern void *__real_malloc(int); + + void *__wrap_malloc(int size) + { + void *ret; + + if (!kmalloc_ok) +--- linux-2.6.36.orig/arch/um/os-Linux/skas/process.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/skas/process.c 2010-11-22 01:02:19.000000000 +0100 +@@ -69,139 +69,139 @@ + if ((n < 0) || !WIFSTOPPED(status)) + goto bad_wait; + + if (((1 << WSTOPSIG(status)) & STUB_SIG_MASK) == 0) + break; + + err = ptrace(PTRACE_CONT, pid, 0, 0); + if (err) { + printk(UM_KERN_ERR "wait_stub_done : continue failed, " + "errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + } + + if (((1 << WSTOPSIG(status)) & STUB_DONE_MASK) != 0) + return; + + bad_wait: + err = ptrace_dump_regs(pid); + if (err) + printk(UM_KERN_ERR "Failed to get registers from stub, " + "errno = %d\n", -err); + printk(UM_KERN_ERR "wait_stub_done : failed to wait for SIGTRAP, " + "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno, + status); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + extern unsigned long current_stub_stack(void); + + static void get_skas_faultinfo(int pid, struct faultinfo *fi) + { + int err; + + if (ptrace_faultinfo) { + err = ptrace(PTRACE_FAULTINFO, pid, 0, fi); + if (err) { + printk(UM_KERN_ERR "get_skas_faultinfo - " + "PTRACE_FAULTINFO failed, errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + /* Special handling for i386, which has different structs */ + if (sizeof(struct ptrace_faultinfo) < sizeof(struct faultinfo)) + memset((char *)fi + sizeof(struct ptrace_faultinfo), 0, + sizeof(struct faultinfo) - + sizeof(struct ptrace_faultinfo)); + } + else { + unsigned long fpregs[FP_SIZE]; + + err = get_fp_registers(pid, fpregs); + if (err < 0) { + printk(UM_KERN_ERR "save_fp_registers returned %d\n", + err); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + err = ptrace(PTRACE_CONT, pid, 0, SIGSEGV); + if (err) { + printk(UM_KERN_ERR "Failed to continue stub, pid = %d, " + "errno = %d\n", pid, errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + wait_stub_done(pid); + + /* + * faultinfo is prepared by the stub-segv-handler at start of + * the stub stack page. We just have to copy it. + */ + memcpy(fi, (void *)current_stub_stack(), sizeof(*fi)); + + err = put_fp_registers(pid, fpregs); + if (err < 0) { + printk(UM_KERN_ERR "put_fp_registers returned %d\n", + err); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + } + } + + static void handle_segv(int pid, struct uml_pt_regs * regs) + { + get_skas_faultinfo(pid, ®s->faultinfo); + segv(regs->faultinfo, 0, 1, NULL); + } + + /* + * To use the same value of using_sysemu as the caller, ask it that value + * (in local_using_sysemu + */ + static void handle_trap(int pid, struct uml_pt_regs *regs, + int local_using_sysemu) + { + int err, status; + + if ((UPT_IP(regs) >= STUB_START) && (UPT_IP(regs) < STUB_END)) +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + + /* Mark this as a syscall */ + UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->gp); + + if (!local_using_sysemu) + { + err = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_NR_OFFSET, + __NR_getpid); + if (err < 0) { + printk(UM_KERN_ERR "handle_trap - nullifying syscall " + "failed, errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + err = ptrace(PTRACE_SYSCALL, pid, 0, 0); + if (err < 0) { + printk(UM_KERN_ERR "handle_trap - continuing to end of " + "syscall failed, errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); + if ((err < 0) || !WIFSTOPPED(status) || + (WSTOPSIG(status) != SIGTRAP + 0x80)) { + err = ptrace_dump_regs(pid); + if (err) + printk(UM_KERN_ERR "Failed to get registers " + "from process, errno = %d\n", -err); + printk(UM_KERN_ERR "handle_trap - failed to wait at " + "end of syscall, errno = %d, status = %d\n", + errno, status); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + } + + handle_syscall(regs); + } + + extern int __syscall_stub_start; + + static int userspace_tramp(void *stack) + { +@@ -364,46 +364,46 @@ + while (1) { + /* + * This can legitimately fail if the process loads a + * bogus value into a segment register. It will + * segfault and PTRACE_GETREGS will read that value + * out of the process. However, PTRACE_SETREGS will + * fail. In this case, there is nothing to do but + * just kill the process. + */ + if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + + /* Now we set local_using_sysemu to be used for one loop */ + local_using_sysemu = get_using_sysemu(); + + op = SELECT_PTRACE_OPERATION(local_using_sysemu, + singlestepping(NULL)); + + if (ptrace(op, pid, 0, 0)) { + printk(UM_KERN_ERR "userspace - ptrace continue " + "failed, op = %d, errno = %d\n", op, errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL)); + if (err < 0) { + printk(UM_KERN_ERR "userspace - wait failed, " + "errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + regs->is_user = 1; + if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) { + printk(UM_KERN_ERR "userspace - PTRACE_GETREGS failed, " + "errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + + UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */ + + if (WIFSTOPPED(status)) { + int sig = WSTOPSIG(status); + switch (sig) { + case SIGSEGV: + if (PTRACE_FULL_FAULTINFO || + !ptrace_faultinfo) { +@@ -434,24 +434,27 @@ + break; + case SIGIO: + case SIGILL: + case SIGBUS: + case SIGFPE: + case SIGWINCH: + block_signals(); + (*sig_info[sig])(sig, regs); + unblock_signals(); + break; ++ case SIGXCPU: ++ fatal_sigsegv(SIGXCPU); ++ break; + default: + printk(UM_KERN_ERR "userspace - child stopped " + "with signal %d\n", sig); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + pid = userspace_pid[0]; + interrupt_end(); + + /* Avoid -ERESTARTSYS handling in host */ + if (PT_SYSCALL_NR_OFFSET != PT_SYSCALL_RET_OFFSET) + PT_SYSCALL_NR(regs->gp) = -1; + } + } + } +@@ -668,21 +671,21 @@ + break; + case INIT_JMP_HALT: + kmalloc_ok = 0; + return 0; + case INIT_JMP_REBOOT: + kmalloc_ok = 0; + return 1; + default: + printk(UM_KERN_ERR "Bad sigsetjmp return in " + "start_idle_thread - %d\n", n); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + longjmp(*switch_buf, 1); + } + + void initial_thread_cb_skas(void (*proc)(void *), void *arg) + { + jmp_buf here; + + cb_proc = proc; + cb_arg = arg; +@@ -714,15 +717,15 @@ + { + int err; + + /* FIXME: need cpu pid in __switch_mm */ + if (proc_mm) { + err = ptrace(PTRACE_SWITCH_MM, userspace_pid[0], 0, + mm_idp->u.mm_fd); + if (err) { + printk(UM_KERN_ERR "__switch_mm - PTRACE_SWITCH_MM " + "failed, errno = %d\n", errno); +- fatal_sigsegv(); ++ fatal_sigsegv(SIGSEGV); + } + } + else userspace_pid[0] = mm_idp->u.pid; + } +--- linux-2.6.36.orig/arch/um/os-Linux/start_up.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/start_up.c 2010-11-20 21:26:43.000000000 +0100 +@@ -80,21 +80,21 @@ + va_end(list); + + exit(1); + } + + static void non_fatal(char *fmt, ...) + { + va_list list; + + va_start(list, fmt); +- vfprintf(stderr, fmt, list); ++ vfprintf(stdout, fmt, list); + va_end(list); + } + + static int start_ptraced_child(void) + { + int pid, n, status; + + pid = fork(); + if (pid == 0) + ptrace_child(); +@@ -463,21 +463,21 @@ + } + + stop_ptraced_child(pid, 1, 1); + #endif + } + + static inline void check_skas3_proc_mm(void) + { + non_fatal(" - /proc/mm..."); + if (access("/proc/mm", W_OK) < 0) +- perror("not found"); ++ non_fatal("not found"); + else if (disable_proc_mm) + non_fatal("found but disabled on command line\n"); + else { + proc_mm = 1; + non_fatal("found\n"); + } + } + + void can_do_skas(void) + { +--- linux-2.6.36.orig/arch/um/os-Linux/umid.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/um/os-Linux/umid.c 2010-11-21 23:06:02.000000000 +0100 +@@ -10,31 +10,32 @@ + #include + #include + #include + #include + #include + #include "init.h" + #include "kern_constants.h" + #include "os.h" + #include "user.h" + +-#define UML_DIR "~/.uml/" ++/* TODO(pts): why is make_uml_dir called with the defaults? -- disabled anyway because of strange effect on getenv("HOME") upon UML process exit */ ++#define UML_DIR "-~/.uml/" + + #define UMID_LEN 64 + + /* Changed by set_umid, which is run early in boot */ + static char umid[UMID_LEN] = { 0 }; + + /* Changed by set_uml_dir and make_uml_dir, which are run early in boot */ + static char *uml_dir = UML_DIR; + +-static int __init make_uml_dir(void) ++static int make_uml_dir(void) + { + char dir[512] = { '\0' }; + int len, err; + + if (*uml_dir == '~') { + char *home = getenv("HOME"); + + err = -ENOENT; + if (home == NULL) { + printk(UM_KERN_ERR "make_uml_dir : no value in " +@@ -243,20 +244,22 @@ + } + + /* Changed in make_umid, which is called during early boot */ + static int umid_setup = 0; + + static int __init make_umid(void) + { + int fd, err; + char tmp[256]; + ++ if (uml_dir[0] == '-') return 0; ++ + if (umid_setup) + return 0; + + make_uml_dir(); + + if (*umid == '\0') { + strlcpy(tmp, uml_dir, sizeof(tmp)); + strlcat(tmp, "XXXXXX", sizeof(tmp)); + fd = mkstemp(tmp); + if (fd < 0) { +@@ -379,18 +382,20 @@ + + __uml_setup("uml_dir=", set_uml_dir, + "uml_dir=\n" + " The location to place the pid and umid files.\n\n" + ); + + static void remove_umid_dir(void) + { + char dir[strlen(uml_dir) + UMID_LEN + 1], err; + ++ if (uml_dir[0] == '-') return; ++ + sprintf(dir, "%s%s", uml_dir, umid); + err = remove_files_and_dir(dir); + if (err) + printf("remove_umid_dir - remove_files_and_dir failed with " + "err = %d\n", err); + } + + __uml_exitcall(remove_umid_dir); +--- linux-2.6.36.orig/arch/x86/lib/string_32.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/arch/x86/lib/string_32.c 2010-11-20 22:27:19.000000000 +0100 +@@ -6,20 +6,21 @@ + * used through-out, making for "slightly" unclear code :-) + * + * AK: On P4 and K7 using non string instruction implementations might be faster + * for large memory blocks. But most of them are unlikely to be used on large + * strings. + */ + + #include + #include + ++#if 0 /**** pts ****/ + #ifdef __HAVE_ARCH_STRCPY + char *strcpy(char *dest, const char *src) + { + int d0, d1, d2; + asm volatile("1:\tlodsb\n\t" + "stosb\n\t" + "testb %%al,%%al\n\t" + "jne 1b" + : "=&S" (d0), "=&D" (d1), "=&a" (d2) + : "0" (src), "1" (dest) : "memory"); +@@ -190,37 +191,20 @@ + "movl $1,%0\n" + "1:\tdecl %0" + : "=D" (res), "=&c" (d0) + : "a" (c), "0" (cs), "1" (count) + : "memory"); + return res; + } + EXPORT_SYMBOL(memchr); + #endif + +-#ifdef __HAVE_ARCH_MEMSCAN +-void *memscan(void *addr, int c, size_t size) +-{ +- if (!size) +- return addr; +- asm volatile("repnz; scasb\n\t" +- "jnz 1f\n\t" +- "dec %%edi\n" +- "1:" +- : "=D" (addr), "=c" (size) +- : "0" (addr), "1" (size), "a" (c) +- : "memory"); +- return addr; +-} +-EXPORT_SYMBOL(memscan); +-#endif +- + #ifdef __HAVE_ARCH_STRNLEN + size_t strnlen(const char *s, size_t count) + { + int d0; + int res; + asm volatile("movl %2,%0\n\t" + "jmp 2f\n" + "1:\tcmpb $0,(%0)\n\t" + "je 3f\n\t" + "incl %0\n" +@@ -228,10 +212,29 @@ + "cmpl $-1,%1\n\t" + "jne 1b\n" + "3:\tsubl %2,%0" + : "=a" (res), "=&d" (d0) + : "c" (s), "1" (count) + : "memory"); + return res; + } + EXPORT_SYMBOL(strnlen); + #endif ++#endif ++ ++#ifdef __HAVE_ARCH_MEMSCAN ++void *memscan(void *addr, int c, size_t size) ++{ ++ if (!size) ++ return addr; ++ asm volatile("repnz; scasb\n\t" ++ "jnz 1f\n\t" ++ "dec %%edi\n" ++ "1:" ++ : "=D" (addr), "=c" (size) ++ : "0" (addr), "1" (size), "a" (c) ++ : "memory"); ++ return addr; ++} ++EXPORT_SYMBOL(memscan); ++#endif ++ +--- linux-2.6.36.orig/fs/exec.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/fs/exec.c 2010-11-21 00:35:05.000000000 +0100 +@@ -685,25 +685,27 @@ + struct file *file; + int err; + + file = do_filp_open(AT_FDCWD, name, + O_LARGEFILE | O_RDONLY | FMODE_EXEC, 0, + MAY_EXEC | MAY_OPEN); + if (IS_ERR(file)) + goto out; + + err = -EACCES; ++ if (!S_ISBLK(file->f_path.dentry->d_inode->i_mode)) { + if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) + goto exit; + + if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) + goto exit; ++ } + + fsnotify_open(file); + + err = deny_write_access(file); + if (err) + goto exit; + + out: + return file; + +--- linux-2.6.36.orig/kernel/sys.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/kernel/sys.c 2010-11-21 02:24:06.000000000 +0100 +@@ -302,62 +302,62 @@ + * @cmd: pointer to buffer containing command to execute for restart + * or %NULL + * + * Shutdown everything and perform a clean reboot. + * This is not safe to call in interrupt context. + */ + void kernel_restart(char *cmd) + { + kernel_restart_prepare(cmd); + if (!cmd) +- printk(KERN_EMERG "Restarting system.\n"); ++ printk(KERN_ALERT "Restarting system.\n"); + else +- printk(KERN_EMERG "Restarting system with command '%s'.\n", cmd); ++ printk(KERN_ALERT "Restarting system with command '%s'.\n", cmd); + machine_restart(cmd); + } + EXPORT_SYMBOL_GPL(kernel_restart); + + static void kernel_shutdown_prepare(enum system_states state) + { + blocking_notifier_call_chain(&reboot_notifier_list, + (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL); + system_state = state; + device_shutdown(); + } + /** + * kernel_halt - halt the system + * + * Shutdown everything and perform a clean system halt. + */ + void kernel_halt(void) + { + kernel_shutdown_prepare(SYSTEM_HALT); + sysdev_shutdown(); +- printk(KERN_EMERG "System halted.\n"); ++ printk(KERN_ALERT "System halted.\n"); + machine_halt(); + } + + EXPORT_SYMBOL_GPL(kernel_halt); + + /** + * kernel_power_off - power_off the system + * + * Shutdown everything and perform a clean system power_off. + */ + void kernel_power_off(void) + { + kernel_shutdown_prepare(SYSTEM_POWER_OFF); + if (pm_power_off_prepare) + pm_power_off_prepare(); + disable_nonboot_cpus(); + sysdev_shutdown(); +- printk(KERN_EMERG "Power down.\n"); ++ printk(KERN_ALERT "Power down.\n"); + machine_power_off(); + } + EXPORT_SYMBOL_GPL(kernel_power_off); + + static DEFINE_MUTEX(reboot_mutex); + + /* + * Reboot system call: for obvious reasons only root may call it, + * and even root needs to set up some magic numbers in the registers + * so that some mistake won't make this reboot the whole machine. +--- linux-2.6.36.orig/lib/string.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/lib/string.c 2010-11-20 21:58:48.000000000 +0100 +@@ -77,21 +77,21 @@ + + do { + c1 = tolower(*s1++); + c2 = tolower(*s2++); + } while ((--n > 0) && c1 == c2 && c1 != 0); + return c1 - c2; + } + EXPORT_SYMBOL(strncasecmp); + #endif + +-#ifndef __HAVE_ARCH_STRCPY ++#if 0 /*#ifndef __HAVE_ARCH_STRCPY*/ + /** + * strcpy - Copy a %NUL terminated string + * @dest: Where to copy the string to + * @src: Where to copy the string from + */ + #undef strcpy + char *strcpy(char *dest, const char *src) + { + char *tmp = dest; + +@@ -698,21 +698,21 @@ + len--; + if (!memcmp(s1, s2, l2)) + return (char *)s1; + s1++; + } + return NULL; + } + EXPORT_SYMBOL(strnstr); + #endif + +-#ifndef __HAVE_ARCH_MEMCHR ++#if 0 /*#ifndef __HAVE_ARCH_MEMCHR*/ + /** + * memchr - Find a character in an area of memory. + * @s: The memory area + * @c: The byte to search for + * @n: The size of the area. + * + * returns the address of the first occurrence of @c, or %NULL + * if @c is not found + */ + void *memchr(const void *s, int c, size_t n) +--- linux-2.6.36.orig/lib/vsprintf.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/lib/vsprintf.c 2010-11-20 22:30:17.000000000 +0100 +@@ -1231,20 +1231,21 @@ + } else { + if (spec->flags & SIGN) + spec->type = FORMAT_TYPE_INT; + else + spec->type = FORMAT_TYPE_UINT; + } + + return ++fmt - start; + } + ++#if 0 /**** pts ****/ + /** + * vsnprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @size: The size of the buffer, including the trailing null space + * @fmt: The format string to use + * @args: Arguments for the format string + * + * This function follows C99 vsnprintf, but has some extensions: + * %pS output the name of a text symbol with offset + * %ps output the name of a text symbol without offset +@@ -1428,20 +1429,21 @@ + *str = '\0'; + else + end[-1] = '\0'; + } + + /* the trailing null byte doesn't count towards the total */ + return str-buf; + + } + EXPORT_SYMBOL(vsnprintf); ++#endif + + /** + * vscnprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @size: The size of the buffer, including the trailing null space + * @fmt: The format string to use + * @args: Arguments for the format string + * + * The return value is the number of characters which have been written into + * the @buf not including the trailing '\0'. If @size is <= 0 the function +@@ -1527,20 +1529,21 @@ + * You probably want sprintf() instead. + * + * See the vsnprintf() documentation for format string extensions over C99. + */ + int vsprintf(char *buf, const char *fmt, va_list args) + { + return vsnprintf(buf, INT_MAX, fmt, args); + } + EXPORT_SYMBOL(vsprintf); + ++#if 0 /**** pts ****/ + /** + * sprintf - Format a string and place it in a buffer + * @buf: The buffer to place the result into + * @fmt: The format string to use + * @...: Arguments for the format string + * + * The function returns the number of characters written + * into @buf. Use snprintf() or scnprintf() in order to avoid + * buffer overflows. + * +@@ -1551,20 +1554,21 @@ + va_list args; + int i; + + va_start(args, fmt); + i = vsnprintf(buf, INT_MAX, fmt, args); + va_end(args); + + return i; + } + EXPORT_SYMBOL(sprintf); ++#endif + + #ifdef CONFIG_BINARY_PRINTF + /* + * bprintf service: + * vbin_printf() - VA arguments to binary data + * bstr_printf() - Binary data to text string + */ + + /** + * vbin_printf - Parse a format string and place args' binary value in a buffer +--- linux-2.6.36.orig/scripts/mod/modpost.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36/scripts/mod/modpost.c 2010-11-20 21:38:08.000000000 +0100 +@@ -19,20 +19,22 @@ + #include "../../include/generated/autoconf.h" + #include "../../include/linux/license.h" + + /* Some toolchains use a `_' prefix for all user symbols. */ + #ifdef CONFIG_SYMBOL_PREFIX + #define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX + #else + #define MODULE_SYMBOL_PREFIX "" + #endif + ++void __stack_chk_fail(void) {} ++ + + /* Are we using CONFIG_MODVERSIONS? */ + int modversions = 0; + /* Warn about undefined symbols? (do so if we have vmlinux) */ + int have_vmlinux = 0; + /* Is CONFIG_MODULE_SRCVERSION_ALL set? */ + static int all_versions = 0; + /* If we are modposting external module set to 1 */ + static int external_module = 0; + /* Warn about section mismatch in vmlinux if set to 1 */ +--- linux-2.6.36.orig/kernel/timeconst.h.fixed 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.36/kernel/timeconst.h.fixed 2010-11-25 00:34:44.000000000 +0100 +@@ -0,0 +1,35 @@ ++/* Automatically generated by kernel/timeconst.pl */ ++/* Conversion constants for HZ == 100 */ ++ ++#ifndef KERNEL_TIMECONST_H ++#define KERNEL_TIMECONST_H ++ ++#include ++#include ++ ++#if HZ != 100 ++#error "kernel/timeconst.h has the wrong HZ value!" ++#endif ++ ++#define HZ_TO_MSEC_MUL32 U64_C(0xa0000000) ++#define HZ_TO_MSEC_ADJ32 U64_C(0x0) ++#define HZ_TO_MSEC_SHR32 28 ++#define HZ_TO_MSEC_NUM U64_C(10) ++#define HZ_TO_MSEC_DEN U64_C(1) ++#define MSEC_TO_HZ_MUL32 U64_C(0xcccccccd) ++#define MSEC_TO_HZ_ADJ32 U64_C(0x733333333) ++#define MSEC_TO_HZ_SHR32 35 ++#define MSEC_TO_HZ_NUM U64_C(1) ++#define MSEC_TO_HZ_DEN U64_C(10) ++#define HZ_TO_USEC_MUL32 U64_C(0x9c400000) ++#define HZ_TO_USEC_ADJ32 U64_C(0x0) ++#define HZ_TO_USEC_SHR32 18 ++#define HZ_TO_USEC_NUM U64_C(10000) ++#define HZ_TO_USEC_DEN U64_C(1) ++#define USEC_TO_HZ_MUL32 U64_C(0xd1b71759) ++#define USEC_TO_HZ_ADJ32 U64_C(0x1fff2e48e8a7) ++#define USEC_TO_HZ_SHR32 45 ++#define USEC_TO_HZ_NUM U64_C(1) ++#define USEC_TO_HZ_DEN U64_C(10000) ++ ++#endif /* KERNEL_TIMECONST_H */ +--- linux-2.6.36.orig/kernel/Makefile.orig 2010-11-25 00:32:16.000000000 +0100 ++++ linux-2.6.36/kernel/Makefile 2010-11-25 00:33:05.000000000 +0100 +@@ -124,14 +124,14 @@ + + quiet_cmd_ikconfiggz = IKCFG $@ + cmd_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@ + targets += config_data.h + $(obj)/config_data.h: $(obj)/config_data.gz FORCE + $(call if_changed,ikconfiggz) + + $(obj)/time.o: $(obj)/timeconst.h + + quiet_cmd_timeconst = TIMEC $@ +- cmd_timeconst = $(PERL) $< $(CONFIG_HZ) > $@ ++ cmd_timeconst = cp $(src)/timeconst.h.fixed $@ + targets += timeconst.h + $(obj)/timeconst.h: $(src)/timeconst.pl FORCE + $(call if_changed,timeconst) diff --git a/deps/uevalrun/make b/deps/uevalrun/make new file mode 100755 index 0000000..4a02fe9 Binary files /dev/null and b/deps/uevalrun/make differ diff --git a/deps/uevalrun/make_kernel.sh b/deps/uevalrun/make_kernel.sh new file mode 100755 index 0000000..05ff56a --- /dev/null +++ b/deps/uevalrun/make_kernel.sh @@ -0,0 +1,104 @@ +#! /bin/bash -- +# +# make_kernel.sh: build the uevalrun.linux.uml kernel +# by pts@fazekas.hu at Wed Nov 24 00:26:59 CET 2010 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +set -ex + +# Make sure we fail unless weuse ./busybox for all non-built-in commands. +export PATH=/dev/null + +test "${0%/*}" != "$0" && cd "${0%/*}" + +KERNEL_TBZ2="${KERNEL_TBZ2:-linux-2.6.36.1.tar.bz2}" + +./busybox sh ./download.sh "$KERNEL_TBZ2" gcxbase.stbx86.tbz2 gcc.stbx86.tbz2 gcctool.stbx86.tbz2 gcxtool.stbx86.tbz2 + +./busybox rm -rf make_kernel.tmp +./busybox mkdir make_kernel.tmp + +./busybox mkdir make_kernel.tmp/cross-compiler +for P in gcxbase gcc gcctool gcxtool; do + : Extracting "$P" + (cd make_kernel.tmp/cross-compiler && ../../busybox tar xj) <"$P.stbx86.tbz2" || exit "$?" +done + +: Extracting "$KERNEL_TBZ2" +(cd make_kernel.tmp && ../busybox tar xj) <"$KERNEL_TBZ2" || exit "$?" +./busybox mv make_kernel.tmp/linux-* make_kernel.tmp/kernel +: Applying linux-2.6.36-uevalrun.patch +# TODO(pts): Make ``busybox patch'' not talk to the user. +(cd make_kernel.tmp/kernel && ../../busybox patch -p1) make_kernel.tmp/out + ./busybox cat make_kernel.tmp/out >"$F" +done + +./busybox mkdir make_kernel.tmp/bin +./busybox cp busybox make make_kernel.tmp/bin/ +for F in cat cmp cp cut date echo expr grep hostname mkdir mv rm \ + sed sh tail uname wc whoami \ +; do + ./busybox ln -s busybox make_kernel.tmp/bin/"$F" +done + +# TODO(pts): Auto-detect non-i686 prefixes. +CROSS="$PWD/make_kernel.tmp/cross-compiler/bin/i686-" +test "${CROSS}gcc" + +( unset LANG LANGUAGE LC_ALL LC_CTYPE LC_MONETARY LC_TIME LC_NUMERIC \ + LC_COLLATE LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE \ + LC_MEASUREMENT LC_IDENTIFICATION + export SHELL="$PWD/make_kernel.tmp/bin/sh" + export PATH="$PWD/make_kernel.tmp/bin" + cd make_kernel.tmp/kernel && + SHELL="$SHELL" PATH="$PATH" \ + make \ + ARCH=um \ + CROSS_COMPILE="$CROSS" \ + HOSTCC="${CROSS}gcc -static" \ + LD_XFLAGS=-static \ + vmlinux) +./busybox ls -l make_kernel.tmp/kernel/vmlinux +${CROSS}strip make_kernel.tmp/kernel/vmlinux +./busybox ls -l make_kernel.tmp/kernel/vmlinux +./busybox rm -f uevalrun.linux.uml.tmp +./busybox cp make_kernel.tmp/kernel/vmlinux uevalrun.linux.uml.tmp +./busybox mv uevalrun.linux.uml.tmp uevalrun.linux.uml # Atomic replace. +./busybox ls -l uevalrun.linux.uml + +# Full compile and extract time on narancs: +# 118.13user 14.18system 2:24.38elapsed 91%CPU (0avgtext+0avgdata 80528maxresident)k +# 4936inputs+1118032outputs (58major+2190404minor)pagefaults 0swaps + +# TODO(pts): Cleanup: ./busybox rm -rf make_kernel.tmp + +: All OK. diff --git a/deps/uevalrun/make_rootfs.sh b/deps/uevalrun/make_rootfs.sh new file mode 100755 index 0000000..bca961d --- /dev/null +++ b/deps/uevalrun/make_rootfs.sh @@ -0,0 +1,131 @@ +#! /bin/bash -- +# +# make_rootfs.sh: Create the root filesystem for uevalrun UML guests +# by pts@fazekas.hu at Sat Nov 20 16:42:03 CET 2010 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +set -ex + +test "${0%/*}" != "$0" && cd "${0%/*}" + +# Make sure we fail unless weuse ./busybox for all non-built-in commands. +export PATH=/dev/null + +test -f busybox +# TODO(pts): Make it configurable so some of these won't be needed. +DPROGS="perl5.10 php5.3 ruby1.8 ruby1.9 stackless2.7 luajit1.1 smjs1.8" +./busybox sh ./download.sh $DPROGS +PROGS="$DPROGS busybox" +PROGS_KB=$(./busybox ls -l $PROGS | ./busybox awk '{s+=(($5+1023)/1024)}END{printf"%d\n",s}') +test "$PROGS_KB" +# TODO(pts): Give a better estimate. +let MINIX_KB=12+PROGS_KB+PROGS_KB/256 + +./busybox rm -f uevalrun.rootfs.minix.img # Make sure it's not mounted. +./busybox dd if=/dev/zero of=uevalrun.rootfs.minix.img bs=${MINIX_KB}K count=1 +# Increase `-i 100' here to increase the file size limit if you get a +# `No space left on device' when running this script. +./busybox mkfs.minix -n 14 -i 115 uevalrun.rootfs.minix.img + +./busybox tar cvf mkroot.tmp.tar $PROGS +./busybox cat >mkroot.tmp.sh <<'ENDMKROOT' +#! /bin/sh +# Don't autorun /sbin/minihalt, so we'll get a kernel panic in the UML guest, +# thus we'll get a nonzero exit code in the UML host if this script fails. +#trap /sbin/minihalt EXIT +set -ex +echo "Hello, World!" +#ls /proc # Works. + +mkdir /fs/dev /fs/bin /fs/sbin /fs/proc /fs/etc +mkdir /fs/etc/init.d +cat >/fs/etc/init.d/rcS <<'END' +#! /bin/sh +/bin/mount proc /proc -t proc +END +chmod +x /fs/etc/init.d/rcS +cp -a /dev/console /fs/dev/ +cp -a /dev/ttyS0 /fs/dev/ +cp -a /dev/ttyS1 /fs/dev/ +cp -a /dev/tty0 /fs/dev/ +cp -a /dev/tty1 /fs/dev/ +cp -a /dev/tty2 /fs/dev/ +cp -a /dev/tty3 /fs/dev/ +cp -a /dev/tty4 /fs/dev/ +cp -a /dev/null /fs/dev/ +cp -a /dev/zero /fs/dev/ +mknod /fs/dev/ubdb b 98 16 +mknod /fs/dev/ubdc b 98 32 +mknod /fs/dev/ubdd b 98 48 +mknod /fs/dev/ubde b 98 64 +# Grant read permission for the user: it migh be a script. +chmod 755 /fs/dev/ubdb +chmod 600 /fs/dev/ubdc +chmod 700 /fs/dev/ubdd +chmod 600 /fs/dev/ubde +mknod /fs/dev/random c 1 8 +chmod 666 /fs/dev/random +mknod /fs/dev/urandom c 1 9 +chmod 666 /fs/dev/urandom + +(cd /fs && tar xf /dev/ubdd) || exit "$?" # creates /fs/busybox /fs/ruby1.8 +chmod 755 /fs/perl5.10 /fs/php5.3 /fs/ruby1.8 /fs/ruby1.9 /fs/stackless2.7 /fs/luajit1.1 /fs/smjs1.8 /fs/busybox +mv /fs/ruby1.8 /fs/bin/ruby1.8 +ln -s ruby1.8 /fs/bin/ruby +mv /fs/ruby1.9 /fs/bin/ruby1.9 +mv /fs/php5.3 /fs/bin/php +mv /fs/perl5.10 /fs/bin/perl +mv /fs/luajit1.1 /fs/bin/luajit1.1 +ln -s luajit1.1 /fs/bin/luajit +ln -s luajit1.1 /fs/bin/lua +mv /fs/smjs1.8 /fs/bin/smjs1.8 +ln -s smjs1.8 /fs/bin/smjs +ln -s smjs1.8 /fs/bin/js +mv /fs/stackless2.7 /fs/bin/stackless2.7 +ln -s stackless2.7 /fs/bin/python +ln -s stackless2.7 /fs/bin/stackless +mv /fs/busybox /fs/bin/busybox +# cp hello bincat /fs/bin # Custom binaries. +ln -s ../bin/busybox /fs/sbin/init +ln -s ../bin/busybox /fs/sbin/halt +ln -s ../bin/busybox /fs/sbin/reboot +ln -s ../bin/busybox /fs/sbin/swapoff +ln -s ../bin/busybox /fs/bin/mount +ln -s ../bin/busybox /fs/bin/umount +ln -s ../bin/busybox /fs/bin/sh +ln -s ../bin/busybox /fs/bin/ls +ln -s ../bin/busybox /fs/bin/mkdir +ln -s ../bin/busybox /fs/bin/rmdir +ln -s ../bin/busybox /fs/bin/cp +ln -s ../bin/busybox /fs/bin/mv +ln -s ../bin/busybox /fs/bin/rm +ln -s ../bin/busybox /fs/bin/du +ln -s ../bin/busybox /fs/bin/df +ln -s ../bin/busybox /fs/bin/awk +ln -s ../bin/busybox /fs/bin/sed +ln -s ../bin/busybox /fs/bin/cat +ln -s ../bin/busybox /fs/bin/vi +ln -s ../bin/busybox /fs/bin/stty + +: guest-creator script OK, halting. +/sbin/minihalt +ENDMKROOT + +# Use the minix driver in uevalrun.linux.uml to populate our rootfs +# (uevalrun.rootfs.minix.img). +./uevalrun.linux.uml con=null ssl=null con0=fd:-1,fd:1 mem=10M \ + ubda=uevalrun.rootfs.mini.minix.img ubdb=uevalrun.rootfs.minix.img \ + ubdc=mkroot.tmp.sh ubdd=mkroot.tmp.tar init=/sbin/minihalt \ + mkrootgcxpkg.tmp.sh <mkrootgcx.tmp.sh <<'ENDMKROOT' +#! /bin/sh +# Don't autorun /sbin/minihalt, so we'll get a kernel panic in the UML guest, +# thus we'll get a nonzero exit code in the UML host if this script fails. +#trap /sbin/minihalt EXIT +set -ex +echo "Hello, World!" +echo +#ls /proc # Works. +mkdir -p /fs/bin +mkdir /fs/dev /fs/sbin /fs/proc /fs/etc /fs/fs +mkdir /fs/etc/init.d +cat >/fs/etc/init.d/rcS <<'END' +#! /bin/sh +/bin/mount proc /proc -t proc +END +chmod +x /fs/etc/init.d/rcS +ln -s /fs /fs/tmp +cp -a /dev/console /fs/dev/ +cp -a /dev/ttyS0 /fs/dev/ +cp -a /dev/ttyS1 /fs/dev/ +cp -a /dev/tty0 /fs/dev/ +cp -a /dev/tty1 /fs/dev/ +cp -a /dev/tty2 /fs/dev/ +cp -a /dev/tty3 /fs/dev/ +cp -a /dev/tty4 /fs/dev/ +cp -a /dev/null /fs/dev/ +cp -a /dev/zero /fs/dev/ +mknod /fs/dev/ubdb b 98 16 +mknod /fs/dev/ubdc b 98 32 +mknod /fs/dev/ubdd b 98 48 +mknod /fs/dev/ubde b 98 64 +# Grant read permission for the user: it migh be a script. +chmod 755 /fs/dev/ubdb +chmod 600 /fs/dev/ubdc +chmod 700 /fs/dev/ubdd +chmod 600 /fs/dev/ubde +mknod /fs/dev/random c 1 8 +chmod 666 /fs/dev/random +mknod /fs/dev/urandom c 1 9 +chmod 666 /fs/dev/urandom + +(cd /fs && tar xf /dev/ubdd) || exit "$?" # creates /fs/busybox +mv /fs/busybox /fs/bin/busybox +cp /sbin/minihalt /fs/sbin/minihalt +# TODO(pts): Get +(echo '#include '; echo 'int main() { return printf("HIX\n"); }') >/fs/hello.c +(echo '#include '; echo 'using namespace std;'; echo 'int main() { cout << "HIX" << endl; }') >/fs/hello.cc +# ln -s wouldn't work, gcc tries to find itself based on its argv[0]. +#ln -s ../compact-compiler-i686/bin/i686-gcc fs/bin/gcc +cat >fs/bin/gcc <<'END' +#! /bin/sh +export PATH=/ +set -ex +exec /bin/i686-gcc -static "$@" +END +chmod +x fs/bin/gcc +cat >fs/bin/g++ <<'END' +#! /bin/sh +export PATH=/ +set -ex +exec /bin/i686-g++ -static "$@" +END +chmod +x fs/bin/g++ +ln -s ../bin/busybox /fs/sbin/init +ln -s ../bin/busybox /fs/sbin/halt +ln -s ../bin/busybox /fs/sbin/reboot +ln -s ../bin/busybox /fs/sbin/swapoff +ln -s ../bin/busybox /fs/bin/mount +ln -s ../bin/busybox /fs/bin/umount +ln -s ../bin/busybox /fs/bin/sh +ln -s ../bin/busybox /fs/bin/ls +ln -s ../bin/busybox /fs/bin/mkdir +ln -s ../bin/busybox /fs/bin/rmdir +ln -s ../bin/busybox /fs/bin/cp +ln -s ../bin/busybox /fs/bin/mv +ln -s ../bin/busybox /fs/bin/rm +ln -s ../bin/busybox /fs/bin/du +ln -s ../bin/busybox /fs/bin/df +ln -s ../bin/busybox /fs/bin/awk +ln -s ../bin/busybox /fs/bin/sed +ln -s ../bin/busybox /fs/bin/cat +ln -s ../bin/busybox /fs/bin/vi +ln -s ../bin/busybox /fs/bin/stty + +/fs/bin/busybox df +: guest-creator script OK, halting. +/sbin/minihalt +ENDMKROOT + +./uevalrun.linux.uml con=null ssl=null con0=fd:-1,fd:1 mem=10M \ + ubda=uevalrun.rootfs.mini.minix.img ubdb=uevalrun.rootfs.gcx.minix.img \ + ubdc=mkrootgcx.tmp.sh ubdd=mkrootgcx.tmp.tar init=/sbin/minihalt \ + mkrootmini.tmp.sh <<'ENDMKROOT' +#! /bin/sh +# Don't autorun /sbin/minihalt, so we'll get a kernel panic in the UML guest, +# thus we'll get a nonzero exit code in the UML host if this script fails. +#trap /sbin/halt EXIT +set -ex +echo "Hello, World!" +#ls /proc # Works. + +mkdir /fs/dev /fs/bin /fs/sbin /fs/proc /fs/fs +cp -a /dev/console /fs/dev/ +cp -a /dev/ttyS0 /fs/dev/ +cp -a /dev/ttyS1 /fs/dev/ +cp -a /dev/tty0 /fs/dev/ +cp -a /dev/tty1 /fs/dev/ +cp -a /dev/tty2 /fs/dev/ +cp -a /dev/tty3 /fs/dev/ +cp -a /dev/tty4 /fs/dev/ +cp -a /dev/null /fs/dev/ +cp -a /dev/zero /fs/dev/ +mknod /fs/dev/ubdb b 98 16 +mknod /fs/dev/ubdc b 98 32 +mknod /fs/dev/ubdd b 98 48 +chmod 711 /fs/dev/ubdb +chmod 600 /fs/dev/ubdc +chmod 700 /fs/dev/ubdd + +(cd /fs && tar xf /dev/ubdd) || exit "$?" # creates /fs/busybox.mini and /fs/minihalt +mv /fs/busybox.mini /fs/bin/busybox +mv /fs/minihalt /fs/sbin/minihalt +ln -s minihalt /fs/sbin/halt +ln -s ../bin/busybox /fs/bin/[ +ln -s ../bin/busybox /fs/bin/[[ +ln -s ../bin/busybox /fs/bin/ash +ln -s ../bin/busybox /fs/bin/awk +ln -s ../bin/busybox /fs/bin/cat +ln -s ../bin/busybox /fs/bin/chgrp +ln -s ../bin/busybox /fs/bin/chmod +ln -s ../bin/busybox /fs/bin/chown +ln -s ../bin/busybox /fs/bin/cmp +ln -s ../bin/busybox /fs/bin/cp +ln -s ../bin/busybox /fs/bin/dd +ln -s ../bin/busybox /fs/bin/echo +ln -s ../bin/busybox /fs/bin/egrep +ln -s ../bin/busybox /fs/bin/expr +ln -s ../bin/busybox /fs/bin/false +ln -s ../bin/busybox /fs/bin/fgrep +ln -s ../bin/busybox /fs/bin/grep +ln -s ../bin/busybox /fs/bin/install +ln -s ../bin/busybox /fs/bin/ls +ln -s ../bin/busybox /fs/bin/ln +ln -s ../bin/busybox /fs/bin/mkdir +ln -s ../bin/busybox /fs/bin/mkfifo +ln -s ../bin/busybox /fs/bin/mknod +ln -s ../bin/busybox /fs/bin/mv +ln -s ../bin/busybox /fs/bin/pwd +ln -s ../bin/busybox /fs/bin/readlink +ln -s ../bin/busybox /fs/bin/realpath +ln -s ../bin/busybox /fs/bin/rm +ln -s ../bin/busybox /fs/bin/rmdir +ln -s ../bin/busybox /fs/bin/sh +ln -s ../bin/busybox /fs/bin/sync +ln -s ../bin/busybox /fs/bin/tar +ln -s ../bin/busybox /fs/bin/test +ln -s ../bin/busybox /fs/bin/true +ln -s ../bin/busybox /fs/bin/uncompress +ln -s ../bin/busybox /fs/bin/wc +ln -s ../bin/busybox /fs/bin/xargs +ln -s ../bin/busybox /fs/bin/yes + +: guest-creator script OK, halting. +/sbin/minihalt +ENDMKROOT + +./uevalrun.linux.uml con=null ssl=null con0=fd:-1,fd:1 mem=10M \ + ubda=uevalrun.rootfs.mini.minix.img \ + ubdb=uevalrun.rootfs.newmini.minix.img \ + ubdc=mkrootmini.tmp.sh ubdd=mkrootmini.tmp.tar init=/sbin/minihalt \ + +#include +#include +#include +#include +#include + +#define ERRMSG(msg) write(2, msg, sizeof msg - 1) + +int main(int argc, char **argv, char **environ) { + (void)argc; (void)argv; + if (getpid() == 1) { + char *args[] = { "/bin/sh", "/dev/ubdc", NULL }; + int fd; + if (0 != mount("dummy", "/proc", "proc", MS_MGC_VAL, NULL)) { + ERRMSG("minihalt: failed: mount dummy /proc -t proc\n"); + return 2; + } + if (0 != mount("/dev/ubdb", "/fs", "minix", MS_MGC_VAL, NULL)) { + ERRMSG("minihalt: failed: mount /dev/ubdb /fs -t minix\n"); + return 2; + } + if (0 <= (fd = open(args[1], O_RDONLY))) { + close(fd); + } else { + args[1] = NULL; /* just /bin/sh */ + } + return execve(args[0], args, environ); + } + /* EINVAL is returned if /fs is not mounted */ + if (0 != umount("/fs") && errno != EINVAL) { + ERRMSG("minihalt: failed: umount /fs\n"); + return 2; + } + /* Make sure that con0 (/dev/tty0) is flushed to the UML host. */ + tcdrain(1); + sync(); + return reboot(RB_HALT_SYSTEM); +} diff --git a/deps/uevalrun/precompiled/.svn/all-wcprops b/deps/uevalrun/precompiled/.svn/all-wcprops new file mode 100644 index 0000000..7258297 --- /dev/null +++ b/deps/uevalrun/precompiled/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 44 +/svn/!svn/ver/163/trunk/uevalrun/precompiled +END +xcat +K 25 +svn:wc:ra_dav:version-url +V 49 +/svn/!svn/ver/140/trunk/uevalrun/precompiled/xcat +END +uevalrun +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/!svn/ver/163/trunk/uevalrun/precompiled/uevalrun +END +minihalt +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/!svn/ver/140/trunk/uevalrun/precompiled/minihalt +END +uevalrun.guestinit +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/!svn/ver/163/trunk/uevalrun/precompiled/uevalrun.guestinit +END diff --git a/deps/uevalrun/precompiled/.svn/entries b/deps/uevalrun/precompiled/.svn/entries new file mode 100644 index 0000000..b0aee29 --- /dev/null +++ b/deps/uevalrun/precompiled/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +207 +http://pts-mini-gpl.googlecode.com/svn/trunk/uevalrun/precompiled +http://pts-mini-gpl.googlecode.com/svn + + + +2010-11-28T22:17:35.980551Z +163 +ptspts + + + + + + + + + + + + + + +5875f506-4f57-11de-a3de-f74ccfcb021d + +xcat +file + + + + +2011-04-01T20:18:26.681106Z +e7a5aa901aff4d3d7652dab38715e928 +2010-11-28T12:22:45.293610Z +140 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +14632 + +uevalrun +file + + + + +2011-04-01T20:18:26.681106Z +f96519050fa57f4b1069095b14ab8f55 +2010-11-28T22:17:35.980551Z +163 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +50292 + +minihalt +file + + + + +2011-04-01T20:18:26.681106Z +9944c0db7031351174d63cbfc0fb2d3d +2010-11-28T12:22:45.293610Z +140 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +5080 + +uevalrun.guestinit +file + + + + +2011-04-01T20:18:26.681106Z +f13dd0ba237a801dfac37b425b6bcc39 +2010-11-28T22:17:35.980551Z +163 +ptspts +has-props + + + + + + + + + + + + + + + + + + + + +32964 + diff --git a/deps/uevalrun/precompiled/.svn/prop-base/minihalt.svn-base b/deps/uevalrun/precompiled/.svn/prop-base/minihalt.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/deps/uevalrun/precompiled/.svn/prop-base/minihalt.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/precompiled/.svn/prop-base/uevalrun.guestinit.svn-base b/deps/uevalrun/precompiled/.svn/prop-base/uevalrun.guestinit.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/deps/uevalrun/precompiled/.svn/prop-base/uevalrun.guestinit.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/precompiled/.svn/prop-base/uevalrun.svn-base b/deps/uevalrun/precompiled/.svn/prop-base/uevalrun.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/deps/uevalrun/precompiled/.svn/prop-base/uevalrun.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/precompiled/.svn/prop-base/xcat.svn-base b/deps/uevalrun/precompiled/.svn/prop-base/xcat.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/deps/uevalrun/precompiled/.svn/prop-base/xcat.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/deps/uevalrun/precompiled/.svn/text-base/minihalt.svn-base b/deps/uevalrun/precompiled/.svn/text-base/minihalt.svn-base new file mode 100644 index 0000000..3a616f1 Binary files /dev/null and b/deps/uevalrun/precompiled/.svn/text-base/minihalt.svn-base differ diff --git a/deps/uevalrun/precompiled/.svn/text-base/uevalrun.guestinit.svn-base b/deps/uevalrun/precompiled/.svn/text-base/uevalrun.guestinit.svn-base new file mode 100644 index 0000000..bc01fd3 Binary files /dev/null and b/deps/uevalrun/precompiled/.svn/text-base/uevalrun.guestinit.svn-base differ diff --git a/deps/uevalrun/precompiled/.svn/text-base/uevalrun.svn-base b/deps/uevalrun/precompiled/.svn/text-base/uevalrun.svn-base new file mode 100644 index 0000000..c1c7c2c Binary files /dev/null and b/deps/uevalrun/precompiled/.svn/text-base/uevalrun.svn-base differ diff --git a/deps/uevalrun/precompiled/.svn/text-base/xcat.svn-base b/deps/uevalrun/precompiled/.svn/text-base/xcat.svn-base new file mode 100644 index 0000000..d3d00ef Binary files /dev/null and b/deps/uevalrun/precompiled/.svn/text-base/xcat.svn-base differ diff --git a/deps/uevalrun/precompiled/minihalt b/deps/uevalrun/precompiled/minihalt new file mode 100755 index 0000000..3a616f1 Binary files /dev/null and b/deps/uevalrun/precompiled/minihalt differ diff --git a/deps/uevalrun/precompiled/uevalrun b/deps/uevalrun/precompiled/uevalrun new file mode 100755 index 0000000..c1c7c2c Binary files /dev/null and b/deps/uevalrun/precompiled/uevalrun differ diff --git a/deps/uevalrun/precompiled/uevalrun.guestinit b/deps/uevalrun/precompiled/uevalrun.guestinit new file mode 100755 index 0000000..bc01fd3 Binary files /dev/null and b/deps/uevalrun/precompiled/uevalrun.guestinit differ diff --git a/deps/uevalrun/precompiled/xcat b/deps/uevalrun/precompiled/xcat new file mode 100755 index 0000000..d3d00ef Binary files /dev/null and b/deps/uevalrun/precompiled/xcat differ diff --git a/deps/uevalrun/repeat.c b/deps/uevalrun/repeat.c new file mode 100644 index 0000000..7f0ae42 --- /dev/null +++ b/deps/uevalrun/repeat.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) { + pid_t child; + int status, count; + (void)argc; + if (argv[1] == NULL || 1 != sscanf(argv[1], "%i", &count) || + argv[2] == NULL) { + fprintf(stderr, "Usage: %s

[ ...]\n", argv[0]); + return 1; + } + while (count != 0) { + if (0 > (child = fork())) { + fprintf(stderr, "error: fork failed: %s\n", strerror(errno)); + return 2; + } + if (child == 0) { + execve(argv[2], argv + 2, NULL); + fprintf(stderr, "error: child: %s: %s\n", argv[2], strerror(errno)); + return 125; + } + while (child != waitpid(child, &status, 0)) {} + if (status != 0) { + fprintf(stderr, "error: child failed with status=0x%x\n", status); + return 3; + } + if (count > 0) + --count; + } + return 0; +} diff --git a/deps/uevalrun/ruby-1.8-Makefile b/deps/uevalrun/ruby-1.8-Makefile new file mode 100644 index 0000000..be23e93 --- /dev/null +++ b/deps/uevalrun/ruby-1.8-Makefile @@ -0,0 +1,56 @@ +/* by pts@fazekas.hu at Thu Nov 25 14:15:38 CET 2010 */ + +#define _(x) x + +extern void rb_provide(const char *feature); + +void Init_bigdecimal _((void)); +void Init_curses _((void)); +void Init_digest _((void)); +void Init_etc _((void)); +void Init_fcntl _((void)); +void Init_nkf _((void)); +void Init_pty _((void)); +void Init_readline _((void)); +void Init_sdbm _((void)); +void Init_socket _((void)); +void Init_stringio _((void)); +void Init_strscan _((void)); +void Init_syck _((void)); +void Init_syslog _((void)); +void Init_zlib _((void)); + +void +Init_ext() +{ + Init_bigdecimal(); + rb_provide("bigdecimal.so"); + Init_curses(); + rb_provide("curses.so"); + Init_digest(); + rb_provide("digest.so"); + Init_etc(); + rb_provide("etc.so"); + Init_fcntl(); + rb_provide("fcntl.so"); + Init_nkf(); + rb_provide("nkf.so"); + Init_pty(); + rb_provide("pty.so"); + Init_readline(); + rb_provide("readline.so"); + Init_sdbm(); + rb_provide("sdbm.so"); + Init_socket(); + rb_provide("socket.so"); + Init_stringio(); + rb_provide("stringio.so"); + Init_strscan(); + rb_provide("strscan.so"); + Init_syck(); + rb_provide("syck.so"); + Init_syslog(); + rb_provide("syslog.so"); + Init_zlib(); + rb_provide("zlib.so"); +} diff --git a/deps/uevalrun/ruby-1.8-configure b/deps/uevalrun/ruby-1.8-configure new file mode 100644 index 0000000..690ea65 --- /dev/null +++ b/deps/uevalrun/ruby-1.8-configure @@ -0,0 +1,2 @@ +wget ftp://ftp.ruby-lang.org//pub/ruby/1.8/ruby-1.8.7-p302.tar.gz +./configure --disable-largefile --disable-fastthread --disable-rpath --disable-shared --enable-frame-address diff --git a/deps/uevalrun/ruby-1.8-dmyext.c b/deps/uevalrun/ruby-1.8-dmyext.c new file mode 100644 index 0000000..be23e93 --- /dev/null +++ b/deps/uevalrun/ruby-1.8-dmyext.c @@ -0,0 +1,56 @@ +/* by pts@fazekas.hu at Thu Nov 25 14:15:38 CET 2010 */ + +#define _(x) x + +extern void rb_provide(const char *feature); + +void Init_bigdecimal _((void)); +void Init_curses _((void)); +void Init_digest _((void)); +void Init_etc _((void)); +void Init_fcntl _((void)); +void Init_nkf _((void)); +void Init_pty _((void)); +void Init_readline _((void)); +void Init_sdbm _((void)); +void Init_socket _((void)); +void Init_stringio _((void)); +void Init_strscan _((void)); +void Init_syck _((void)); +void Init_syslog _((void)); +void Init_zlib _((void)); + +void +Init_ext() +{ + Init_bigdecimal(); + rb_provide("bigdecimal.so"); + Init_curses(); + rb_provide("curses.so"); + Init_digest(); + rb_provide("digest.so"); + Init_etc(); + rb_provide("etc.so"); + Init_fcntl(); + rb_provide("fcntl.so"); + Init_nkf(); + rb_provide("nkf.so"); + Init_pty(); + rb_provide("pty.so"); + Init_readline(); + rb_provide("readline.so"); + Init_sdbm(); + rb_provide("sdbm.so"); + Init_socket(); + rb_provide("socket.so"); + Init_stringio(); + rb_provide("stringio.so"); + Init_strscan(); + rb_provide("strscan.so"); + Init_syck(); + rb_provide("syck.so"); + Init_syslog(); + rb_provide("syslog.so"); + Init_zlib(); + rb_provide("zlib.so"); +} diff --git a/deps/uevalrun/uevalrun.c b/deps/uevalrun/uevalrun.c new file mode 100644 index 0000000..fc53d4b --- /dev/null +++ b/deps/uevalrun/uevalrun.c @@ -0,0 +1,1033 @@ +/* + * uevalrun.c: Entry point executable for running solutions sandboxed. + * + * by pts@fazekas.hu at Sun Nov 21 20:00:22 CET 2010 + * --- Mon Nov 22 01:44:59 CET 2010 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * TODO(pts): What error message do we report if the solution wants to + * write a very long wrong answer? + * TODO(pts): make error messages more useful if the compilation fails + * TODO(pts): Is there a 64MB limit (or just df?) for minix filesystems? + * TODO(pts): move auxilary files like *-config to another dir + * TODO(pts): Benchmark UML speed by running g++ hello.cc and g++ all.cc + * inside and outside UML (6x slower) + * TODO(pts): Benchmark CPU-intensive calculations inside and outside UML. + * (1x slower). + * * overhead: + * Intel(R) Core(TM)2 Duo CPU T6600 @ 2.20GHz, 4GB RAM. + * Just the UML kernel with a hello-world C binary: 50.0625 per second. + * Answer verification (uevalrun) for hello-world C binary: 43.3163 per second. + * * we have to set: CONFIG_HIGH_RES_TIMERS=y + * to avoid this kernel syslog message: Switched to NOHz mode on CPU #0 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ELF_SHF_ALLOC (1 << 1) + +enum { + ST_MIDLINE = 1, + ST_BOL = 2, +}; + +#define PTS_ISDIGIT(c) ((c) - '0' + 0U <= 9U) + +static void out_of_memory() { + printf("@ error: out of memory\n"); + exit(2); +} + +static char *xstrcat(char const *s1, char const *s2) { + size_t ss1 = strlen(s1); + char *t = malloc(ss1 + strlen(s2) + 1); + if (t == NULL) + out_of_memory(); + memcpy(t, s1, ss1); + strcpy(t + ss1, s2); + return t; +} + +static char *xstrcat3(char const *s1, char const *s2, char const *s3) { + size_t ss1 = strlen(s1); + size_t ss2 = strlen(s2); + char *t = malloc(ss1 + ss2 + strlen(s3) + 1); + if (t == NULL) + out_of_memory(); + memcpy(t, s1, ss1); + memcpy(t + ss1, s2, ss2); + strcpy(t + ss1 + ss2, s3); + return t; +} + +static char *xslice(const char *s, size_t slen) { + char *t = malloc(slen + 1); + if (t == NULL) + out_of_memory(); + memcpy(t, s, slen); + t[slen] = '\0'; + return t; +} + +/* Example command: "python", "php", "perl", "ruby", "ruby1.8", "ruby1.9", + * "lua". + * + * The command "lua" matches "luajit" etc. + */ +static char shebang_has_command(const char *shebang, const char *command) { + const char *p = shebang; + int command_size = strlen(command); + while (1) { + while (*p != ' ' && *p !='\t' && *p != '/' && *p != '\0' && *p != '\n') + ++p; + if (*p == '\0' || *p == '\n') + return 0; + ++p; + if (0 == strncmp(p, command, command_size)) + return 1; + } +} + +static void usage(const char* argv0) { + printf("@ info: usage: %s -M -T " + "-E -s " + "[-C -N -U " + "-o ] " + "[-t -e ]\n", argv0); +} + +/* --- Read buffering */ + +/** Characters read from the stdout of the UML process */ +static char rbuf[8192]; +static int rbuf_fd; +static char *rbuf_p, *rbuf_end; +fd_set rbuf_rset; + +static void rbuf_init(int fd) { + long flags; + flags = fcntl(fd, F_GETFL); + if (flags < 0) { + printf("@ error: fcntl F_GETFL: %s\n", strerror(errno)); + exit(2); + } + if (0 != fcntl(fd, F_SETFL, flags | O_NONBLOCK)) { + printf("@ error: fcntl F_SETFL: %s\n", strerror(errno)); + exit(2); + } + rbuf_fd = fd; + rbuf_p = rbuf_end = rbuf; + FD_ZERO(&rbuf_rset); +} + +/** @return -1 on EOF */ +static int rbuf_getc_heavy() { + int got; + if (rbuf_p == NULL) + return -1; /* EOF */ + if (rbuf_p != rbuf_end) + return *(unsigned char*)rbuf_p++; + while (1) { + got = read(rbuf_fd, rbuf, sizeof rbuf); + if (got > 0) { + rbuf_p = rbuf; + rbuf_end = rbuf + got; + return *(unsigned char*)rbuf_p++; + } else if (got == 0) { + rbuf_p = rbuf_end = NULL; + return -1; /* EOF */ + } else if (errno == EAGAIN) { + /* This fflush(stdout) is the only reason why we are doing input + * buffering manually instead of using a FILE*. + */ + fflush(stdout); + FD_SET(rbuf_fd, &rbuf_rset); + got = select(rbuf_fd + 1, &rbuf_rset, NULL, NULL, NULL); + if (got < 0 && got != EINTR) { + printf("\n error: error selecting for solution output pipe: %s\n", + strerror(errno)); + exit(2); + } + } else if (errno != EINTR) { + printf("\n@ error: error reading from solution output pipe: %s\n", + strerror(errno)); + exit(2); + } + } +} + +static inline int rbuf_getc() { + if (rbuf_p != rbuf_end) + return *(unsigned char*)rbuf_p++; + return rbuf_getc_heavy(); +} + +/* --- */ + +#define IS_LCALPHA(c) ((c) - 'a' + 0U <= 'z' - 'a' + 0U) +#define IS_WSPACE(c) ( \ + (c) == ' ' || (c) == '\r' || (c) == '\n' || (c) == '\t' || (c) == '\0' || \ + (c) == '\f' || (c) == '\v') + +/* This must return false for C code (which doesn't use C++ features). */ +static char is_cplusplus_header(const char *hdr, int hdr_size) { + /* TODO(pts): Do a more sophisticated matching, find `namespace', `using', + * #include without a .h etc */ + while (hdr_size > 0 && IS_WSPACE(hdr[0])) { + --hdr_size; + ++hdr; + } + /* TODO(pts): Support `# include' */ + return hdr_size >= 2 && hdr[0] == '/' && hdr[1] == '/'; +} + +static char is_c_header(const char *hdr, int hdr_size) { + /* TODO(pts): Do a more sophisticated matching. */ + while (hdr_size > 0 && IS_WSPACE(hdr[0])) { + --hdr_size; + ++hdr; + } + /* TODO(pts): Support `# include' */ + return (hdr_size >= 2 && hdr[0] == '/' && hdr[1] == '*') || + (hdr_size >= 2 && hdr[0] == '#' && IS_LCALPHA(hdr[1])); +} + +typedef struct { + /* TODO(pts): Disallow too small values for the limit options. */ + int mem_mb; /* -M */ + int timeout; /* -T */ + int excess_answer_limit_kb; /* -E */ + /* Total maximum file size (+ minix filesystem overhead) of the source + * file, the assembly output file (.s) and the binary (executable) file + * produced by the compiler. + */ + int compiler_disk_mb; /* -C */ + int compiler_mem_mb; /* -N */ + int compiler_timeout; /* -U */ + char *solution_binary; /* -s */ + char *test_input; /* -t */ + char *binary_output; /* -o */ + char *expected_output; /* -e */ + + char *prog_dir; + char *argv0; + char *gcxtmp_path; + char is_binary_output_tmp; +} flags_s; + +static int parse_cmdline(int argc, char** argv, flags_s *flags) { + int opt, i; + + flags->mem_mb = -1; + flags->compiler_mem_mb = -1; + flags->timeout = -1; + flags->compiler_timeout = -1; + flags->excess_answer_limit_kb = -1; + flags->compiler_disk_mb = -1; + flags->solution_binary = NULL; + flags->test_input = NULL; + flags->binary_output = NULL; + flags->expected_output = NULL; + flags->prog_dir = NULL; + flags->argv0 = argv[0]; + flags->is_binary_output_tmp = 0; + flags->gcxtmp_path = NULL; + + if (argv[1] == NULL) { + usage(argv[0]); + return 1; + } + if (0 == strcmp(argv[1], "--help")) { + usage(argv[0]); + return 0; + } + + while ((opt = getopt(argc, argv, "M:N:T:U:E:C:s:t:e:h:o:")) != -1) { + if (opt == 'M') { + if (1 != sscanf(optarg, "%i", &flags->mem_mb)) { + printf("@ error: bad -M syntax\n"); + return 1; + } + } else if (opt == 'N') { + if (1 != sscanf(optarg, "%i", &flags->compiler_mem_mb)) { + printf("@ error: bad -N syntax\n"); + return 1; + } + } else if (opt == 'T') { + if (1 != sscanf(optarg, "%i", &flags->timeout)) { + printf("@ error: bad -T syntax\n"); + return 1; + } + } else if (opt == 'U') { + if (1 != sscanf(optarg, "%i", &flags->compiler_timeout)) { + printf("@ error: bad -U syntax\n"); + return 1; + } + } else if (opt == 'E') { + if (1 != sscanf(optarg, "%i", &flags->excess_answer_limit_kb)) { + printf("@ error: bad -E syntax\n"); + return 1; + } + } else if (opt == 'C') { + if (1 != sscanf(optarg, "%i", &flags->compiler_disk_mb)) { + printf("@ error: bad -C syntax\n"); + return 1; + } + } else if (opt == 's') { + if (optarg[0] == '\0') { + printf("@ error: bad -s syntax\n"); + return 1; + } + flags->solution_binary = optarg; + } else if (opt == 't') { + if (optarg[0] == '\0') { + printf("@ error: bad -t syntax\n"); + return 1; + } + flags->test_input = optarg; + } else if (opt == 'o') { + if (optarg[0] == '\0') { + printf("@ error: bad -o syntax\n"); + return 1; + } + flags->binary_output = optarg; + } else if (opt == 'e') { + if (optarg[0] == '\0') { + printf("@ error: bad -t syntax\n"); + return 1; + } + flags->expected_output = optarg; + } else { + printf("@ error: unknown command-line flag\n"); + usage(argv[0]); + return 1; + } + } + if (optind < argc) { + printf("@ error: too many command-line arguments\n"); + usage(argv[0]); + return 1; + } + if (flags->mem_mb >= 0 || + flags->timeout >= 0 || + flags->excess_answer_limit_kb >= 0) { + if (flags->mem_mb < 0) { + printf("@ error: missing -M\n"); + usage(argv[0]); + return 1; + } + if (flags->timeout < 0) { + printf("@ error: missing -T\n"); + usage(argv[0]); + return 1; + } + if (flags->excess_answer_limit_kb < 0) { + printf("@ error: missing -E\n"); + usage(argv[0]); + return 1; + } + if (flags->mem_mb == 0 || flags->mem_mb > 2000) { + /* 4096MB is the absolute hard limit, since our UML is a 32-bit binary. */ + printf("@ error: expected 1 <= mem_mb <= 2000, got %d\n", flags->mem_mb); + return 1; + } + if (flags->timeout == 0) { + printf("@ error: expected 1 <= timeout, got %d\n", flags->timeout); + return 1; + } + } + if (flags->compiler_mem_mb >= 0 || + flags->compiler_timeout >= 0 || + flags->compiler_disk_mb >= 0) { + if (flags->compiler_mem_mb < 0) { + printf("@ error: missing -N\n"); + usage(argv[0]); + return 1; + } + if (flags->compiler_timeout < 0) { + printf("@ error: missing -U\n"); + usage(argv[0]); + return 1; + } + if (flags->compiler_disk_mb < 0) { + printf("@ error: missing -C\n"); + usage(argv[0]); + return 1; + } + if (flags->compiler_mem_mb == 0 || flags->compiler_mem_mb > 2000) { + /* 4096MB is the absolute hard limit, since our UML is a 32-bit binary. */ + printf("@ error: expected 1 <= compiler_mem_mb <= 2000, got %d\n", flags->compiler_mem_mb); + return 2; + } + if (flags->compiler_timeout == 0) { + printf("@ error: expected 1 <= compiler_timeout, got %d\n", flags->compiler_timeout); + return 1; + } + if (flags->compiler_disk_mb == 0) { + printf("@ error: expected 1 <= compiler_disk_mb, got %d\n", + flags->compiler_disk_mb); + return 1; + } + } + if (flags->solution_binary == NULL) { + printf("@ error: missing -s\n"); + usage(argv[0]); + return 1; + } + + i = strlen(argv[0]); + while (i > 0 && argv[0][i - 1] != '/') + --i; + if (i > 0) { /* prog_dir = "" means "/" */ + flags->prog_dir = xslice(argv[0], i - 1); + } else { + flags->prog_dir = "."; + } + + return 0; +} + +static int work(flags_s *flags) { + char hdr[128]; /* Should be at least 52, for reading ELF */ + int hdr_size; + char mismatch_msg[128]; + char state; + int pfd[2]; + int status; + pid_t child; + FILE *f, *fexp, *fout; + int i, j, n, line, col; + char is_gcx; + char is_rootfs_missing; + int answer_remaining; + char *args[16]; + char *envs[] = {NULL}; + char mem_used; + char memarg[16]; + char *uml_linux_path; + char *uml_rootfs_path; + char *guestinit_path; + char *solution_format; + + if (NULL == (f = fopen(flags->solution_binary, "r"))) { + printf("@ error: open solution binary: %s: %s\n", flags->solution_binary, + strerror(errno)); + return 2; + } + memset(hdr, '\0', sizeof hdr); + if (0 > (hdr_size = fread(hdr, 1, sizeof hdr - 1, f))) { + printf("@ error: cannot read from solution binary: %s: %s\n", + flags->solution_binary, strerror(errno)); + return 2; + } + hdr[hdr_size] = '\0'; + is_gcx = 0; + if (hdr_size >= 4 && 0 == memcmp(hdr, "\177ELF", 4)) { + unsigned char *u; + unsigned long sh_ofs; /* Section header table offset */ + unsigned long uflags; + unsigned long long total_memsize; + int sh_entsize; /* Section header table entry size */ + int sh_num; /* Section header table entry count */ + if (flags->mem_mb < 0) { + printf("@ error: missing -M\n"); + usage(flags->argv0); + } + if (hdr_size < 52) { + printf("@ error: solution binary too small, cannot be ELF: %s\n", + flags->solution_binary); + /* TODO(pts): fclose(f); fclose(fexp); everywhere */ + return 2; + } + if (hdr[4] != 1) { + printf("@ error: solution binary not for 32-bit architecture: %s\n", + flags->solution_binary); + return 2; + } + if (hdr[5] != 1) { + printf("@ error: solution binary not for LSB architecture: %s\n", + flags->solution_binary); + return 2; + } + if (hdr[16] != 2 || hdr[17] != 0) { + printf("@ error: solution binary not an executable: %s\n", + flags->solution_binary); + return 2; + } + if (hdr[18] != 3 || hdr[19] != 0) { + printf("@ error: solution binary not for x86 architecture: %s\n", + flags->solution_binary); + return 2; + } + if (hdr[20] != 1) { + printf("@ error: solution binary not version 1: %s\n", + flags->solution_binary); + return 2; + } + if ((hdr[7] != 0 && hdr[7] != 3) || hdr[8] != 0) { + printf("@ error: solution binary not for Linux: %s\n", + flags->solution_binary); + return 2; + } + u = (unsigned char*)hdr + 32; + sh_ofs = u[0] | (u[1] << 8) | (u[2] << 16) | (u[3] << 24); + u = (unsigned char*)hdr + 46; + sh_entsize = u[0] | (u[1] << 8); + sh_num = u[2] | (u[3] << 8); + printf("@ info: sh_ofs=%lu sh_entsize=%d sh_num=%d\n", + sh_ofs, sh_entsize, sh_num); + if (sh_entsize + 0U > sizeof(hdr)) { + printf("@ error: solution binary sh_entsize too large: %s: %d\n", + flags->solution_binary, sh_entsize); + return 2; + } + if (sh_num < 1) { + printf("@ error: solution binary sh_num too small: %s: %d\n", + flags->solution_binary, sh_num); + return 2; + } + if (0 != fseek(f, sh_ofs, SEEK_SET)) { + printf("@ error: cannot seek to sh_ofs: %s: %lu: %s\n", + flags->solution_binary, sh_ofs, strerror(errno)); + return 2; + } + total_memsize = 0; + for (i = 0; i < sh_num; ++i) { + if (sh_entsize + 0U != fread(hdr, 1, sh_entsize, f)) { + printf("@ error: cannot read section header in solution binary: " + "%s: %d/%d: %s\n", + flags->solution_binary, i, sh_num, strerror(errno)); + return 2; + } + u = (unsigned char*)hdr + 8; + uflags = u[0] | (u[1] << 8) | (u[2] << 16) | (u[3] << 24); + if ((uflags & ELF_SHF_ALLOC) != 0) { + u = (unsigned char*)hdr + 20; + total_memsize += u[0] | (u[1] << 8) | (u[2] << 16) | (u[3] << 24); + } + } + if ((total_memsize >> 31) != 0) { + printf("@ result: memory exceeded, needs way too static memory\n"); + return 3; + } + if (((total_memsize + ((1 << 20) - 1)) >> 20) >= flags->mem_mb + 0U) { + printf("@ result: memory exceeded, needs too much static memory: %ldMB\n", + (long)((total_memsize + ((1 << 20) - 1)) >> 20)); + return 3; + } + printf("@ info: total_memsize=%ldM\n", + (long)((total_memsize + ((1 << 20) - 1)) >> 20)); + solution_format = "elf"; + } else if (hdr[0] == '#' && hdr[1] == '!') { + if (shebang_has_command(hdr, "python")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "python"; + } else if (shebang_has_command(hdr, "ruby1.8")) { /* Before "ruby". */ + /* Having \0 characters at the end of the file is OK */ + solution_format = "ruby1.8"; + } else if (shebang_has_command(hdr, "ruby1.9")) { /* Before "ruby". */ + /* Having \0 characters at the end of the file is OK */ + solution_format = "ruby1.9"; + } else if (shebang_has_command(hdr, "ruby")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "ruby"; + } else if (shebang_has_command(hdr, "php")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "php"; + } else if (shebang_has_command(hdr, "perl")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "perl"; + } else if (shebang_has_command(hdr, "lua")) { /* Also matches "luajit". */ + /* Having \0 characters at the end of the file is OK */ + solution_format = "lua"; + } else if (shebang_has_command(hdr, "js")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "javascript"; + } else if (shebang_has_command(hdr, "smjs")) { + /* Having \0 characters at the end of the file is OK */ + solution_format = "javascript"; + } else { + printf("@ result: file format error: unknown shebang\n"); + return 2; + } + } else if (hdr_size > 5 && 0 == memcmp(hdr, "expected_output != NULL || + flags->test_input != NULL || + !is_gcx) { + if (flags->test_input == NULL) { + printf("@ error: missing -t\n"); + usage(flags->argv0); + return 1; + } + if (flags->expected_output == NULL) { + printf("@ error: missing -e\n"); + usage(flags->argv0); + return 1; + } + } + + if (is_gcx) { + if (flags->compiler_mem_mb == -1) { + /* TODO(pts): Better error reporting if this is reached int the 2nd + * phase, after compilation. + */ + printf("@ error: missing -U\n"); + usage(flags->argv0); + return 1; + } + if (flags->binary_output == NULL) { + sprintf(mismatch_msg, "%d", (int)getpid()); + flags->is_binary_output_tmp = 1; + /* TODO(pts): Clean up even on signal exit. */ + flags->binary_output = xstrcat3( + flags->prog_dir, "/uevalrun.tmp.bin.", mismatch_msg); + } + } else { + if (flags->binary_output != NULL) { + printf("@ error: unexpected -o\n"); + usage(flags->argv0); + return 1; + } + } + + if (flags->binary_output == NULL) { + fout = NULL; + } else if (NULL == (fout = fopen(flags->binary_output, "w"))) { + printf("@ error: open binary output: %s: %s\n", flags->expected_output, + strerror(errno)); + return 2; + } + + if (is_gcx || flags->expected_output == NULL) { + fexp = NULL; + } else if (NULL == (fexp = fopen(flags->expected_output, "r"))) { + printf("@ error: open expected output: %s: %s\n", flags->expected_output, + strerror(errno)); + return 2; + } + + if (is_gcx) { + int fd; + if (flags->compiler_disk_mb == -1) { + printf("@ error: missing -C\n"); + usage(flags->argv0); + return 1; + } + sprintf(mismatch_msg, "%d", (int)getpid()); + flags->gcxtmp_path = xstrcat3( + flags->prog_dir, "/uevalrun.tmp.gccimg.", mismatch_msg); + if (0 > (fd = open(flags->gcxtmp_path, O_WRONLY | O_CREAT, 0644))) { + printf("@ error: cannot create gcxtmp: %s: %s\n", + flags->gcxtmp_path, strerror(errno)); + return 2; + } + if (0 != ftruncate(fd, (off_t)flags->compiler_disk_mb << 20)) { + printf("@ error: cannot set size of gcxtmp: %s: %s\n", + flags->gcxtmp_path, strerror(errno)); + return 2; + } + /* No need to clear previous contents, the user won't be able + * to read within the UML guest. + */ + close(fd); + /* TODO(pts): Security: remove this temporary image file when uevalrun + * exits, so others won't be able to find it in the future. + */ + } + + /* We don't care about free()ig the strings created by xstrcat etc., + * because they are small, and we don't allocate much. + * TODO(pts): Revisit or validate this policy. + */ + guestinit_path = xstrcat(flags->prog_dir, "/uevalrun.guestinit"); + if (NULL == (f = fopen(guestinit_path, "r"))) { + printf("@ error: guestinit not found: %s: %s\n", + guestinit_path, strerror(errno)); + return 2; + } + fclose(f); + + uml_linux_path = xstrcat(flags->prog_dir, "/uevalrun.linux.uml"); + if (NULL == (f = fopen(uml_linux_path, "r"))) { + printf("@ error: uml_linux not found: %s: %s\n", + uml_linux_path, strerror(errno)); + return 2; + } + fclose(f); + + is_rootfs_missing = 0; + uml_rootfs_path = xstrcat(flags->prog_dir, "/uevalrun.rootfs.minix.img"); + if (NULL == (f = fopen(uml_rootfs_path, "r"))) { + printf("@ error: uml rootfs not found: %s: %s\n", + uml_rootfs_path, strerror(errno)); + printf("@ advice: run this first: (cd '%s' && ./make rootfs)\n", + flags->prog_dir); + is_rootfs_missing = 1; + } + + if (is_gcx) { + if (f != NULL) + fclose(f); + uml_rootfs_path = xstrcat(flags->prog_dir, "/uevalrun.rootfs.gcx.minix.img"); + if (NULL == (f = fopen(uml_rootfs_path, "r"))) { + printf("@ error: uml_rootfs not found: %s: %s\n", + uml_rootfs_path, strerror(errno)); + if (is_rootfs_missing) { + printf("@ advice: run this first: (cd '%s' && " + "./make rootfs rootfs_gcx)\n", flags->prog_dir); + } else { + printf("@ advice: run this first: (cd '%s' && ./make rootfs_gcx)\n", + flags->prog_dir); + } + return 2; + } + } else if (is_rootfs_missing) { + return 2; + } + fclose(f); + + /* 6MB is needed by the UML kernel and its buffers. It wouldn't work with + * 5MB (probed). + */ + mem_used = (is_gcx ? flags->compiler_mem_mb : flags->mem_mb) + 6; + /* UML is unreliable with mem=9M, it crashes soon after printing + * ``UML running in SKAS0 mode'' + * TODO(pts): Report this bug, find the root cause. + */ + if (mem_used < 10) + mem_used = 10; + sprintf(memarg, "mem=%dM", mem_used); + + i = 0; + args[i++] = uml_linux_path; + args[i++] = "con=null"; + args[i++] = "ssl=null"; + args[i++] = "con0=fd:-1,fd:1"; + args[i++] = memarg; + /* `r' means read-only, see 'r' in ubd_kern.c. We specify it so multiple + * processes can concurrently open it. + */ + args[i++] = xstrcat("ubdar=", uml_rootfs_path); + args[i++] = xstrcat("ubdbr=", flags->solution_binary); + /* TODO(pts): Verify that flags->test_input etc. don't contain comma, space or + * something UML would interpret. + */ + if (flags->test_input != NULL) + args[i++] = xstrcat("ubdcr=", flags->test_input); + args[i++] = xstrcat("ubddr=", guestinit_path); + if (is_gcx) + args[i++] = xstrcat("ubde=", flags->gcxtmp_path); + args[i++] = xstrcat("solution_format=", solution_format); + args[i++] = "init=/dev/ubdd"; + args[i] = NULL; + + if (0 != pipe(pfd)) { + printf("@ error: pipe: %s\n", strerror(errno)); + return 2; + } + + child = fork(); + if (child < 0) { + printf("@ error: fork: %s\n", strerror(errno)); + return 2; + } + if (child == 0) { /* Child */ + int fd; + struct rlimit rl; + int timeout_used = is_gcx ? flags->compiler_timeout : flags->timeout; + close(0); + close(pfd[0]); + if (fexp != NULL) + close(fileno(fexp)); + if (fout != NULL) + close(fileno(fout)); + close(1); + close(2); /* TODO(pts): Report the errors nevertheless */ + if (0 <= (fd = open("/dev/tty", O_RDWR))) { + ioctl(fd, TIOCNOTTY, 0); + close(fd); + } + if ((pid_t)-1 == setsid()) /* Create a new process group (UML needs it). */ + exit(122); + fd = open("/dev/null", O_RDONLY); + if (fd != 0) { + dup2(fd, 0); + close(fd); + } + fd = open("/dev/null", O_WRONLY); + if (fd != 2) { + dup2(fd, 2); + close(fd); + } + if (pfd[1] != 1) { + if (1 != dup2(pfd[1], 1)) { + printf("@ error: child: dup2: %s\n", strerror(errno)); + exit(121); + } + close(pfd[1]); + } + alarm(timeout_used + 3 + timeout_used / 10); + /* UML needs more than 300 processes. This will be restricted to 0 + * just before the execve(...) to the temp binary. + */ + rl.rlim_cur = 400; + rl.rlim_max = 400; /* hard limit */ + setrlimit(RLIMIT_NPROC, &rl); + rl.rlim_cur = 0; + rl.rlim_max = 0; + setrlimit(RLIMIT_CORE, &rl); + rl.rlim_cur = timeout_used; + rl.rlim_max = timeout_used + 2; + /* This applies to all UML host subprocesses, but most of them don't + * consume much CPU time, so this global limit should be fine. + * + * We don't want to impose this limit in the guest, because its timer + * might not be accurate enough. + */ + setrlimit(RLIMIT_CPU, &rl); + execve(args[0], args, envs); + printf("@ error: child: execve: %s\n", strerror(errno)); + exit(121); + } + close(pfd[1]); + rbuf_init(pfd[0]); + + state = ST_MIDLINE; + mismatch_msg[0] = '\0'; + line = 1; + col = 1; + answer_remaining = -1; + /* TODO(pts): Limit the size of the answer */ + while (0 <= (i = rbuf_getc())) { + if (state == ST_MIDLINE) { + while (i != '\n') { + putchar(i); + if (0 > (i = rbuf_getc())) + goto at_eof; + } + state = ST_BOL; + } + if (state == ST_BOL) { + while (i == '\n') { + putchar(i); + if (0 > (i = rbuf_getc())) + goto at_eof; + } + state = ST_MIDLINE; + if (!PTS_ISDIGIT(i) || i == '0') { + at_badhead: + putchar(i); + state = i == '\n' ? ST_BOL : ST_MIDLINE; + continue; + } + putchar(i); + n = i - '0'; + while (1) { + if (0 > (i = rbuf_getc())) + goto at_eof; + if (!PTS_ISDIGIT(i)) + break; + if (n > 9999) + goto at_badhead; /* Buffer size too long (would be >= 100000) */ + putchar(i); + n = n * 10 + i - '0'; + } + if (i != '>') + goto at_badhead; + if (is_gcx) { + putchar('#'); /* Print '#' instead of '>' for compilation */ + } else { + putchar(i); + } + if (fexp == NULL) { + for (; n > 0; --n) { + if (0 > (i = rbuf_getc())) { + if (mismatch_msg[0] == '\0') + sprintf(mismatch_msg, "@ error: truncated binary\n"); + goto at_eof; + } + if (fout != NULL) + putc(i, fout); + if (i == '\n') { + state = ST_BOL; + ++line; + col = 1; + } else { + state = ST_MIDLINE; + ++col; + } + } + } else { + /* Now read n bytes as the output of the solution. */ + for (; n > 0; --n) { + if (0 > (i = rbuf_getc())) + goto at_eof; + if (mismatch_msg[0] == '\0') { + answer_remaining = flags->excess_answer_limit_kb << 10; + if (0 > (j = getc(fexp))) { + sprintf(mismatch_msg, "@ result: wrong answer, .exp is shorter at %d:%d\n", line, col); + } else if (i != j) { + sprintf(mismatch_msg, "@ result: wrong answer, first mismatch at %d:%d\n", line, col); + } + } + if (answer_remaining >= 0) { + if (answer_remaining-- == 0) { + /* TODO(pts): Limit the length> already emitted. */ + printf("\n@ info: excess answer limit exceeded\n"); + goto at_eof_nl; + } + } + putchar(i); + if (fout != NULL) + putc(i, fout); + if (i == '\n') { + state = ST_BOL; + ++line; + col = 1; + } else { + state = ST_MIDLINE; + ++col; + } + } + } + state = ST_BOL; + } + } + at_eof: + if (state == ST_MIDLINE) + putchar('\n'); + at_eof_nl: + if (fexp != NULL) { + if (mismatch_msg[0] == '\0' && !feof(fexp) && 0 <= (j = getc(fexp))) { + sprintf(mismatch_msg, + "@ result: wrong answer, .exp is longer at %d:%d\n", line, col); + } + if (ferror(fexp)) { + printf("@ error: error reading expected output file\n"); + return 2; + } + fclose(fexp); + } + if (fout != NULL) { + if (ferror(fout)) { + printf("@ error: error writing binary output file\n"); + return 2; + } + fclose(fout); + } + close(pfd[0]); /* rbuf_fd */ + if (child != waitpid(child, &status, WNOHANG)) { + fflush(stdout); + while (child != waitpid(child, &status, 0)) {} + } + + if (status != 0) { + if (mismatch_msg[0] == '\0') { + printf("@ FYI, output matches\n"); + } else { + memcpy(mismatch_msg, "@ FYI ", 8); + fputs(mismatch_msg, stdout); /* emit previous mismatch */ + } + if (WIFSIGNALED(status) && WTERMSIG(status) == SIGALRM) { + printf("@ result: time limit exceeded, wall time\n"); + } else if (status == 0x300) { + printf("@ result: time limit exceeded, user time\n"); + } else if (status == 0x200) { + printf("@ result: static memory limit exceeded\n"); + } else if (status == 0x100) { + /* Non-zero exit code or killed by signal. */ + if (is_gcx) { + printf("@ result: compile error\n"); + } else { + printf("@ result: runtime error\n"); + } + } else { + printf("@ result: framework error, status: 0x%x\n", status); + } + return 3; + } + if (mismatch_msg[0] != '\0') { + fputs(mismatch_msg, stdout); + return 3; + } + if (is_gcx) { + if (flags->expected_output != NULL) { + printf("@ info: compilation successful\n"); + fflush(stdout); + return -2; + } else { + printf("@ result: compilation successful\n"); + } + } else if (fexp == NULL) { + printf("@ result: success\n"); /* Should never happen, is_gcx is true */ + } else { + printf("@ result: pass\n"); /* Actual output matches expected output. */ + } + return 0; +} + +int main(int argc, char** argv) { + flags_s flags; + int ret; + + ret = parse_cmdline(argc, argv, &flags); + if (ret != 0) + return ret; + + /* Disable line buffering, to make writing the output faster. */ + setvbuf(stdout, NULL, _IOFBF, 8192); + + ret = work(&flags); + if (flags.gcxtmp_path != NULL) + unlink(flags.gcxtmp_path); + /* TODO(pts): Get rid of magic constants for ret. */ + if (ret == -2) { /* Run the binary after a successful compilation. */ + fflush(stdout); + flags.solution_binary = flags.binary_output; + flags.binary_output = NULL; + flags.compiler_mem_mb = -1; + flags.compiler_disk_mb = -1; + flags.compiler_timeout = -1; + ret = work(&flags); + if (flags.is_binary_output_tmp) + unlink(flags.solution_binary); + } else { + if (flags.is_binary_output_tmp) + unlink(flags.binary_output); + } + return ret; +} diff --git a/deps/uevalrun/uevalrun.linux.uml b/deps/uevalrun/uevalrun.linux.uml new file mode 100755 index 0000000..89da312 Binary files /dev/null and b/deps/uevalrun/uevalrun.linux.uml differ diff --git a/deps/uevalrun/uevalrun.rootfs.mini.minix.img b/deps/uevalrun/uevalrun.rootfs.mini.minix.img new file mode 100644 index 0000000..1018b45 Binary files /dev/null and b/deps/uevalrun/uevalrun.rootfs.mini.minix.img differ