summaryrefslogtreecommitdiff
path: root/sys-apps
diff options
context:
space:
mode:
authorBertrand Jacquin <beber@meleeweb.net>2011-07-23 00:43:14 +0200
committerBertrand Jacquin <beber@meleeweb.net>2011-07-23 00:43:14 +0200
commit738a8ef09adf61de700d9711bee0d5451bbccdc0 (patch)
tree4870eebe699a2e24a3067665d4101ee3b06f2fb8 /sys-apps
parentmissing-links (diff)
downloadportage-738a8ef09adf61de700d9711bee0d5451bbccdc0.tar.xz
busybox dfc
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/busybox/busybox-1.1.0.ebuild255
-rw-r--r--sys-apps/busybox/files/1.1.0/bb.patch6
-rw-r--r--sys-apps/busybox/files/1.1.0/busybox-1.1.0-BJA-asm-page.diff20
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-01_redirect-dev-null-1.diff13
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-02_klog-block-read-1.diff82
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-03_remove-backspaces-from-kmsg-1.diff61
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-04-disable-unix-listening.diff82
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-05-syslogd-ipc-set-key.diff43
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-06-logread-ipc-set-key.diff46
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-07-syslogd-pidfile.diff77
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-makefile-typo.diff11
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-syslogd-collect-kmsg.diff137
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-syslogd-listen-udp.diff193
-rw-r--r--sys-apps/busybox/files/1.1.0/flx-syslogd-reliability.diff77
-rw-r--r--sys-apps/busybox/files/1.1.0/glibc.patch21
-rw-r--r--sys-apps/busybox/files/1.1.0/ppc64-insmod.patch16
-rw-r--r--sys-apps/dfc/dfc-9999.ebuild31
-rw-r--r--sys-apps/dfc/files/remount-sstrip.diff8
18 files changed, 1179 insertions, 0 deletions
diff --git a/sys-apps/busybox/busybox-1.1.0.ebuild b/sys-apps/busybox/busybox-1.1.0.ebuild
new file mode 100644
index 00000000..5584d0ea
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.1.0.ebuild
@@ -0,0 +1,255 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/sys-apps/busybox/Attic/busybox-1.1.0.ebuild,v 1.18 2006/07/15 02:51:44 vapier dead $
+
+inherit eutils
+
+#SNAPSHOT=20040726
+SNAPSHOT=""
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ -n ${SNAPSHOT} ]] ; then
+ MY_P=${PN}
+ SRC_URI="http://www.busybox.net/downloads/snapshots/${PN}-${SNAPSHOT}.tar.bz2"
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86"
+IUSE="debug static savedconfig netboot floppyboot make-symlinks"
+RESTRICT="test"
+
+DEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+# <pebenito> then eventually turning on selinux would mean
+# adding a dep: selinux? ( sys-libs/libselinux )
+
+busybox_set_env() {
+ type -p ${CHOST}-ar > /dev/null && export CROSS=${CHOST}-
+ # Don't let KBUILD_OUTPUT mess us up #88088
+ unset KBUILD_OUTPUT
+}
+
+busybox_config_option() {
+ case $1 in
+ y) sed -i -e "s:.*CONFIG_$2.*set:CONFIG_$2=y:g" .config;;
+ n) sed -i -e "s:CONFIG_$2=y:# CONFIG_$2 is not set:g" .config;;
+ Y) echo "CONFIG_$2=y" >> .config;;
+ N) echo "CONFIG_$2=n" >> .config;;
+ *) use $1 \
+ && busybox_config_option y $2 \
+ || busybox_config_option n $2
+ return 0
+ ;;
+ esac
+ einfo $(grep "CONFIG_$2[= ]" .config)
+}
+
+src_unpack() {
+ busybox_set_env
+ unpack ${A}
+ cd "${S}"
+
+ # patches go here!
+ epatch "${FILESDIR}"/1.1.0/bb.patch
+ epatch "${FILESDIR}"/1.1.0/ppc64-insmod.patch
+ epatch "${FILESDIR}"/1.1.0/glibc.patch
+
+ epatch "${FILESDIR}"/1.1.0/flx-syslogd-listen-udp.diff
+ epatch "${FILESDIR}"/1.1.0/flx-syslogd-reliability.diff
+ epatch "${FILESDIR}"/1.1.0/flx-makefile-typo.diff
+ epatch "${FILESDIR}"/1.1.0/flx-syslogd-collect-kmsg.diff
+ epatch "${FILESDIR}"/1.1.0/flx-01_redirect-dev-null-1.diff
+ epatch "${FILESDIR}"/1.1.0/flx-02_klog-block-read-1.diff
+ epatch "${FILESDIR}"/1.1.0/flx-03_remove-backspaces-from-kmsg-1.diff
+ epatch "${FILESDIR}"/1.1.0/flx-04-disable-unix-listening.diff
+ epatch "${FILESDIR}"/1.1.0/flx-05-syslogd-ipc-set-key.diff
+ epatch "${FILESDIR}"/1.1.0/flx-06-logread-ipc-set-key.diff
+ epatch "${FILESDIR}"/1.1.0/flx-07-syslogd-pidfile.diff
+
+ epatch "${FILESDIR}"/1.1.0/${P}-BJA-asm-page.diff
+
+ # we'll let portage do the stripping
+ # respect env CFLAGS
+ sed -i \
+ -e '/STRIPCMD:=/s:=.*:=true:' \
+ -e '/^CFLAGS=/s:=:+=:' \
+ Rules.mak
+
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+ # fine grained config control for user defined busybox configs.
+ # [package]-[version]-[revision].config
+ # [package]-[version].config
+ # [package].config
+
+ if use savedconfig ; then
+ [[ -r .config ]] && rm .config
+ for conf in ${PN}-${PV}-${PR} ${PN}-${PV} ${PN}; do
+ configfile=${ROOT}/etc/${PN}/${CHOST}/${conf}.config
+ [[ -r ${configfile} ]] || configfile=/etc/${PN}/${CHOST}/${conf}.config
+ if [[ -r ${configfile} ]] ; then
+ cp ${configfile} ${S}/.config
+ break
+ fi
+ done
+ if [[ -r ${S}/.config ]] ; then
+ einfo "Found your ${configfile} and using it."
+ return 0
+ fi
+ fi
+ if use netboot ; then
+ cp "${FILESDIR}"/config-netboot .config
+ sed -i \
+ -e '/DEFAULT_SCRIPT/s:/share/udhcpc/default.script:/lib/udhcpc.script:' \
+ networking/udhcp/libbb_udhcp.h \
+ || die "fixing netboot/udhcpc"
+ elif use floppyboot ; then
+ cp "${FILESDIR}"/config-floppyboot .config
+ fi
+
+ # setup the config file
+ make allyesconfig > /dev/null
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y FEATURE_SH_IS_ASH
+ busybox_config_option n FEATURE_SH_IS_NONE
+
+ busybox_config_option static STATIC
+ busybox_config_option debug DEBUG
+ use debug \
+ && busybox_config_option Y NO_DEBUG_LIB \
+ && busybox_config_option N DMALLOC \
+ && busybox_config_option N EFENCE
+
+ # 1.00-pre5 uses the old selinux api which is no longer maintained
+ #busybox_config_option selinux SELINUX
+ busybox_config_option n SELINUX
+
+ # default a bunch of uncommon options to off
+ for opt in LOCALE_SUPPORT TFTP FTP{GET,PUT} IPCALC TFTP HUSH \
+ LASH MSH INETD DPKG RPM2CPIO RPM FOLD LOGNAME OD CRONTAB \
+ UUDECODE UUENCODE SULOGIN DC
+ do
+ busybox_config_option n ${opt}
+ done
+
+ make oldconfig > /dev/null
+}
+
+src_compile() {
+ busybox_set_env
+ use ppc64 && CFLAGS="${CFLAGS} -mminimal-toc"
+ emake -j1 CROSS="${CROSS}" depend || die "depend failed"
+ emake CROSS="${CROSS}" busybox || die "build failed"
+ if ! use static ; then
+ mv busybox{,.bak}
+ local failed=0
+ emake -j1 \
+ LDFLAGS="${LDFLAGS} -static" \
+ CROSS="${CROSS}" \
+ busybox || failed=1
+ if [[ ${failed} == 1 ]] ; then
+ if has_version '<sys-libs/glibc-2.3.5' ; then
+ eerror "Your glibc has broken static support, ignorning static build failure."
+ eerror "See http://bugs.gentoo.org/show_bug.cgi?id=94879"
+ cp busybox.bak bb
+ else
+ die "static build failed"
+ fi
+ else
+ mv busybox bb
+ fi
+ mv busybox{.bak,}
+ fi
+}
+
+src_install() {
+ busybox_set_env
+
+ into /
+ dobin busybox
+ use static \
+ && dosym busybox /bin/bb \
+ || dobin bb
+
+ if use make-symlinks ; then
+ if [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is realy what you want."
+ die "silly options will destroy your system"
+ fi
+ make CROSS="${CROSS}" install || die
+ cp -pPR _install/${x}/* "${D}"/ || die "copying links for ${x} failed"
+ cd "${D}"
+ # XXX: should really move this to pkg_preinst() ...
+ local symlink
+ for symlink in {,usr/}{bin,sbin}/* linuxrc ; do
+ [[ -L ${symlink} ]] || continue
+ [[ -e ${ROOT}/${symlink} ]] \
+ && eerror "Deleting symlink ${symlink} because it exists in ${ROOT}" \
+ && rm ${symlink}
+ done
+ cd "${S}"
+ fi
+
+ dodoc AUTHORS Changelog README TODO
+
+ cd docs || die
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html *.sgml
+
+ # no man files?
+ # cd ../man && doman *.1
+
+ cd ../examples || die
+ docinto examples
+ dodoc inittab depmod.pl
+
+ cd bootfloppy || die
+ docinto bootfloppy
+ dodoc bootfloppy.txt display.txt mkdevs.sh etc/* etc/init.d/* 2>/dev/null
+
+ cd ../../ || die
+ if has buildpkg ${FEATURES} && has keepwork ${FEATURES} ; then
+ cd "${S}"
+ # this should install to the ./_install/ dir by default.
+ # we make a micro pkg of busybox that can be used for
+ # embedded systems -solar
+ if ! use make-symlinks ; then
+ make CROSS="${CROSS}" install || die
+ fi
+ cd ./_install/ \
+ && tar --no-same-owner -jcvf ${WORKDIR}/${MY_P}-${ARCH}.bz2 . \
+ && cd ..
+ fi
+
+ if use savedconfig ; then
+ einfo "Saving this build config to /etc/${PN}/${CHOST}/${PN}-${PV}-${PR}.config"
+ einfo "Read this ebuild for more info on how to take advantage of this option"
+ insinto /etc/${PN}/${CHOST}/
+ newins "${S}"/.config ${PN}-${PV}-${PR}.config
+ fi
+}
+
+pkg_postinst() {
+ echo
+ einfo "This ebuild has support for user defined configs"
+ einfo "Please read this ebuild for more details and re-emerge as needed"
+ einfo "if you want to add or remove functionality for ${PN}"
+ echo
+}
diff --git a/sys-apps/busybox/files/1.1.0/bb.patch b/sys-apps/busybox/files/1.1.0/bb.patch
new file mode 100644
index 00000000..fc90b00c
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/bb.patch
@@ -0,0 +1,6 @@
+--- include/applets.h
++++ include/applets.h
+@@ -78,2 +78,3 @@
+ #endif
++ APPLET_NOUSAGE("bb", ash_main, _BB_DIR_BIN, _BB_SUID_NEVER)
+ #ifdef CONFIG_BBCONFIG
diff --git a/sys-apps/busybox/files/1.1.0/busybox-1.1.0-BJA-asm-page.diff b/sys-apps/busybox/files/1.1.0/busybox-1.1.0-BJA-asm-page.diff
new file mode 100644
index 00000000..09888e3b
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/busybox-1.1.0-BJA-asm-page.diff
@@ -0,0 +1,20 @@
+--- util-linux/mkswap.c.ori 2009-05-08 22:56:53.000000000 +0200
++++ util-linux/mkswap.c 2009-05-08 22:57:04.000000000 +0200
+@@ -42,7 +42,6 @@
+ #include <stdlib.h>
+ #include <sys/ioctl.h> /* for _IO */
+ #include <sys/utsname.h>
+-#include <asm/page.h> /* for PAGE_SIZE and PAGE_SHIFT */
+ /* we also get PAGE_SIZE via getpagesize() */
+ #include "busybox.h"
+
+--- libbb/procps.c.ori 2009-05-02 01:15:13.000000000 +0200
++++ libbb/procps.c 2009-05-02 01:15:20.000000000 +0200
+@@ -12,7 +12,6 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+-#include <asm/page.h>
+
+ #include "libbb.h"
+
diff --git a/sys-apps/busybox/files/1.1.0/flx-01_redirect-dev-null-1.diff b/sys-apps/busybox/files/1.1.0/flx-01_redirect-dev-null-1.diff
new file mode 100644
index 00000000..d924f228
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-01_redirect-dev-null-1.diff
@@ -0,0 +1,13 @@
+This patch ensures that even if an error is printed, it will never be sent
+to a socket or other embarrassing fd.
+
+--- ./sysklogd/syslogd.c~ 2006-03-13 22:35:44.000000000 +0100
++++ ./sysklogd/syslogd.c 2006-03-13 22:32:55.000000000 +0100
+@@ -824,6 +824,7 @@
+ bb_perror_msg_and_die("daemon");
+ #endif /* __uClinux__ */
+ close(0); close(1); close(2);
++ open("/dev/null", O_RDWR); dup(0); dup(0);
+ }
+ doSyslogd();
+
diff --git a/sys-apps/busybox/files/1.1.0/flx-02_klog-block-read-1.diff b/sys-apps/busybox/files/1.1.0/flx-02_klog-block-read-1.diff
new file mode 100644
index 00000000..17cd603d
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-02_klog-block-read-1.diff
@@ -0,0 +1,82 @@
+This patch correctly reads the kernel logs at startup time. The kernel then
+returns large blocks of data which must be cut in lines. Also, we need to
+ensure that we will never block on the kernel FD upon next reads.
+
+--- ./sysklogd/syslogd.c~ 2006-03-13 14:59:45.000000000 +0100
++++ ./sysklogd/syslogd.c 2006-03-13 22:35:44.000000000 +0100
+@@ -707,16 +707,68 @@
+ #endif /* SYSLOG_LISTEN_UDP */
+ #ifdef CONFIG_FEATURE_SYSLOG_INCLUDE_KLOG
+ if (doKernelLog && FD_ISSET(klog_fd, &fds)) {
+- int i;
++ int i, j, msgptr, msgend;
++ int save, remain;
+
+- if ((i = read(klog_fd, tmpbuf + 8, TMP_BUF_SZ)) > 0) {
+- memcpy(tmpbuf, "kernel: ", 8);
+- i += 8;
+- tmpbuf[i] = '\0';
+- serveConnection(tmpbuf, i);
+- } else if (i < 0 && errno != EINTR && errno != EAGAIN) {
++ save = strlen("kernel: ");
++ remain = 0;
++
++
++ i = read(klog_fd, tmpbuf + save, TMP_BUF_SZ - save - 1);
++ if (i < 0 && errno != EINTR && errno != EAGAIN) {
+ bb_perror_msg_and_die("/proc/kmsg read error");
+ }
++
++ while (i > 0) {
++ fd_set rfd;
++ struct timeval tv;
++
++ /* look for a line feed after remaining data */
++ msgptr = save;
++ j = msgptr + remain;
++ msgend = j + i;
++ while (j < msgend) {
++ if (tmpbuf[j] != '\n') {
++ j++;
++ continue;
++ }
++ /* we have one complete message between msgptr and j */
++ tmpbuf[j] = 0;
++ memcpy(tmpbuf + msgptr - save,
++ "kernel: ", save);
++ serveConnection(tmpbuf + msgptr - save,
++ j - msgptr + save);
++ msgptr = ++j;
++ }
++ remain = msgend - msgptr;
++
++ if (!remain)
++ break;
++
++ /* now we know there are some data left, so we'll try
++ * to read the next block. but we *MUST* check with
++ * select() that data is available before trying to
++ * read again, otherwise we willy block.
++ */
++
++ memmove(tmpbuf + save, tmpbuf + msgptr, remain);
++
++ FD_ZERO(&rfd); FD_SET(klog_fd, &rfd);
++ tv.tv_sec = tv.tv_usec = 0;
++ i = 0;
++ if (select(klog_fd + 1, &rfd, NULL, NULL, &tv) <= 0 ||
++ (i = read(klog_fd, tmpbuf + save + remain,
++ TMP_BUF_SZ - save - remain - 1)) <= 0) {
++ if (i < 0 && errno != EINTR && errno != EAGAIN) {
++ bb_perror_msg_and_die("/proc/kmsg read error");
++ }
++ /* end of read : send last data and return */
++ tmpbuf[save + remain] = 0;
++ memcpy(tmpbuf, "kernel: ", save);
++ serveConnection(tmpbuf, save + remain);
++ break;
++ }
++ } /* end of while(1) */
+ }
+ #endif
+ } /* for main loop */
diff --git a/sys-apps/busybox/files/1.1.0/flx-03_remove-backspaces-from-kmsg-1.diff b/sys-apps/busybox/files/1.1.0/flx-03_remove-backspaces-from-kmsg-1.diff
new file mode 100644
index 00000000..54778ff7
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-03_remove-backspaces-from-kmsg-1.diff
@@ -0,0 +1,61 @@
+This patch automatically removes backspaces from logs sent by the kernel. The
+kernel uses backspaces to show its progress during the ramdisk decompression.
+
+--- ./sysklogd/syslogd.c~ 2006-03-13 22:32:55.000000000 +0100
++++ ./sysklogd/syslogd.c 2006-03-13 22:30:35.000000000 +0100
+@@ -522,7 +522,7 @@
+
+ /* This must be a #define, since when CONFIG_DEBUG and BUFFERS_GO_IN_BSS are
+ * enabled, we otherwise get a "storage size isn't constant error. */
+-static int serveConnection(char *tmpbuf, int n_read)
++static int serveConnection(char *tmpbuf, int n_read, int remove_bs)
+ {
+ char *p = tmpbuf;
+
+@@ -547,6 +547,9 @@
+ }
+ } else if (c == '\n') {
+ *q++ = ' ';
++ } else if (c == '\b') {
++ if (q > line)
++ *--q = '\0';
+ } else if (iscntrl(c) && (c < 0177)) {
+ *q++ = '^';
+ *q++ = c ^ 0100;
+@@ -687,7 +690,7 @@
+
+ if ((i = recv(sock_fd, tmpbuf, TMP_BUF_SZ, 0)) > 0) {
+ tmpbuf[i] = '\0';
+- serveConnection(tmpbuf, i);
++ serveConnection(tmpbuf, i, 0);
+ } else if (i < 0 && errno != EINTR && errno != EAGAIN) {
+ bb_perror_msg_and_die("UNIX socket error");
+ }
+@@ -699,7 +702,7 @@
+
+ if ((i = recv(listen_udp_fd, tmpbuf, TMP_BUF_SZ, 0)) > 0) {
+ tmpbuf[i] = '\0';
+- serveConnection(tmpbuf, i);
++ serveConnection(tmpbuf, i, 0);
+ } else if (i < 0 && errno != EINTR && errno != EAGAIN) {
+ bb_perror_msg_and_die("UDP socket error");
+ }
+@@ -737,7 +740,7 @@
+ memcpy(tmpbuf + msgptr - save,
+ "kernel: ", save);
+ serveConnection(tmpbuf + msgptr - save,
+- j - msgptr + save);
++ j - msgptr + save, 1);
+ msgptr = ++j;
+ }
+ remain = msgend - msgptr;
+@@ -765,7 +768,7 @@
+ /* end of read : send last data and return */
+ tmpbuf[save + remain] = 0;
+ memcpy(tmpbuf, "kernel: ", save);
+- serveConnection(tmpbuf, save + remain);
++ serveConnection(tmpbuf, save + remain, 1);
+ break;
+ }
+ } /* end of while(1) */
+
diff --git a/sys-apps/busybox/files/1.1.0/flx-04-disable-unix-listening.diff b/sys-apps/busybox/files/1.1.0/flx-04-disable-unix-listening.diff
new file mode 100644
index 00000000..504d69cb
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-04-disable-unix-listening.diff
@@ -0,0 +1,82 @@
+--- ./sysklogd/syslogd.c~ 2006-03-30 18:16:06.000000000 +0200
++++ ./sysklogd/syslogd.c 2006-03-30 21:42:34.000000000 +0200
+@@ -110,6 +110,8 @@
+ static int doKernelLog = FALSE;
+ #endif
+
++static int doListenUnix = TRUE; /* we can disable unix socket listening */
++
+ /* Make loging output smaller. */
+ static bool small = false;
+
+@@ -587,6 +589,8 @@
+ signal(SIGALRM, domark);
+ alarm(MarkInterval);
+
++ if (doListenUnix)
++ {
+ /* Create the syslog file so realpath() can work. */
+ if (realpath(_PATH_LOG, lfile) != NULL) {
+ unlink(lfile);
+@@ -612,6 +616,7 @@
+ if (chmod(lfile, 0666) < 0) {
+ bb_perror_msg_and_die("Could not set permission on " _PATH_LOG);
+ }
++ }
+
+ #ifdef CONFIG_FEATURE_SYSLOG_LISTEN_UDP
+ if (doListenUDP) {
+@@ -654,8 +659,12 @@
+ for (;;) {
+ int nbfd;
+ FD_ZERO(&fds);
+- FD_SET(sock_fd, &fds);
+- nbfd = sock_fd + 1;
++ if (doListenUnix) {
++ FD_SET(sock_fd, &fds);
++ nbfd = sock_fd + 1;
++ } else
++ nbfd = 0;
++
+ #ifdef CONFIG_FEATURE_SYSLOG_LISTEN_UDP
+ if (doListenUDP) {
+ FD_SET(listen_udp_fd, &fds);
+@@ -685,7 +694,7 @@
+ #endif
+ #define tmpbuf bb_common_bufsiz1
+
+- if (FD_ISSET(sock_fd, &fds)) {
++ if (doListenUnix && FD_ISSET(sock_fd, &fds)) {
+ int i;
+
+ if ((i = recv(sock_fd, tmpbuf, TMP_BUF_SZ, 0)) > 0) {
+@@ -786,7 +795,7 @@
+ char *p;
+
+ /* do normal option parsing */
+- while ((opt = getopt(argc, argv, "m:nO:s:Sb:R:Ll:k:C::")) > 0) {
++ while ((opt = getopt(argc, argv, "m:nO:s:uSb:R:Ll:k:C::")) > 0) {
+ switch (opt) {
+ case 'm':
+ MarkInterval = atoi(optarg) * 60;
+@@ -847,7 +856,10 @@
+ }
+ circular_logging = TRUE;
+ break;
+ #endif
++ case 'u':
++ doListenUnix = FALSE;
++ break;
+ case 'S':
+ small = true;
+ break;
+--- ./include/usage.h.orig 2006-03-30 21:51:39.000000000 +0200
++++ ./include/usage.h 2006-03-30 21:52:47.000000000 +0200
+@@ -2907,6 +2907,7 @@
+ "\t-n\t\tRun as a foreground process\n" \
+ "\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)\n" \
+ "\t-S\t\tMake logging output smaller." \
++ "\n\t-u\t\tDo not bind to UNIX socket /dev/log." \
+ USAGE_ROTATE_LOGFILE( \
+ "\n\t-s SIZE\t\tMax size (KB) before rotate (default=200KB, 0=off)\n" \
+ "\t-b NUM\t\tNumber of rotated logs to keep (default=1, max=99, 0=purge)") \
diff --git a/sys-apps/busybox/files/1.1.0/flx-05-syslogd-ipc-set-key.diff b/sys-apps/busybox/files/1.1.0/flx-05-syslogd-ipc-set-key.diff
new file mode 100644
index 00000000..3061e66a
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-05-syslogd-ipc-set-key.diff
@@ -0,0 +1,43 @@
+--- ./sysklogd/syslogd.c~ 2006-03-30 21:44:51.000000000 +0200
++++ ./sysklogd/syslogd.c 2006-03-30 21:42:34.000000000 +0200
+@@ -132,7 +132,7 @@
+ #include <sys/shm.h>
+
+ /* our shared key */
+-static const long KEY_ID = 0x414e4547; /*"GENA" */
++static long KEY_ID = 0x414e4500; /*"\0ENA" */
+
+ // Semaphore operation structures
+ static struct shbuf_ds {
+@@ -795,7 +795,7 @@
+ char *p;
+
+ /* do normal option parsing */
+- while ((opt = getopt(argc, argv, "m:nO:s:uSb:R:Ll:k:C::")) > 0) {
++ while ((opt = getopt(argc, argv, "m:nO:s:uSb:R:Ll:k:K:C::")) > 0) {
+ switch (opt) {
+ case 'm':
+ MarkInterval = atoi(optarg) * 60;
+@@ -856,6 +856,10 @@
+ }
+ circular_logging = TRUE;
+ break;
++ case 'K':
++ KEY_ID = (KEY_ID & ~0xFF) | (atoi(optarg) & 0xFF);
++ circular_logging = TRUE;
++ break;
+ #endif
+ case 'u':
+ doListenUnix = FALSE;
+--- ./include/usage.h.orig 2006-03-30 21:53:08.000000000 +0200
++++ ./include/usage.h 2006-03-30 21:55:58.000000000 +0200
+@@ -2919,7 +2919,8 @@
+ USAGE_SYSLOG_INCLUDE_KLOG( \
+ "\n\t-k LEVEL\tCollect kernel logs and set console to display logs below LEVEL (1-8)\n") \
+ USAGE_IPC_LOG( \
+- "\n\t-C [size(KiB)]\tLog to a circular buffer (read the buffer using logread)")
++ "\n\t-C [size(KiB)]\tLog to a circular buffer (read the buffer using logread)\n" \
++ "\t-K KEYID\tUse this ID for the circular buffer (0..255, default=0)")
+ #define syslogd_example_usage \
+ "$ syslogd -R masterlog:514\n" \
+ "$ syslogd -R 192.168.1.1:601\n"
diff --git a/sys-apps/busybox/files/1.1.0/flx-06-logread-ipc-set-key.diff b/sys-apps/busybox/files/1.1.0/flx-06-logread-ipc-set-key.diff
new file mode 100644
index 00000000..202733dc
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-06-logread-ipc-set-key.diff
@@ -0,0 +1,46 @@
+--- ./sysklogd/logread.c.orig 2006-03-30 22:03:21.000000000 +0200
++++ ./sysklogd/logread.c 2006-03-30 22:03:23.000000000 +0200
+@@ -36,7 +36,7 @@
+ #include <unistd.h>
+ #include "busybox.h"
+
+-static const long KEY_ID = 0x414e4547; /*"GENA"*/
++static long KEY_ID = 0x414e4500; /*"\0ENA"*/
+
+ static struct shbuf_ds {
+ int size; // size of data written
+@@ -80,12 +80,17 @@
+ int i;
+ int follow=0;
+
+- if (argc == 2 && strcmp(argv[1],"-f")==0) {
+- follow = 1;
+- } else {
+- /* no options, no getopt */
+- if (argc > 1)
+- bb_show_usage();
++ argc--; argv++;
++ while (argc > 0) {
++ if (!strcmp(argv[0], "-f"))
++ follow = 1;
++ else if (argc > 1 && !strcmp(argv[0], "-K")) {
++ KEY_ID = (KEY_ID & ~0xFF) | (atoi(argv[1]) & 0xFF);
++ argc--; argv++;
++ }
++ else
++ bb_show_usage();
++ argc--; argv++;
+ }
+
+ // handle intrrupt signal
+--- ./include/usage.h.orig 2006-03-30 22:04:04.000000000 +0200
++++ ./include/usage.h 2006-03-30 22:06:15.000000000 +0200
+@@ -1655,6 +1655,7 @@
+ "Shows the messages from syslogd (using circular buffer).\n\n" \
+ "Options:\n" \
+- "\t-f\t\toutput data as the log grows"
++ "\t-f\t\toutput data as the log grows\n" \
++ "\t-K KEYID\taccess logs with key KEYID (0..255, default=0)"
+
+ #define losetup_trivial_usage \
+ "[-od] LOOPDEVICE [FILE]"
diff --git a/sys-apps/busybox/files/1.1.0/flx-07-syslogd-pidfile.diff b/sys-apps/busybox/files/1.1.0/flx-07-syslogd-pidfile.diff
new file mode 100644
index 00000000..1b479655
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-07-syslogd-pidfile.diff
@@ -0,0 +1,77 @@
+--- ./sysklogd/syslogd.c.flx4-nopid 2006-03-30 22:32:43.000000000 +0200
++++ ./sysklogd/syslogd.c 2006-03-30 22:49:32.000000000 +0200
+@@ -60,6 +60,8 @@
+
+ static const char *logFilePath = __LOG_FILE;
+
++static const char *pidFilePath = NULL;
++
+ #ifdef CONFIG_FEATURE_ROTATE_LOGFILE
+ /* max size of message file before being rotated */
+ static int logFileSize = 200 * 1024;
+@@ -507,6 +509,8 @@
+ {
+ logMessage(LOG_SYSLOG | LOG_INFO, "System log daemon exiting.");
+ unlink(lfile);
++ if (pidFilePath)
++ unlink(pidFilePath);
+ #ifdef CONFIG_FEATURE_IPC_SYSLOG
+ ipcsyslog_cleanup();
+ #endif
+@@ -795,7 +799,7 @@
+ char *p;
+
+ /* do normal option parsing */
+- while ((opt = getopt(argc, argv, "m:nO:s:uSb:R:Ll:k:K:C::")) > 0) {
++ while ((opt = getopt(argc, argv, "m:nO:p:s:uSb:R:Ll:k:K:C::")) > 0) {
+ switch (opt) {
+ case 'm':
+ MarkInterval = atoi(optarg) * 60;
+@@ -806,6 +810,9 @@
+ case 'O':
+ logFilePath = optarg;
+ break;
++ case 'p':
++ pidFilePath = optarg;
++ break;
+ #ifdef CONFIG_FEATURE_ROTATE_LOGFILE
+ case 's':
+ logFileSize = atoi(optarg) * 1024;
+@@ -885,8 +892,6 @@
+ *p = '\0';
+ }
+
+- umask(0);
+-
+ if (doFork == TRUE) {
+ #if defined(__uClinux__)
+ vfork_daemon_rexec(0, 1, argc, argv, "-n");
+@@ -896,7 +901,18 @@
+ #endif /* __uClinux__ */
+ close(0); close(1); close(2);
+ open("/dev/null", O_RDWR); dup(0); dup(0);
++ if (pidFilePath != NULL) {
++ FILE *f;
++
++ f = fopen(pidFilePath, "w+");
++ if (f != NULL) {
++ fprintf(f, "%d\n", getpid());
++ fclose(f);
++ }
++ }
+ }
++ umask(0);
++
+ doSyslogd();
+
+ return EXIT_SUCCESS;
+--- ./include/usage.h.orig 2006-03-30 23:08:03.000000000 +0200
++++ ./include/usage.h 2006-03-30 23:09:03.000000000 +0200
+@@ -2909,6 +2909,7 @@
+ "\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)\n" \
+ "\t-S\t\tMake logging output smaller." \
+ "\n\t-u\t\tDo not bind to UNIX socket /dev/log." \
++ "\n\t-p PIDFILE\tWrite background process ID to this file." \
+ USAGE_ROTATE_LOGFILE( \
+ "\n\t-s SIZE\t\tMax size (KB) before rotate (default=200KB, 0=off)\n" \
+ "\t-b NUM\t\tNumber of rotated logs to keep (default=1, max=99, 0=purge)") \
diff --git a/sys-apps/busybox/files/1.1.0/flx-makefile-typo.diff b/sys-apps/busybox/files/1.1.0/flx-makefile-typo.diff
new file mode 100644
index 00000000..aa787284
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-makefile-typo.diff
@@ -0,0 +1,11 @@
+--- ./Makefile.orig 2006-03-07 22:13:20.000000000 +0100
++++ ./Makefile 2006-03-07 22:13:29.000000000 +0100
+@@ -129,7 +129,7 @@
+ @echo ' oldconfig - resolve any unresolved symbols in .config'
+ @echo
+ @echo 'Installation:'
+- @echo ' install - install busybox into $prefix'
++ @echo ' install - install busybox into $(PREFIX)'
+ @echo ' uninstall'
+ @echo
+ @echo 'Development:'
diff --git a/sys-apps/busybox/files/1.1.0/flx-syslogd-collect-kmsg.diff b/sys-apps/busybox/files/1.1.0/flx-syslogd-collect-kmsg.diff
new file mode 100644
index 00000000..4d502e38
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-syslogd-collect-kmsg.diff
@@ -0,0 +1,137 @@
+--- ./sysklogd/syslogd.c~ 2006-03-07 22:45:12.000000000 +0100
++++ ./sysklogd/syslogd.c 2006-03-09 21:03:57.000000000 +0100
+@@ -104,6 +104,11 @@
+ static int doListenUDP = FALSE;
+ #endif
+
++#ifdef CONFIG_FEATURE_SYSLOG_INCLUDE_KLOG
++static int console_level;
++static int klog_fd;
++static int doKernelLog = FALSE;
++#endif
+
+ /* Make loging output smaller. */
+ static bool small = false;
+@@ -616,6 +621,19 @@
+ }
+ #endif
+
++#ifdef CONFIG_FEATURE_SYSLOG_INCLUDE_KLOG
++ if (doKernelLog) {
++ klogctl(8, NULL, console_level);
++ klog_fd = open("/proc/kmsg", O_RDONLY);
++ if (klog_fd < 0) {
++ bb_perror_msg_and_die("Cannot open /proc/kmsg");
++ }
++ if (fcntl(klog_fd, F_SETFL, O_NONBLOCK) < 0) {
++ bb_perror_msg_and_die("Couldn't make /proc/kmsg non-blocking");
++ }
++ }
++#endif
++
+ #ifdef CONFIG_FEATURE_IPC_SYSLOG
+ if (circular_logging == TRUE) {
+ ipcsyslog_init();
+@@ -642,6 +660,13 @@
+ nbfd = listen_udp_fd + 1;
+ }
+ #endif
++#ifdef CONFIG_FEATURE_SYSLOG_INCLUDE_KLOG
++ if (doKernelLog) {
++ FD_SET(klog_fd, &fds);
++ if (klog_fd >= nbfd)
++ nbfd = klog_fd + 1;
++ }
++#endif
+ if (select(nbfd, &fds, NULL, NULL, NULL) < 0) {
+ if (errno == EINTR) {
+ /* alarm may have happened. */
+@@ -680,6 +705,20 @@
+ }
+ } /* FD_ISSET() */
+ #endif /* SYSLOG_LISTEN_UDP */
++#ifdef CONFIG_FEATURE_SYSLOG_INCLUDE_KLOG
++ if (doKernelLog && FD_ISSET(klog_fd, &fds)) {
++ int i;
++
++ if ((i = read(klog_fd, tmpbuf + 8, TMP_BUF_SZ)) > 0) {
++ memcpy(tmpbuf, "kernel: ", 8);
++ i += 8;
++ tmpbuf[i] = '\0';
++ serveConnection(tmpbuf, i);
++ } else if (i < 0 && errno != EINTR && errno != EAGAIN) {
++ bb_perror_msg_and_die("/proc/kmsg read error");
++ }
++ }
++#endif
+ } /* for main loop */
+ }
+
+@@ -692,7 +731,7 @@
+ char *p;
+
+ /* do normal option parsing */
+- while ((opt = getopt(argc, argv, "m:nO:s:Sb:R:Ll:C::")) > 0) {
++ while ((opt = getopt(argc, argv, "m:nO:s:Sb:R:Ll:k:C::")) > 0) {
+ switch (opt) {
+ case 'm':
+ MarkInterval = atoi(optarg) * 60;
+@@ -735,6 +774,14 @@
+ doListenUDP = TRUE;
+ break;
+ #endif
++#ifdef CONFIG_FEATURE_SYSLOG_INCLUDE_KLOG
++ case 'k':
++ console_level = atoi(optarg);
++ if (console_level < 0)
++ console_level = 0;
++ doKernelLog = TRUE;
++ break;
++#endif
+ #ifdef CONFIG_FEATURE_IPC_SYSLOG
+ case 'C':
+ if (optarg) {
+--- ./sysklogd/Config.in~ 2006-03-07 22:45:12.000000000 +0100
++++ ./sysklogd/Config.in 2006-03-09 20:39:53.000000000 +0100
+@@ -53,6 +53,18 @@
+ The real goal is not to provide a big local syslog server,
+ but to use it as a centralized repeater.
+
++config CONFIG_FEATURE_SYSLOG_INCLUDE_KLOG
++ bool " Make syslogd collect kernel messages"
++ default n
++ depends on CONFIG_SYSLOGD
++ help
++ When you enable this feature, the syslogd utility will
++ be able to directly read kernel messages from /proc/kmsg
++ without the need for an external klogd daemon. Unless you
++ know that you really need this option, you'd better use
++ the more flexible klogd featured as a standalone daemon
++ which is provided in another option below.
++
+ config CONFIG_FEATURE_IPC_SYSLOG
+ bool " Circular Buffer support"
+ default n
+--- ./include/usage.h~ 2006-03-07 22:45:12.000000000 +0100
++++ ./include/usage.h 2006-03-09 21:08:32.000000000 +0100
+@@ -2869,6 +2869,11 @@
+ #else
+ # define USAGE_SYSLOG_LISTEN_UDP(a)
+ #endif
++#ifdef CONFIG_FEATURE_SYSLOG_INCLUDE_KLOG
++# define USAGE_SYSLOG_INCLUDE_KLOG(a) a
++#else
++# define USAGE_SYSLOG_INCLUDE_KLOG(a)
++#endif
+ #ifdef CONFIG_FEATURE_IPC_SYSLOG
+ # define USAGE_IPC_LOG(a) a
+ #else
+@@ -2910,6 +2915,8 @@
+ "\t-L\t\tLog locally and via network logging (default is network only)") \
+ USAGE_SYSLOG_LISTEN_UDP( \
+ "\n\t-l HOST[:PORT]\tAccept UDP packets on this local IP or hostname on PORT (default PORT=514/UDP)\n") \
++ USAGE_SYSLOG_INCLUDE_KLOG( \
++ "\n\t-k LEVEL\tCollect kernel logs and set console to display logs below LEVEL (1-8)\n") \
+ USAGE_IPC_LOG( \
+ "\n\t-C [size(KiB)]\tLog to a circular buffer (read the buffer using logread)")
+ #define syslogd_example_usage \
diff --git a/sys-apps/busybox/files/1.1.0/flx-syslogd-listen-udp.diff b/sys-apps/busybox/files/1.1.0/flx-syslogd-listen-udp.diff
new file mode 100644
index 00000000..e846f925
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-syslogd-listen-udp.diff
@@ -0,0 +1,193 @@
+--- ./sysklogd/syslogd.c.orig 2006-03-07 20:19:12.000000000 +0100
++++ ./sysklogd/syslogd.c 2006-03-07 21:55:28.000000000 +0100
+@@ -91,6 +91,20 @@
+ static int local_logging = FALSE;
+ #endif
+
++#ifdef CONFIG_FEATURE_SYSLOG_LISTEN_UDP
++/* udp socket for receiving local UDP messages */
++static int listen_udp_fd = -1;
++static struct sockaddr_in listen_udp_addr;
++
++/* where are we listening to? */
++static char *ListenHost;
++
++/* what port are we listening to? */
++static int ListenPort = 514;
++static int doListenUDP = FALSE;
++#endif
++
++
+ /* Make loging output smaller. */
+ static bool small = false;
+
+@@ -394,6 +408,22 @@
+ }
+ #endif
+
++#ifdef CONFIG_FEATURE_SYSLOG_LISTEN_UDP
++static void init_LocalLog(void)
++{
++ memset(&listen_udp_addr, 0, sizeof(listen_udp_addr));
++ listen_udp_fd = socket(AF_INET, SOCK_DGRAM, 0);
++
++ if (listen_udp_fd < 0) {
++ bb_error_msg("cannot create socket");
++ }
++
++ listen_udp_addr.sin_family = AF_INET;
++ listen_udp_addr.sin_addr = *(struct in_addr *) *(xgethostbyname(ListenHost))->h_addr_list;
++ listen_udp_addr.sin_port = htons(ListenPort);
++}
++#endif
++
+ static void logMessage(int pri, char *msg)
+ {
+ time_t now;
+@@ -569,6 +599,18 @@
+ if (chmod(lfile, 0666) < 0) {
+ bb_perror_msg_and_die("Could not set permission on " _PATH_LOG);
+ }
++
++#ifdef CONFIG_FEATURE_SYSLOG_LISTEN_UDP
++ if (doListenUDP) {
++ init_LocalLog();
++
++ if (bind(listen_udp_fd, (struct sockaddr *) &listen_udp_addr,
++ sizeof(listen_udp_addr)) < 0) {
++ bb_perror_msg_and_die("Could not bind to local UDP socket");
++ }
++ }
++#endif
++
+ #ifdef CONFIG_FEATURE_IPC_SYSLOG
+ if (circular_logging == TRUE) {
+ ipcsyslog_init();
+@@ -584,11 +626,18 @@
+ logMessage(LOG_SYSLOG | LOG_INFO, "syslogd started: " BB_BANNER);
+
+ for (;;) {
+-
++ int nbfd;
+ FD_ZERO(&fds);
+ FD_SET(sock_fd, &fds);
+-
+- if (select(sock_fd + 1, &fds, NULL, NULL, NULL) < 0) {
++ nbfd = sock_fd + 1;
++#ifdef CONFIG_FEATURE_SYSLOG_LISTEN_UDP
++ if (doListenUDP) {
++ FD_SET(listen_udp_fd, &fds);
++ if (listen_udp_fd >= nbfd)
++ nbfd = listen_udp_fd + 1;
++ }
++#endif
++ if (select(nbfd, &fds, NULL, NULL, NULL) < 0) {
+ if (errno == EINTR) {
+ /* alarm may have happened. */
+ continue;
+@@ -596,8 +645,6 @@
+ bb_perror_msg_and_die("select error");
+ }
+
+- if (FD_ISSET(sock_fd, &fds)) {
+- int i;
+ #if MAXLINE > BUFSIZ
+ # define TMP_BUF_SZ BUFSIZ
+ #else
+@@ -605,6 +652,9 @@
+ #endif
+ #define tmpbuf bb_common_bufsiz1
+
++ if (FD_ISSET(sock_fd, &fds)) {
++ int i;
++
+ if ((i = recv(sock_fd, tmpbuf, TMP_BUF_SZ, 0)) > 0) {
+ tmpbuf[i] = '\0';
+ serveConnection(tmpbuf, i);
+@@ -612,6 +662,17 @@
+ bb_perror_msg_and_die("UNIX socket error");
+ }
+ } /* FD_ISSET() */
++
++#ifdef CONFIG_FEATURE_SYSLOG_LISTEN_UDP
++ if (doListenUDP && FD_ISSET(listen_udp_fd, &fds)) {
++ int i;
++
++ if ((i = recv(listen_udp_fd, tmpbuf, TMP_BUF_SZ, 0)) > 0) {
++ tmpbuf[i] = '\0';
++ serveConnection(tmpbuf, i);
++ }
++ } /* FD_ISSET() */
++#endif /* SYSLOG_LISTEN_UDP */
+ } /* for main loop */
+ }
+
+@@ -624,7 +685,7 @@
+ char *p;
+
+ /* do normal option parsing */
+- while ((opt = getopt(argc, argv, "m:nO:s:Sb:R:LC::")) > 0) {
++ while ((opt = getopt(argc, argv, "m:nO:s:Sb:R:Ll:C::")) > 0) {
+ switch (opt) {
+ case 'm':
+ MarkInterval = atoi(optarg) * 60;
+@@ -657,6 +718,16 @@
+ local_logging = TRUE;
+ break;
+ #endif
++#ifdef CONFIG_FEATURE_SYSLOG_LISTEN_UDP
++ case 'l':
++ ListenHost = bb_xstrdup(optarg);
++ if ((p = strchr(ListenHost, ':'))) {
++ ListenPort = atoi(p + 1);
++ *p = '\0';
++ }
++ doListenUDP = TRUE;
++ break;
++#endif
+ #ifdef CONFIG_FEATURE_IPC_SYSLOG
+ case 'C':
+ if (optarg) {
+--- ./sysklogd/Config.in.orig 2006-03-07 20:37:28.000000000 +0100
++++ ./sysklogd/Config.in 2006-03-07 20:40:32.000000000 +0100
+@@ -42,6 +42,17 @@
+ measure to prevent system logs from being tampered with
+ by an intruder.
+
++config CONFIG_FEATURE_SYSLOG_LISTEN_UDP
++ bool " Listen to UDP socket"
++ default n
++ depends on CONFIG_SYSLOGD
++ help
++ When you enable this feature, the syslogd utility will
++ be able to listen to a local UDP socket, which will
++ make it reachable by tools which can only log to network.
++ The real goal is not to provide a big local syslog server,
++ but to use it as a centralized repeater.
++
+ config CONFIG_FEATURE_IPC_SYSLOG
+ bool " Circular Buffer support"
+ default n
+--- ./include/usage.h.orig 2006-03-07 20:53:55.000000000 +0100
++++ ./include/usage.h 2006-03-07 20:56:22.000000000 +0100
+@@ -2864,6 +2864,11 @@
+ #else
+ # define USAGE_REMOTE_LOG(a)
+ #endif
++#ifdef CONFIG_FEATURE_SYSLOG_LISTEN_UDP
++# define USAGE_SYSLOG_LISTEN_UDP(a) a
++#else
++# define USAGE_SYSLOG_LISTEN_UDP(a)
++#endif
+ #ifdef CONFIG_FEATURE_IPC_SYSLOG
+ # define USAGE_IPC_LOG(a) a
+ #else
+@@ -2903,6 +2908,8 @@
+ USAGE_REMOTE_LOG( \
+ "\n\t-R HOST[:PORT]\tLog to IP or hostname on PORT (default PORT=514/UDP)\n" \
+ "\t-L\t\tLog locally and via network logging (default is network only)") \
++ USAGE_SYSLOG_LISTEN_UDP( \
++ "\n\t-l HOST[:PORT]\tAccept UDP packets on this local IP or hostname on PORT (default PORT=514/UDP)\n") \
+ USAGE_IPC_LOG( \
+ "\n\t-C [size(KiB)]\tLog to a circular buffer (read the buffer using logread)")
+ #define syslogd_example_usage \
diff --git a/sys-apps/busybox/files/1.1.0/flx-syslogd-reliability.diff b/sys-apps/busybox/files/1.1.0/flx-syslogd-reliability.diff
new file mode 100644
index 00000000..be05703a
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/flx-syslogd-reliability.diff
@@ -0,0 +1,77 @@
+--- ./sysklogd/syslogd.c.udplog 2006-03-07 21:55:28.000000000 +0100
++++ ./sysklogd/syslogd.c 2006-03-07 21:56:27.000000000 +0100
+@@ -414,6 +414,10 @@
+ memset(&listen_udp_addr, 0, sizeof(listen_udp_addr));
+ listen_udp_fd = socket(AF_INET, SOCK_DGRAM, 0);
+
++ if (fcntl(listen_udp_fd, F_SETFL, O_NONBLOCK) < 0) {
++ bb_perror_msg_and_die("Couldn't make UDP socket non-blocking");
++ }
++
+ if (listen_udp_fd < 0) {
+ bb_error_msg("cannot create socket");
+ }
+@@ -468,19 +472,16 @@
+
+ /* if we have a valid socket, send the message */
+ if (-1 != remotefd) {
+- now = 1;
++ now = 5; /* used as a retry counter */
+ snprintf(line, sizeof(line), "<%d>%s", pri, msg);
+
+- retry:
+ /* send message to remote logger */
+- if(( -1 == sendto(remotefd, line, strlen(line), 0,
+- (struct sockaddr *) &remoteaddr,
+- sizeof(remoteaddr))) && (errno == EINTR)) {
+- /* sleep now seconds and retry (with now * 2) */
+- sleep(now);
+- now *= 2;
+- goto retry;
+- }
++ while ((now-- > 0) &&
++ ( -1 == sendto(remotefd, line, strlen(line),
++ MSG_NOSIGNAL,
++ (struct sockaddr *) &remoteaddr,
++ sizeof(remoteaddr))) &&
++ (errno == EINTR));
+ }
+ }
+
+@@ -591,6 +592,10 @@
+ _PATH_LOG);
+ }
+
++ if (fcntl(sock_fd, F_SETFL, O_NONBLOCK) < 0) {
++ bb_perror_msg_and_die("Couldn't mark UNIX socket " _PATH_LOG " non-blocking");
++ }
++
+ addrLength = sizeof(sunx.sun_family) + strlen(sunx.sun_path);
+ if (bind(sock_fd, (struct sockaddr *) &sunx, addrLength) < 0) {
+ bb_perror_msg_and_die("Could not connect to socket " _PATH_LOG);
+@@ -658,7 +663,7 @@
+ if ((i = recv(sock_fd, tmpbuf, TMP_BUF_SZ, 0)) > 0) {
+ tmpbuf[i] = '\0';
+ serveConnection(tmpbuf, i);
+- } else {
++ } else if (i < 0 && errno != EINTR && errno != EAGAIN) {
+ bb_perror_msg_and_die("UNIX socket error");
+ }
+ } /* FD_ISSET() */
+@@ -670,6 +675,8 @@
+ if ((i = recv(listen_udp_fd, tmpbuf, TMP_BUF_SZ, 0)) > 0) {
+ tmpbuf[i] = '\0';
+ serveConnection(tmpbuf, i);
++ } else if (i < 0 && errno != EINTR && errno != EAGAIN) {
++ bb_perror_msg_and_die("UDP socket error");
+ }
+ } /* FD_ISSET() */
+ #endif /* SYSLOG_LISTEN_UDP */
+@@ -769,6 +776,7 @@
+ if(daemon(0, 1) < 0)
+ bb_perror_msg_and_die("daemon");
+ #endif /* __uClinux__ */
++ close(0); close(1); close(2);
+ }
+ doSyslogd();
+
diff --git a/sys-apps/busybox/files/1.1.0/glibc.patch b/sys-apps/busybox/files/1.1.0/glibc.patch
new file mode 100644
index 00000000..9025265a
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/glibc.patch
@@ -0,0 +1,21 @@
+Index: networking/ping6.c
+===================================================================
+--- networking/ping6.c (revision 14514)
++++ networking/ping6.c (working copy)
+@@ -236,6 +236,16 @@
+ }
+ }
+
++/* libc defines have changed around on us, whee ! */
++#ifndef ICMP6_MEMBERSHIP_QUERY
++# define ICMP6_MEMBERSHIP_QUERY MLD_LISTENER_QUERY
++#endif
++#ifndef ICMP6_MEMBERSHIP_REPORT
++# define ICMP6_MEMBERSHIP_REPORT MLD_LISTENER_REPORT
++#endif
++#ifndef ICMP6_MEMBERSHIP_REDUCTION
++# define ICMP6_MEMBERSHIP_REDUCTION MLD_LISTENER_REDUCTION
++#endif
+ static char *icmp6_type_name (int id)
+ {
+ switch (id) {
diff --git a/sys-apps/busybox/files/1.1.0/ppc64-insmod.patch b/sys-apps/busybox/files/1.1.0/ppc64-insmod.patch
new file mode 100644
index 00000000..cda3ac61
--- /dev/null
+++ b/sys-apps/busybox/files/1.1.0/ppc64-insmod.patch
@@ -0,0 +1,16 @@
+http://bugs.gentoo.org/122992
+
+Index: modutils/insmod.c
+===================================================================
+--- modutils/insmod.c (revision 14108)
++++ modutils/insmod.c (revision 14109)
+@@ -1297,6 +1297,9 @@
+ }
+ break;
+
++#elif defined(__powerpc64__)
++ /* do this someday ... */
++
+ #elif defined(__powerpc__)
+
+ case R_PPC_ADDR16_HA:
diff --git a/sys-apps/dfc/dfc-9999.ebuild b/sys-apps/dfc/dfc-9999.ebuild
new file mode 100644
index 00000000..06797e96
--- /dev/null
+++ b/sys-apps/dfc/dfc-9999.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit git
+
+DESCRIPTION="Formilux Tools"
+HOMEPAGE="http://master.formilux.org/git/people/ben/dfc.git"
+EGIT_REPO_URI="http://master.formilux.org/git/people/ben/dfc.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND=""
+RDEPEND=""
+
+src_compile ()
+{
+# export DIET="/usr/bin/diet"
+# export OBJDUMP="$(tc-getPROG OBJDUMP objdump ${CHOST})"
+# export STRIP="$(tc-getSTRIP)"
+
+ emake || die "emake flx failed"
+}
+
+src_install ()
+{
+ into /usr
+ dobin dfc
+}
diff --git a/sys-apps/dfc/files/remount-sstrip.diff b/sys-apps/dfc/files/remount-sstrip.diff
new file mode 100644
index 00000000..a9ca6ef5
--- /dev/null
+++ b/sys-apps/dfc/files/remount-sstrip.diff
@@ -0,0 +1,8 @@
+--- remount/Makefile.ori 2009-04-24 13:54:14.000000000 +0200
++++ remount/Makefile 2009-04-24 13:54:59.000000000 +0200
+@@ -9,4 +9,4 @@
+ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
+- sstrip $@
++ -if [ -n "$(SSTRIP)" ]; then $(SSTRIP) $@ ; fi