* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/files/, sys-apps/busybox/
@ 2016-03-21 18:48 Mike Frysinger
0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2016-03-21 18:48 UTC (permalink / raw
To: gentoo-commits
commit: 596b078da777fa1b066d57366803a13855a0c652
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 21 18:45:08 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 21 18:45:08 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=596b078d
sys-apps/busybox: version bump to 1.24.2 #577610
sys-apps/busybox/Manifest | 1 +
sys-apps/busybox/busybox-1.24.2.ebuild | 305 +++++++++++++++++++++
.../files/busybox-1.24.2-CVE-2016-2147.patch | 72 +++++
.../files/busybox-1.24.2-CVE-2016-2148.patch | 55 ++++
.../busybox-1.24.2-ash-recursive-heredocs.patch | 83 ++++++
5 files changed, 516 insertions(+)
diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
index b8590e5..f3487c1 100644
--- a/sys-apps/busybox/Manifest
+++ b/sys-apps/busybox/Manifest
@@ -2,3 +2,4 @@ DIST busybox-1.21.0.tar.bz2 2200841 SHA256 eb9d268627783297f5f459cb9bd61a94e395d
DIST busybox-1.23.1.tar.bz2 2252635 SHA256 300f1db0a7ca4ecee8f8d8027aba250b903372e8339b7d9123d37c1e900473bf SHA512 60849c220dde596c4197f16dd844573b24dd46c8544345a2d5a2b1976fa0ac340d22fbc97f5a1437b7de1c04f4e16aa07b3d62bc77eb83b2467582a50ed4b362 WHIRLPOOL 7cd25e42e74663849b094df699a72deaf02b1088064a511341f76aaa419c936557bbafd54523c6818082dfd4e17605f06ee51abed238ef57a56a9be12c910f99
DIST busybox-1.23.2.tar.bz2 2252786 SHA256 05a6f9e21aad8c098e388ae77de7b2361941afa7157ef74216703395b14e319a SHA512 209c8ef26e40ccb81510f6b663202b080f9bbecac7faf386bbabf7e36a43d63b15dd6ce9f7a84c1ccc5345c524999812251da1e113ef9faadc6af1fedd24c7c9 WHIRLPOOL a0396f7f49ae702f1617e72d5d4646aceec4eba67219c7125bd8d0926d1acb1ef41ea15a7406c3cf5e5e0d8925cc75910ed5128e5fbdd257b80e2cb4f7a048a2
DIST busybox-1.24.1.tar.bz2 2068803 SHA256 37d03132cc078937360b392170b7a1d0e5b322eee9f57c0b82292a8b1f0afe3d SHA512 3afc757ebaae61ae13c2c69097ee734717434f9e658eb77093a8b7b49af3326cbca2d723483ff84a1da99544b822fd2b47d9a97c68f09962e11754e5daf124ca WHIRLPOOL 5e827d08d737caac832e7e5923da624094ff27ee2edbb46dadc339e95edba65378a8fa3db412682724476a2092eee41a804f8f36c2eec0b9f883f5ba855f3ad0
+DIST busybox-1.24.2.tar.bz2 2066822 SHA256 e71ef53ec656f31c42633918d301405d40dea1d97eca12f272217ae4a971c855 SHA512 4d20fb68ee440be2855231c7fd5f3cb9dd9bfcc1a688f0b59cd3f7a55c8819e9cc44bd15f91500713571f2a84e5e44adc0fa8ae0ae3ebf63961dfc9e1c9ef8e0 WHIRLPOOL 2d89e3fded8d61567873acdb1e1e21888a4447e19c1b893543bbe82de52e8e3cf091adb10f34aa155da573994d89ae42f40ecce65ec0d32a641d103c8d8ce053
diff --git a/sys-apps/busybox/busybox-1.24.2.ebuild b/sys-apps/busybox/busybox-1.24.2.ebuild
new file mode 100644
index 0000000..ade4b52
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.24.2.ebuild
@@ -0,0 +1,305 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2" # GPL-2 only
+SLOT="0"
+IUSE="debug ipv6 livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
+RESTRICT="test"
+
+COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${COMMON_DEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+RDEPEND="${COMMON_DEPEND}
+ mdev? ( !<sys-apps/openrc-0.13 )"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/busybox-1.24.1-trylink-ldflags.patch
+ epatch "${FILESDIR}"/busybox-1.24.2-ash-recursive-heredocs.patch
+ epatch "${FILESDIR}"/busybox-1.24.2-CVE-2016-2147.patch
+ epatch "${FILESDIR}"/busybox-1.24.2-CVE-2016-2148.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 -s allyesconfig >/dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ busybox_config_option n UDHCPC6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.initd mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${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 really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2147.patch b/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2147.patch
new file mode 100644
index 0000000..2187c9b
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2147.patch
@@ -0,0 +1,72 @@
+From 3c4de6e36c4d387a648622e7b828a05f2b1b47e6 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Fri, 26 Feb 2016 15:54:56 +0100
+Subject: [PATCH] udhcpc: fix OPTION_6RD parsing (could overflow its malloced
+ buffer)
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+(cherry picked from commit 352f79acbd759c14399e39baef21fc4ffe180ac2)
+---
+ networking/udhcp/common.c | 15 +++++++++++++--
+ networking/udhcp/dhcpc.c | 4 ++--
+ 2 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
+index bc41c8d..680852c 100644
+--- a/networking/udhcp/common.c
++++ b/networking/udhcp/common.c
+@@ -142,7 +142,7 @@ const char dhcp_option_strings[] ALIGN1 =
+ * udhcp_str2optset: to determine how many bytes to allocate.
+ * xmalloc_optname_optval: to estimate string length
+ * from binary option length: (option[LEN] / dhcp_option_lengths[opt_type])
+- * is the number of elements, multiply in by one element's string width
++ * is the number of elements, multiply it by one element's string width
+ * (len_of_option_as_string[opt_type]) and you know how wide string you need.
+ */
+ const uint8_t dhcp_option_lengths[] ALIGN1 = {
+@@ -162,7 +162,18 @@ const uint8_t dhcp_option_lengths[] ALIGN1 = {
+ [OPTION_S32] = 4,
+ /* Just like OPTION_STRING, we use minimum length here */
+ [OPTION_STATIC_ROUTES] = 5,
+- [OPTION_6RD] = 22, /* ignored by udhcp_str2optset */
++ [OPTION_6RD] = 12, /* ignored by udhcp_str2optset */
++ /* The above value was chosen as follows:
++ * len_of_option_as_string[] for this option is >60: it's a string of the form
++ * "32 128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 255.255.255.255 ".
++ * Each additional ipv4 address takes 4 bytes in binary option and appends
++ * another "255.255.255.255 " 16-byte string. We can set [OPTION_6RD] = 4
++ * but this severely overestimates string length: instead of 16 bytes,
++ * it adds >60 for every 4 bytes in binary option.
++ * We cheat and declare here that option is in units of 12 bytes.
++ * This adds more than 60 bytes for every three ipv4 addresses - more than enough.
++ * (Even 16 instead of 12 should work, but let's be paranoid).
++ */
+ };
+
+
+diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
+index 915f659..2332b57 100644
+--- a/networking/udhcp/dhcpc.c
++++ b/networking/udhcp/dhcpc.c
+@@ -113,7 +113,7 @@ static const uint8_t len_of_option_as_string[] = {
+ [OPTION_IP ] = sizeof("255.255.255.255 "),
+ [OPTION_IP_PAIR ] = sizeof("255.255.255.255 ") * 2,
+ [OPTION_STATIC_ROUTES ] = sizeof("255.255.255.255/32 255.255.255.255 "),
+- [OPTION_6RD ] = sizeof("32 128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 255.255.255.255 "),
++ [OPTION_6RD ] = sizeof("132 128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 255.255.255.255 "),
+ [OPTION_STRING ] = 1,
+ [OPTION_STRING_HOST ] = 1,
+ #if ENABLE_FEATURE_UDHCP_RFC3397
+@@ -220,7 +220,7 @@ static NOINLINE char *xmalloc_optname_optval(uint8_t *option, const struct dhcp_
+ type = optflag->flags & OPTION_TYPE_MASK;
+ optlen = dhcp_option_lengths[type];
+ upper_length = len_of_option_as_string[type]
+- * ((unsigned)(len + optlen - 1) / (unsigned)optlen);
++ * ((unsigned)(len + optlen) / (unsigned)optlen);
+
+ dest = ret = xmalloc(upper_length + strlen(opt_name) + 2);
+ dest += sprintf(ret, "%s=", opt_name);
+--
+2.7.4
+
diff --git a/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2148.patch b/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2148.patch
new file mode 100644
index 0000000..08e08be
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2148.patch
@@ -0,0 +1,55 @@
+From 3a76bb5136d05f94ee62e377aa723e63444912c7 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Thu, 10 Mar 2016 11:47:58 +0100
+Subject: [PATCH] udhcp: fix a SEGV on malformed RFC1035-encoded domain name
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+(cherry picked from commit d474ffc68290e0a83651c4432eeabfa62cd51e87)
+---
+ networking/udhcp/domain_codec.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/networking/udhcp/domain_codec.c b/networking/udhcp/domain_codec.c
+index c1325d8..8429367 100644
+--- a/networking/udhcp/domain_codec.c
++++ b/networking/udhcp/domain_codec.c
+@@ -63,11 +63,10 @@ char* FAST_FUNC dname_dec(const uint8_t *cstr, int clen, const char *pre)
+ if (crtpos + *c + 1 > clen) /* label too long? abort */
+ return NULL;
+ if (dst)
+- memcpy(dst + len, c + 1, *c);
++ /* \3com ---> "com." */
++ ((char*)mempcpy(dst + len, c + 1, *c))[0] = '.';
+ len += *c + 1;
+ crtpos += *c + 1;
+- if (dst)
+- dst[len - 1] = '.';
+ } else {
+ /* NUL: end of current domain name */
+ if (retpos == 0) {
+@@ -78,7 +77,10 @@ char* FAST_FUNC dname_dec(const uint8_t *cstr, int clen, const char *pre)
+ crtpos = retpos;
+ retpos = depth = 0;
+ }
+- if (dst)
++ if (dst && len != 0)
++ /* \4host\3com\0\4host and we are at \0:
++ * \3com was converted to "com.", change dot to space.
++ */
+ dst[len - 1] = ' ';
+ }
+
+@@ -228,6 +230,9 @@ int main(int argc, char **argv)
+ int len;
+ uint8_t *encoded;
+
++ uint8_t str[6] = { 0x00, 0x00, 0x02, 0x65, 0x65, 0x00 };
++ printf("NUL:'%s'\n", dname_dec(str, 6, ""));
++
+ #define DNAME_DEC(encoded,pre) dname_dec((uint8_t*)(encoded), sizeof(encoded), (pre))
+ printf("'%s'\n", DNAME_DEC("\4host\3com\0", "test1:"));
+ printf("test2:'%s'\n", DNAME_DEC("\4host\3com\0\4host\3com\0", ""));
+--
+2.7.4
+
diff --git a/sys-apps/busybox/files/busybox-1.24.2-ash-recursive-heredocs.patch b/sys-apps/busybox/files/busybox-1.24.2-ash-recursive-heredocs.patch
new file mode 100644
index 0000000..5405eaf
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.24.2-ash-recursive-heredocs.patch
@@ -0,0 +1,83 @@
+From 4194c2875310c13ee3ca2bb0e1aea6a2ae67c55a Mon Sep 17 00:00:00 2001
+From: Ron Yorston <rmy@pobox.com>
+Date: Thu, 29 Oct 2015 16:44:56 +0000
+Subject: [PATCH] ash: fix error during recursive processing of here document
+
+Save the value of the checkkwd flag to prevent it being clobbered
+during recursion.
+
+Based on commit ec2c84d from git://git.kernel.org/pub/scm/utils/dash/dash.git
+by Herbert Xu.
+
+function old new delta
+readtoken 190 203 +13
+------------------------------------------------------------------------------
+(add/remove: 0/0 grow/shrink: 1/0 up/down: 13/0) Total: 13 bytes
+
+Signed-off-by: Ron Yorston <rmy@pobox.com>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+(cherry picked from commit 713f07d906d9171953be0c12e2369869855b6ca6)
+---
+ shell/ash.c | 5 +++--
+ shell/ash_test/ash-heredoc/heredoc3.right | 1 +
+ shell/ash_test/ash-heredoc/heredoc3.tests | 9 +++++++++
+ 3 files changed, 13 insertions(+), 2 deletions(-)
+ create mode 100644 shell/ash_test/ash-heredoc/heredoc3.right
+ create mode 100755 shell/ash_test/ash-heredoc/heredoc3.tests
+
+diff --git a/shell/ash.c b/shell/ash.c
+index 8a1628e..256e933 100644
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -11893,6 +11893,7 @@ static int
+ readtoken(void)
+ {
+ int t;
++ int kwd = checkkwd;
+ #if DEBUG
+ smallint alreadyseen = tokpushback;
+ #endif
+@@ -11906,7 +11907,7 @@ readtoken(void)
+ /*
+ * eat newlines
+ */
+- if (checkkwd & CHKNL) {
++ if (kwd & CHKNL) {
+ while (t == TNL) {
+ parseheredoc();
+ t = xxreadtoken();
+@@ -11920,7 +11921,7 @@ readtoken(void)
+ /*
+ * check for keywords
+ */
+- if (checkkwd & CHKKWD) {
++ if (kwd & CHKKWD) {
+ const char *const *pp;
+
+ pp = findkwd(wordtext);
+diff --git a/shell/ash_test/ash-heredoc/heredoc3.right b/shell/ash_test/ash-heredoc/heredoc3.right
+new file mode 100644
+index 0000000..ce01362
+--- /dev/null
++++ b/shell/ash_test/ash-heredoc/heredoc3.right
+@@ -0,0 +1 @@
++hello
+diff --git a/shell/ash_test/ash-heredoc/heredoc3.tests b/shell/ash_test/ash-heredoc/heredoc3.tests
+new file mode 100755
+index 0000000..96c227c
+--- /dev/null
++++ b/shell/ash_test/ash-heredoc/heredoc3.tests
+@@ -0,0 +1,9 @@
++echo hello >greeting
++cat <<EOF &&
++$(cat greeting)
++EOF
++{
++ echo $?
++ cat greeting
++} >/dev/null
++rm greeting
+--
+2.7.4
+
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/files/, sys-apps/busybox/
@ 2016-04-20 3:58 Mike Frysinger
0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2016-04-20 3:58 UTC (permalink / raw
To: gentoo-commits
commit: e325df509bae58f3830003eb3cd0bf75e05cab23
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 20 03:41:01 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Apr 20 03:57:30 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e325df50
sys-apps/busybox: drop old <1.24.1 versions
sys-apps/busybox/Manifest | 3 -
sys-apps/busybox/busybox-1.21.0.ebuild | 299 --------------------
sys-apps/busybox/busybox-1.23.1-r1.ebuild | 303 --------------------
sys-apps/busybox/busybox-1.23.1.ebuild | 302 --------------------
sys-apps/busybox/busybox-1.23.2.ebuild | 305 ---------------------
.../files/busybox-1.20.0-udhcpc6-ipv6.patch | 33 ---
.../files/busybox-1.20.2-glibc-sys-resource.patch | 109 --------
.../files/busybox-1.20.2-selinux-pkg-config.patch | 67 -----
sys-apps/busybox/files/busybox-1.21.0-mdev.patch | 35 ---
.../busybox/files/busybox-1.21.0-platform.patch | 24 --
sys-apps/busybox/files/busybox-1.21.0-xz.patch | 84 ------
...ox-1.21.1-trylink-only-prefix-libs-with-l.patch | 51 ----
sys-apps/busybox/files/busybox-1.22.0-find.patch | 40 ---
sys-apps/busybox/files/busybox-1.22.0-grep.patch | 80 ------
.../busybox/files/busybox-1.22.0-lineedit.patch | 12 -
sys-apps/busybox/files/busybox-1.22.0-ntpd.patch | 11 -
sys-apps/busybox/files/busybox-1.22.1-ash.patch | 11 -
sys-apps/busybox/files/busybox-1.22.1-date.patch | 30 --
sys-apps/busybox/files/busybox-1.22.1-iplink.patch | 19 --
sys-apps/busybox/files/busybox-1.22.1-lzop.patch | 66 -----
sys-apps/busybox/files/busybox-1.22.1-nc.patch | 15 -
.../busybox/files/busybox-1.22.1-zcat-no-ext.patch | 64 -----
.../files/busybox-1.23.1-modprobe-small.patch | 166 -----------
.../files/busybox-1.23.1-trylink-flags.patch | 39 ---
sys-apps/busybox/files/mdev-start.sh | 125 ---------
sys-apps/busybox/files/mdev.rc | 9 -
sys-apps/busybox/files/mdev.rc.1 | 98 -------
27 files changed, 2400 deletions(-)
diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
index f3487c1..cedf77c 100644
--- a/sys-apps/busybox/Manifest
+++ b/sys-apps/busybox/Manifest
@@ -1,5 +1,2 @@
-DIST busybox-1.21.0.tar.bz2 2200841 SHA256 eb9d268627783297f5f459cb9bd61a94e395dc7cb3647e10ec186e0159aa36ed SHA512 ddafded24881f03db550d9793585bb5442c70f2a60a5d9770126f50981dadfe95fc0b280f83d5b8a8ce21c86bb7ce64e9f1a606cea140fb2f2599a21de55ba31 WHIRLPOOL d50378bb823dd59e8a607ed6a72d4890f4e5ad3304f1ddba9f7f3d49b5ab820acc9daa2b3c4619f8b147dec085c53c3c6f4b4ebe4c60b431299031d2af00a4d3
-DIST busybox-1.23.1.tar.bz2 2252635 SHA256 300f1db0a7ca4ecee8f8d8027aba250b903372e8339b7d9123d37c1e900473bf SHA512 60849c220dde596c4197f16dd844573b24dd46c8544345a2d5a2b1976fa0ac340d22fbc97f5a1437b7de1c04f4e16aa07b3d62bc77eb83b2467582a50ed4b362 WHIRLPOOL 7cd25e42e74663849b094df699a72deaf02b1088064a511341f76aaa419c936557bbafd54523c6818082dfd4e17605f06ee51abed238ef57a56a9be12c910f99
-DIST busybox-1.23.2.tar.bz2 2252786 SHA256 05a6f9e21aad8c098e388ae77de7b2361941afa7157ef74216703395b14e319a SHA512 209c8ef26e40ccb81510f6b663202b080f9bbecac7faf386bbabf7e36a43d63b15dd6ce9f7a84c1ccc5345c524999812251da1e113ef9faadc6af1fedd24c7c9 WHIRLPOOL a0396f7f49ae702f1617e72d5d4646aceec4eba67219c7125bd8d0926d1acb1ef41ea15a7406c3cf5e5e0d8925cc75910ed5128e5fbdd257b80e2cb4f7a048a2
DIST busybox-1.24.1.tar.bz2 2068803 SHA256 37d03132cc078937360b392170b7a1d0e5b322eee9f57c0b82292a8b1f0afe3d SHA512 3afc757ebaae61ae13c2c69097ee734717434f9e658eb77093a8b7b49af3326cbca2d723483ff84a1da99544b822fd2b47d9a97c68f09962e11754e5daf124ca WHIRLPOOL 5e827d08d737caac832e7e5923da624094ff27ee2edbb46dadc339e95edba65378a8fa3db412682724476a2092eee41a804f8f36c2eec0b9f883f5ba855f3ad0
DIST busybox-1.24.2.tar.bz2 2066822 SHA256 e71ef53ec656f31c42633918d301405d40dea1d97eca12f272217ae4a971c855 SHA512 4d20fb68ee440be2855231c7fd5f3cb9dd9bfcc1a688f0b59cd3f7a55c8819e9cc44bd15f91500713571f2a84e5e44adc0fa8ae0ae3ebf63961dfc9e1c9ef8e0 WHIRLPOOL 2d89e3fded8d61567873acdb1e1e21888a4447e19c1b893543bbe82de52e8e3cf091adb10f34aa155da573994d89ae42f40ecce65ec0d32a641d103c8d8ce053
diff --git a/sys-apps/busybox/busybox-1.21.0.ebuild b/sys-apps/busybox/busybox-1.21.0.ebuild
deleted file mode 100644
index 6bb6f6d..0000000
--- a/sys-apps/busybox/busybox-1.21.0.ebuild
+++ /dev/null
@@ -1,299 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
-
-EAPI="4"
-inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
-
-DESCRIPTION="Utilities for rescue and embedded systems"
-HOMEPAGE="http://www.busybox.net/"
-if [[ ${PV} == "9999" ]] ; then
- MY_P=${PN}
- EGIT_REPO_URI="git://busybox.net/busybox.git"
- inherit git-2
-else
- MY_P=${PN}-${PV/_/-}
- SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
- KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
-fi
-
-LICENSE="GPL-2"
-SLOT="0"
-
-IUSE="ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
-RESTRICT="test"
-
-RDEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
- pam? ( sys-libs/pam )"
-DEPEND="${RDEPEND}
- static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
- >=sys-kernel/linux-headers-2.6.39"
-
-S=${WORKDIR}/${MY_P}
-
-busybox_config_option() {
- local flag=$1 ; shift
- if [[ ${flag} != [yn] ]] ; then
- busybox_config_option $(usex ${flag} y n) "$@"
- return
- fi
- while [[ $# -gt 0 ]] ; do
- if [[ ${flag} == "y" ]] ; then
- sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
- else
- sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
- fi
- einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
- shift
- done
-}
-
-busybox_config_enabled() {
- local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
- case ${val} in
- "") return 1 ;;
- y) return 0 ;;
- *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
- esac
-}
-
-src_prepare() {
- unset KBUILD_OUTPUT #88088
- append-flags -fno-strict-aliasing #310413
- use ppc64 && append-flags -mminimal-toc #130943
-
- # patches go here!
- epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
- epatch "${FILESDIR}"/${P}-*.patch
- cp "${FILESDIR}"/ginit.c init/ || die
-
- # flag cleanup
- sed -i -r \
- -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
- Makefile.flags || die
- #sed -i '/bbsh/s:^//::' include/applets.h
- sed -i '/^#error Aborting compilation./d' applets/applets.c || die
- use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
- sed -i \
- -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
- -e "/^AR\>/s:=.*:= $(tc-getAR):" \
- -e "/^CC\>/s:=.*:= $(tc-getCC):" \
- -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
- -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
- Makefile || die
- sed -i \
- -e 's:-static-libgcc::' \
- Makefile.flags || die
-}
-
-src_configure() {
- # check for a busybox config before making one of our own.
- # if one exist lets return and use it.
-
- restore_config .config
- if [ -f .config ]; then
- yes "" | emake -j1 oldconfig > /dev/null
- return 0
- else
- ewarn "Could not locate user configfile, so we will save a default one"
- fi
-
- # setup the config file
- emake -j1 allyesconfig > /dev/null
- # nommu forces a bunch of things off which we want on #387555
- busybox_config_option n NOMMU
- sed -i '/^#/d' .config
- yes "" | emake -j1 oldconfig >/dev/null
-
- # now turn off stuff we really don't want
- busybox_config_option n DMALLOC
- busybox_config_option n FEATURE_SUID_CONFIG
- busybox_config_option n BUILD_AT_ONCE
- busybox_config_option n BUILD_LIBBUSYBOX
- busybox_config_option n FEATURE_CLEAN_UP
- busybox_config_option n MONOTONIC_SYSCALL
- busybox_config_option n USE_PORTABLE_CODE
- busybox_config_option n WERROR
-
- # If these are not set and we are using a uclibc/busybox setup
- # all calls to system() will fail.
- busybox_config_option y ASH
- busybox_config_option n HUSH
-
- # disable ipv6 applets
- if ! use ipv6; then
- busybox_config_option n FEATURE_IPV6
- busybox_config_option n TRACEROUTE6
- busybox_config_option n PING6
- fi
-
- if use static && use pam ; then
- ewarn "You cannot have USE='static pam'. Assuming static is more important."
- fi
- busybox_config_option $(usex static n pam) PAM
- busybox_config_option static STATIC
- busybox_config_option syslog {K,SYS}LOGD LOGGER
- busybox_config_option systemd FEATURE_SYSTEMD
- busybox_config_option math FEATURE_AWK_LIBM
-
- # all the debug options are compiler related, so punt them
- busybox_config_option n DEBUG
- busybox_config_option y NO_DEBUG_LIB
- busybox_config_option n DMALLOC
- busybox_config_option n EFENCE
-
- busybox_config_option selinux SELINUX
-
- # this opt only controls mounting with <linux-2.6.23
- busybox_config_option n FEATURE_MOUNT_NFS
-
- # default a bunch of uncommon options to off
- local opt
- for opt in \
- ADD_SHELL \
- BEEP BOOTCHARTD \
- CRONTAB \
- DC DEVFSD DNSD DPKG{,_DEB} \
- FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
- FEATURE_DEVFS \
- HOSTID HUSH \
- INETD INOTIFYD IPCALC \
- LOCALE_SUPPORT LOGNAME LPD \
- MAKEMIME MKFS_MINIX MSH \
- OD \
- RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
- SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
- TASKSET TCPSVD \
- RPM RPM2CPIO \
- UDPSVD UUDECODE UUENCODE
- do
- busybox_config_option n ${opt}
- done
-
- emake -j1 oldconfig > /dev/null
-}
-
-src_compile() {
- unset KBUILD_OUTPUT #88088
- export SKIP_STRIP=y
-
- emake V=1 busybox
-}
-
-src_install() {
- unset KBUILD_OUTPUT #88088
- save_config .config
-
- into /
- dodir /bin
- if use sep-usr ; then
- # install /ginit to take care of mounting stuff
- exeinto /
- newexe busybox_unstripped ginit
- dosym /ginit /bin/bb
- dosym bb /bin/busybox
- else
- newbin busybox_unstripped busybox
- dosym busybox /bin/bb
- fi
- if use mdev ; then
- dodir /$(get_libdir)/mdev/
- use make-symlinks || dosym /bin/bb /sbin/mdev
- cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
-
- exeinto /$(get_libdir)/mdev/
- doexe "${FILESDIR}"/mdev/*
-
- newinitd "${FILESDIR}"/mdev.rc.1 mdev
- fi
- if use livecd ; then
- dosym busybox /bin/vi
- fi
-
- # add busybox daemon's, bug #444718
- if busybox_config_enabled FEATURE_NTPD_SERVER; then
- newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
- newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
- fi
- if busybox_config_enabled SYSLOGD; then
- newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
- newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
- fi
- if busybox_config_enabled KLOGD; then
- newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
- newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
- fi
- if busybox_config_enabled WATCHDOG; then
- newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
- newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
- fi
- if busybox_config_enabled UDHCPC; then
- local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
- exeinto "${path%/*}"
- newexe examples/udhcp/simple.script "${path##*/}"
- fi
- if busybox_config_enabled UDHCPD; then
- insinto /etc
- doins examples/udhcp/udhcpd.conf
- fi
-
- # bundle up the symlink files for use later
- emake DESTDIR="${ED}" install
- rm _install/bin/busybox
- # for compatibility, provide /usr/bin/env
- mkdir -p _install/usr/bin
- ln -s /bin/env _install/usr/bin/env
- tar cf busybox-links.tar -C _install . || : #;die
- insinto /usr/share/${PN}
- use make-symlinks && doins busybox-links.tar
-
- dodoc AUTHORS README TODO
-
- cd docs
- docinto txt
- dodoc *.txt
- docinto pod
- dodoc *.pod
- dohtml *.html
-
- cd ../examples
- docinto examples
- dodoc inittab depmod.pl *.conf *.script undeb unrpm
-}
-
-pkg_preinst() {
- if use make-symlinks && [[ ! ${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 really what you want."
- die "silly options will destroy your system"
- fi
-
- if use make-symlinks ; then
- mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
- fi
-}
-
-pkg_postinst() {
- savedconfig_pkg_postinst
-
- if use make-symlinks ; then
- cd "${T}" || die
- mkdir _install
- tar xf busybox-links.tar -C _install || die
- cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
- fi
-
- if use sep-usr ; then
- elog "In order to use the sep-usr support, you have to update your"
- elog "kernel command line. Add the option:"
- elog " init=/ginit"
- elog "To launch a different init than /sbin/init, use:"
- elog " init=/ginit /sbin/yourinit"
- elog "To get a rescue shell, you may boot with:"
- elog " init=/ginit bb"
- fi
-}
diff --git a/sys-apps/busybox/busybox-1.23.1-r1.ebuild b/sys-apps/busybox/busybox-1.23.1-r1.ebuild
deleted file mode 100644
index 66057b0..0000000
--- a/sys-apps/busybox/busybox-1.23.1-r1.ebuild
+++ /dev/null
@@ -1,303 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
-
-EAPI="4"
-inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
-
-DESCRIPTION="Utilities for rescue and embedded systems"
-HOMEPAGE="http://www.busybox.net/"
-if [[ ${PV} == "9999" ]] ; then
- MY_P=${PN}
- EGIT_REPO_URI="git://busybox.net/busybox.git"
- inherit git-2
-else
- MY_P=${PN}-${PV/_/-}
- SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sh ~sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
-fi
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="debug ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
-RESTRICT="test"
-
-COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
- pam? ( sys-libs/pam )"
-DEPEND="${COMMON_DEPEND}
- static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
- >=sys-kernel/linux-headers-2.6.39"
-RDEPEND="${COMMON_DEPEND}
-mdev? ( !<sys-apps/openrc-0.13 )"
-
-S=${WORKDIR}/${MY_P}
-
-busybox_config_option() {
- local flag=$1 ; shift
- if [[ ${flag} != [yn] ]] ; then
- busybox_config_option $(usex ${flag} y n) "$@"
- return
- fi
- while [[ $# -gt 0 ]] ; do
- if [[ ${flag} == "y" ]] ; then
- sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
- else
- sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
- fi
- einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
- shift
- done
-}
-
-busybox_config_enabled() {
- local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
- case ${val} in
- "") return 1 ;;
- y) return 0 ;;
- *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
- esac
-}
-
-src_prepare() {
- unset KBUILD_OUTPUT #88088
- append-flags -fno-strict-aliasing #310413
- use ppc64 && append-flags -mminimal-toc #130943
-
- # patches go here!
- epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
- epatch "${FILESDIR}"/${P}-*.patch
- cp "${FILESDIR}"/ginit.c init/ || die
-
- # flag cleanup
- sed -i -r \
- -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
- Makefile.flags || die
- #sed -i '/bbsh/s:^//::' include/applets.h
- sed -i '/^#error Aborting compilation./d' applets/applets.c || die
- use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
- sed -i \
- -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
- -e "/^AR\>/s:=.*:= $(tc-getAR):" \
- -e "/^CC\>/s:=.*:= $(tc-getCC):" \
- -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
- -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
- Makefile || die
- sed -i \
- -e 's:-static-libgcc::' \
- Makefile.flags || die
-}
-
-src_configure() {
- # check for a busybox config before making one of our own.
- # if one exist lets return and use it.
-
- restore_config .config
- if [ -f .config ]; then
- yes "" | emake -j1 -s oldconfig >/dev/null
- return 0
- else
- ewarn "Could not locate user configfile, so we will save a default one"
- fi
-
- # setup the config file
- emake -j1 -s allyesconfig >/dev/null
- # nommu forces a bunch of things off which we want on #387555
- busybox_config_option n NOMMU
- sed -i '/^#/d' .config
- yes "" | emake -j1 -s oldconfig >/dev/null
-
- # now turn off stuff we really don't want
- busybox_config_option n DMALLOC
- busybox_config_option n FEATURE_SUID_CONFIG
- busybox_config_option n BUILD_AT_ONCE
- busybox_config_option n BUILD_LIBBUSYBOX
- busybox_config_option n FEATURE_CLEAN_UP
- busybox_config_option n MONOTONIC_SYSCALL
- busybox_config_option n START_STOP_DAEMON
- busybox_config_option n USE_PORTABLE_CODE
- busybox_config_option n WERROR
-
- # If these are not set and we are using a uclibc/busybox setup
- # all calls to system() will fail.
- busybox_config_option y ASH
- busybox_config_option n HUSH
-
- # disable ipv6 applets
- if ! use ipv6; then
- busybox_config_option n FEATURE_IPV6
- busybox_config_option n TRACEROUTE6
- busybox_config_option n PING6
- busybox_config_option n UDHCPC6
- fi
-
- if use static && use pam ; then
- ewarn "You cannot have USE='static pam'. Assuming static is more important."
- fi
- busybox_config_option $(usex static n pam) PAM
- busybox_config_option static STATIC
- busybox_config_option syslog {K,SYS}LOGD LOGGER
- busybox_config_option systemd FEATURE_SYSTEMD
- busybox_config_option math FEATURE_AWK_LIBM
-
- # all the debug options are compiler related, so punt them
- busybox_config_option n DEBUG
- busybox_config_option y NO_DEBUG_LIB
- busybox_config_option n DMALLOC
- busybox_config_option n EFENCE
- busybox_config_option $(usex debug y n) TFTP_DEBUG
-
- busybox_config_option selinux SELINUX
-
- # this opt only controls mounting with <linux-2.6.23
- busybox_config_option n FEATURE_MOUNT_NFS
-
- # default a bunch of uncommon options to off
- local opt
- for opt in \
- ADD_SHELL \
- BEEP BOOTCHARTD \
- CRONTAB \
- DC DEVFSD DNSD DPKG{,_DEB} \
- FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
- FEATURE_DEVFS \
- HOSTID HUSH \
- INETD INOTIFYD IPCALC \
- LOCALE_SUPPORT LOGNAME LPD \
- MAKEMIME MKFS_MINIX MSH \
- OD \
- RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
- SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
- TASKSET TCPSVD \
- RPM RPM2CPIO \
- UDPSVD UUDECODE UUENCODE
- do
- busybox_config_option n ${opt}
- done
-
- emake -j1 oldconfig > /dev/null
-}
-
-src_compile() {
- unset KBUILD_OUTPUT #88088
- export SKIP_STRIP=y
-
- emake V=1 busybox
-}
-
-src_install() {
- unset KBUILD_OUTPUT #88088
- save_config .config
-
- into /
- dodir /bin
- if use sep-usr ; then
- # install /ginit to take care of mounting stuff
- exeinto /
- newexe busybox_unstripped ginit
- dosym /ginit /bin/bb
- dosym bb /bin/busybox
- else
- newbin busybox_unstripped busybox
- dosym busybox /bin/bb
- fi
- if use mdev ; then
- dodir /$(get_libdir)/mdev/
- use make-symlinks || dosym /bin/bb /sbin/mdev
- cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
-
- exeinto /$(get_libdir)/mdev/
- doexe "${FILESDIR}"/mdev/*
-
- newinitd "${FILESDIR}"/mdev.initd mdev
- fi
- if use livecd ; then
- dosym busybox /bin/vi
- fi
-
- # add busybox daemon's, bug #444718
- if busybox_config_enabled FEATURE_NTPD_SERVER; then
- newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
- newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
- fi
- if busybox_config_enabled SYSLOGD; then
- newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
- newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
- fi
- if busybox_config_enabled KLOGD; then
- newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
- newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
- fi
- if busybox_config_enabled WATCHDOG; then
- newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
- newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
- fi
- if busybox_config_enabled UDHCPC; then
- local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
- exeinto "${path%/*}"
- newexe examples/udhcp/simple.script "${path##*/}"
- fi
- if busybox_config_enabled UDHCPD; then
- insinto /etc
- doins examples/udhcp/udhcpd.conf
- fi
-
- # bundle up the symlink files for use later
- emake DESTDIR="${ED}" install
- rm _install/bin/busybox
- # for compatibility, provide /usr/bin/env
- mkdir -p _install/usr/bin
- ln -s /bin/env _install/usr/bin/env
- tar cf busybox-links.tar -C _install . || : #;die
- insinto /usr/share/${PN}
- use make-symlinks && doins busybox-links.tar
-
- dodoc AUTHORS README TODO
-
- cd docs
- docinto txt
- dodoc *.txt
- docinto pod
- dodoc *.pod
- dohtml *.html
-
- cd ../examples
- docinto examples
- dodoc inittab depmod.pl *.conf *.script undeb unrpm
-}
-
-pkg_preinst() {
- if use make-symlinks && [[ ! ${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 really what you want."
- die "silly options will destroy your system"
- fi
-
- if use make-symlinks ; then
- mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
- fi
-}
-
-pkg_postinst() {
- savedconfig_pkg_postinst
-
- if use make-symlinks ; then
- cd "${T}" || die
- mkdir _install
- tar xf busybox-links.tar -C _install || die
- cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
- fi
-
- if use sep-usr ; then
- elog "In order to use the sep-usr support, you have to update your"
- elog "kernel command line. Add the option:"
- elog " init=/ginit"
- elog "To launch a different init than /sbin/init, use:"
- elog " init=/ginit /sbin/yourinit"
- elog "To get a rescue shell, you may boot with:"
- elog " init=/ginit bb"
- fi
-}
diff --git a/sys-apps/busybox/busybox-1.23.1.ebuild b/sys-apps/busybox/busybox-1.23.1.ebuild
deleted file mode 100644
index ad62648..0000000
--- a/sys-apps/busybox/busybox-1.23.1.ebuild
+++ /dev/null
@@ -1,302 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
-
-EAPI="4"
-inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
-
-DESCRIPTION="Utilities for rescue and embedded systems"
-HOMEPAGE="http://www.busybox.net/"
-if [[ ${PV} == "9999" ]] ; then
- MY_P=${PN}
- EGIT_REPO_URI="git://busybox.net/busybox.git"
- inherit git-2
-else
- MY_P=${PN}-${PV/_/-}
- SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
- KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
-fi
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="debug ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
-RESTRICT="test"
-
-COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
- pam? ( sys-libs/pam )"
-DEPEND="${COMMON_DEPEND}
- static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
- >=sys-kernel/linux-headers-2.6.39"
-RDEPEND="${COMMON_DEPEND}
-mdev? ( !<sys-apps/openrc-0.13 )"
-
-S=${WORKDIR}/${MY_P}
-
-busybox_config_option() {
- local flag=$1 ; shift
- if [[ ${flag} != [yn] ]] ; then
- busybox_config_option $(usex ${flag} y n) "$@"
- return
- fi
- while [[ $# -gt 0 ]] ; do
- if [[ ${flag} == "y" ]] ; then
- sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
- else
- sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
- fi
- einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
- shift
- done
-}
-
-busybox_config_enabled() {
- local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
- case ${val} in
- "") return 1 ;;
- y) return 0 ;;
- *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
- esac
-}
-
-src_prepare() {
- unset KBUILD_OUTPUT #88088
- append-flags -fno-strict-aliasing #310413
- use ppc64 && append-flags -mminimal-toc #130943
-
- # patches go here!
- epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
-# epatch "${FILESDIR}"/${P}-*.patch
- cp "${FILESDIR}"/ginit.c init/ || die
-
- # flag cleanup
- sed -i -r \
- -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
- Makefile.flags || die
- #sed -i '/bbsh/s:^//::' include/applets.h
- sed -i '/^#error Aborting compilation./d' applets/applets.c || die
- use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
- sed -i \
- -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
- -e "/^AR\>/s:=.*:= $(tc-getAR):" \
- -e "/^CC\>/s:=.*:= $(tc-getCC):" \
- -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
- -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
- Makefile || die
- sed -i \
- -e 's:-static-libgcc::' \
- Makefile.flags || die
-}
-
-src_configure() {
- # check for a busybox config before making one of our own.
- # if one exist lets return and use it.
-
- restore_config .config
- if [ -f .config ]; then
- yes "" | emake -j1 -s oldconfig >/dev/null
- return 0
- else
- ewarn "Could not locate user configfile, so we will save a default one"
- fi
-
- # setup the config file
- emake -j1 -s allyesconfig >/dev/null
- # nommu forces a bunch of things off which we want on #387555
- busybox_config_option n NOMMU
- sed -i '/^#/d' .config
- yes "" | emake -j1 -s oldconfig >/dev/null
-
- # now turn off stuff we really don't want
- busybox_config_option n DMALLOC
- busybox_config_option n FEATURE_SUID_CONFIG
- busybox_config_option n BUILD_AT_ONCE
- busybox_config_option n BUILD_LIBBUSYBOX
- busybox_config_option n FEATURE_CLEAN_UP
- busybox_config_option n MONOTONIC_SYSCALL
- busybox_config_option n USE_PORTABLE_CODE
- busybox_config_option n WERROR
-
- # If these are not set and we are using a uclibc/busybox setup
- # all calls to system() will fail.
- busybox_config_option y ASH
- busybox_config_option n HUSH
-
- # disable ipv6 applets
- if ! use ipv6; then
- busybox_config_option n FEATURE_IPV6
- busybox_config_option n TRACEROUTE6
- busybox_config_option n PING6
- busybox_config_option n UDHCPC6
- fi
-
- if use static && use pam ; then
- ewarn "You cannot have USE='static pam'. Assuming static is more important."
- fi
- busybox_config_option $(usex static n pam) PAM
- busybox_config_option static STATIC
- busybox_config_option syslog {K,SYS}LOGD LOGGER
- busybox_config_option systemd FEATURE_SYSTEMD
- busybox_config_option math FEATURE_AWK_LIBM
-
- # all the debug options are compiler related, so punt them
- busybox_config_option n DEBUG
- busybox_config_option y NO_DEBUG_LIB
- busybox_config_option n DMALLOC
- busybox_config_option n EFENCE
- busybox_config_option $(usex debug y n) TFTP_DEBUG
-
- busybox_config_option selinux SELINUX
-
- # this opt only controls mounting with <linux-2.6.23
- busybox_config_option n FEATURE_MOUNT_NFS
-
- # default a bunch of uncommon options to off
- local opt
- for opt in \
- ADD_SHELL \
- BEEP BOOTCHARTD \
- CRONTAB \
- DC DEVFSD DNSD DPKG{,_DEB} \
- FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
- FEATURE_DEVFS \
- HOSTID HUSH \
- INETD INOTIFYD IPCALC \
- LOCALE_SUPPORT LOGNAME LPD \
- MAKEMIME MKFS_MINIX MSH \
- OD \
- RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
- SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
- TASKSET TCPSVD \
- RPM RPM2CPIO \
- UDPSVD UUDECODE UUENCODE
- do
- busybox_config_option n ${opt}
- done
-
- emake -j1 oldconfig > /dev/null
-}
-
-src_compile() {
- unset KBUILD_OUTPUT #88088
- export SKIP_STRIP=y
-
- emake V=1 busybox
-}
-
-src_install() {
- unset KBUILD_OUTPUT #88088
- save_config .config
-
- into /
- dodir /bin
- if use sep-usr ; then
- # install /ginit to take care of mounting stuff
- exeinto /
- newexe busybox_unstripped ginit
- dosym /ginit /bin/bb
- dosym bb /bin/busybox
- else
- newbin busybox_unstripped busybox
- dosym busybox /bin/bb
- fi
- if use mdev ; then
- dodir /$(get_libdir)/mdev/
- use make-symlinks || dosym /bin/bb /sbin/mdev
- cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
-
- exeinto /$(get_libdir)/mdev/
- doexe "${FILESDIR}"/mdev/*
-
- newinitd "${FILESDIR}"/mdev.initd mdev
- fi
- if use livecd ; then
- dosym busybox /bin/vi
- fi
-
- # add busybox daemon's, bug #444718
- if busybox_config_enabled FEATURE_NTPD_SERVER; then
- newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
- newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
- fi
- if busybox_config_enabled SYSLOGD; then
- newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
- newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
- fi
- if busybox_config_enabled KLOGD; then
- newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
- newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
- fi
- if busybox_config_enabled WATCHDOG; then
- newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
- newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
- fi
- if busybox_config_enabled UDHCPC; then
- local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
- exeinto "${path%/*}"
- newexe examples/udhcp/simple.script "${path##*/}"
- fi
- if busybox_config_enabled UDHCPD; then
- insinto /etc
- doins examples/udhcp/udhcpd.conf
- fi
-
- # bundle up the symlink files for use later
- emake DESTDIR="${ED}" install
- rm _install/bin/busybox
- # for compatibility, provide /usr/bin/env
- mkdir -p _install/usr/bin
- ln -s /bin/env _install/usr/bin/env
- tar cf busybox-links.tar -C _install . || : #;die
- insinto /usr/share/${PN}
- use make-symlinks && doins busybox-links.tar
-
- dodoc AUTHORS README TODO
-
- cd docs
- docinto txt
- dodoc *.txt
- docinto pod
- dodoc *.pod
- dohtml *.html
-
- cd ../examples
- docinto examples
- dodoc inittab depmod.pl *.conf *.script undeb unrpm
-}
-
-pkg_preinst() {
- if use make-symlinks && [[ ! ${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 really what you want."
- die "silly options will destroy your system"
- fi
-
- if use make-symlinks ; then
- mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
- fi
-}
-
-pkg_postinst() {
- savedconfig_pkg_postinst
-
- if use make-symlinks ; then
- cd "${T}" || die
- mkdir _install
- tar xf busybox-links.tar -C _install || die
- cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
- fi
-
- if use sep-usr ; then
- elog "In order to use the sep-usr support, you have to update your"
- elog "kernel command line. Add the option:"
- elog " init=/ginit"
- elog "To launch a different init than /sbin/init, use:"
- elog " init=/ginit /sbin/yourinit"
- elog "To get a rescue shell, you may boot with:"
- elog " init=/ginit bb"
- fi
-}
diff --git a/sys-apps/busybox/busybox-1.23.2.ebuild b/sys-apps/busybox/busybox-1.23.2.ebuild
deleted file mode 100644
index 5492e2b..0000000
--- a/sys-apps/busybox/busybox-1.23.2.ebuild
+++ /dev/null
@@ -1,305 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
-
-EAPI="4"
-inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
-
-DESCRIPTION="Utilities for rescue and embedded systems"
-HOMEPAGE="http://www.busybox.net/"
-if [[ ${PV} == "9999" ]] ; then
- MY_P=${PN}
- EGIT_REPO_URI="git://busybox.net/busybox.git"
- inherit git-2
-else
- MY_P=${PN}-${PV/_/-}
- SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
-fi
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="debug ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
-RESTRICT="test"
-
-COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
- pam? ( sys-libs/pam )"
-DEPEND="${COMMON_DEPEND}
- static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
- >=sys-kernel/linux-headers-2.6.39"
-RDEPEND="${COMMON_DEPEND}
-mdev? ( !<sys-apps/openrc-0.13 )"
-
-S=${WORKDIR}/${MY_P}
-
-busybox_config_option() {
- local flag=$1 ; shift
- if [[ ${flag} != [yn] ]] ; then
- busybox_config_option $(usex ${flag} y n) "$@"
- return
- fi
- while [[ $# -gt 0 ]] ; do
- if [[ ${flag} == "y" ]] ; then
- sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
- else
- sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
- fi
- einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
- shift
- done
-}
-
-busybox_config_enabled() {
- local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
- case ${val} in
- "") return 1 ;;
- y) return 0 ;;
- *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
- esac
-}
-
-src_prepare() {
- unset KBUILD_OUTPUT #88088
- append-flags -fno-strict-aliasing #310413
- use ppc64 && append-flags -mminimal-toc #130943
-
- # patches go here!
- epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
- epatch "${FILESDIR}"/${PN}-1.23.1-trylink-flags.patch
- # No busybox-1.23.2 specific patches ... yet!
- #epatch "${FILESDIR}"/${P}-*.patch
- cp "${FILESDIR}"/ginit.c init/ || die
-
- # flag cleanup
- sed -i -r \
- -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
- Makefile.flags || die
- #sed -i '/bbsh/s:^//::' include/applets.h
- sed -i '/^#error Aborting compilation./d' applets/applets.c || die
- use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
- sed -i \
- -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
- -e "/^AR\>/s:=.*:= $(tc-getAR):" \
- -e "/^CC\>/s:=.*:= $(tc-getCC):" \
- -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
- -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
- Makefile || die
- sed -i \
- -e 's:-static-libgcc::' \
- Makefile.flags || die
-}
-
-src_configure() {
- # check for a busybox config before making one of our own.
- # if one exist lets return and use it.
-
- restore_config .config
- if [ -f .config ]; then
- yes "" | emake -j1 -s oldconfig >/dev/null
- return 0
- else
- ewarn "Could not locate user configfile, so we will save a default one"
- fi
-
- # setup the config file
- emake -j1 -s allyesconfig >/dev/null
- # nommu forces a bunch of things off which we want on #387555
- busybox_config_option n NOMMU
- sed -i '/^#/d' .config
- yes "" | emake -j1 -s oldconfig >/dev/null
-
- # now turn off stuff we really don't want
- busybox_config_option n DMALLOC
- busybox_config_option n FEATURE_SUID_CONFIG
- busybox_config_option n BUILD_AT_ONCE
- busybox_config_option n BUILD_LIBBUSYBOX
- busybox_config_option n FEATURE_CLEAN_UP
- busybox_config_option n MONOTONIC_SYSCALL
- busybox_config_option n START_STOP_DAEMON
- busybox_config_option n USE_PORTABLE_CODE
- busybox_config_option n WERROR
-
- # If these are not set and we are using a uclibc/busybox setup
- # all calls to system() will fail.
- busybox_config_option y ASH
- busybox_config_option n HUSH
-
- # disable ipv6 applets
- if ! use ipv6; then
- busybox_config_option n FEATURE_IPV6
- busybox_config_option n TRACEROUTE6
- busybox_config_option n PING6
- busybox_config_option n UDHCPC6
- fi
-
- if use static && use pam ; then
- ewarn "You cannot have USE='static pam'. Assuming static is more important."
- fi
- busybox_config_option $(usex static n pam) PAM
- busybox_config_option static STATIC
- busybox_config_option syslog {K,SYS}LOGD LOGGER
- busybox_config_option systemd FEATURE_SYSTEMD
- busybox_config_option math FEATURE_AWK_LIBM
-
- # all the debug options are compiler related, so punt them
- busybox_config_option n DEBUG
- busybox_config_option y NO_DEBUG_LIB
- busybox_config_option n DMALLOC
- busybox_config_option n EFENCE
- busybox_config_option $(usex debug y n) TFTP_DEBUG
-
- busybox_config_option selinux SELINUX
-
- # this opt only controls mounting with <linux-2.6.23
- busybox_config_option n FEATURE_MOUNT_NFS
-
- # default a bunch of uncommon options to off
- local opt
- for opt in \
- ADD_SHELL \
- BEEP BOOTCHARTD \
- CRONTAB \
- DC DEVFSD DNSD DPKG{,_DEB} \
- FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
- FEATURE_DEVFS \
- HOSTID HUSH \
- INETD INOTIFYD IPCALC \
- LOCALE_SUPPORT LOGNAME LPD \
- MAKEMIME MKFS_MINIX MSH \
- OD \
- RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
- SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
- TASKSET TCPSVD \
- RPM RPM2CPIO \
- UDPSVD UUDECODE UUENCODE
- do
- busybox_config_option n ${opt}
- done
-
- emake -j1 oldconfig > /dev/null
-}
-
-src_compile() {
- unset KBUILD_OUTPUT #88088
- export SKIP_STRIP=y
-
- emake V=1 busybox
-}
-
-src_install() {
- unset KBUILD_OUTPUT #88088
- save_config .config
-
- into /
- dodir /bin
- if use sep-usr ; then
- # install /ginit to take care of mounting stuff
- exeinto /
- newexe busybox_unstripped ginit
- dosym /ginit /bin/bb
- dosym bb /bin/busybox
- else
- newbin busybox_unstripped busybox
- dosym busybox /bin/bb
- fi
- if use mdev ; then
- dodir /$(get_libdir)/mdev/
- use make-symlinks || dosym /bin/bb /sbin/mdev
- cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
-
- exeinto /$(get_libdir)/mdev/
- doexe "${FILESDIR}"/mdev/*
-
- newinitd "${FILESDIR}"/mdev.initd mdev
- fi
- if use livecd ; then
- dosym busybox /bin/vi
- fi
-
- # add busybox daemon's, bug #444718
- if busybox_config_enabled FEATURE_NTPD_SERVER; then
- newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
- newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
- fi
- if busybox_config_enabled SYSLOGD; then
- newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
- newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
- fi
- if busybox_config_enabled KLOGD; then
- newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
- newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
- fi
- if busybox_config_enabled WATCHDOG; then
- newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
- newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
- fi
- if busybox_config_enabled UDHCPC; then
- local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
- exeinto "${path%/*}"
- newexe examples/udhcp/simple.script "${path##*/}"
- fi
- if busybox_config_enabled UDHCPD; then
- insinto /etc
- doins examples/udhcp/udhcpd.conf
- fi
-
- # bundle up the symlink files for use later
- emake DESTDIR="${ED}" install
- rm _install/bin/busybox
- # for compatibility, provide /usr/bin/env
- mkdir -p _install/usr/bin
- ln -s /bin/env _install/usr/bin/env
- tar cf busybox-links.tar -C _install . || : #;die
- insinto /usr/share/${PN}
- use make-symlinks && doins busybox-links.tar
-
- dodoc AUTHORS README TODO
-
- cd docs
- docinto txt
- dodoc *.txt
- docinto pod
- dodoc *.pod
- dohtml *.html
-
- cd ../examples
- docinto examples
- dodoc inittab depmod.pl *.conf *.script undeb unrpm
-}
-
-pkg_preinst() {
- if use make-symlinks && [[ ! ${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 really what you want."
- die "silly options will destroy your system"
- fi
-
- if use make-symlinks ; then
- mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
- fi
-}
-
-pkg_postinst() {
- savedconfig_pkg_postinst
-
- if use make-symlinks ; then
- cd "${T}" || die
- mkdir _install
- tar xf busybox-links.tar -C _install || die
- cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
- fi
-
- if use sep-usr ; then
- elog "In order to use the sep-usr support, you have to update your"
- elog "kernel command line. Add the option:"
- elog " init=/ginit"
- elog "To launch a different init than /sbin/init, use:"
- elog " init=/ginit /sbin/yourinit"
- elog "To get a rescue shell, you may boot with:"
- elog " init=/ginit bb"
- fi
-}
diff --git a/sys-apps/busybox/files/busybox-1.20.0-udhcpc6-ipv6.patch b/sys-apps/busybox/files/busybox-1.20.0-udhcpc6-ipv6.patch
deleted file mode 100644
index 0148809..0000000
--- a/sys-apps/busybox/files/busybox-1.20.0-udhcpc6-ipv6.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 3da46c8163ecf14a02f8317d0b76b225eceaf28c Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 2 May 2012 21:45:35 -0400
-Subject: [PATCH] udhcpc6: depend on ipv6
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- networking/udhcp/d6_dhcpc.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
-index a792a9d..7c9f52a 100644
---- a/networking/udhcp/d6_dhcpc.c
-+++ b/networking/udhcp/d6_dhcpc.c
-@@ -12,10 +12,11 @@
- */
-
- //config:config UDHCPC6
--//config: bool "udhcp client for DHCPv6 (udhcpc6)"
--//config: default n # not yet ready
--//config: help
--//config: udhcpc6 is a DHCPv6 client
-+//config: bool "udhcp client for DHCPv6 (udhcpc6)"
-+//config: default n # not yet ready
-+//config: depends on FEATURE_IPV6
-+//config: help
-+//config: udhcpc6 is a DHCPv6 client
-
- //applet:IF_UDHCPC6(APPLET(udhcpc6, BB_DIR_USR_BIN, BB_SUID_DROP))
-
---
-1.7.9.7
-
diff --git a/sys-apps/busybox/files/busybox-1.20.2-glibc-sys-resource.patch b/sys-apps/busybox/files/busybox-1.20.2-glibc-sys-resource.patch
deleted file mode 100644
index f682d00..0000000
--- a/sys-apps/busybox/files/busybox-1.20.2-glibc-sys-resource.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-https://bugs.gentoo.org/424954
-
-From c5fe9f7b723f949457263ef8e22ab807d5b549ce Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Thu, 5 Jul 2012 23:19:09 -0400
-Subject: [PATCH] include sys/resource.h where needed
-
-We use functions from sys/resource.h in misc applets, but don't include
-the header. This breaks building with newer glibc versions, so add the
-include where needed.
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- loginutils/passwd.c | 1 +
- miscutils/time.c | 1 +
- networking/inetd.c | 1 +
- networking/ntpd.c | 1 +
- networking/ntpd_simple.c | 1 +
- runit/chpst.c | 1 +
- shell/shell_common.c | 1 +
- 7 files changed, 7 insertions(+)
-
-diff --git a/loginutils/passwd.c b/loginutils/passwd.c
-index b83db00..a7006f0 100644
---- a/loginutils/passwd.c
-+++ b/loginutils/passwd.c
-@@ -15,6 +15,7 @@
-
- #include "libbb.h"
- #include <syslog.h>
-+#include <sys/resource.h> /* setrlimit */
-
- static void nuke_str(char *str)
- {
-diff --git a/miscutils/time.c b/miscutils/time.c
-index 945f15f..ffed386 100644
---- a/miscutils/time.c
-+++ b/miscutils/time.c
-@@ -16,6 +16,7 @@
- //usage: "\n -v Verbose"
-
- #include "libbb.h"
-+#include <sys/resource.h> /* getrusage */
-
- /* Information on the resources used by a child process. */
- typedef struct {
-diff --git a/networking/inetd.c b/networking/inetd.c
-index 1308d74..00baf69 100644
---- a/networking/inetd.c
-+++ b/networking/inetd.c
-@@ -165,6 +165,7 @@
- //usage: "\n (default: 0 - disabled)"
-
- #include <syslog.h>
-+#include <sys/resource.h> /* setrlimit */
- #include <sys/un.h>
-
- #include "libbb.h"
-diff --git a/networking/ntpd.c b/networking/ntpd.c
-index 72e9d0b..5b92db6 100644
---- a/networking/ntpd.c
-+++ b/networking/ntpd.c
-@@ -46,6 +46,7 @@
- #include "libbb.h"
- #include <math.h>
- #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
-+#include <sys/resource.h> /* setpriority */
- #include <sys/timex.h>
- #ifndef IPTOS_LOWDELAY
- # define IPTOS_LOWDELAY 0x10
-diff --git a/networking/ntpd_simple.c b/networking/ntpd_simple.c
-index 4ad44e4..1b7c66b 100644
---- a/networking/ntpd_simple.c
-+++ b/networking/ntpd_simple.c
-@@ -7,6 +7,7 @@
- */
- #include "libbb.h"
- #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
-+#include <sys/resource.h> /* setpriority */
- #ifndef IPTOS_LOWDELAY
- # define IPTOS_LOWDELAY 0x10
- #endif
-diff --git a/runit/chpst.c b/runit/chpst.c
-index ac296ba..ed72c8b 100644
---- a/runit/chpst.c
-+++ b/runit/chpst.c
-@@ -91,6 +91,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- //usage: "\n a SIGXCPU after N seconds"
-
- #include "libbb.h"
-+#include <sys/resource.h> /* getrlimit */
-
- /*
- Five applets here: chpst, envdir, envuidgid, setuidgid, softlimit.
-diff --git a/shell/shell_common.c b/shell/shell_common.c
-index 51c92d6..780e27e 100644
---- a/shell/shell_common.c
-+++ b/shell/shell_common.c
-@@ -18,6 +18,7 @@
- */
- #include "libbb.h"
- #include "shell_common.h"
-+#include <sys/resource.h> /* getrlimit */
-
- const char defifsvar[] ALIGN1 = "IFS= \t\n";
-
---
-1.7.9.7
-
diff --git a/sys-apps/busybox/files/busybox-1.20.2-selinux-pkg-config.patch b/sys-apps/busybox/files/busybox-1.20.2-selinux-pkg-config.patch
deleted file mode 100644
index 5e9ef26..0000000
--- a/sys-apps/busybox/files/busybox-1.20.2-selinux-pkg-config.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From 5694afd72a0a424fcdd2ac85838229a1a86b7e84 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sat, 20 Oct 2012 15:01:26 -0400
-Subject: [PATCH] build system: use pkg-config to look up selinux libs
-
-Newer versions of libselinux has started linking against more libs.
-Rather than continuing hardcoding things, switch to using pkg-config
-to query for its dependencies.
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- Makefile | 1 +
- Makefile.flags | 12 +++++++++++-
- 2 files changed, 12 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index b2e9477..8995ff5 100644
---- a/Makefile
-+++ b/Makefile
-@@ -297,6 +297,7 @@ NM = $(CROSS_COMPILE)nm
- STRIP = $(CROSS_COMPILE)strip
- OBJCOPY = $(CROSS_COMPILE)objcopy
- OBJDUMP = $(CROSS_COMPILE)objdump
-+PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
- AWK = awk
- GENKSYMS = scripts/genksyms/genksyms
- DEPMOD = /sbin/depmod
-diff --git a/Makefile.flags b/Makefile.flags
-index e77c0e5..307afa7 100644
---- a/Makefile.flags
-+++ b/Makefile.flags
-@@ -78,6 +78,12 @@ ARCH_FPIC ?= -fpic
- ARCH_FPIE ?= -fpie
- ARCH_PIE ?= -pie
-
-+# Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES))
-+define pkg_check_modules
-+$(1)_CFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags $(2))
-+$(1)_LIBS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs $(2))
-+endef
-+
- ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
- # on i386: 14% smaller libbusybox.so
- # (code itself is 9% bigger, we save on relocs/PLT/GOT)
-@@ -89,6 +95,7 @@ endif
-
- ifeq ($(CONFIG_STATIC),y)
- CFLAGS_busybox += -static
-+PKG_CONFIG_FLAGS += --static
- endif
-
- ifeq ($(CONFIG_PIE),y)
-@@ -131,7 +138,10 @@ LDLIBS += pam pam_misc pthread
- endif
-
- ifeq ($(CONFIG_SELINUX),y)
--LDLIBS += selinux sepol
-+SELINUX_PC_MODULES = libselinux libsepol
-+$(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES)))
-+CPPFLAGS += $(SELINUX_CFLAGS)
-+LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%))
- endif
-
- ifeq ($(CONFIG_EFENCE),y)
---
-1.7.12
-
diff --git a/sys-apps/busybox/files/busybox-1.21.0-mdev.patch b/sys-apps/busybox/files/busybox-1.21.0-mdev.patch
deleted file mode 100644
index cb873fa..0000000
--- a/sys-apps/busybox/files/busybox-1.21.0-mdev.patch
+++ /dev/null
@@ -1,35 +0,0 @@
---- busybox-1.21.0/util-linux/mdev.c
-+++ busybox-1.21.0-mdev/util-linux/mdev.c
-@@ -661,6 +661,8 @@ static void make_device(char *device_nam
- if (mknod(node_name, rule->mode | type, makedev(major, minor)) && errno != EEXIST)
- bb_perror_msg("can't create '%s'", node_name);
- if (ENABLE_FEATURE_MDEV_CONF) {
-+ if (G.verbose)
-+ bb_error_msg("chmod: %o chown: %u:%u", rule->mode, rule->ugid.uid, rule->ugid.gid);
- chmod(node_name, rule->mode);
- chown(node_name, rule->ugid.uid, rule->ugid.gid);
- }
-@@ -813,6 +815,7 @@ static void load_firmware(const char *fi
- full_write(loading_fd, "-1", 2);
-
- out:
-+ xchdir("/dev");
- if (ENABLE_FEATURE_CLEAN_UP) {
- close(firmware_fd);
- close(loading_fd);
-@@ -919,11 +922,13 @@ int mdev_main(int argc UNUSED_PARAM, cha
- }
-
- {
-- int logfd = open("/dev/mdev.log", O_WRONLY | O_APPEND);
-+ int logfd = open("mdev.log", O_WRONLY | O_APPEND);
- if (logfd >= 0) {
- xmove_fd(logfd, STDERR_FILENO);
- G.verbose = 1;
-- bb_error_msg("seq: %s action: %s", seq, action);
-+ if (seq)
-+ applet_name = xasprintf("%s[%s]", applet_name, seq);
-+ bb_error_msg("action: %s", action);
- }
- }
-
diff --git a/sys-apps/busybox/files/busybox-1.21.0-platform.patch b/sys-apps/busybox/files/busybox-1.21.0-platform.patch
deleted file mode 100644
index 9be6cb8..0000000
--- a/sys-apps/busybox/files/busybox-1.21.0-platform.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- busybox-1.21.0/archival/libarchive/decompress_unxz.c
-+++ busybox-1.21.0-platform/archival/libarchive/decompress_unxz.c
-@@ -30,8 +30,8 @@ static uint32_t xz_crc32(const uint8_t *
- /* We use arch-optimized unaligned accessors */
- #define get_unaligned_le32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_LE32(v); })
- #define get_unaligned_be32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_BE32(v); })
--#define put_unaligned_le32(val, buf) move_to_unaligned16(buf, SWAP_LE32(val))
--#define put_unaligned_be32(val, buf) move_to_unaligned16(buf, SWAP_BE32(val))
-+#define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val))
-+#define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val))
-
- #include "unxz/xz_dec_bcj.c"
- #include "unxz/xz_dec_lzma2.c"
---- busybox-1.21.0/include/platform.h
-+++ busybox-1.21.0-platform/include/platform.h
-@@ -228,7 +228,7 @@ typedef uint32_t bb__aliased_uint32_t FI
- # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4))
- # define move_to_unaligned16(u16p, v) do { \
- uint16_t __t = (v); \
-- memcpy((u16p), &__t, 4); \
-+ memcpy((u16p), &__t, 2); \
- } while (0)
- # define move_to_unaligned32(u32p, v) do { \
- uint32_t __t = (v); \
diff --git a/sys-apps/busybox/files/busybox-1.21.0-xz.patch b/sys-apps/busybox/files/busybox-1.21.0-xz.patch
deleted file mode 100644
index 56ba1a2..0000000
--- a/sys-apps/busybox/files/busybox-1.21.0-xz.patch
+++ /dev/null
@@ -1,84 +0,0 @@
---- busybox-1.21.0/archival/libarchive/decompress_unxz.c
-+++ busybox-1.21.0-xz/archival/libarchive/decompress_unxz.c
-@@ -40,6 +40,7 @@ static uint32_t xz_crc32(const uint8_t *
- IF_DESKTOP(long long) int FAST_FUNC
- unpack_xz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
- {
-+ enum xz_ret xz_result;
- struct xz_buf iobuf;
- struct xz_dec *state;
- unsigned char *membuf;
-@@ -63,9 +64,8 @@ unpack_xz_stream(transformer_aux_data_t
- /* Limit memory usage to about 64 MiB. */
- state = xz_dec_init(XZ_DYNALLOC, 64*1024*1024);
-
-+ xz_result = X_OK;
- while (1) {
-- enum xz_ret r;
--
- if (iobuf.in_pos == iobuf.in_size) {
- int rd = safe_read(src_fd, membuf, BUFSIZ);
- if (rd < 0) {
-@@ -73,28 +73,57 @@ unpack_xz_stream(transformer_aux_data_t
- total = -1;
- break;
- }
-+ if (rd == 0 && xz_result == XZ_STREAM_END)
-+ break;
- iobuf.in_size = rd;
- iobuf.in_pos = 0;
- }
-+ if (xz_result == XZ_STREAM_END) {
-+ /*
-+ * Try to start decoding next concatenated stream.
-+ * Stream padding must always be a multiple of four
-+ * bytes to preserve four-byte alignment. To keep the
-+ * code slightly smaller, we aren't as strict here as
-+ * the .xz spec requires. We just skip all zero-bytes
-+ * without checking the alignment and thus can accept
-+ * files that aren't valid, e.g. the XZ utils test
-+ * files bad-0pad-empty.xz and bad-0catpad-empty.xz.
-+ */
-+ do {
-+ if (membuf[iobuf.in_pos] != 0) {
-+ xz_dec_reset(state);
-+ goto do_run;
-+ }
-+ iobuf.in_pos++;
-+ } while (iobuf.in_pos < iobuf.in_size);
-+ }
-+ do_run:
- // bb_error_msg(">in pos:%d size:%d out pos:%d size:%d",
- // iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size);
-- r = xz_dec_run(state, &iobuf);
-+ xz_result = xz_dec_run(state, &iobuf);
- // bb_error_msg("<in pos:%d size:%d out pos:%d size:%d r:%d",
--// iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size, r);
-+// iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size, xz_result);
- if (iobuf.out_pos) {
- xwrite(dst_fd, iobuf.out, iobuf.out_pos);
- IF_DESKTOP(total += iobuf.out_pos;)
- iobuf.out_pos = 0;
- }
-- if (r == XZ_STREAM_END) {
-- break;
-+ if (xz_result == XZ_STREAM_END) {
-+ /*
-+ * Can just "break;" here, if not for concatenated
-+ * .xz streams.
-+ * Checking for padding may require buffer
-+ * replenishment. Can't do it here.
-+ */
-+ continue;
- }
-- if (r != XZ_OK && r != XZ_UNSUPPORTED_CHECK) {
-+ if (xz_result != XZ_OK && xz_result != XZ_UNSUPPORTED_CHECK) {
- bb_error_msg("corrupted data");
- total = -1;
- break;
- }
- }
-+
- xz_dec_end(state);
- free(membuf);
-
diff --git a/sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch b/sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch
deleted file mode 100644
index bbd9e55..0000000
--- a/sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-https://bugs.gentoo.org/484560
-
-From 3eab2b7675fc7e2889cd69285a2a31980a4bf504 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Thu, 12 Sep 2013 00:29:40 -0400
-Subject: [PATCH] trylink: only prefix libs with -l
-
-If our pkg-config queries pass back a flag like -pthread, the trylink
-script will expand that to -l-pthread. So change trylink to only add
-the -l prefix to a value that doesn't have a - prefix already.
-
-Reported-by: thaehaid@incognitomail.org
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- scripts/trylink | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/scripts/trylink b/scripts/trylink
-index a8b0b2e..e471699 100755
---- a/scripts/trylink
-+++ b/scripts/trylink
-@@ -117,7 +117,7 @@ LDLIBS=`echo "$LDLIBS" | xargs -n1 | sort | uniq | xargs`
- # First link with all libs. If it fails, bail out
- echo "Trying libraries: $LDLIBS"
- # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
--l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
-+l_list=`echo " $LDLIBS " | sed -e 's: \([^- ][^ ]*\): -l\1:g'`
- test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
- try $CC $CFLAGS $LDFLAGS \
- -o $EXE \
-@@ -141,7 +141,7 @@ while test "$LDLIBS"; do
- for one in $LDLIBS; do
- without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs`
- # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
-- l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
-+ l_list=`echo " $without_one " | sed -e 's: \([^- ][^ ]*\): -l\1:g'`
- test x"$l_list" != x"" && l_list="$START_GROUP $l_list $END_GROUP"
- $debug && echo "Trying -l options: '$l_list'"
- try $CC $CFLAGS $LDFLAGS \
-@@ -172,7 +172,7 @@ done
-
- # Make the binary with final, minimal list of libs
- echo "Final link with: ${LDLIBS:-<none>}"
--l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
-+l_list=`echo " $LDLIBS " | sed -e 's: \([^- ][^ ]*\): -l\1:g'`
- test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
- # --verbose gives us gobs of info to stdout (e.g. linker script used)
- if ! test -f busybox_ldscript; then
---
-1.8.3.2
-
diff --git a/sys-apps/busybox/files/busybox-1.22.0-find.patch b/sys-apps/busybox/files/busybox-1.22.0-find.patch
deleted file mode 100644
index 75a06a8..0000000
--- a/sys-apps/busybox/files/busybox-1.22.0-find.patch
+++ /dev/null
@@ -1,40 +0,0 @@
---- busybox-1.22.0/findutils/find.c
-+++ busybox-1.22.0-find/findutils/find.c
-@@ -1291,9 +1291,27 @@ int find_main(int argc, char **argv) MAI
- int find_main(int argc UNUSED_PARAM, char **argv)
- {
- int i, firstopt, status = EXIT_SUCCESS;
-+ char **past_HLP, *saved;
-
- INIT_G();
-
-+ /* "find -type f" + getopt("+HLP") => disaster.
-+ * Need to avoid getopt running into a non-HLP option.
-+ * Do this by temporarily storing NULL there:
-+ */
-+ past_HLP = argv;
-+ for (;;) {
-+ saved = *++past_HLP;
-+ if (!saved)
-+ break;
-+ if (saved[0] != '-')
-+ break;
-+ if (!saved[1])
-+ break; /* it is "-" */
-+ if ((saved+1)[strspn(saved+1, "HLP")] != '\0')
-+ break;
-+ }
-+ *past_HLP = NULL;
- /* "+": stop on first non-option */
- i = getopt32(argv, "+HLP");
- if (i & (1<<0))
-@@ -1301,7 +1319,8 @@ int find_main(int argc UNUSED_PARAM, cha
- if (i & (1<<1))
- G.recurse_flags |= ACTION_FOLLOWLINKS | ACTION_DANGLING_OK;
- /* -P is default and is ignored */
-- argv += optind;
-+ argv = past_HLP; /* same result as "argv += optind;" */
-+ *past_HLP = saved;
-
- for (firstopt = 0; argv[firstopt]; firstopt++) {
- if (argv[firstopt][0] == '-')
diff --git a/sys-apps/busybox/files/busybox-1.22.0-grep.patch b/sys-apps/busybox/files/busybox-1.22.0-grep.patch
deleted file mode 100644
index 053245d..0000000
--- a/sys-apps/busybox/files/busybox-1.22.0-grep.patch
+++ /dev/null
@@ -1,80 +0,0 @@
---- busybox-1.22.0/findutils/grep.c
-+++ busybox-1.22.0-grep/findutils/grep.c
-@@ -373,6 +373,9 @@ static int grep_file(FILE *file)
- opt_f_not_found: ;
- }
- } else {
-+#if ENABLE_EXTRA_COMPAT
-+ unsigned start_pos;
-+#endif
- char *match_at;
-
- if (!(gl->flg_mem_alocated_compiled & COMPILED)) {
-@@ -389,15 +392,18 @@ static int grep_file(FILE *file)
- #if !ENABLE_EXTRA_COMPAT
- gl->matched_range.rm_so = 0;
- gl->matched_range.rm_eo = 0;
-+#else
-+ start_pos = 0;
- #endif
- match_at = line;
- opt_w_again:
-+//bb_error_msg("'%s' start_pos:%d line_len:%d", match_at, start_pos, line_len);
- if (
- #if !ENABLE_EXTRA_COMPAT
- regexec(&gl->compiled_regex, match_at, 1, &gl->matched_range, 0) == 0
- #else
- re_search(&gl->compiled_regex, match_at, line_len,
-- /*start:*/ 0, /*range:*/ line_len,
-+ start_pos, /*range:*/ line_len,
- &gl->matched_range) >= 0
- #endif
- ) {
-@@ -416,8 +422,24 @@ static int grep_file(FILE *file)
- if (!c || (!isalnum(c) && c != '_')) {
- found = 1;
- } else {
-- match_at += gl->matched_range.rm_eo;
-- goto opt_w_again;
-+ /*
-+ * Why check gl->matched_range.rm_eo?
-+ * Zero-length match makes -w skip the line:
-+ * "echo foo | grep ^" prints "foo",
-+ * "echo foo | grep -w ^" prints nothing.
-+ * Without such check, we can loop forever.
-+ */
-+#if !ENABLE_EXTRA_COMPAT
-+ if (gl->matched_range.rm_eo != 0) {
-+ match_at += gl->matched_range.rm_eo;
-+ goto opt_w_again;
-+ }
-+#else
-+ if (gl->matched_range.rm_eo > start_pos) {
-+ start_pos = gl->matched_range.rm_eo;
-+ goto opt_w_again;
-+ }
-+#endif
- }
- }
- }
---- busybox-1.22.0/testsuite/grep.tests
-+++ busybox-1.22.0-grep/testsuite/grep.tests
-@@ -147,6 +147,18 @@ testing "grep -w doesn't stop on 1st mis
- "foop foo\n" \
- ""
-
-+testing "grep -w ^str doesn't match str not at the beginning" \
-+ "grep -w ^str input" \
-+ "" \
-+ "strstr\n" \
-+ ""
-+
-+testing "grep -w ^ doesn't hang" \
-+ "grep -w ^ input" \
-+ "" \
-+ "anything\n" \
-+ ""
-+
- # testing "test name" "commands" "expected result" "file input" "stdin"
- # file input will be file called "input"
- # test can create a file "actual" instead of writing to stdout
diff --git a/sys-apps/busybox/files/busybox-1.22.0-lineedit.patch b/sys-apps/busybox/files/busybox-1.22.0-lineedit.patch
deleted file mode 100644
index e414314..0000000
--- a/sys-apps/busybox/files/busybox-1.22.0-lineedit.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- busybox-1.22.0/libbb/lineedit.c
-+++ busybox-1.22.0-lineedit/libbb/lineedit.c
-@@ -1255,7 +1255,9 @@ line_input_t* FAST_FUNC new_line_input_t
- {
- line_input_t *n = xzalloc(sizeof(*n));
- n->flags = flags;
-+#if MAX_HISTORY > 0
- n->max_history = MAX_HISTORY;
-+#endif
- return n;
- }
-
diff --git a/sys-apps/busybox/files/busybox-1.22.0-ntpd.patch b/sys-apps/busybox/files/busybox-1.22.0-ntpd.patch
deleted file mode 100644
index 1334f57..0000000
--- a/sys-apps/busybox/files/busybox-1.22.0-ntpd.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- busybox-1.22.0/networking/ntpd.c
-+++ busybox-1.22.0-ntpd/networking/ntpd.c
-@@ -1445,6 +1445,8 @@ update_local_clock(peer_t *p)
-
- run_script("step", offset);
-
-+ recv_time += offset;
-+
- #if USING_INITIAL_FREQ_ESTIMATION
- if (G.discipline_state == STATE_NSET) {
- set_new_values(STATE_FREQ, /*offset:*/ 0, recv_time);
diff --git a/sys-apps/busybox/files/busybox-1.22.1-ash.patch b/sys-apps/busybox/files/busybox-1.22.1-ash.patch
deleted file mode 100644
index 301e942..0000000
--- a/sys-apps/busybox/files/busybox-1.22.1-ash.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- busybox-1.22.1/shell/ash.c
-+++ busybox-1.22.1-ash/shell/ash.c
-@@ -13014,7 +13014,7 @@ init(void)
- setvar2("PPID", utoa(getppid()));
- #if ENABLE_ASH_BASH_COMPAT
- p = lookupvar("SHLVL");
-- setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1));
-+ setvar("SHLVL", utoa((p ? atoi(p) : 0) + 1), VEXPORT);
- #endif
- p = lookupvar("PWD");
- if (p) {
diff --git a/sys-apps/busybox/files/busybox-1.22.1-date.patch b/sys-apps/busybox/files/busybox-1.22.1-date.patch
deleted file mode 100644
index 6380d87..0000000
--- a/sys-apps/busybox/files/busybox-1.22.1-date.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- busybox-1.22.1/libbb/time.c
-+++ busybox-1.22.1-date/libbb/time.c
-@@ -68,15 +68,23 @@ void FAST_FUNC parse_datestr(const char
- /* else end != NUL and we error out */
- }
- } else
-- /* yyyy-mm-dd HH */
-- if (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
-+ if (strchr(date_str, '-')
-+ /* Why strchr('-') check?
-+ * sscanf below will trash ptm->tm_year, this breaks
-+ * if parse_str is "10101010" (iow, "MMddhhmm" form)
-+ * because we destroy year. Do these sscanf
-+ * only if we saw a dash in parse_str.
-+ */
-+ /* yyyy-mm-dd HH */
-+ && (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
- &ptm->tm_mon, &ptm->tm_mday,
- &ptm->tm_hour,
- &end) >= 4
-- /* yyyy-mm-dd */
-- || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
-+ /* yyyy-mm-dd */
-+ || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
- &ptm->tm_mon, &ptm->tm_mday,
- &end) >= 3
-+ )
- ) {
- ptm->tm_year -= 1900; /* Adjust years */
- ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */
diff --git a/sys-apps/busybox/files/busybox-1.22.1-iplink.patch b/sys-apps/busybox/files/busybox-1.22.1-iplink.patch
deleted file mode 100644
index dbd76c5..0000000
--- a/sys-apps/busybox/files/busybox-1.22.1-iplink.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- busybox-1.22.1/networking/libiproute/iplink.c
-+++ busybox-1.22.1-iplink/networking/libiproute/iplink.c
-@@ -31,6 +31,16 @@
- #ifndef IFLA_LINKINFO
- # define IFLA_LINKINFO 18
- # define IFLA_INFO_KIND 1
-+# define IFLA_INFO_DATA 2
-+#endif
-+
-+#ifndef IFLA_VLAN_MAX
-+# define IFLA_VLAN_ID 1
-+# define IFLA_VLAN_FLAGS 2
-+struct ifla_vlan_flags {
-+ uint32_t flags;
-+ uint32_t mask;
-+};
- #endif
-
- /* taken from linux/sockios.h */
diff --git a/sys-apps/busybox/files/busybox-1.22.1-lzop.patch b/sys-apps/busybox/files/busybox-1.22.1-lzop.patch
deleted file mode 100644
index d89cc24..0000000
--- a/sys-apps/busybox/files/busybox-1.22.1-lzop.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From a9dc7c2f59dc5e92870d2d46316ea5c1f14740e3 Mon Sep 17 00:00:00 2001
-From: Denys Vlasenko <vda.linux@googlemail.com>
-Date: Mon, 30 Jun 2014 10:14:34 +0200
-Subject: [PATCH] lzop: add overflow check
-
-See CVE-2014-4607
-http://www.openwall.com/lists/oss-security/2014/06/26/20
-
-function old new delta
-lzo1x_decompress_safe 1010 1031 +21
-
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
----
- archival/libarchive/liblzo.h | 2 ++
- archival/libarchive/lzo1x_d.c | 3 +++
- 2 files changed, 5 insertions(+)
-
-diff --git a/archival/libarchive/liblzo.h b/archival/libarchive/liblzo.h
-index 843997c..4596620 100644
---- a/archival/libarchive/liblzo.h
-+++ b/archival/libarchive/liblzo.h
-@@ -76,11 +76,13 @@
- # define TEST_IP (ip < ip_end)
- # define NEED_IP(x) \
- if ((unsigned)(ip_end - ip) < (unsigned)(x)) goto input_overrun
-+# define TEST_IV(x) if ((x) > (unsigned)0 - (511)) goto input_overrun
-
- # undef TEST_OP /* don't need both of the tests here */
- # define TEST_OP 1
- # define NEED_OP(x) \
- if ((unsigned)(op_end - op) < (unsigned)(x)) goto output_overrun
-+# define TEST_OV(x) if ((x) > (unsigned)0 - (511)) goto output_overrun
-
- #define HAVE_ANY_OP 1
-
-diff --git a/archival/libarchive/lzo1x_d.c b/archival/libarchive/lzo1x_d.c
-index 9bc1270..40b167e 100644
---- a/archival/libarchive/lzo1x_d.c
-+++ b/archival/libarchive/lzo1x_d.c
-@@ -92,6 +92,7 @@ int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
- ip++;
- NEED_IP(1);
- }
-+ TEST_IV(t);
- t += 15 + *ip++;
- }
- /* copy literals */
-@@ -224,6 +225,7 @@ int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
- ip++;
- NEED_IP(1);
- }
-+ TEST_IV(t);
- t += 31 + *ip++;
- }
- #if defined(COPY_DICT)
-@@ -265,6 +267,7 @@ int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
- ip++;
- NEED_IP(1);
- }
-+ TEST_IV(t);
- t += 7 + *ip++;
- }
- #if defined(COPY_DICT)
---
-2.1.2
-
diff --git a/sys-apps/busybox/files/busybox-1.22.1-nc.patch b/sys-apps/busybox/files/busybox-1.22.1-nc.patch
deleted file mode 100644
index 1ddb483..0000000
--- a/sys-apps/busybox/files/busybox-1.22.1-nc.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- busybox-1.22.1/networking/nc_bloaty.c
-+++ busybox-1.22.1-nc/networking/nc_bloaty.c
-@@ -175,9 +175,9 @@ enum {
- OPT_w = (1 << 5),
- OPT_l = (1 << 6) * ENABLE_NC_SERVER,
- OPT_k = (1 << 7) * ENABLE_NC_SERVER,
-- OPT_i = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
-- OPT_o = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
-- OPT_z = (1 << (9+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
-+ OPT_i = (1 << (6+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
-+ OPT_o = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
-+ OPT_z = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
- };
-
- #define o_nflag (option_mask32 & OPT_n)
diff --git a/sys-apps/busybox/files/busybox-1.22.1-zcat-no-ext.patch b/sys-apps/busybox/files/busybox-1.22.1-zcat-no-ext.patch
deleted file mode 100644
index f468228..0000000
--- a/sys-apps/busybox/files/busybox-1.22.1-zcat-no-ext.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 28dd64a0e1a9cffcde7799f2849b66c0e16bb9cc Mon Sep 17 00:00:00 2001
-From: Denys Vlasenko <vda.linux@googlemail.com>
-Date: Fri, 10 Jan 2014 14:06:57 +0100
-Subject: [PATCH] libarchive: open_zipped() does not need to check extensions
- for e.g. gzip
-
-We only need to check for signature-less extensions,
-currently only .lzma. The rest can be happily autodetected.
-
-This fixes "zcat FILE_WITHOUT_GZ_EXT" case, among others.
-
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-(cherry picked from commit 7c47b560a8fc97956dd8132bd7f1863d83c19866)
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- archival/libarchive/open_transformer.c | 23 +++++++++++------------
- 1 file changed, 11 insertions(+), 12 deletions(-)
-
-diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c
-index 4e98264..1aeba13 100644
---- a/archival/libarchive/open_transformer.c
-+++ b/archival/libarchive/open_transformer.c
-@@ -182,27 +182,26 @@ int FAST_FUNC setup_unzip_on_fd(int fd, int fail_if_not_detected)
-
- int FAST_FUNC open_zipped(const char *fname)
- {
-- char *sfx;
- int fd;
-
- fd = open(fname, O_RDONLY);
- if (fd < 0)
- return fd;
-
-- sfx = strrchr(fname, '.');
-- if (sfx) {
-- sfx++;
-- if (ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0)
-- /* .lzma has no header/signature, just trust it */
-+ if (ENABLE_FEATURE_SEAMLESS_LZMA) {
-+ /* .lzma has no header/signature, can only detect it by extension */
-+ char *sfx = strrchr(fname, '.');
-+ if (sfx && strcmp(sfx+1, "lzma") == 0) {
- open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
-- else
-- if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0)
-- || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0)
-- || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0)
-- ) {
-- setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
-+ return fd;
- }
- }
-+ if ((ENABLE_FEATURE_SEAMLESS_GZ)
-+ || (ENABLE_FEATURE_SEAMLESS_BZ2)
-+ || (ENABLE_FEATURE_SEAMLESS_XZ)
-+ ) {
-+ setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
-+ }
-
- return fd;
- }
---
-2.1.2
-
diff --git a/sys-apps/busybox/files/busybox-1.23.1-modprobe-small.patch b/sys-apps/busybox/files/busybox-1.23.1-modprobe-small.patch
deleted file mode 100644
index 50fc877..0000000
--- a/sys-apps/busybox/files/busybox-1.23.1-modprobe-small.patch
+++ /dev/null
@@ -1,166 +0,0 @@
---- busybox-1.23.1/modutils/modprobe-small.c
-+++ busybox-1.23.1-modprobe-small/modutils/modprobe-small.c
-@@ -552,9 +552,23 @@ static int already_loaded(const char *na
- return ret;
- }
- #else
--#define already_loaded(name) is_rmmod
-+#define already_loaded(name) 0
- #endif
-
-+static int rmmod(const char *filename)
-+{
-+ int r;
-+ char modname[MODULE_NAME_LEN];
-+
-+ filename2modname(filename, modname);
-+ r = delete_module(modname, O_NONBLOCK | O_EXCL);
-+ dbg1_error_msg("delete_module('%s', O_NONBLOCK | O_EXCL):%d", modname, r);
-+ if (r != 0 && !(option_mask32 & OPT_q)) {
-+ bb_perror_msg("remove '%s'", modname);
-+ }
-+ return r;
-+}
-+
- /*
- * Given modules definition and module name (or alias, or symbol)
- * load/remove the module respecting dependencies.
-@@ -571,26 +585,36 @@ static void process_module(char *name, c
- module_info **infovec;
- module_info *info;
- int infoidx;
-- int is_rmmod = (option_mask32 & OPT_r) != 0;
-+ int is_remove = (option_mask32 & OPT_r) != 0;
-
- dbg1_error_msg("process_module('%s','%s')", name, cmdline_options);
-
- replace(name, '-', '_');
-
-- dbg1_error_msg("already_loaded:%d is_rmmod:%d", already_loaded(name), is_rmmod);
-+ dbg1_error_msg("already_loaded:%d is_remove:%d", already_loaded(name), is_remove);
-+
-+ if (applet_name[0] == 'r') {
-+ /* rmmod.
-+ * Does not remove dependencies, no need to scan, just remove.
-+ * (compat note: this allows and strips .ko suffix)
-+ */
-+ rmmod(name);
-+ return;
-+ }
-+
- /*
-- * We used to have "is_rmmod != already_loaded(name)" check here, but
-+ * We used to have "is_remove != already_loaded(name)" check here, but
- * modprobe -r pci:v00008086d00007010sv00000000sd00000000bc01sc01i80
- * won't unload modules (there are more than one)
- * which have this alias.
- */
-- if (!is_rmmod && already_loaded(name)) {
-+ if (!is_remove && already_loaded(name)) {
- dbg1_error_msg("nothing to do for '%s'", name);
- return;
- }
-
- options = NULL;
-- if (!is_rmmod) {
-+ if (!is_remove) {
- char *opt_filename = xasprintf("/etc/modules/%s", name);
- options = xmalloc_open_read_close(opt_filename, NULL);
- if (options)
-@@ -624,7 +648,7 @@ static void process_module(char *name, c
- 0 /* depth */
- );
- dbg1_error_msg("dirscan complete");
-- /* Module was not found, or load failed, or is_rmmod */
-+ /* Module was not found, or load failed, or is_remove */
- if (module_found_idx >= 0) { /* module was found */
- infovec = xzalloc(2 * sizeof(infovec[0]));
- infovec[0] = &modinfo[module_found_idx];
-@@ -637,7 +661,7 @@ static void process_module(char *name, c
-
- if (!infovec) {
- /* both dirscan and find_alias found nothing */
-- if (!is_rmmod && applet_name[0] != 'd') /* it wasn't rmmod or depmod */
-+ if (!is_remove && applet_name[0] != 'd') /* it wasn't rmmod or depmod */
- bb_error_msg("module '%s' not found", name);
- //TODO: _and_die()? or should we continue (un)loading modules listed on cmdline?
- goto ret;
-@@ -651,29 +675,15 @@ static void process_module(char *name, c
- * a *list* of modinfo pointers from find_alias().
- */
-
-- /* rmmod or modprobe -r? unload module(s) */
-- if (is_rmmod) {
-+ /* modprobe -r? unload module(s) */
-+ if (is_remove) {
- infoidx = 0;
- while ((info = infovec[infoidx++]) != NULL) {
-- int r;
-- char modname[MODULE_NAME_LEN];
--
-- filename2modname(
-- bb_get_last_path_component_nostrip(info->pathname), modname);
-- r = delete_module(modname, O_NONBLOCK | O_EXCL);
-- dbg1_error_msg("delete_module('%s', O_NONBLOCK | O_EXCL):%d", modname, r);
-+ int r = rmmod(bb_get_last_path_component_nostrip(info->pathname));
- if (r != 0) {
-- if (!(option_mask32 & OPT_q))
-- bb_perror_msg("remove '%s'", modname);
-- goto ret;
-+ goto ret; /* error */
- }
- }
--
-- if (applet_name[0] == 'r') {
-- /* rmmod: do not remove dependencies, exit */
-- goto ret;
-- }
--
- /* modprobe -r: we do not stop here -
- * continue to unload modules on which the module depends:
- * "-r --remove: option causes modprobe to remove a module.
-@@ -694,7 +704,7 @@ static void process_module(char *name, c
- }
- free(deps);
-
-- if (is_rmmod)
-+ if (is_remove)
- continue;
-
- /* We are modprobe: load it */
-@@ -897,10 +907,10 @@ int modprobe_main(int argc UNUSED_PARAM,
- }
-
- #if ENABLE_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE
-- /* If not rmmod, parse possible module options given on command line.
-+ /* If not rmmod/-r, parse possible module options given on command line.
- * insmod/modprobe takes one module name, the rest are parameters. */
- options = NULL;
-- if ('r' != applet0) {
-+ if (!(option_mask32 & OPT_r)) {
- char **arg = argv;
- while (*++arg) {
- /* Enclose options in quotes */
-@@ -911,7 +921,7 @@ int modprobe_main(int argc UNUSED_PARAM,
- }
- }
- #else
-- if ('r' != applet0)
-+ if (!(option_mask32 & OPT_r))
- argv[1] = NULL;
- #endif
-
-@@ -935,10 +945,11 @@ int modprobe_main(int argc UNUSED_PARAM,
- }
-
- /* Try to load modprobe.dep.bb */
-- load_dep_bb();
-+ if ('r' != applet0) /* not rmmod */
-+ load_dep_bb();
-
- /* Load/remove modules.
-- * Only rmmod loops here, modprobe has only argv[0] */
-+ * Only rmmod/modprobe -r loops here, insmod/modprobe has only argv[0] */
- do {
- process_module(*argv, options);
- } while (*++argv);
diff --git a/sys-apps/busybox/files/busybox-1.23.1-trylink-flags.patch b/sys-apps/busybox/files/busybox-1.23.1-trylink-flags.patch
deleted file mode 100644
index 13725cb..0000000
--- a/sys-apps/busybox/files/busybox-1.23.1-trylink-flags.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 6798564b9e2f1a81b8c2d0cb4add97cb736d982b Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Mon, 16 Mar 2015 17:47:01 -0400
-Subject: [PATCH] trylink: respect compiler settings when probing features
-
-The CPPFLAGS/CFLAGS settings might have features that matter, so make
-sure we utilize them when testing the compiler.
-
-URL: https://bugs.gentoo.org/471118
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- scripts/trylink | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/scripts/trylink b/scripts/trylink
-index 5a67fcf..48c487b 100755
---- a/scripts/trylink
-+++ b/scripts/trylink
-@@ -49,7 +49,7 @@ check_cc() {
- local tempname="$(mktemp)"
- # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :(
- # "-xc": C language. "/dev/null" is an empty source file.
-- if $CC $1 -shared -xc /dev/null -o "$tempname".o >/dev/null 2>&1; then
-+ if $CC $CPPFLAGS $CFLAGS $1 -shared -xc /dev/null -o "$tempname".o >/dev/null 2>&1; then
- echo "$1";
- else
- echo "$2";
-@@ -66,7 +66,7 @@ check_libc_is_glibc() {
- syntax error here
- #endif
- " >"$tempname".c
-- if $CC "$tempname".c -c -o "$tempname".o >/dev/null 2>&1; then
-+ if $CC $CPPFLAGS $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1; then
- echo "$2";
- else
- echo "$1";
---
-2.3.2
-
diff --git a/sys-apps/busybox/files/mdev-start.sh b/sys-apps/busybox/files/mdev-start.sh
deleted file mode 100644
index 8784cd5..0000000
--- a/sys-apps/busybox/files/mdev-start.sh
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-find_mdev()
-{
- if [ -x /sbin/mdev ] ; then
- echo "/sbin/mdev"
- else
- echo "/bin/busybox mdev"
- fi
-}
-
-populate_mdev()
-{
- # populate /dev with devices already found by the kernel
-
- if get_bootparam "nocoldplug" ; then
- RC_COLDPLUG="no"
- ewarn "Skipping mdev coldplug as requested in kernel cmdline"
- fi
-
- ebegin "Populating /dev with existing devices with mdev -s"
- $(find_mdev) -s
- eend $?
-
- return 0
-}
-
-seed_dev()
-{
- # Seed /dev with some things that we know we need
-
- # creating /dev/console and /dev/tty1 to be able to write
- # to $CONSOLE with/without bootsplash before mdev creates it
- [ -c /dev/console ] || mknod /dev/console c 5 1
- [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1
-
- # udevd will dup its stdin/stdout/stderr to /dev/null
- # and we do not want a file which gets buffered in ram
- [ -c /dev/null ] || mknod /dev/null c 1 3
-
- # copy over any persistant things
- if [ -d /lib/mdev/devices ] ; then
- cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
- fi
-
- # Not provided by sysfs but needed
- ln -snf /proc/self/fd /dev/fd
- ln -snf fd/0 /dev/stdin
- ln -snf fd/1 /dev/stdout
- ln -snf fd/2 /dev/stderr
- [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
-
- # Create problematic directories
- mkdir -p /dev/pts /dev/shm
-}
-
-mount_it_b1()
-{
- if [ "${RC_USE_FSTAB}" = "yes" ] ; then
- mntcmd=$(get_mount_fstab /dev)
- else
- unset mntcmd
- fi
- if [ -n "${mntcmd}" ] ; then
- try mount -n ${mntcmd}
- else
- if grep -Eq "[[:space:]]+tmpfs$" /proc/filesystems ; then
- mntcmd="tmpfs"
- else
- mntcmd="ramfs"
- fi
- # many video drivers require exec access in /dev #92921
- try mount -n -t "${mntcmd}" -o exec,nosuid,mode=0755 mdev /dev
- fi
-}
-mount_it_b2()
-{
- if fstabinfo --quiet /dev ; then
- mount -n /dev
- else
- # Some devices require exec, Bug #92921
- mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" mdev /dev
- fi
-}
-mount_it()
-{
- type fstabinfo && mount_it_b2 || mount_it_b1
-}
-
-main()
-{
- # Setup temporary storage for /dev
- ebegin "Mounting /dev for mdev"
- mount_it
- eend $?
-
- # Create a file so that our rc system knows it's still in sysinit.
- # Existance means init scripts will not directly run.
- # rc will remove the file when done with sysinit.
- touch /dev/.rcsysinit
-
- # Selinux lovin; /selinux should be mounted by selinux-patched init
- if [ -x /sbin/restorecon ] && [ -c /selinux/null ] ; then
- restorecon /dev > /selinux/null
- fi
-
- seed_dev
-
- # Setup hotplugging (if possible)
- if [ -e /proc/sys/kernel/hotplug ] ; then
- ebegin "Setting up proper hotplug agent"
- eindent
- einfo "Setting /sbin/mdev as hotplug agent ..."
- echo $(find_mdev) > /proc/sys/kernel/hotplug
- eoutdent
- eend 0
- fi
-
- populate_mdev
-}
-
-main
-
-# vim:ts=4
diff --git a/sys-apps/busybox/files/mdev.rc b/sys-apps/busybox/files/mdev.rc
deleted file mode 100644
index df55e25..0000000
--- a/sys-apps/busybox/files/mdev.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-start()
-{
- . /lib/rcscripts/addons/mdev-start.sh
-}
diff --git a/sys-apps/busybox/files/mdev.rc.1 b/sys-apps/busybox/files/mdev.rc.1
deleted file mode 100644
index 74cc8c6..0000000
--- a/sys-apps/busybox/files/mdev.rc.1
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-depend()
-{
- provide dev dev-mount
- need sysfs
-}
-
-find_mdev()
-{
- if [ -x /sbin/mdev ] ; then
- echo "/sbin/mdev"
- else
- echo "/bin/busybox mdev"
- fi
-}
-
-populate_mdev()
-{
- # populate /dev with devices already found by the kernel
-
- if get_bootparam "nocoldplug" ; then
- RC_COLDPLUG="no"
- ewarn "Skipping mdev coldplug as requested in kernel cmdline"
- fi
-
- ebegin "Populating /dev with existing devices with mdev -s"
- $(find_mdev) -s
- eend $?
-
- return 0
-}
-
-seed_dev()
-{
- # Seed /dev with some things that we know we need
-
- # creating /dev/console and /dev/tty1 to be able to write
- # to $CONSOLE with/without bootsplash before mdev creates it
- [ -c /dev/console ] || mknod /dev/console c 5 1
- [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1
-
- # udevd will dup its stdin/stdout/stderr to /dev/null
- # and we do not want a file which gets buffered in ram
- [ -c /dev/null ] || mknod /dev/null c 1 3
-
- # copy over any persistant things
- if [ -d /lib/mdev/devices ] ; then
- cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
- fi
-
- # Not provided by sysfs but needed
- ln -snf /proc/self/fd /dev/fd
- ln -snf fd/0 /dev/stdin
- ln -snf fd/1 /dev/stdout
- ln -snf fd/2 /dev/stderr
- [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
-
- # Create problematic directories
- mkdir -p /dev/pts /dev/shm
-}
-
-mount_it()
-{
- if fstabinfo --quiet /dev ; then
- mount -n /dev
- else
- # Some devices require exec, Bug #92921
- mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" mdev /dev
- fi
-}
-
-start()
-{
- # Setup temporary storage for /dev
- ebegin "Mounting /dev for mdev"
- mount_it
- eend $?
-
- # Create a file so that our rc system knows it's still in sysinit.
- # Existance means init scripts will not directly run.
- # rc will remove the file when done with sysinit.
- touch /dev/.rcsysinit
-
- seed_dev
-
- # Setup hotplugging (if possible)
- if [ -e /proc/sys/kernel/hotplug ] ; then
- ebegin "Setting up mdev as hotplug agent"
- echo $(find_mdev) > /proc/sys/kernel/hotplug
- eend 0
- fi
-
- populate_mdev
-}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/files/, sys-apps/busybox/
@ 2016-12-09 23:20 Mike Frysinger
0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2016-12-09 23:20 UTC (permalink / raw
To: gentoo-commits
commit: 168fd5c048be682fd985b197bc80370d57de1d57
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 9 23:20:09 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Dec 9 23:20:15 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=168fd5c0
sys-apps/busybox: fix build with USE=selinux #600106
sys-apps/busybox/busybox-1.25.1.ebuild | 2 +-
.../busybox/files/busybox-1.25.1-setfiles.patch | 34 ++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/sys-apps/busybox/busybox-1.25.1.ebuild b/sys-apps/busybox/busybox-1.25.1.ebuild
index 0e56819..7774872 100644
--- a/sys-apps/busybox/busybox-1.25.1.ebuild
+++ b/sys-apps/busybox/busybox-1.25.1.ebuild
@@ -68,7 +68,7 @@ src_prepare() {
# patches go here!
epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
-# epatch "${FILESDIR}"/${P}-*.patch
+ epatch "${FILESDIR}"/${P}-*.patch
cp "${FILESDIR}"/ginit.c init/ || die
# flag cleanup
diff --git a/sys-apps/busybox/files/busybox-1.25.1-setfiles.patch b/sys-apps/busybox/files/busybox-1.25.1-setfiles.patch
new file mode 100644
index 00000000..3a5f5ed
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.25.1-setfiles.patch
@@ -0,0 +1,34 @@
+From c1704a34745f8e49373eb2cbe1c83199ab2d0091 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 9 Dec 2016 18:14:12 -0500
+Subject: [PATCH] setfiles: fix build failure after common_bufsiz change
+
+Commit 47cfbf32fd66563f8c4e09ad6cced6abfbe2fad5 ("*: add most of the
+required setup_common_bufsiz() calls") switched this tool over to use
+the common_bufsiz logic but missed including the header leading to a
+build failure when enabled:
+selinux/setfiles.c:80:30: error: 'bb_common_bufsiz1' undeclared (first use in this function)
+
+URL: https://bugs.gentoo.org/600106
+Reported-by: Jonas Jelten <jj@stusta.net>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+(cherry picked from commit 1cda8790803a6fb072375c8fa53273333d2d4607)
+---
+ selinux/setfiles.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/selinux/setfiles.c b/selinux/setfiles.c
+index 51a7e63bd741..d8083d4fd580 100644
+--- a/selinux/setfiles.c
++++ b/selinux/setfiles.c
+@@ -46,6 +46,7 @@
+ //usage: "\n if it has changed"
+
+ #include "libbb.h"
++#include "common_bufsiz.h"
+ #if ENABLE_FEATURE_SETFILES_CHECK_OPTION
+ #include <sepol/sepol.h>
+ #endif
+--
+2.11.0.rc2
+
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/files/, sys-apps/busybox/
@ 2016-12-22 6:15 Mike Frysinger
0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2016-12-22 6:15 UTC (permalink / raw
To: gentoo-commits
commit: 7dba2ad13c919fee0db42be39e57e64ac4307c5a
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 22 06:07:29 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 22 06:07:29 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dba2ad1
sys-apps/busybox: drop old <1.25.1 versions
sys-apps/busybox/Manifest | 2 -
sys-apps/busybox/busybox-1.24.1.ebuild | 304 --------------------
sys-apps/busybox/busybox-1.24.2.ebuild | 305 ---------------------
.../files/busybox-1.24.1-trylink-ldflags.patch | 32 ---
.../files/busybox-1.24.1-unzip-regression.patch | 135 ---------
sys-apps/busybox/files/busybox-1.24.1-unzip.patch | 112 --------
.../files/busybox-1.24.2-CVE-2016-2147.patch | 72 -----
.../files/busybox-1.24.2-CVE-2016-2148.patch | 55 ----
.../busybox-1.24.2-ash-recursive-heredocs.patch | 83 ------
9 files changed, 1100 deletions(-)
diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
index de3680e..9f98c8d 100644
--- a/sys-apps/busybox/Manifest
+++ b/sys-apps/busybox/Manifest
@@ -1,3 +1 @@
-DIST busybox-1.24.1.tar.bz2 2068803 SHA256 37d03132cc078937360b392170b7a1d0e5b322eee9f57c0b82292a8b1f0afe3d SHA512 3afc757ebaae61ae13c2c69097ee734717434f9e658eb77093a8b7b49af3326cbca2d723483ff84a1da99544b822fd2b47d9a97c68f09962e11754e5daf124ca WHIRLPOOL 5e827d08d737caac832e7e5923da624094ff27ee2edbb46dadc339e95edba65378a8fa3db412682724476a2092eee41a804f8f36c2eec0b9f883f5ba855f3ad0
-DIST busybox-1.24.2.tar.bz2 2066822 SHA256 e71ef53ec656f31c42633918d301405d40dea1d97eca12f272217ae4a971c855 SHA512 4d20fb68ee440be2855231c7fd5f3cb9dd9bfcc1a688f0b59cd3f7a55c8819e9cc44bd15f91500713571f2a84e5e44adc0fa8ae0ae3ebf63961dfc9e1c9ef8e0 WHIRLPOOL 2d89e3fded8d61567873acdb1e1e21888a4447e19c1b893543bbe82de52e8e3cf091adb10f34aa155da573994d89ae42f40ecce65ec0d32a641d103c8d8ce053
DIST busybox-1.25.1.tar.bz2 2103070 SHA256 27667e0f2328fdbd79cfd622e4453e5c57e58f781c5da97c9be337d93aa2a02e SHA512 9648877ed11e5a55213cd14fd64f6fc64dbd17013fbfaa4e67f4fd433f59e9231ed78a88e6e8100a4794d833f1d9863bb86f75faae093418866770804bf873cb WHIRLPOOL 4b7bc6d3a88559812797feb4574975b9fdeb6eac6ac7a0fe51e4750a3b05a614ecb8bd9d58547047cdf1e0b66d9bcd189c8a4193fc2f3b491a6268bc06761ad1
diff --git a/sys-apps/busybox/busybox-1.24.1.ebuild b/sys-apps/busybox/busybox-1.24.1.ebuild
deleted file mode 100644
index fdc9571..00000000
--- a/sys-apps/busybox/busybox-1.24.1.ebuild
+++ /dev/null
@@ -1,304 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
-
-EAPI="4"
-inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
-
-DESCRIPTION="Utilities for rescue and embedded systems"
-HOMEPAGE="https://www.busybox.net/"
-if [[ ${PV} == "9999" ]] ; then
- MY_P=${PN}
- EGIT_REPO_URI="git://busybox.net/busybox.git"
- inherit git-2
-else
- MY_P=${PN}-${PV/_/-}
- SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
- KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
-fi
-
-LICENSE="GPL-2" # GPL-2 only
-SLOT="0"
-IUSE="debug ipv6 livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
-RESTRICT="test"
-
-COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
- pam? ( sys-libs/pam )"
-DEPEND="${COMMON_DEPEND}
- static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
- >=sys-kernel/linux-headers-2.6.39"
-RDEPEND="${COMMON_DEPEND}
- mdev? ( !<sys-apps/openrc-0.13 )"
-
-S=${WORKDIR}/${MY_P}
-
-busybox_config_option() {
- local flag=$1 ; shift
- if [[ ${flag} != [yn] ]] ; then
- busybox_config_option $(usex ${flag} y n) "$@"
- return
- fi
- while [[ $# -gt 0 ]] ; do
- if [[ ${flag} == "y" ]] ; then
- sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
- else
- sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
- fi
- einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
- shift
- done
-}
-
-busybox_config_enabled() {
- local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
- case ${val} in
- "") return 1 ;;
- y) return 0 ;;
- *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
- esac
-}
-
-src_prepare() {
- unset KBUILD_OUTPUT #88088
- append-flags -fno-strict-aliasing #310413
- use ppc64 && append-flags -mminimal-toc #130943
-
- # patches go here!
- epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
- epatch "${FILESDIR}"/busybox-1.24.1-trylink-ldflags.patch
- epatch "${FILESDIR}"/busybox-1.24.1-unzip.patch
- epatch "${FILESDIR}"/busybox-1.24.1-unzip-regression.patch
- cp "${FILESDIR}"/ginit.c init/ || die
-
- # flag cleanup
- sed -i -r \
- -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
- Makefile.flags || die
- #sed -i '/bbsh/s:^//::' include/applets.h
- sed -i '/^#error Aborting compilation./d' applets/applets.c || die
- use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
- sed -i \
- -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
- -e "/^AR\>/s:=.*:= $(tc-getAR):" \
- -e "/^CC\>/s:=.*:= $(tc-getCC):" \
- -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
- -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
- Makefile || die
- sed -i \
- -e 's:-static-libgcc::' \
- Makefile.flags || die
-}
-
-src_configure() {
- # check for a busybox config before making one of our own.
- # if one exist lets return and use it.
-
- restore_config .config
- if [ -f .config ]; then
- yes "" | emake -j1 -s oldconfig >/dev/null
- return 0
- else
- ewarn "Could not locate user configfile, so we will save a default one"
- fi
-
- # setup the config file
- emake -j1 -s allyesconfig >/dev/null
- # nommu forces a bunch of things off which we want on #387555
- busybox_config_option n NOMMU
- sed -i '/^#/d' .config
- yes "" | emake -j1 -s oldconfig >/dev/null
-
- # now turn off stuff we really don't want
- busybox_config_option n DMALLOC
- busybox_config_option n FEATURE_SUID_CONFIG
- busybox_config_option n BUILD_AT_ONCE
- busybox_config_option n BUILD_LIBBUSYBOX
- busybox_config_option n FEATURE_CLEAN_UP
- busybox_config_option n MONOTONIC_SYSCALL
- busybox_config_option n USE_PORTABLE_CODE
- busybox_config_option n WERROR
-
- # If these are not set and we are using a uclibc/busybox setup
- # all calls to system() will fail.
- busybox_config_option y ASH
- busybox_config_option n HUSH
-
- # disable ipv6 applets
- if ! use ipv6; then
- busybox_config_option n FEATURE_IPV6
- busybox_config_option n TRACEROUTE6
- busybox_config_option n PING6
- busybox_config_option n UDHCPC6
- fi
-
- if use static && use pam ; then
- ewarn "You cannot have USE='static pam'. Assuming static is more important."
- fi
- busybox_config_option $(usex static n pam) PAM
- busybox_config_option static STATIC
- busybox_config_option syslog {K,SYS}LOGD LOGGER
- busybox_config_option systemd FEATURE_SYSTEMD
- busybox_config_option math FEATURE_AWK_LIBM
-
- # all the debug options are compiler related, so punt them
- busybox_config_option n DEBUG
- busybox_config_option y NO_DEBUG_LIB
- busybox_config_option n DMALLOC
- busybox_config_option n EFENCE
- busybox_config_option $(usex debug y n) TFTP_DEBUG
-
- busybox_config_option selinux SELINUX
-
- # this opt only controls mounting with <linux-2.6.23
- busybox_config_option n FEATURE_MOUNT_NFS
-
- # default a bunch of uncommon options to off
- local opt
- for opt in \
- ADD_SHELL \
- BEEP BOOTCHARTD \
- CRONTAB \
- DC DEVFSD DNSD DPKG{,_DEB} \
- FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
- FEATURE_DEVFS \
- HOSTID HUSH \
- INETD INOTIFYD IPCALC \
- LOCALE_SUPPORT LOGNAME LPD \
- MAKEMIME MKFS_MINIX MSH \
- OD \
- RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
- SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
- TASKSET TCPSVD \
- RPM RPM2CPIO \
- UDPSVD UUDECODE UUENCODE
- do
- busybox_config_option n ${opt}
- done
-
- emake -j1 oldconfig > /dev/null
-}
-
-src_compile() {
- unset KBUILD_OUTPUT #88088
- export SKIP_STRIP=y
-
- emake V=1 busybox
-}
-
-src_install() {
- unset KBUILD_OUTPUT #88088
- save_config .config
-
- into /
- dodir /bin
- if use sep-usr ; then
- # install /ginit to take care of mounting stuff
- exeinto /
- newexe busybox_unstripped ginit
- dosym /ginit /bin/bb
- dosym bb /bin/busybox
- else
- newbin busybox_unstripped busybox
- dosym busybox /bin/bb
- fi
- if use mdev ; then
- dodir /$(get_libdir)/mdev/
- use make-symlinks || dosym /bin/bb /sbin/mdev
- cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
-
- exeinto /$(get_libdir)/mdev/
- doexe "${FILESDIR}"/mdev/*
-
- newinitd "${FILESDIR}"/mdev.initd mdev
- fi
- if use livecd ; then
- dosym busybox /bin/vi
- fi
-
- # add busybox daemon's, bug #444718
- if busybox_config_enabled FEATURE_NTPD_SERVER; then
- newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
- newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
- fi
- if busybox_config_enabled SYSLOGD; then
- newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
- newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
- fi
- if busybox_config_enabled KLOGD; then
- newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
- newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
- fi
- if busybox_config_enabled WATCHDOG; then
- newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
- newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
- fi
- if busybox_config_enabled UDHCPC; then
- local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
- exeinto "${path%/*}"
- newexe examples/udhcp/simple.script "${path##*/}"
- fi
- if busybox_config_enabled UDHCPD; then
- insinto /etc
- doins examples/udhcp/udhcpd.conf
- fi
-
- # bundle up the symlink files for use later
- emake DESTDIR="${ED}" install
- rm _install/bin/busybox
- # for compatibility, provide /usr/bin/env
- mkdir -p _install/usr/bin
- ln -s /bin/env _install/usr/bin/env
- tar cf busybox-links.tar -C _install . || : #;die
- insinto /usr/share/${PN}
- use make-symlinks && doins busybox-links.tar
-
- dodoc AUTHORS README TODO
-
- cd docs
- docinto txt
- dodoc *.txt
- docinto pod
- dodoc *.pod
- dohtml *.html
-
- cd ../examples
- docinto examples
- dodoc inittab depmod.pl *.conf *.script undeb unrpm
-}
-
-pkg_preinst() {
- if use make-symlinks && [[ ! ${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 really what you want."
- die "silly options will destroy your system"
- fi
-
- if use make-symlinks ; then
- mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
- fi
-}
-
-pkg_postinst() {
- savedconfig_pkg_postinst
-
- if use make-symlinks ; then
- cd "${T}" || die
- mkdir _install
- tar xf busybox-links.tar -C _install || die
- cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
- fi
-
- if use sep-usr ; then
- elog "In order to use the sep-usr support, you have to update your"
- elog "kernel command line. Add the option:"
- elog " init=/ginit"
- elog "To launch a different init than /sbin/init, use:"
- elog " init=/ginit /sbin/yourinit"
- elog "To get a rescue shell, you may boot with:"
- elog " init=/ginit bb"
- fi
-}
diff --git a/sys-apps/busybox/busybox-1.24.2.ebuild b/sys-apps/busybox/busybox-1.24.2.ebuild
deleted file mode 100644
index 39decea..00000000
--- a/sys-apps/busybox/busybox-1.24.2.ebuild
+++ /dev/null
@@ -1,305 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
-
-EAPI="4"
-inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
-
-DESCRIPTION="Utilities for rescue and embedded systems"
-HOMEPAGE="https://www.busybox.net/"
-if [[ ${PV} == "9999" ]] ; then
- MY_P=${PN}
- EGIT_REPO_URI="git://busybox.net/busybox.git"
- inherit git-2
-else
- MY_P=${PN}-${PV/_/-}
- SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
- KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
-fi
-
-LICENSE="GPL-2" # GPL-2 only
-SLOT="0"
-IUSE="debug ipv6 livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
-RESTRICT="test"
-
-COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
- pam? ( sys-libs/pam )"
-DEPEND="${COMMON_DEPEND}
- static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
- >=sys-kernel/linux-headers-2.6.39"
-RDEPEND="${COMMON_DEPEND}
- mdev? ( !<sys-apps/openrc-0.13 )"
-
-S=${WORKDIR}/${MY_P}
-
-busybox_config_option() {
- local flag=$1 ; shift
- if [[ ${flag} != [yn] ]] ; then
- busybox_config_option $(usex ${flag} y n) "$@"
- return
- fi
- while [[ $# -gt 0 ]] ; do
- if [[ ${flag} == "y" ]] ; then
- sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
- else
- sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
- fi
- einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
- shift
- done
-}
-
-busybox_config_enabled() {
- local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
- case ${val} in
- "") return 1 ;;
- y) return 0 ;;
- *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
- esac
-}
-
-src_prepare() {
- unset KBUILD_OUTPUT #88088
- append-flags -fno-strict-aliasing #310413
- use ppc64 && append-flags -mminimal-toc #130943
-
- # patches go here!
- epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
- epatch "${FILESDIR}"/busybox-1.24.1-trylink-ldflags.patch
- epatch "${FILESDIR}"/busybox-1.24.2-ash-recursive-heredocs.patch
- epatch "${FILESDIR}"/busybox-1.24.2-CVE-2016-2147.patch
- epatch "${FILESDIR}"/busybox-1.24.2-CVE-2016-2148.patch
- cp "${FILESDIR}"/ginit.c init/ || die
-
- # flag cleanup
- sed -i -r \
- -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
- Makefile.flags || die
- #sed -i '/bbsh/s:^//::' include/applets.h
- sed -i '/^#error Aborting compilation./d' applets/applets.c || die
- use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
- sed -i \
- -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
- -e "/^AR\>/s:=.*:= $(tc-getAR):" \
- -e "/^CC\>/s:=.*:= $(tc-getCC):" \
- -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
- -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
- Makefile || die
- sed -i \
- -e 's:-static-libgcc::' \
- Makefile.flags || die
-}
-
-src_configure() {
- # check for a busybox config before making one of our own.
- # if one exist lets return and use it.
-
- restore_config .config
- if [ -f .config ]; then
- yes "" | emake -j1 -s oldconfig >/dev/null
- return 0
- else
- ewarn "Could not locate user configfile, so we will save a default one"
- fi
-
- # setup the config file
- emake -j1 -s allyesconfig >/dev/null
- # nommu forces a bunch of things off which we want on #387555
- busybox_config_option n NOMMU
- sed -i '/^#/d' .config
- yes "" | emake -j1 -s oldconfig >/dev/null
-
- # now turn off stuff we really don't want
- busybox_config_option n DMALLOC
- busybox_config_option n FEATURE_SUID_CONFIG
- busybox_config_option n BUILD_AT_ONCE
- busybox_config_option n BUILD_LIBBUSYBOX
- busybox_config_option n FEATURE_CLEAN_UP
- busybox_config_option n MONOTONIC_SYSCALL
- busybox_config_option n USE_PORTABLE_CODE
- busybox_config_option n WERROR
-
- # If these are not set and we are using a uclibc/busybox setup
- # all calls to system() will fail.
- busybox_config_option y ASH
- busybox_config_option n HUSH
-
- # disable ipv6 applets
- if ! use ipv6; then
- busybox_config_option n FEATURE_IPV6
- busybox_config_option n TRACEROUTE6
- busybox_config_option n PING6
- busybox_config_option n UDHCPC6
- fi
-
- if use static && use pam ; then
- ewarn "You cannot have USE='static pam'. Assuming static is more important."
- fi
- busybox_config_option $(usex static n pam) PAM
- busybox_config_option static STATIC
- busybox_config_option syslog {K,SYS}LOGD LOGGER
- busybox_config_option systemd FEATURE_SYSTEMD
- busybox_config_option math FEATURE_AWK_LIBM
-
- # all the debug options are compiler related, so punt them
- busybox_config_option n DEBUG
- busybox_config_option y NO_DEBUG_LIB
- busybox_config_option n DMALLOC
- busybox_config_option n EFENCE
- busybox_config_option $(usex debug y n) TFTP_DEBUG
-
- busybox_config_option selinux SELINUX
-
- # this opt only controls mounting with <linux-2.6.23
- busybox_config_option n FEATURE_MOUNT_NFS
-
- # default a bunch of uncommon options to off
- local opt
- for opt in \
- ADD_SHELL \
- BEEP BOOTCHARTD \
- CRONTAB \
- DC DEVFSD DNSD DPKG{,_DEB} \
- FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
- FEATURE_DEVFS \
- HOSTID HUSH \
- INETD INOTIFYD IPCALC \
- LOCALE_SUPPORT LOGNAME LPD \
- MAKEMIME MKFS_MINIX MSH \
- OD \
- RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
- SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
- TASKSET TCPSVD \
- RPM RPM2CPIO \
- UDPSVD UUDECODE UUENCODE
- do
- busybox_config_option n ${opt}
- done
-
- emake -j1 oldconfig > /dev/null
-}
-
-src_compile() {
- unset KBUILD_OUTPUT #88088
- export SKIP_STRIP=y
-
- emake V=1 busybox
-}
-
-src_install() {
- unset KBUILD_OUTPUT #88088
- save_config .config
-
- into /
- dodir /bin
- if use sep-usr ; then
- # install /ginit to take care of mounting stuff
- exeinto /
- newexe busybox_unstripped ginit
- dosym /ginit /bin/bb
- dosym bb /bin/busybox
- else
- newbin busybox_unstripped busybox
- dosym busybox /bin/bb
- fi
- if use mdev ; then
- dodir /$(get_libdir)/mdev/
- use make-symlinks || dosym /bin/bb /sbin/mdev
- cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
-
- exeinto /$(get_libdir)/mdev/
- doexe "${FILESDIR}"/mdev/*
-
- newinitd "${FILESDIR}"/mdev.initd mdev
- fi
- if use livecd ; then
- dosym busybox /bin/vi
- fi
-
- # add busybox daemon's, bug #444718
- if busybox_config_enabled FEATURE_NTPD_SERVER; then
- newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
- newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
- fi
- if busybox_config_enabled SYSLOGD; then
- newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
- newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
- fi
- if busybox_config_enabled KLOGD; then
- newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
- newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
- fi
- if busybox_config_enabled WATCHDOG; then
- newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
- newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
- fi
- if busybox_config_enabled UDHCPC; then
- local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
- exeinto "${path%/*}"
- newexe examples/udhcp/simple.script "${path##*/}"
- fi
- if busybox_config_enabled UDHCPD; then
- insinto /etc
- doins examples/udhcp/udhcpd.conf
- fi
-
- # bundle up the symlink files for use later
- emake DESTDIR="${ED}" install
- rm _install/bin/busybox
- # for compatibility, provide /usr/bin/env
- mkdir -p _install/usr/bin
- ln -s /bin/env _install/usr/bin/env
- tar cf busybox-links.tar -C _install . || : #;die
- insinto /usr/share/${PN}
- use make-symlinks && doins busybox-links.tar
-
- dodoc AUTHORS README TODO
-
- cd docs
- docinto txt
- dodoc *.txt
- docinto pod
- dodoc *.pod
- dohtml *.html
-
- cd ../examples
- docinto examples
- dodoc inittab depmod.pl *.conf *.script undeb unrpm
-}
-
-pkg_preinst() {
- if use make-symlinks && [[ ! ${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 really what you want."
- die "silly options will destroy your system"
- fi
-
- if use make-symlinks ; then
- mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
- fi
-}
-
-pkg_postinst() {
- savedconfig_pkg_postinst
-
- if use make-symlinks ; then
- cd "${T}" || die
- mkdir _install
- tar xf busybox-links.tar -C _install || die
- cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
- fi
-
- if use sep-usr ; then
- elog "In order to use the sep-usr support, you have to update your"
- elog "kernel command line. Add the option:"
- elog " init=/ginit"
- elog "To launch a different init than /sbin/init, use:"
- elog " init=/ginit /sbin/yourinit"
- elog "To get a rescue shell, you may boot with:"
- elog " init=/ginit bb"
- fi
-}
diff --git a/sys-apps/busybox/files/busybox-1.24.1-trylink-ldflags.patch b/sys-apps/busybox/files/busybox-1.24.1-trylink-ldflags.patch
deleted file mode 100644
index 9d61ceb..00000000
--- a/sys-apps/busybox/files/busybox-1.24.1-trylink-ldflags.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 77e2bde6a50f0f6b9b3c9983c86e661a9872b5f6 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Tue, 1 Dec 2015 11:25:10 -0500
-Subject: [PATCH] trylink: include LDFLAGS when checking linkage
-
-The user might be including options in their LDFLAGS (like -fuse-ld=gold)
-that change the behavior of the linker and thus change the results of the
-flag tests. Make sure we include the user's LDFLAGS when running these
-tests so we filter out flags that will fail when used later on.
-
-URL: https://bugs.gentoo.org/499712
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- scripts/trylink | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/scripts/trylink b/scripts/trylink
-index 6e1187e..3c431ed 100755
---- a/scripts/trylink
-+++ b/scripts/trylink
-@@ -54,7 +54,7 @@ check_cc() {
- # "eval" may be needed if CFLAGS can contain
- # '... -D"BB_VER=KBUILD_STR(1.N.M)" ...'
- # and we need shell to process quotes!
-- $CC $CFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1
-+ $CC $CFLAGS $LDFLAGS $1 "$tempname".c -o "$tempname" >/dev/null 2>&1
- r=$?
- rm -f "$tempname" "$tempname".c "$tempname".o
- return $r
---
-2.6.2
-
diff --git a/sys-apps/busybox/files/busybox-1.24.1-unzip-regression.patch b/sys-apps/busybox/files/busybox-1.24.1-unzip-regression.patch
deleted file mode 100644
index 58d7b7c..00000000
--- a/sys-apps/busybox/files/busybox-1.24.1-unzip-regression.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-From 092fabcf1df5d46cd22be4ffcd3b871f6180eb9c Mon Sep 17 00:00:00 2001
-From: Denys Vlasenko <vda.linux@googlemail.com>
-Date: Fri, 30 Oct 2015 23:41:53 +0100
-Subject: [PATCH] [g]unzip: fix recent breakage.
-
-Also, do emit error message we so painstakingly pass from gzip internals
-
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-(cherry picked from commit 6bd3fff51aa74e2ee2d87887b12182a3b09792ef)
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- archival/libarchive/decompress_gunzip.c | 33 +++++++++++++++++++++------------
- testsuite/unzip.tests | 1 +
- 2 files changed, 22 insertions(+), 12 deletions(-)
-
-diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
-index c76fd31..357c9bf 100644
---- a/archival/libarchive/decompress_gunzip.c
-+++ b/archival/libarchive/decompress_gunzip.c
-@@ -309,8 +309,7 @@ static int huft_build(const unsigned *b, const unsigned n,
- huft_t *q; /* points to current table */
- huft_t r; /* table entry for structure assignment */
- huft_t *u[BMAX]; /* table stack */
-- unsigned v[N_MAX]; /* values in order of bit length */
-- unsigned v_end;
-+ unsigned v[N_MAX + 1]; /* values in order of bit length. last v[] is never used */
- int ws[BMAX + 1]; /* bits decoded stack */
- int w; /* bits decoded */
- unsigned x[BMAX + 1]; /* bit offsets, then code stack */
-@@ -365,15 +364,17 @@ static int huft_build(const unsigned *b, const unsigned n,
- *xp++ = j;
- }
-
-- /* Make a table of values in order of bit lengths */
-+ /* Make a table of values in order of bit lengths.
-+ * To detect bad input, unused v[i]'s are set to invalid value UINT_MAX.
-+ * In particular, last v[i] is never filled and must not be accessed.
-+ */
-+ memset(v, 0xff, sizeof(v));
- p = b;
- i = 0;
-- v_end = 0;
- do {
- j = *p++;
- if (j != 0) {
- v[x[j]++] = i;
-- v_end = x[j];
- }
- } while (++i < n);
-
-@@ -435,7 +436,9 @@ static int huft_build(const unsigned *b, const unsigned n,
-
- /* set up table entry in r */
- r.b = (unsigned char) (k - w);
-- if (p >= v + v_end) { // Was "if (p >= v + n)" but v[] can be shorter!
-+ if (/*p >= v + n || -- redundant, caught by the second check: */
-+ *p == UINT_MAX /* do we access uninited v[i]? (see memset(v))*/
-+ ) {
- r.e = 99; /* out of values--invalid code */
- } else if (*p < s) {
- r.e = (unsigned char) (*p < 256 ? 16 : 15); /* 256 is EOB code */
-@@ -520,8 +523,9 @@ static NOINLINE int inflate_codes(STATE_PARAM_ONLY)
- e = t->e;
- if (e > 16)
- do {
-- if (e == 99)
-- abort_unzip(PASS_STATE_ONLY);;
-+ if (e == 99) {
-+ abort_unzip(PASS_STATE_ONLY);
-+ }
- bb >>= t->b;
- k -= t->b;
- e -= 16;
-@@ -557,8 +561,9 @@ static NOINLINE int inflate_codes(STATE_PARAM_ONLY)
- e = t->e;
- if (e > 16)
- do {
-- if (e == 99)
-+ if (e == 99) {
- abort_unzip(PASS_STATE_ONLY);
-+ }
- bb >>= t->b;
- k -= t->b;
- e -= 16;
-@@ -824,8 +829,9 @@ static int inflate_block(STATE_PARAM smallint *e)
-
- b_dynamic >>= 4;
- k_dynamic -= 4;
-- if (nl > 286 || nd > 30)
-+ if (nl > 286 || nd > 30) {
- abort_unzip(PASS_STATE_ONLY); /* bad lengths */
-+ }
-
- /* read in bit-length-code lengths */
- for (j = 0; j < nb; j++) {
-@@ -906,12 +912,14 @@ static int inflate_block(STATE_PARAM smallint *e)
- bl = lbits;
-
- i = huft_build(ll, nl, 257, cplens, cplext, &inflate_codes_tl, &bl);
-- if (i != 0)
-+ if (i != 0) {
- abort_unzip(PASS_STATE_ONLY);
-+ }
- bd = dbits;
- i = huft_build(ll + nl, nd, 0, cpdist, cpdext, &inflate_codes_td, &bd);
-- if (i != 0)
-+ if (i != 0) {
- abort_unzip(PASS_STATE_ONLY);
-+ }
-
- /* set up data for inflate_codes() */
- inflate_codes_setup(PASS_STATE bl, bd);
-@@ -999,6 +1007,7 @@ inflate_unzip_internal(STATE_PARAM transformer_state_t *xstate)
- error_msg = "corrupted data";
- if (setjmp(error_jmp)) {
- /* Error from deep inside zip machinery */
-+ bb_error_msg(error_msg);
- n = -1;
- goto ret;
- }
-diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
-index ca0a458..d8738a3 100755
---- a/testsuite/unzip.tests
-+++ b/testsuite/unzip.tests
-@@ -34,6 +34,7 @@ rm foo.zip
- testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \
- "Archive: bad.zip
- inflating: ]3j½r«I^[\x12K-%Ix
-+unzip: corrupted data
- unzip: inflate error
- 1
- " \
---
-2.6.2
-
diff --git a/sys-apps/busybox/files/busybox-1.24.1-unzip.patch b/sys-apps/busybox/files/busybox-1.24.1-unzip.patch
deleted file mode 100644
index 722b5fb..00000000
--- a/sys-apps/busybox/files/busybox-1.24.1-unzip.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-https://bugs.gentoo.org/564246
-
-From 1de25a6e87e0e627aa34298105a3d17c60a1f44e Mon Sep 17 00:00:00 2001
-From: Denys Vlasenko <vda.linux@googlemail.com>
-Date: Mon, 26 Oct 2015 19:33:05 +0100
-Subject: [PATCH] unzip: test for bad archive SEGVing
-
-function old new delta
-huft_build 1296 1300 +4
-
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
----
- archival/libarchive/decompress_gunzip.c | 11 +++++++----
- testsuite/unzip.tests | 23 ++++++++++++++++++++++-
- 2 files changed, 29 insertions(+), 5 deletions(-)
-
-diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c
-index 7b6f459..30bf451 100644
---- a/archival/libarchive/decompress_gunzip.c
-+++ b/archival/libarchive/decompress_gunzip.c
-@@ -305,11 +305,12 @@ static int huft_build(const unsigned *b, const unsigned n,
- unsigned i; /* counter, current code */
- unsigned j; /* counter */
- int k; /* number of bits in current code */
-- unsigned *p; /* pointer into c[], b[], or v[] */
-+ const unsigned *p; /* pointer into c[], b[], or v[] */
- huft_t *q; /* points to current table */
- huft_t r; /* table entry for structure assignment */
- huft_t *u[BMAX]; /* table stack */
- unsigned v[N_MAX]; /* values in order of bit length */
-+ unsigned v_end;
- int ws[BMAX + 1]; /* bits decoded stack */
- int w; /* bits decoded */
- unsigned x[BMAX + 1]; /* bit offsets, then code stack */
-@@ -324,7 +325,7 @@ static int huft_build(const unsigned *b, const unsigned n,
-
- /* Generate counts for each bit length */
- memset(c, 0, sizeof(c));
-- p = (unsigned *) b; /* cast allows us to reuse p for pointing to b */
-+ p = b;
- i = n;
- do {
- c[*p]++; /* assume all entries <= BMAX */
-@@ -365,12 +366,14 @@ static int huft_build(const unsigned *b, const unsigned n,
- }
-
- /* Make a table of values in order of bit lengths */
-- p = (unsigned *) b;
-+ p = b;
- i = 0;
-+ v_end = 0;
- do {
- j = *p++;
- if (j != 0) {
- v[x[j]++] = i;
-+ v_end = x[j];
- }
- } while (++i < n);
-
-@@ -432,7 +435,7 @@ static int huft_build(const unsigned *b, const unsigned n,
-
- /* set up table entry in r */
- r.b = (unsigned char) (k - w);
-- if (p >= v + n) {
-+ if (p >= v + v_end) { // Was "if (p >= v + n)" but v[] can be shorter!
- r.e = 99; /* out of values--invalid code */
- } else if (*p < s) {
- r.e = (unsigned char) (*p < 256 ? 16 : 15); /* 256 is EOB code */
-diff --git a/testsuite/unzip.tests b/testsuite/unzip.tests
-index 8677a03..ca0a458 100755
---- a/testsuite/unzip.tests
-+++ b/testsuite/unzip.tests
-@@ -7,7 +7,7 @@
-
- . ./testing.sh
-
--# testing "test name" "options" "expected result" "file input" "stdin"
-+# testing "test name" "commands" "expected result" "file input" "stdin"
- # file input will be file called "input"
- # test can create a file "actual" instead of writing to stdout
-
-@@ -30,6 +30,27 @@ testing "unzip (subdir only)" "unzip -q foo.zip foo/ && test -d foo && test ! -f
- rmdir foo
- rm foo.zip
-
-+# File containing some damaged encrypted stream
-+testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \
-+"Archive: bad.zip
-+ inflating: ]3j½r«I^[\x12K-%Ix
-+unzip: inflate error
-+1
-+" \
-+"" "\
-+begin-base64 644 bad.zip
-+UEsDBBQAAgkIAAAAIQA5AAAANwAAADwAAAAQAAcAXTNqwr1ywqtJGxJLLSVJ
-+eCkBD0AdKBk8JzQsIj01JC0/ORJQSwMEFAECCAAAAAAhADoAAAAPAAAANgAA
-+AAwAAQASw73Ct1DCokohPXQiNjoUNTUiHRwgLT4WHlBLAQIQABQAAggIAAAA
-+oQA5AAAANwAAADwAAAAQQAcADAAAACwAMgCAAAAAAABdM2rCvXLCq0kbEkst
-+JUl4KQEPQB0oGSY4Cz4QNgEnJSYIPVBLAQIAABQAAggAAAAAIQAqAAAADwAA
-+BDYAAAAMAAEADQAAADIADQAAAEEAAAASw73Ct1DKokohPXQiNzA+FAI1HCcW
-+NzITNFBLBQUKAC4JAA04Cw0EOhZQSwUGAQAABAIAAgCZAAAAeQAAAAIALhM=
-+====
-+"
-+
-+rm *
-+
- # Clean up scratch directory.
-
- cd ..
---
-2.6.2
-
diff --git a/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2147.patch b/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2147.patch
deleted file mode 100644
index 2187c9b..00000000
--- a/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2147.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 3c4de6e36c4d387a648622e7b828a05f2b1b47e6 Mon Sep 17 00:00:00 2001
-From: Denys Vlasenko <vda.linux@googlemail.com>
-Date: Fri, 26 Feb 2016 15:54:56 +0100
-Subject: [PATCH] udhcpc: fix OPTION_6RD parsing (could overflow its malloced
- buffer)
-
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-(cherry picked from commit 352f79acbd759c14399e39baef21fc4ffe180ac2)
----
- networking/udhcp/common.c | 15 +++++++++++++--
- networking/udhcp/dhcpc.c | 4 ++--
- 2 files changed, 15 insertions(+), 4 deletions(-)
-
-diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
-index bc41c8d..680852c 100644
---- a/networking/udhcp/common.c
-+++ b/networking/udhcp/common.c
-@@ -142,7 +142,7 @@ const char dhcp_option_strings[] ALIGN1 =
- * udhcp_str2optset: to determine how many bytes to allocate.
- * xmalloc_optname_optval: to estimate string length
- * from binary option length: (option[LEN] / dhcp_option_lengths[opt_type])
-- * is the number of elements, multiply in by one element's string width
-+ * is the number of elements, multiply it by one element's string width
- * (len_of_option_as_string[opt_type]) and you know how wide string you need.
- */
- const uint8_t dhcp_option_lengths[] ALIGN1 = {
-@@ -162,7 +162,18 @@ const uint8_t dhcp_option_lengths[] ALIGN1 = {
- [OPTION_S32] = 4,
- /* Just like OPTION_STRING, we use minimum length here */
- [OPTION_STATIC_ROUTES] = 5,
-- [OPTION_6RD] = 22, /* ignored by udhcp_str2optset */
-+ [OPTION_6RD] = 12, /* ignored by udhcp_str2optset */
-+ /* The above value was chosen as follows:
-+ * len_of_option_as_string[] for this option is >60: it's a string of the form
-+ * "32 128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 255.255.255.255 ".
-+ * Each additional ipv4 address takes 4 bytes in binary option and appends
-+ * another "255.255.255.255 " 16-byte string. We can set [OPTION_6RD] = 4
-+ * but this severely overestimates string length: instead of 16 bytes,
-+ * it adds >60 for every 4 bytes in binary option.
-+ * We cheat and declare here that option is in units of 12 bytes.
-+ * This adds more than 60 bytes for every three ipv4 addresses - more than enough.
-+ * (Even 16 instead of 12 should work, but let's be paranoid).
-+ */
- };
-
-
-diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
-index 915f659..2332b57 100644
---- a/networking/udhcp/dhcpc.c
-+++ b/networking/udhcp/dhcpc.c
-@@ -113,7 +113,7 @@ static const uint8_t len_of_option_as_string[] = {
- [OPTION_IP ] = sizeof("255.255.255.255 "),
- [OPTION_IP_PAIR ] = sizeof("255.255.255.255 ") * 2,
- [OPTION_STATIC_ROUTES ] = sizeof("255.255.255.255/32 255.255.255.255 "),
-- [OPTION_6RD ] = sizeof("32 128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 255.255.255.255 "),
-+ [OPTION_6RD ] = sizeof("132 128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 255.255.255.255 "),
- [OPTION_STRING ] = 1,
- [OPTION_STRING_HOST ] = 1,
- #if ENABLE_FEATURE_UDHCP_RFC3397
-@@ -220,7 +220,7 @@ static NOINLINE char *xmalloc_optname_optval(uint8_t *option, const struct dhcp_
- type = optflag->flags & OPTION_TYPE_MASK;
- optlen = dhcp_option_lengths[type];
- upper_length = len_of_option_as_string[type]
-- * ((unsigned)(len + optlen - 1) / (unsigned)optlen);
-+ * ((unsigned)(len + optlen) / (unsigned)optlen);
-
- dest = ret = xmalloc(upper_length + strlen(opt_name) + 2);
- dest += sprintf(ret, "%s=", opt_name);
---
-2.7.4
-
diff --git a/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2148.patch b/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2148.patch
deleted file mode 100644
index 08e08be..00000000
--- a/sys-apps/busybox/files/busybox-1.24.2-CVE-2016-2148.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 3a76bb5136d05f94ee62e377aa723e63444912c7 Mon Sep 17 00:00:00 2001
-From: Denys Vlasenko <vda.linux@googlemail.com>
-Date: Thu, 10 Mar 2016 11:47:58 +0100
-Subject: [PATCH] udhcp: fix a SEGV on malformed RFC1035-encoded domain name
-
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-(cherry picked from commit d474ffc68290e0a83651c4432eeabfa62cd51e87)
----
- networking/udhcp/domain_codec.c | 13 +++++++++----
- 1 file changed, 9 insertions(+), 4 deletions(-)
-
-diff --git a/networking/udhcp/domain_codec.c b/networking/udhcp/domain_codec.c
-index c1325d8..8429367 100644
---- a/networking/udhcp/domain_codec.c
-+++ b/networking/udhcp/domain_codec.c
-@@ -63,11 +63,10 @@ char* FAST_FUNC dname_dec(const uint8_t *cstr, int clen, const char *pre)
- if (crtpos + *c + 1 > clen) /* label too long? abort */
- return NULL;
- if (dst)
-- memcpy(dst + len, c + 1, *c);
-+ /* \3com ---> "com." */
-+ ((char*)mempcpy(dst + len, c + 1, *c))[0] = '.';
- len += *c + 1;
- crtpos += *c + 1;
-- if (dst)
-- dst[len - 1] = '.';
- } else {
- /* NUL: end of current domain name */
- if (retpos == 0) {
-@@ -78,7 +77,10 @@ char* FAST_FUNC dname_dec(const uint8_t *cstr, int clen, const char *pre)
- crtpos = retpos;
- retpos = depth = 0;
- }
-- if (dst)
-+ if (dst && len != 0)
-+ /* \4host\3com\0\4host and we are at \0:
-+ * \3com was converted to "com.", change dot to space.
-+ */
- dst[len - 1] = ' ';
- }
-
-@@ -228,6 +230,9 @@ int main(int argc, char **argv)
- int len;
- uint8_t *encoded;
-
-+ uint8_t str[6] = { 0x00, 0x00, 0x02, 0x65, 0x65, 0x00 };
-+ printf("NUL:'%s'\n", dname_dec(str, 6, ""));
-+
- #define DNAME_DEC(encoded,pre) dname_dec((uint8_t*)(encoded), sizeof(encoded), (pre))
- printf("'%s'\n", DNAME_DEC("\4host\3com\0", "test1:"));
- printf("test2:'%s'\n", DNAME_DEC("\4host\3com\0\4host\3com\0", ""));
---
-2.7.4
-
diff --git a/sys-apps/busybox/files/busybox-1.24.2-ash-recursive-heredocs.patch b/sys-apps/busybox/files/busybox-1.24.2-ash-recursive-heredocs.patch
deleted file mode 100644
index 5405eaf..00000000
--- a/sys-apps/busybox/files/busybox-1.24.2-ash-recursive-heredocs.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From 4194c2875310c13ee3ca2bb0e1aea6a2ae67c55a Mon Sep 17 00:00:00 2001
-From: Ron Yorston <rmy@pobox.com>
-Date: Thu, 29 Oct 2015 16:44:56 +0000
-Subject: [PATCH] ash: fix error during recursive processing of here document
-
-Save the value of the checkkwd flag to prevent it being clobbered
-during recursion.
-
-Based on commit ec2c84d from git://git.kernel.org/pub/scm/utils/dash/dash.git
-by Herbert Xu.
-
-function old new delta
-readtoken 190 203 +13
-------------------------------------------------------------------------------
-(add/remove: 0/0 grow/shrink: 1/0 up/down: 13/0) Total: 13 bytes
-
-Signed-off-by: Ron Yorston <rmy@pobox.com>
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-(cherry picked from commit 713f07d906d9171953be0c12e2369869855b6ca6)
----
- shell/ash.c | 5 +++--
- shell/ash_test/ash-heredoc/heredoc3.right | 1 +
- shell/ash_test/ash-heredoc/heredoc3.tests | 9 +++++++++
- 3 files changed, 13 insertions(+), 2 deletions(-)
- create mode 100644 shell/ash_test/ash-heredoc/heredoc3.right
- create mode 100755 shell/ash_test/ash-heredoc/heredoc3.tests
-
-diff --git a/shell/ash.c b/shell/ash.c
-index 8a1628e..256e933 100644
---- a/shell/ash.c
-+++ b/shell/ash.c
-@@ -11893,6 +11893,7 @@ static int
- readtoken(void)
- {
- int t;
-+ int kwd = checkkwd;
- #if DEBUG
- smallint alreadyseen = tokpushback;
- #endif
-@@ -11906,7 +11907,7 @@ readtoken(void)
- /*
- * eat newlines
- */
-- if (checkkwd & CHKNL) {
-+ if (kwd & CHKNL) {
- while (t == TNL) {
- parseheredoc();
- t = xxreadtoken();
-@@ -11920,7 +11921,7 @@ readtoken(void)
- /*
- * check for keywords
- */
-- if (checkkwd & CHKKWD) {
-+ if (kwd & CHKKWD) {
- const char *const *pp;
-
- pp = findkwd(wordtext);
-diff --git a/shell/ash_test/ash-heredoc/heredoc3.right b/shell/ash_test/ash-heredoc/heredoc3.right
-new file mode 100644
-index 0000000..ce01362
---- /dev/null
-+++ b/shell/ash_test/ash-heredoc/heredoc3.right
-@@ -0,0 +1 @@
-+hello
-diff --git a/shell/ash_test/ash-heredoc/heredoc3.tests b/shell/ash_test/ash-heredoc/heredoc3.tests
-new file mode 100755
-index 0000000..96c227c
---- /dev/null
-+++ b/shell/ash_test/ash-heredoc/heredoc3.tests
-@@ -0,0 +1,9 @@
-+echo hello >greeting
-+cat <<EOF &&
-+$(cat greeting)
-+EOF
-+{
-+ echo $?
-+ cat greeting
-+} >/dev/null
-+rm greeting
---
-2.7.4
-
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/files/, sys-apps/busybox/
@ 2017-03-12 4:41 Mike Frysinger
0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2017-03-12 4:41 UTC (permalink / raw
To: gentoo-commits
commit: 7c558088fc8b3e4bf28ded33509ad971e72c8a4e
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 12 04:37:01 2017 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 12 04:37:01 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c558088
sys-apps/busybox: migrate to /run
sys-apps/busybox/busybox-1.26.2.ebuild | 19 ++++++++++++-------
sys-apps/busybox/busybox-9999.ebuild | 19 ++++++++++++-------
sys-apps/busybox/files/klogd.initd | 2 +-
sys-apps/busybox/files/ntpd.initd | 2 +-
sys-apps/busybox/files/syslogd.initd | 2 +-
sys-apps/busybox/files/watchdog.initd | 2 +-
6 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/sys-apps/busybox/busybox-1.26.2.ebuild b/sys-apps/busybox/busybox-1.26.2.ebuild
index 3d4a6cee553..af2ec1b08ef 100644
--- a/sys-apps/busybox/busybox-1.26.2.ebuild
+++ b/sys-apps/busybox/busybox-1.26.2.ebuild
@@ -36,17 +36,19 @@ S=${WORKDIR}/${MY_P}
busybox_config_option() {
local flag=$1 ; shift
- if [[ ${flag} != [yn] ]] ; then
+ if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
busybox_config_option $(usex ${flag} y n) "$@"
return
fi
+ local expr
while [[ $# -gt 0 ]] ; do
- if [[ ${flag} == "y" ]] ; then
- sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
- else
- sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
- fi
- einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ case ${flag} in
+ y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
+ n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
+ *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
+ esac
+ sed -i -e "${expr}" .config || die
+ einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find CONFIG_$1 ...")"
shift
done
}
@@ -125,6 +127,9 @@ src_configure() {
busybox_config_option y ASH
busybox_config_option n HUSH
+ busybox_config_option '"/run"' PID_FILE_PATH
+ busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
+
# disable ipv6 applets
if ! use ipv6; then
busybox_config_option n FEATURE_IPV6
diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-9999.ebuild
index 3d4a6cee553..af2ec1b08ef 100644
--- a/sys-apps/busybox/busybox-9999.ebuild
+++ b/sys-apps/busybox/busybox-9999.ebuild
@@ -36,17 +36,19 @@ S=${WORKDIR}/${MY_P}
busybox_config_option() {
local flag=$1 ; shift
- if [[ ${flag} != [yn] ]] ; then
+ if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
busybox_config_option $(usex ${flag} y n) "$@"
return
fi
+ local expr
while [[ $# -gt 0 ]] ; do
- if [[ ${flag} == "y" ]] ; then
- sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
- else
- sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
- fi
- einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ case ${flag} in
+ y) expr="s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" ;;
+ n) expr="s:CONFIG_$1=y:# CONFIG_$1 is not set:g" ;;
+ *) expr="s:.*\<CONFIG_$1\>.*:CONFIG_$1=${flag}:g" ;;
+ esac
+ sed -i -e "${expr}" .config || die
+ einfo "$(grep "CONFIG_$1[= ]" .config || echo "Could not find CONFIG_$1 ...")"
shift
done
}
@@ -125,6 +127,9 @@ src_configure() {
busybox_config_option y ASH
busybox_config_option n HUSH
+ busybox_config_option '"/run"' PID_FILE_PATH
+ busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
+
# disable ipv6 applets
if ! use ipv6; then
busybox_config_option n FEATURE_IPV6
diff --git a/sys-apps/busybox/files/klogd.initd b/sys-apps/busybox/files/klogd.initd
index 5c816e69ad7..95d5eb030d5 100644
--- a/sys-apps/busybox/files/klogd.initd
+++ b/sys-apps/busybox/files/klogd.initd
@@ -4,7 +4,7 @@
command="/bin/busybox klogd"
command_args="${KLOGD_OPTS}"
-pidfile="/var/run/klogd.pid"
+pidfile="/run/klogd.pid"
depend() {
need clock hostname
diff --git a/sys-apps/busybox/files/ntpd.initd b/sys-apps/busybox/files/ntpd.initd
index 4bc2011f4bb..dffea3bcde3 100644
--- a/sys-apps/busybox/files/ntpd.initd
+++ b/sys-apps/busybox/files/ntpd.initd
@@ -4,7 +4,7 @@
command="/bin/busybox ntpd"
command_args="${NTPD_OPTS}"
-pidfile="/var/run/ntpd.pid"
+pidfile="/run/ntpd.pid"
depend() {
use net dns logger
diff --git a/sys-apps/busybox/files/syslogd.initd b/sys-apps/busybox/files/syslogd.initd
index a4a7c99374d..b2ac5ac1722 100644
--- a/sys-apps/busybox/files/syslogd.initd
+++ b/sys-apps/busybox/files/syslogd.initd
@@ -4,7 +4,7 @@
command="/bin/busybox syslogd"
command_args="${SYSLOGD_OPTS}"
-pidfile="/var/run/syslogd.pid"
+pidfile="/run/syslogd.pid"
depend() {
need clock hostname
diff --git a/sys-apps/busybox/files/watchdog.initd b/sys-apps/busybox/files/watchdog.initd
index 6f71e26cfc3..89043738a7e 100644
--- a/sys-apps/busybox/files/watchdog.initd
+++ b/sys-apps/busybox/files/watchdog.initd
@@ -4,4 +4,4 @@
command="/bin/busybox watchdog"
command_args="${WATCHDOG_OPTS}"
-pidfile="/var/run/watchdog.pid"
+pidfile="/run/watchdog.pid"
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/files/, sys-apps/busybox/
@ 2017-04-26 21:12 Mike Frysinger
0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2017-04-26 21:12 UTC (permalink / raw
To: gentoo-commits
commit: 5c7ecf36f0bbbe18b513d7afb82b0f7bf342889c
Author: Mike Frysinger <vapier <AT> chromium <DOT> org>
AuthorDate: Wed Apr 26 21:09:04 2017 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Apr 26 21:12:26 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c7ecf36
sys-apps/busybox: fix default shell handling
Make sure we explicitly select sh->ash by default as newer versions
are defaulting to sh->hush.
Also fix up the hush patch to include the /bin/busybox fallbacks.
...ybox-1.26.2.ebuild => busybox-1.26.2-r1.ebuild} | 1 +
sys-apps/busybox/files/busybox-1.26.2-bb.patch | 29 ++++++++++++++++------
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/sys-apps/busybox/busybox-1.26.2.ebuild b/sys-apps/busybox/busybox-1.26.2-r1.ebuild
similarity index 99%
rename from sys-apps/busybox/busybox-1.26.2.ebuild
rename to sys-apps/busybox/busybox-1.26.2-r1.ebuild
index 1feb3a5ac22..6c42e41a452 100644
--- a/sys-apps/busybox/busybox-1.26.2.ebuild
+++ b/sys-apps/busybox/busybox-1.26.2-r1.ebuild
@@ -126,6 +126,7 @@ src_configure() {
# If these are not set and we are using a uclibc/busybox setup
# all calls to system() will fail.
busybox_config_option y ASH
+ busybox_config_option y SH_IS_ASH
busybox_config_option n HUSH
busybox_config_option '"/run"' PID_FILE_PATH
diff --git a/sys-apps/busybox/files/busybox-1.26.2-bb.patch b/sys-apps/busybox/files/busybox-1.26.2-bb.patch
index f120340162b..5e2405c3a67 100644
--- a/sys-apps/busybox/files/busybox-1.26.2-bb.patch
+++ b/sys-apps/busybox/files/busybox-1.26.2-bb.patch
@@ -1,6 +1,11 @@
-diff -Naur busybox-1.26.2.orig/shell/ash.c busybox-1.26.2/shell/ash.c
---- busybox-1.26.2.orig/shell/ash.c 2017-01-10 10:55:51.000000000 -0500
-+++ busybox-1.26.2/shell/ash.c 2017-01-28 17:02:08.961584737 -0500
+add `bb` and `bbsh` shortcuts as aliases to the main shell so we can install
+symlinks in Gentoo at /bin/bb as our recovery shell.
+
+we also add fallbacks to /bin/busybox and /bin/busybox.static in case /proc
+is not yet mounted during early boot.
+
+--- a/shell/ash.c
++++ b/shell/ash.c
@@ -144,6 +144,8 @@
//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
//applet:IF_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
@@ -19,9 +24,8 @@ diff -Naur busybox-1.26.2.orig/shell/ash.c busybox-1.26.2/shell/ash.c
/* If they called chroot or otherwise made the binary no longer
* executable, fall through */
}
-diff -Naur busybox-1.26.2.orig/shell/hush.c busybox-1.26.2/shell/hush.c
---- busybox-1.26.2.orig/shell/hush.c 2017-01-10 10:55:51.000000000 -0500
-+++ busybox-1.26.2/shell/hush.c 2017-01-28 17:05:13.235936850 -0500
+--- a/shell/hush.c
++++ b/shell/hush.c
@@ -221,6 +221,8 @@
//applet:IF_MSH(APPLET_ODDNAME(msh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
//applet:IF_SH_IS_HUSH(APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
@@ -35,8 +39,17 @@ diff -Naur busybox-1.26.2.orig/shell/hush.c busybox-1.26.2/shell/hush.c
if (SPECIAL_JOBSTOP_SIGS != 0)
switch_off_special_sigs(G.special_sig_mask & SPECIAL_JOBSTOP_SIGS);
execve(bb_busybox_exec_path, argv, pp);
-+ execve("/bin/busybox.static", argv, envp);
-+ execve("/bin/busybox", argv, envp);
++ execve("/bin/busybox.static", argv, pp);
++ execve("/bin/busybox", argv, pp);
/* Fallback. Useful for init=/bin/hush usage etc */
if (argv[0][0] == '/')
execve(argv[0], argv, pp);
+@@ -6931,6 +6931,8 @@
+ if (SPECIAL_JOBSTOP_SIGS != 0)
+ switch_off_special_sigs(G.special_sig_mask & SPECIAL_JOBSTOP_SIGS);
+ execv(bb_busybox_exec_path, argv);
++ execv("/bin/busybox.static", argv);
++ execv("/bin/busybox", argv);
+ /* If they called chroot or otherwise made the binary no longer
+ * executable, fall through */
+ }
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/files/, sys-apps/busybox/
@ 2023-05-24 15:35 Viorel Munteanu
0 siblings, 0 replies; 7+ messages in thread
From: Viorel Munteanu @ 2023-05-24 15:35 UTC (permalink / raw
To: gentoo-commits
commit: c153e982c2c2d6066a27e240484e2db08aaaf940
Author: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Wed May 24 15:16:13 2023 +0000
Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Wed May 24 15:35:32 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c153e982
sys-apps/busybox: sync live
Sync live.
Update EAPI 7 -> 8.
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
sys-apps/busybox/busybox-9999.ebuild | 28 ++++----
.../files/busybox-1.36.0-fix-wx-sections.patch | 74 ----------------------
2 files changed, 11 insertions(+), 91 deletions(-)
diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-9999.ebuild
index 51f115d22ffb..a9f3d85703c7 100644
--- a/sys-apps/busybox/busybox-9999.ebuild
+++ b/sys-apps/busybox/busybox-9999.ebuild
@@ -3,9 +3,9 @@
# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
-EAPI=7
+EAPI=8
-inherit eapi8-dosym flag-o-matic savedconfig toolchain-funcs
+inherit flag-o-matic savedconfig toolchain-funcs
DESCRIPTION="Utilities for rescue and embedded systems"
HOMEPAGE="https://www.busybox.net/"
@@ -18,10 +18,11 @@ else
SRC_URI="https://www.busybox.net/downloads/${MY_P}.tar.bz2"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
fi
+S="${WORKDIR}/${MY_P}"
LICENSE="GPL-2" # GPL-2 only
SLOT="0"
-IUSE="debug ipv6 livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
+IUSE="debug livecd make-symlinks math mdev pam selinux sep-usr static syslog systemd"
REQUIRED_USE="pam? ( !static )"
RESTRICT="test"
@@ -42,8 +43,6 @@ DEPEND="${RDEPEND}
sys-kernel/linux-headers"
BDEPEND="virtual/pkgconfig"
-S="${WORKDIR}/${MY_P}"
-
busybox_config_option() {
local flag=$1 ; shift
if [[ ${flag} != [yn] && ${flag} != \"* ]] ; then
@@ -76,7 +75,9 @@ busybox_config_enabled() {
PATCHES=(
"${FILESDIR}"/${PN}-1.26.2-bb.patch
"${FILESDIR}"/${PN}-1.34.1-skip-selinux-search.patch
- "${FILESDIR}"/${PN}-1.36.0-fix-wx-sections.patch
+
+ "${FILESDIR}"/${PN}-1.36.0-fortify-source-3-fixdep.patch
+
# "${FILESDIR}"/${P}-*.patch
)
@@ -173,14 +174,6 @@ src_configure() {
busybox_config_option '"/run"' PID_FILE_PATH
busybox_config_option '"/run/ifstate"' IFUPDOWN_IFSTATE_PATH
- # disable ipv6 applets
- if ! use ipv6; then
- busybox_config_option n FEATURE_IPV6
- busybox_config_option n TRACEROUTE6
- busybox_config_option n PING6
- busybox_config_option n UDHCPC6
- fi
-
busybox_config_option pam PAM
busybox_config_option static STATIC
busybox_config_option syslog {K,SYS}LOGD LOGGER
@@ -261,7 +254,8 @@ src_install() {
use make-symlinks || dosym /bin/bb /sbin/mdev
cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf || die
if [[ ! "$(get_libdir)" == "lib" ]]; then
- sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die #831251 - replace lib with lib64 where appropriate
+ #831251 - replace lib with lib64 where appropriate
+ sed -i -e "s:/lib/:/$(get_libdir)/:g" "${ED}"/etc/mdev.conf || die
fi
exeinto /$(get_libdir)/mdev/
@@ -301,7 +295,7 @@ src_install() {
doins examples/udhcp/udhcpd.conf
fi
if busybox_config_enabled ASH && ! use make-symlinks; then
- dosym8 -r /bin/busybox /bin/ash
+ dosym -r /bin/busybox /bin/ash
fi
if busybox_config_enabled CROND; then
newconfd "${FILESDIR}"/crond.confd busybox-crond
@@ -310,12 +304,12 @@ src_install() {
# bundle up the symlink files for use later
emake DESTDIR="${ED}" install
- rm _install/bin/busybox || die
# for compatibility, provide /usr/bin/env
mkdir -p _install/usr/bin || die
if [[ ! -e _install/usr/bin/env ]]; then
ln -s /bin/env _install/usr/bin/env || die
fi
+ rm _install/bin/busybox || die
tar cf busybox-links.tar -C _install . || : #;die
insinto /usr/share/${PN}
use make-symlinks && doins busybox-links.tar
diff --git a/sys-apps/busybox/files/busybox-1.36.0-fix-wx-sections.patch b/sys-apps/busybox/files/busybox-1.36.0-fix-wx-sections.patch
deleted file mode 100644
index 16118cf9b95f..000000000000
--- a/sys-apps/busybox/files/busybox-1.36.0-fix-wx-sections.patch
+++ /dev/null
@@ -1,74 +0,0 @@
- * QA Notice: The following files contain writable and executable sections
- * Files with such sections will not work properly (or at all!) on some
- * architectures/operating systems. A bug should be filed at
- * https://bugs.gentoo.org/ to make sure the issue is fixed.
- * For more information, see:
- *
- * https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
- *
- * Please include the following list of files in your report:
- * Note: Bugs should be filed for the respective maintainers
- * of the package in question and not hardened@gentoo.org.
- * RWX --- --- bin/busybox
-
-$ scanelf -qeR .
-RWX --- --- ./busybox
-RWX --- --- ./busybox_unstripped
-!WX --- --- ./libbb/hash_md5_sha_x86-64_shaNI.o
-!WX --- --- ./libbb/hash_md5_sha_x86-64.o
-!WX --- --- ./libbb/hash_md5_sha_x86-32_shaNI.o
-!WX --- --- ./libbb/hash_md5_sha256_x86-64_shaNI.o
-!WX --- --- ./libbb/hash_md5_sha256_x86-32_shaNI.o
-
-Try to fix this QA issue
-
---- a/libbb/hash_md5_sha256_x86-32_shaNI.S
-+++ b/libbb/hash_md5_sha256_x86-32_shaNI.S
-@@ -278,4 +278,7 @@
- PSHUFFLE_BSWAP32_FLIP_MASK:
- .octa 0x0c0d0e0f08090a0b0405060700010203
-
-+#if defined(__linux__) && defined(__ELF__)
-+ .section .note.GNU-stack, "", %progbits
-+#endif
- #endif
---- a/libbb/hash_md5_sha256_x86-64_shaNI.S
-+++ b/libbb/hash_md5_sha256_x86-64_shaNI.S
-@@ -284,4 +284,7 @@
- PSHUFFLE_BSWAP32_FLIP_MASK:
- .octa 0x0c0d0e0f08090a0b0405060700010203
-
-+#if defined(__linux__) && defined(__ELF__)
-+ .section .note.GNU-stack, "", %progbits
-+#endif
- #endif
---- a/libbb/hash_md5_sha_x86-32_shaNI.S
-+++ b/libbb/hash_md5_sha_x86-32_shaNI.S
-@@ -228,4 +228,7 @@
- PSHUFFLE_BYTE_FLIP_MASK:
- .octa 0x000102030405060708090a0b0c0d0e0f
-
-+#if defined(__linux__) && defined(__ELF__)
-+ .section .note.GNU-stack, "", %progbits
-+#endif
- #endif
---- a/libbb/hash_md5_sha_x86-64.S
-+++ b/libbb/hash_md5_sha_x86-64.S
-@@ -1483,4 +1483,7 @@
- .long 0x8F1BBCDC
- .long 0xCA62C1D6
-
-+#if defined(__linux__) && defined(__ELF__)
-+ .section .note.GNU-stack, "", %progbits
-+#endif
- #endif
---- a/libbb/hash_md5_sha_x86-64_shaNI.S
-+++ b/libbb/hash_md5_sha_x86-64_shaNI.S
-@@ -226,4 +226,7 @@
- PSHUFFLE_BYTE_FLIP_MASK:
- .octa 0x000102030405060708090a0b0c0d0e0f
-
-+#if defined(__linux__) && defined(__ELF__)
-+ .section .note.GNU-stack, "", %progbits
-+#endif
- #endif
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-05-24 15:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-12 4:41 [gentoo-commits] repo/gentoo:master commit in: sys-apps/busybox/files/, sys-apps/busybox/ Mike Frysinger
-- strict thread matches above, loose matches on Subject: below --
2023-05-24 15:35 Viorel Munteanu
2017-04-26 21:12 Mike Frysinger
2016-12-22 6:15 Mike Frysinger
2016-12-09 23:20 Mike Frysinger
2016-04-20 3:58 Mike Frysinger
2016-03-21 18:48 Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox