summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-08-19 14:11:55 +0000
committerMike Frysinger <vapier@gentoo.org>2011-08-19 14:11:55 +0000
commitd4378961c4cc446823709007e137516ee5fa4f22 (patch)
tree15570af6af72f80554d45a1403751d964ab0e25f /sys-apps
parentDrop .la files, and explicitly disable static libs (diff)
downloadhistorical-d4378961c4cc446823709007e137516ee5fa4f22.tar.gz
historical-d4378961c4cc446823709007e137516ee5fa4f22.tar.bz2
historical-d4378961c4cc446823709007e137516ee5fa4f22.zip
Version bump #379857.
Package-Manager: portage-2.2.0_alpha51/cvs/Linux x86_64
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/busybox/ChangeLog10
-rw-r--r--sys-apps/busybox/Manifest16
-rw-r--r--sys-apps/busybox/busybox-1.19.0.ebuild275
-rw-r--r--sys-apps/busybox/files/busybox-1.19.0-bb.patch22
-rw-r--r--sys-apps/busybox/files/busybox-1.19.0-cttyhack.patch18
-rw-r--r--sys-apps/busybox/files/busybox-1.19.0-less.patch12
-rw-r--r--sys-apps/busybox/files/busybox-1.19.0-sed.patch237
-rw-r--r--sys-apps/busybox/files/busybox-1.19.0-swap.patch12
-rw-r--r--sys-apps/busybox/files/busybox-1.19.0-uncompress.patch50
9 files changed, 647 insertions, 5 deletions
diff --git a/sys-apps/busybox/ChangeLog b/sys-apps/busybox/ChangeLog
index d025ff5ffb3b..71d09e688dc8 100644
--- a/sys-apps/busybox/ChangeLog
+++ b/sys-apps/busybox/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-apps/busybox
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.277 2011/08/14 20:00:31 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.278 2011/08/19 14:11:55 vapier Exp $
+
+*busybox-1.19.0 (19 Aug 2011)
+
+ 19 Aug 2011; Mike Frysinger <vapier@gentoo.org> +busybox-1.19.0.ebuild,
+ +files/busybox-1.19.0-bb.patch, +files/busybox-1.19.0-cttyhack.patch,
+ +files/busybox-1.19.0-less.patch, +files/busybox-1.19.0-sed.patch,
+ +files/busybox-1.19.0-swap.patch, +files/busybox-1.19.0-uncompress.patch:
+ Version bump #379857.
14 Aug 2011; Mike Frysinger <vapier@gentoo.org> busybox-1.18.5.ebuild:
Use elog for user facing messages #378585 by William Throwe.
diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
index 95664da15f09..1288bd12e0b2 100644
--- a/sys-apps/busybox/Manifest
+++ b/sys-apps/busybox/Manifest
@@ -13,6 +13,12 @@ AUX busybox-1.18.3-modutils24.patch 949 RMD160 5c7aef4dd8195a6432a8c7e6e865eff1b
AUX busybox-1.18.3-wget.patch 3805 RMD160 e3846336786aa825da96ff9b2cf08829c81482a9 SHA1 cb9227a3d9783e4222fbe2f42cb769c7ff1e14e3 SHA256 22538ebee96f66916104b8143cfd16e21568da4c5a89128b9daa60d83a59120b
AUX busybox-1.18.4-fuser.patch 405 RMD160 44df4d30c0e3ce7a9d391b9b7e9c2c6da8a09bc4 SHA1 c825dc8d2b3b979118eff5aaf68008fd6ce6fddc SHA256 b8b83f442e09a721293d6c23c5a44014bb6009d40950385ee7a9fbe7bf7c880a
AUX busybox-1.18.4-hush.patch 7400 RMD160 e284357d8364aee6a134e6e0d308387668ee0ad1 SHA1 a0ecb618850b326a0bf3b76857e1c881d708d350 SHA256 e76da947c40784c9a0527c38b1e9edb615c80cfe911d28b9d8a5d67a492bf67c
+AUX busybox-1.19.0-bb.patch 908 RMD160 6f035ec5d812bff4383f5f0e3542c3b4462c6528 SHA1 62bac73bfb5e36662707b3da1a3304a58e205365 SHA256 98f92c2edbcf61d1bacef783ea8b08cce07051b0a4489ed3f4579296846f89f1
+AUX busybox-1.19.0-cttyhack.patch 592 RMD160 bfb2e09a6fa41ce921eb7a26a2eb9633f067b026 SHA1 6b5ae0cec7fb534b32b490dd5a3dcbcbf536ecdc SHA256 f315e48a9c586fb5e77921eda59c773ba8afbb1e4ac9fd422c66b5c482dca6d2
+AUX busybox-1.19.0-less.patch 278 RMD160 17938258201616878efbef785d982ee373790fc4 SHA1 22917f88ddb12bab1e5994dee3edeeae175019d0 SHA256 e0d1a306bf3be7802ef19c0033b278ae2ecf8fd4f271bad7d93209c9c6a0f019
+AUX busybox-1.19.0-sed.patch 8081 RMD160 8fa603968141b36106dda560223f82b87583437f SHA1 d8b04777b43805ff4b7ce3a44edaa69adde500f5 SHA256 b21ac5eb86519fbcbe0a74fc531cb707a878e988b6fdb298be6083760e04fb89
+AUX busybox-1.19.0-swap.patch 402 RMD160 0cc3e6d7c7b7b3b1fa25904ae9c1c3b79dba1161 SHA1 d04c5741213a81433f17c50208baa89681d24c3d SHA256 d9d70a607d877646b4e2087ddf4c3ad14d5bcb2b5973b33fed30ee8e6d69b40d
+AUX busybox-1.19.0-uncompress.patch 1505 RMD160 53b3deb6f79bc2fd3cd0ca36709364191f7eb8b9 SHA1 c349cb6b162f8ebfbe02150fceb253a70278f1f1 SHA256 74cd12b54d47a2ce0e418d8d15cd0be1649bbec5951d9000b5275683f9b0623d
AUX mdev-start.sh 2758 RMD160 c177aac4940b177bd857bc98ff2ac031e0489bbc SHA1 5a5b95da36c489cd12820513434a7a17ac3bffd1 SHA256 9904263c8dfe2b8c3e968a9b4245fa0c162a2413110c037cdd797ac3773587d7
AUX mdev.rc 282 RMD160 6a11e23fbed92acd24088a7885bdc52b9c845fac SHA1 46f1a0494e009332e83b62599842f8213b60ba60 SHA256 e52abbc3399fc85ce1f097e8f12b25a5ca7fe2e3d648bee60c061b547ba39dc5
AUX mdev/dvbdev 356 RMD160 db7f546ae6e47b59cca9712f1e218cdbc3985c78 SHA1 993c0ab79fa41912f84db95e7dd09aa0965aa8c7 SHA256 ef091bb4c8943a99b9a97b556cdc15ddd20275f5afa8287e201419b08c4e71de
@@ -22,15 +28,17 @@ AUX mdev/usbdisk_link 984 RMD160 9b86d85f5f27f03f894a062c9f00d3583c4db3ae SHA1 6
DIST busybox-1.17.4.tar.bz2 2093389 RMD160 abb7e3ceebac4fdf48b0e717367e64456749016e SHA1 9a2be1e709dd0703d78bed620439bac069d19254 SHA256 0c6b80f007e665228d1b271354b7e80450dcaa67c9162a30eebf936c7cdfcbdc
DIST busybox-1.18.4.tar.bz2 2130598 RMD160 db21d00498b155f950a3f2fb63fa339253e536c2 SHA1 d285855e5770b0fb7caf477dd41ce0863657b975 SHA256 4d24d37bd6f1bd153e8cf9a984ec2f32f18464f73ca535e2cc2e8be9694097fa
DIST busybox-1.18.5.tar.bz2 2130681 RMD160 22746c6e9ed6b7f8f42a49a5329b8b36da088422 SHA1 0aa287ea0f19a8c0c9224e2aa9c4516a79887139 SHA256 10954fcd5c48d8a262a3497b16227bf983a05658bf2bf661af2fdeca773f2fc0
+DIST busybox-1.19.0.tar.bz2 2168657 RMD160 07c8c313d8ed7edcf8f12fe805389c96bda3dae2 SHA1 70569f23751640d9ac7fc2aa49b29e6cd274be6d SHA256 19cf44a096d7796800780d6344c4cc5054dac9f50d1c9b7a5c506c4777f7620c
EBUILD busybox-1.17.4.ebuild 7921 RMD160 2b3306d4c4b21f4fa246e4963f15ad75707d6fe1 SHA1 7808c464cb6e0d2efd4bd24f3aecaef4ce3c40c4 SHA256 31ee8f50c3123db62879b2209e96e020ae143a5e5f960138924a467eef8f7c8a
EBUILD busybox-1.18.4.ebuild 8228 RMD160 e56dfe2383ba8507b37c15332b87c5800cd007f7 SHA1 4897ba0aaaf03177760b66545c326d3a032aba82 SHA256 f5345e2a1c4f325ac2b36c32b850cd394187ca6c644a03ef0463b8dd06e0729b
EBUILD busybox-1.18.5.ebuild 8223 RMD160 a4e3e6cf07d7736d47b21499c1ad30d66ba394df SHA1 c2df0c81bc43746575458e1bf087fcc45a4baa53 SHA256 17517a9d9bfa7fb32375e457fadbb5a31f775001be3624fabce887703edff270
-MISC ChangeLog 41203 RMD160 72ac63210a68b1c2b952183686b0171a7f947d62 SHA1 6c261ebf3127cf2f0a7f5540dbfd87ab295934d4 SHA256 162cb896308aab9234769b3774ced2cb9a2f6b5c7197fffd21c8b95a930b6131
+EBUILD busybox-1.19.0.ebuild 8223 RMD160 485c2e179fdabb4752ef926975e6cf33251b8325 SHA1 7212d94fa93631ba540768d183ae5c453a0d47b6 SHA256 7ec15e6e752548a3d1324b8237cedc2348cf13fe278d357dd13f5989729a30d4
+MISC ChangeLog 41550 RMD160 ba0350d37f94e64f5180e72209f593fd804bc93b SHA1 68d35ff6479d56e7228b0377488604290847c2f7 SHA256 17159caa638479c28f7b4e18db59bf1d023fd6d0fa844db180c85ff5292590bc
MISC metadata.xml 420 RMD160 a3d9cd7689418647525460862b05d3adfb9cd4f4 SHA1 c67d73ae61fb0180060ff7d3d13b1b5e9ef2c56c SHA256 1d2b931bd8b4026d665b485a21263438fe5892bf81af7139e409bfd61a68d55c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
-iF4EAREIAAYFAk5IKW0ACgkQaC/OocHi7JYVogD/RzAl2S3oZNMux4TnxjoZr/4I
-pzEdbqJioUqBjpbUdtQA/2nuNLe8xfHoYRHUlR3L0T0eU4K7ZNaMY1XLS/CToeY8
-=bBaw
+iF4EAREIAAYFAk5ObzEACgkQaC/OocHi7JYVQAD9FuRWlObQW+FozfO2dMK9Fx2f
+utSKr1pepnin8irm1mYA/36gukSlVvXZOoPLR0RJWzVKByGbqJ2dRWPfY9TToHPP
+=Bgmt
-----END PGP SIGNATURE-----
diff --git a/sys-apps/busybox/busybox-1.19.0.ebuild b/sys-apps/busybox/busybox-1.19.0.ebuild
new file mode 100644
index 000000000000..f23e290a1eb4
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.19.0.ebuild
@@ -0,0 +1,275 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.19.0.ebuild,v 1.1 2011/08/19 14:11:55 vapier Exp $
+
+EAPI="3"
+inherit eutils flag-o-matic savedconfig toolchain-funcs
+
+################################################################################
+# BUSYBOX ALTERNATE CONFIG MINI-HOWTO
+#
+# Busybox can be modified in many different ways. Here's a few ways to do it:
+#
+# (1) Emerge busybox with FEATURES=keepwork so the work directory won't
+# get erased afterwards. Add a definition like ROOT=/my/root/path to the
+# start of the line if you're installing to somewhere else than the root
+# directory. This command will save the default configuration to
+# ${PORTAGE_CONFIGROOT} (or ${ROOT} if ${PORTAGE_CONFIGROOT} is not
+# defined), and it will tell you that it has done this. Note the location
+# where the config file was saved.
+#
+# FEATURES=keepwork USE=savedconfig emerge busybox
+#
+# (2) Go to the work directory and change the configuration of busybox using its
+# menuconfig feature.
+#
+# cd /var/tmp/portage/busybox*/work/busybox-*
+# make menuconfig
+#
+# (3) Save your configuration to the default location and copy it to the
+# one of the locations listed in /usr/portage/eclass/savedconfig.eclass
+#
+# (4) Emerge busybox with USE=savedconfig to use the configuration file you
+# just generated.
+#
+################################################################################
+#
+# (1) Alternatively skip the above steps and simply emerge busybox without
+# USE=savedconfig.
+#
+# (2) Edit the file it saves by hand. ${ROOT}"/etc/portage/savedconfig/${CATEGORY}/${PF}
+#
+# (3) Remerge busybox as using USE=savedconfig.
+#
+################################################################################
+
+#SNAPSHOT=20040726
+SNAPSHOT=""
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ -n ${SNAPSHOT} ]] ; then
+ MY_P=${PN}
+ SRC_URI="http://www.busybox.net/downloads/snapshots/${PN}-${SNAPSHOT}.tar.bz2"
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+fi
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-linux"
+IUSE="debug ipv6 make-symlinks +mdev nfs -pam selinux static elibc_glibc"
+RESTRICT="test"
+
+RDEPEND="selinux? ( sys-libs/libselinux )
+ pam? ( sys-libs/pam )"
+DEPEND="${RDEPEND}
+ nfs? ( || ( <sys-libs/glibc-2.13 >=net-libs/libtirpc-0.2.2-r1 ) )"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ case $1 in
+ y) sed -i -e "s:.*\<CONFIG_$2\>.*set:CONFIG_$2=y:g" .config;;
+ n) sed -i -e "s:CONFIG_$2=y:# CONFIG_$2 is not set:g" .config;;
+ *) use $1 \
+ && busybox_config_option y $2 \
+ || busybox_config_option n $2
+ return 0
+ ;;
+ esac
+ einfo $(grep "CONFIG_$2[= ]" .config || echo Could not find CONFIG_$2 ...)
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ append-cppflags $($(tc-getPKG_CONFIG) libtirpc --cflags)
+
+ # patches go here!
+ #epatch "${FILESDIR}"/busybox-1.19.0-bb.patch
+ epatch "${FILESDIR}"/busybox-${PV}-*.patch
+
+ # 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):" \
+ Makefile || 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
+ 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 NOMMU
+ busybox_config_option n MONOTONIC_SYSCALL
+
+ # 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 nfs FEATURE_MOUNT_NFS
+ use static \
+ && busybox_config_option n PAM \
+ || busybox_config_option pam PAM
+ busybox_config_option static STATIC
+ busybox_config_option debug DEBUG
+ use debug \
+ && busybox_config_option y NO_DEBUG_LIB \
+ && busybox_config_option n DMALLOC \
+ && busybox_config_option n EFENCE
+
+ busybox_config_option selinux SELINUX
+
+ # 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 \
+ LASH 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 busybox || die "build failed"
+ if ! use static ; then
+ cp .config{,.bak}
+ mv busybox_unstripped{,.bak}
+ use pam && busybox_config_option n PAM
+ emake CONFIG_STATIC=y busybox || die "static build failed"
+ mv busybox_unstripped bb
+ mv busybox_unstripped{.bak,}
+ mv .config{.bak,}
+ fi
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ newbin busybox_unstripped busybox || die
+ if use static ; then
+ dosym busybox /bin/bb || die
+ dosym bb /bin/busybox.static || die
+ else
+ dobin bb || die
+ 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/*
+
+ insinto /$(get_libdir)/rcscripts/addons
+ doins "${FILESDIR}"/mdev-start.sh || die
+ newinitd "${FILESDIR}"/mdev.rc mdev || die
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install || die
+ rm _install/bin/busybox
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ doins busybox-links.tar || die
+ newins .config ${PF}.config || die
+
+ dodoc AUTHORS README TODO
+
+ cd docs || die
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples || die
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+
+ cd bootfloppy || die
+ docinto bootfloppy
+ dodoc $(find . -type f)
+}
+
+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 realy 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() {
+ 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
+
+ elog "This ebuild has support for user defined configs"
+ elog "Please read this ebuild for more details and re-emerge as needed"
+ elog "if you want to add or remove functionality for ${PN}"
+}
diff --git a/sys-apps/busybox/files/busybox-1.19.0-bb.patch b/sys-apps/busybox/files/busybox-1.19.0-bb.patch
new file mode 100644
index 000000000000..a66b45a5e21d
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.19.0-bb.patch
@@ -0,0 +1,22 @@
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -75,6 +75,8 @@
+ //applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
+ //applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, sh))
+ //applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, bash))
++//applet:IF_ASH(APPLET_ODDNAME(bb, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
++//applet:IF_ASH(APPLET_ODDNAME(bbsh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
+
+ //kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
+ //kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -7255,6 +7255,8 @@
+ }
+ /* re-exec ourselves with the new arguments */
+ execve(bb_busybox_exec_path, argv, envp);
++ execve("/bin/busybox.static", argv, envp);
++ execve("/bin/busybox", argv, envp);
+ /* If they called chroot or otherwise made the binary no longer
+ * executable, fall through */
+ }
diff --git a/sys-apps/busybox/files/busybox-1.19.0-cttyhack.patch b/sys-apps/busybox/files/busybox-1.19.0-cttyhack.patch
new file mode 100644
index 000000000000..ef2781d78de7
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.19.0-cttyhack.patch
@@ -0,0 +1,18 @@
+--- busybox-1.19.0/shell/cttyhack.c
++++ busybox-1.19.0-cttyhack/shell/cttyhack.c
+@@ -122,10 +122,12 @@ int cttyhack_main(int argc UNUSED_PARAM,
+ do {
+ #ifdef __linux__
+ int s = open_read_close("/sys/class/tty/console/active",
+- console + 5, sizeof(console) - 5 - 1);
++ console + 5, sizeof(console) - 5);
+ if (s > 0) {
+- /* found active console via sysfs (Linux 2.6.38+) */
+- console[5 + s] = '\0';
++ /* found active console via sysfs (Linux 2.6.38+)
++ * sysfs string looks like "ttyS0\n" so zap the newline:
++ */
++ console[4 + s] = '\0';
+ break;
+ }
+
diff --git a/sys-apps/busybox/files/busybox-1.19.0-less.patch b/sys-apps/busybox/files/busybox-1.19.0-less.patch
new file mode 100644
index 000000000000..a1d3374bcf9d
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.19.0-less.patch
@@ -0,0 +1,12 @@
+--- busybox-1.19.0/miscutils/less.c
++++ busybox-1.19.0-less/miscutils/less.c
+@@ -990,7 +990,8 @@ static int64_t less_getch(int pos)
+ */
+ if (key >= 0 && key < ' ' && key != 0x0d && key != 8)
+ goto again;
+- return key;
++
++ return key64;
+ }
+
+ static char* less_gets(int sz)
diff --git a/sys-apps/busybox/files/busybox-1.19.0-sed.patch b/sys-apps/busybox/files/busybox-1.19.0-sed.patch
new file mode 100644
index 000000000000..c71e9c26e28f
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.19.0-sed.patch
@@ -0,0 +1,237 @@
+--- busybox-1.19.0/editors/sed.c
++++ busybox-1.19.0-sed/editors/sed.c
+@@ -75,6 +75,13 @@
+ #include "libbb.h"
+ #include "xregex.h"
+
++#if 0
++# define dbg(...) bb_error_msg(__VA_ARGS__)
++#else
++# define dbg(...) ((void)0)
++#endif
++
++
+ enum {
+ OPT_in_place = 1 << 0,
+ };
+@@ -89,6 +96,7 @@ typedef struct sed_cmd_s {
+ regex_t *end_match; /* sed -e '/match/,/end_match/cmd' */
+ regex_t *sub_match; /* For 's/sub_match/string/' */
+ int beg_line; /* 'sed 1p' 0 == apply commands to all lines */
++ int beg_line_orig; /* copy of the above, needed for -i */
+ int end_line; /* 'sed 1,3p' 0 == one line only. -1 = last line ($) */
+
+ FILE *sw_file; /* File (sw) command writes to, -1 for none. */
+@@ -123,7 +131,7 @@ struct globals {
+ regex_t *previous_regex_ptr;
+
+ /* linked list of sed commands */
+- sed_cmd_t sed_cmd_head, *sed_cmd_tail;
++ sed_cmd_t *sed_cmd_head, **sed_cmd_tail;
+
+ /* Linked list of append lines */
+ llist_t *append_head;
+@@ -148,7 +156,7 @@ struct BUG_G_too_big {
+ #if ENABLE_FEATURE_CLEAN_UP
+ static void sed_free_and_close_stuff(void)
+ {
+- sed_cmd_t *sed_cmd = G.sed_cmd_head.next;
++ sed_cmd_t *sed_cmd = G.sed_cmd_head;
+
+ llist_free(G.append_head, free);
+
+@@ -599,6 +607,7 @@ static void add_cmd(const char *cmdstr)
+
+ /* first part (if present) is an address: either a '$', a number or a /regex/ */
+ cmdstr += get_address(cmdstr, &sed_cmd->beg_line, &sed_cmd->beg_match);
++ sed_cmd->beg_line_orig = sed_cmd->beg_line;
+
+ /* second part (if present) will begin with a comma */
+ if (*cmdstr == ',') {
+@@ -630,8 +639,8 @@ static void add_cmd(const char *cmdstr)
+ cmdstr = parse_cmd_args(sed_cmd, cmdstr);
+
+ /* Add the command to the command array */
+- G.sed_cmd_tail->next = sed_cmd;
+- G.sed_cmd_tail = G.sed_cmd_tail->next;
++ *G.sed_cmd_tail = sed_cmd;
++ G.sed_cmd_tail = &sed_cmd->next;
+ }
+
+ /* If we glued multiple lines together, free the memory. */
+@@ -777,7 +786,7 @@ static sed_cmd_t *branch_to(char *label)
+ {
+ sed_cmd_t *sed_cmd;
+
+- for (sed_cmd = G.sed_cmd_head.next; sed_cmd; sed_cmd = sed_cmd->next) {
++ for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
+ if (sed_cmd->cmd == ':' && sed_cmd->string && !strcmp(sed_cmd->string, label)) {
+ return sed_cmd;
+ }
+@@ -953,24 +962,24 @@ static void process_files(void)
+
+ /* For every line, go through all the commands */
+ restart:
+- for (sed_cmd = G.sed_cmd_head.next; sed_cmd; sed_cmd = sed_cmd->next) {
++ for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
+ int old_matched, matched;
+
+ old_matched = sed_cmd->in_match;
+
+ /* Determine if this command matches this line: */
+
+- //bb_error_msg("match1:%d", sed_cmd->in_match);
+- //bb_error_msg("match2:%d", (!sed_cmd->beg_line && !sed_cmd->end_line
+- // && !sed_cmd->beg_match && !sed_cmd->end_match));
+- //bb_error_msg("match3:%d", (sed_cmd->beg_line > 0
+- // && (sed_cmd->end_line || sed_cmd->end_match
+- // ? (sed_cmd->beg_line <= linenum)
+- // : (sed_cmd->beg_line == linenum)
+- // )
+- // )
+- //bb_error_msg("match4:%d", (beg_match(sed_cmd, pattern_space)));
+- //bb_error_msg("match5:%d", (sed_cmd->beg_line == -1 && next_line == NULL));
++ dbg("match1:%d", sed_cmd->in_match);
++ dbg("match2:%d", (!sed_cmd->beg_line && !sed_cmd->end_line
++ && !sed_cmd->beg_match && !sed_cmd->end_match));
++ dbg("match3:%d", (sed_cmd->beg_line > 0
++ && (sed_cmd->end_line || sed_cmd->end_match
++ ? (sed_cmd->beg_line <= linenum)
++ : (sed_cmd->beg_line == linenum)
++ )
++ ));
++ dbg("match4:%d", (beg_match(sed_cmd, pattern_space)));
++ dbg("match5:%d", (sed_cmd->beg_line == -1 && next_line == NULL));
+
+ /* Are we continuing a previous multi-line match? */
+ sed_cmd->in_match = sed_cmd->in_match
+@@ -981,7 +990,14 @@ static void process_files(void)
+ || (sed_cmd->beg_line > 0
+ && (sed_cmd->end_line || sed_cmd->end_match
+ /* note: even if end is numeric and is < linenum too,
+- * GNU sed matches! We match too */
++ * GNU sed matches! We match too, therefore we don't
++ * check here that linenum <= end.
++ * Example:
++ * printf '1\n2\n3\n4\n' | sed -n '1{N;N;d};1p;2,3p;3p;4p'
++ * first three input lines are deleted;
++ * 4th line is matched and printed
++ * by "2,3" (!) and by "4" ranges
++ */
+ ? (sed_cmd->beg_line <= linenum) /* N,end */
+ : (sed_cmd->beg_line == linenum) /* N */
+ )
+@@ -994,16 +1010,14 @@ static void process_files(void)
+ /* Snapshot the value */
+ matched = sed_cmd->in_match;
+
+- //bb_error_msg("cmd:'%c' matched:%d beg_line:%d end_line:%d linenum:%d",
+- //sed_cmd->cmd, matched, sed_cmd->beg_line, sed_cmd->end_line, linenum);
++ dbg("cmd:'%c' matched:%d beg_line:%d end_line:%d linenum:%d",
++ sed_cmd->cmd, matched, sed_cmd->beg_line, sed_cmd->end_line, linenum);
+
+ /* Is this line the end of the current match? */
+
+ if (matched) {
+ /* once matched, "n,xxx" range is dead, disabling it */
+- if (sed_cmd->beg_line > 0
+- && !(option_mask32 & OPT_in_place) /* but not for -i */
+- ) {
++ if (sed_cmd->beg_line > 0) {
+ sed_cmd->beg_line = -2;
+ }
+ sed_cmd->in_match = !(
+@@ -1017,7 +1031,8 @@ static void process_files(void)
+ /* or does this line matches our last address regex */
+ || (sed_cmd->end_match && old_matched
+ && (regexec(sed_cmd->end_match,
+- pattern_space, 0, NULL, 0) == 0))
++ pattern_space, 0, NULL, 0) == 0)
++ )
+ );
+ }
+
+@@ -1407,11 +1422,12 @@ int sed_main(int argc UNUSED_PARAM, char
+ add_input_file(stdin);
+ } else {
+ int i;
+- FILE *file;
+
+ for (i = 0; argv[i]; i++) {
+ struct stat statbuf;
+ int nonstdoutfd;
++ FILE *file;
++ sed_cmd_t *sed_cmd;
+
+ if (LONE_DASH(argv[i]) && !(opt & OPT_in_place)) {
+ add_input_file(stdin);
+@@ -1423,11 +1439,13 @@ int sed_main(int argc UNUSED_PARAM, char
+ status = EXIT_FAILURE;
+ continue;
+ }
++ add_input_file(file);
+ if (!(opt & OPT_in_place)) {
+- add_input_file(file);
+ continue;
+ }
+
++ /* -i: process each FILE separately: */
++
+ G.outname = xasprintf("%sXXXXXX", argv[i]);
+ nonstdoutfd = xmkstemp(G.outname);
+ G.nonstdout = xfdopen_for_write(nonstdoutfd);
+@@ -1438,15 +1456,20 @@ int sed_main(int argc UNUSED_PARAM, char
+ * but GNU sed 4.2.1 does not preserve them either */
+ fchmod(nonstdoutfd, statbuf.st_mode);
+ fchown(nonstdoutfd, statbuf.st_uid, statbuf.st_gid);
+- add_input_file(file);
++
+ process_files();
+ fclose(G.nonstdout);
+-
+ G.nonstdout = stdout;
++
+ /* unlink(argv[i]); */
+ xrename(G.outname, argv[i]);
+ free(G.outname);
+ G.outname = NULL;
++
++ /* Re-enable disabled range matches */
++ for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) {
++ sed_cmd->beg_line = sed_cmd->beg_line_orig;
++ }
+ }
+ /* Here, to handle "sed 'cmds' nonexistent_file" case we did:
+ * if (G.current_input_file >= G.input_file_count)
+--- busybox-1.19.0/testsuite/sed.tests
++++ busybox-1.19.0-sed/testsuite/sed.tests
+@@ -6,7 +6,7 @@
+
+ . ./testing.sh
+
+-# testing "description" "arguments" "result" "infile" "stdin"
++# testing "description" "commands" "result" "infile" "stdin"
+
+ # Corner cases
+ testing "sed no files (stdin)" 'sed ""' "hello\n" "" "hello\n"
+@@ -225,7 +225,7 @@ testing "sed s/xxx/[/" "sed -e 's/xxx/[/
+ #testing "sed -g (exhaustive)" "sed -e 's/[[:space:]]*/,/g'" ",1,2,3,4,5," \
+ # "" "12345"
+
+-# testing "description" "arguments" "result" "infile" "stdin"
++# testing "description" "commands" "result" "infile" "stdin"
+
+ testing "sed n command must reset 'substituted' bit" \
+ "sed 's/1/x/;T;n;: next;s/3/y/;t quit;n;b next;: quit;q'" \
+@@ -291,6 +291,10 @@ testing "sed understands \r" \
+ "sed 's/r/\r/'" \
+ "\rrr\n" "" "rrr\n"
+
+-# testing "description" "arguments" "result" "infile" "stdin"
++testing "sed -i finishes ranges correctly" \
++ "sed '1,2d' -i input; echo \$?; cat input" \
++ "0\n3\n4\n" "1\n2\n3\n4\n" ""
++
++# testing "description" "commands" "result" "infile" "stdin"
+
+ exit $FAILCOUNT
diff --git a/sys-apps/busybox/files/busybox-1.19.0-swap.patch b/sys-apps/busybox/files/busybox-1.19.0-swap.patch
new file mode 100644
index 000000000000..c7839457b9cc
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.19.0-swap.patch
@@ -0,0 +1,12 @@
+--- busybox-1.19.0/util-linux/swaponoff.c
++++ busybox-1.19.0-swap/util-linux/swaponoff.c
+@@ -114,7 +114,8 @@ int swap_on_off_main(int argc UNUSED_PAR
+ #if !ENABLE_FEATURE_SWAPON_PRI
+ ret = getopt32(argv, "a");
+ #else
+- opt_complementary = "p+";
++ if (applet_name[5] == 'n')
++ opt_complementary = "p+";
+ ret = getopt32(argv, (applet_name[5] == 'n') ? "ap:" : "a", &g_flags);
+
+ if (ret & 2) { // -p
diff --git a/sys-apps/busybox/files/busybox-1.19.0-uncompress.patch b/sys-apps/busybox/files/busybox-1.19.0-uncompress.patch
new file mode 100644
index 000000000000..303373908bd4
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.19.0-uncompress.patch
@@ -0,0 +1,50 @@
+--- busybox-1.19.0/archival/libarchive/decompress_uncompress.c
++++ busybox-1.19.0-uncompress/archival/libarchive/decompress_uncompress.c
+@@ -163,7 +163,8 @@ unpack_Z_stream(int fd_in, int fd_out)
+
+ if (insize < (int) (IBUFSIZ + 64) - IBUFSIZ) {
+ rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ);
+-//error check??
++ if (rsize < 0)
++ bb_error_msg(bb_msg_read_error);
+ insize += rsize;
+ }
+
+@@ -195,6 +196,8 @@ unpack_Z_stream(int fd_in, int fd_out)
+
+
+ if (oldcode == -1) {
++ if (code >= 256)
++ bb_error_msg_and_die("corrupted data"); /* %ld", code); */
+ oldcode = code;
+ finchar = (int) oldcode;
+ outbuf[outpos++] = (unsigned char) finchar;
+@@ -239,6 +242,8 @@ unpack_Z_stream(int fd_in, int fd_out)
+
+ /* Generate output characters in reverse order */
+ while ((long) code >= (long) 256) {
++ if (stackp <= &htabof(0))
++ bb_error_msg_and_die("corrupted data");
+ *--stackp = tab_suffixof(code);
+ code = tab_prefixof(code);
+ }
+@@ -263,8 +268,7 @@ unpack_Z_stream(int fd_in, int fd_out)
+ }
+
+ if (outpos >= OBUFSIZ) {
+- full_write(fd_out, outbuf, outpos);
+-//error check??
++ xwrite(fd_out, outbuf, outpos);
+ IF_DESKTOP(total_written += outpos;)
+ outpos = 0;
+ }
+@@ -292,8 +296,7 @@ unpack_Z_stream(int fd_in, int fd_out)
+ } while (rsize > 0);
+
+ if (outpos > 0) {
+- full_write(fd_out, outbuf, outpos);
+-//error check??
++ xwrite(fd_out, outbuf, outpos);
+ IF_DESKTOP(total_written += outpos;)
+ }
+