diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-02-06 15:36:38 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-02-06 15:36:38 +0000 |
commit | ecba3ff2cbb12d38eca9b898c0aa623367e581d5 (patch) | |
tree | 8e3d66144104353e7950bcc47c169cd696e9a0e7 /sys-apps/busybox | |
parent | old (diff) | |
download | gentoo-2-ecba3ff2cbb12d38eca9b898c0aa623367e581d5.tar.gz gentoo-2-ecba3ff2cbb12d38eca9b898c0aa623367e581d5.tar.bz2 gentoo-2-ecba3ff2cbb12d38eca9b898c0aa623367e581d5.zip |
Version bump.
(Portage version: 2.1.4.1)
Diffstat (limited to 'sys-apps/busybox')
-rw-r--r-- | sys-apps/busybox/ChangeLog | 12 | ||||
-rw-r--r-- | sys-apps/busybox/busybox-1.9.0.ebuild | 239 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.9.0-allno.patch | 23 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.9.0-fsck.patch | 15 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.9.0-iproute.patch | 25 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.9.0-mkswap.patch | 15 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.9.0-msh.patch | 79 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.9.0-nameif.patch | 33 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.9.0-nohup.patch | 82 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.9.0-stty.patch | 37 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.9.0-zcip.patch | 69 |
11 files changed, 628 insertions, 1 deletions
diff --git a/sys-apps/busybox/ChangeLog b/sys-apps/busybox/ChangeLog index 77f9bbcbd22c..e5622163ae39 100644 --- a/sys-apps/busybox/ChangeLog +++ b/sys-apps/busybox/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sys-apps/busybox # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.178 2008/02/05 11:18:23 corsair Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.179 2008/02/06 15:36:37 vapier Exp $ + +*busybox-1.9.0 (06 Feb 2008) + + 06 Feb 2008; Mike Frysinger <vapier@gentoo.org> + +files/busybox-1.9.0-allno.patch, +files/busybox-1.9.0-fsck.patch, + +files/busybox-1.9.0-iproute.patch, +files/busybox-1.9.0-mkswap.patch, + +files/busybox-1.9.0-msh.patch, +files/busybox-1.9.0-nameif.patch, + +files/busybox-1.9.0-nohup.patch, +files/busybox-1.9.0-stty.patch, + +files/busybox-1.9.0-zcip.patch, +busybox-1.9.0.ebuild: + Version bump. 05 Feb 2008; Markus Rothe <corsair@gentoo.org> busybox-1.8.2.ebuild: Stable on ppc64 diff --git a/sys-apps/busybox/busybox-1.9.0.ebuild b/sys-apps/busybox/busybox-1.9.0.ebuild new file mode 100644 index 000000000000..38e43bdfff20 --- /dev/null +++ b/sys-apps/busybox/busybox-1.9.0.ebuild @@ -0,0 +1,239 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.9.0.ebuild,v 1.1 2008/02/06 15:36:37 vapier Exp $ + +EAPI=1 + +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 +# 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" +IUSE="debug make-symlinks pam selinux +static" +RESTRICT="test" + +DEPEND="selinux? ( sys-libs/libselinux ) + pam? ( sys-libs/pam )" + +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) +} + +src_unpack() { + unset KBUILD_OUTPUT #88088 + + unpack ${MY_P}.tar.bz2 + cd "${S}" + + # patches go here! + epatch "${FILESDIR}"/busybox-1.7.0-bb.patch + epatch "${FILESDIR}"/busybox-1.9.0-* + + # work around broken ass powerpc compilers + use ppc64 && append-flags -mminimal-toc + # 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 '/^#error Aborting compilation./d' applets/applets.c || die + use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile + cat <<-EOF >> Makefile.flags + CROSS_COMPILE := ${CHOST}- + HOSTCC := $(tc-getBUILD_CC) + SKIP_STRIP = y + EOF + + # 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 + + # If these are not set and we are using a uclibc/busybox setup + # all calls to system() will fail. + busybox_config_option y FEATURE_SH_IS_ASH + busybox_config_option n FEATURE_SH_IS_NONE + + if use static && use pam ; then + ewarn "You cannot have USE='static pam'. Assuming static is more important." + fi + 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 + for opt in LOCALE_SUPPORT TFTP FTP{GET,PUT} IPCALC TFTP HUSH \ + LASH MSH INETD DPKG RPM2CPIO RPM FOLD LOGNAME OD CRONTAB \ + UUDECODE UUENCODE SULOGIN DC DEBUG_YANK_SUSv2 DEBUG_INIT \ + DEBUG_CROND_OPTION FEATURE_UDHCP_DEBUG TASKSET + do + busybox_config_option n ${opt} + done + + emake -j1 oldconfig > /dev/null +} + +src_compile() { + unset KBUILD_OUTPUT #88088 + + emake busybox || die "build failed" + if ! use static && ! use pam ; then + mv busybox_unstripped{,.bak} + emake CONFIG_STATIC=y busybox || die "static build failed" + mv busybox_unstripped bb + mv busybox_unstripped{.bak,} + fi +} + +src_install() { + unset KBUILD_OUTPUT #88088 + save_config .config + + into / + newbin busybox_unstripped busybox || die + if use static || use pam ; then + dosym busybox /bin/bb || die + dosym bb /bin/busybox.static || die + else + dobin bb || die + fi + + insinto /$(get_libdir)/rcscripts/addons + doins "${FILESDIR}"/mdev-start.sh || die + + # bundle up the symlink files for use later + emake 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 *.sgml + + cd ../examples || die + docinto examples + dodoc inittab depmod.pl *.conf *.script undeb unrpm + + cd bootfloppy || die + docinto bootfloppy + dodoc * etc/* etc/init.d/* 2>/dev/null +} + +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 "${D}"/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 + + echo + einfo "This ebuild has support for user defined configs" + einfo "Please read this ebuild for more details and re-emerge as needed" + einfo "if you want to add or remove functionality for ${PN}" + echo +} diff --git a/sys-apps/busybox/files/busybox-1.9.0-allno.patch b/sys-apps/busybox/files/busybox-1.9.0-allno.patch new file mode 100644 index 000000000000..e830ddf4f2e5 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.9.0-allno.patch @@ -0,0 +1,23 @@ +diff -urN busybox-1.9.0/Makefile.help busybox-1.9.0-allno/Makefile.help +--- busybox-1.9.0/Makefile.help 2007-12-21 22:00:33.000000000 +0000 ++++ busybox-1.9.0-allno/Makefile.help 2008-01-04 20:03:30.000000000 +0000 +@@ -16,7 +16,6 @@ + @echo 'Configuration:' + @echo ' allnoconfig - disable all symbols in .config' + @echo ' allyesconfig - enable all symbols in .config (see defconfig)' +- @echo ' allbareconfig - enable all applets without any sub-features' + @echo ' config - text based configurator (of last resort)' + @echo ' defconfig - set .config to largest generic configuration' + @echo ' menuconfig - interactive curses-based configurator' +diff -urN busybox-1.9.0/applets/applet_tables.c busybox-1.9.0-allno/applets/applet_tables.c +--- busybox-1.9.0/applets/applet_tables.c 2007-12-24 14:08:25.000000000 +0000 ++++ busybox-1.9.0-allno/applets/applet_tables.c 2008-01-04 20:00:12.000000000 +0000 +@@ -71,7 +71,7 @@ + + puts("/* This is a generated file, don't edit */"); + +- puts("const char applet_names[] ALIGN1 ="); ++ puts("const char applet_names[] ALIGN1 = \"\" \n"); + for (i = 0; i < NUM_APPLETS; i++) { + printf("\"%s\" \"\\0\"\n", applets[i].name); + } diff --git a/sys-apps/busybox/files/busybox-1.9.0-fsck.patch b/sys-apps/busybox/files/busybox-1.9.0-fsck.patch new file mode 100644 index 000000000000..5bf4bd275ca7 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.9.0-fsck.patch @@ -0,0 +1,15 @@ +--- busybox-1.9.0/e2fsprogs/fsck.c Fri Dec 21 22:00:31 2007 ++++ busybox-1.9.0-fsck/e2fsprogs/fsck.c Sat Feb 2 18:55:22 2008 +@@ -665,6 +665,12 @@ + for (i = num_args+1; i < argc; i++) + free(argv[i]); + ++ /* No pid, so don't record an instance */ ++ if (pid < 0) { ++ free(inst); ++ return; ++ } ++ + inst->pid = pid; + inst->prog = argv[0]; + inst->type = xstrdup(type); diff --git a/sys-apps/busybox/files/busybox-1.9.0-iproute.patch b/sys-apps/busybox/files/busybox-1.9.0-iproute.patch new file mode 100644 index 000000000000..4813aa3c6c06 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.9.0-iproute.patch @@ -0,0 +1,25 @@ +diff -urN busybox-1.9.0/networking/libiproute/iproute.c busybox-1.9.0-iproute/networking/libiproute/iproute.c +--- busybox-1.9.0/networking/libiproute/iproute.c 2007-12-21 22:00:23.000000000 +0000 ++++ busybox-1.9.0-iproute/networking/libiproute/iproute.c 2008-01-04 15:18:33.000000000 +0000 +@@ -841,15 +841,17 @@ + /*0-3*/ "add\0""append\0""change\0""chg\0" + /*4-7*/ "delete\0""get\0""list\0""show\0" + /*8..*/ "prepend\0""replace\0""test\0""flush\0"; +- int command_num = 6; ++ int command_num; + unsigned flags = 0; + int cmd = RTM_NEWROUTE; + ++ if (!*argv) ++ return iproute_list_or_flush(argv, 0); ++ + /* "Standard" 'ip r a' treats 'a' as 'add', not 'append' */ + /* It probably means that it is using "first match" rule */ +- if (*argv) { +- command_num = index_in_substrings(ip_route_commands, *argv); +- } ++ command_num = index_in_substrings(ip_route_commands, *argv); ++ + switch (command_num) { + case 0: /* add */ + flags = NLM_F_CREATE|NLM_F_EXCL; diff --git a/sys-apps/busybox/files/busybox-1.9.0-mkswap.patch b/sys-apps/busybox/files/busybox-1.9.0-mkswap.patch new file mode 100644 index 000000000000..ac7e1ecc5c81 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.9.0-mkswap.patch @@ -0,0 +1,15 @@ +--- busybox-1.9.0/util-linux/mkswap.c Fri Dec 21 22:00:33 2007 ++++ busybox-1.9.0-mkswap/util-linux/mkswap.c Sat Feb 2 18:55:31 2008 +@@ -64,9 +64,10 @@ + // Figure out how big the device is and announce our intentions. + + fd = xopen(argv[1], O_RDWR); +- len = fdlength(fd); ++ len = lseek(fd, 0, SEEK_END); ++ lseek(fd, 0, SEEK_SET); + pagesize = getpagesize(); +- printf("Setting up swapspace version 1, size = %"OFF_FMT"d bytes\n", ++ printf("Setting up swapspace version 1, size = %"OFF_FMT"u bytes\n", + len - pagesize); + mkswap_selinux_setcontext(fd, argv[1]); + diff --git a/sys-apps/busybox/files/busybox-1.9.0-msh.patch b/sys-apps/busybox/files/busybox-1.9.0-msh.patch new file mode 100644 index 000000000000..25c7c7605544 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.9.0-msh.patch @@ -0,0 +1,79 @@ +--- busybox-1.9.0/include/libbb.h Fri Dec 21 22:00:31 2007 ++++ busybox-1.9.0-msh/include/libbb.h Sat Feb 2 18:55:36 2008 +@@ -950,10 +950,9 @@ + }; + line_input_t *new_line_input_t(int flags); + /* Returns: +- * -1 on read errors or EOF, or on bare Ctrl-D. +- * 0 on ctrl-C, ++ * -1 on read errors or EOF, or on bare Ctrl-D, ++ * 0 on ctrl-C (the line entered is still returned in 'command'), + * >0 length of input string, including terminating '\n' +- * [is this true? stores "" in 'command' if return value is 0 or -1] + */ + int read_line_input(const char* prompt, char* command, int maxsize, line_input_t *state); + #else +--- busybox-1.9.0/libbb/lineedit.c Mon Dec 24 14:08:25 2007 ++++ busybox-1.9.0-msh/libbb/lineedit.c Sat Feb 2 18:55:36 2008 +@@ -1315,8 +1315,8 @@ + #define CTRL(a) ((a) & ~0x40) + + /* Returns: +- * -1 on read errors or EOF, or on bare Ctrl-D. +- * 0 on ctrl-C, ++ * -1 on read errors or EOF, or on bare Ctrl-D, ++ * 0 on ctrl-C (the line entered is still returned in 'command'), + * >0 length of input string, including terminating '\n' + */ + int read_line_input(const char *prompt, char *command, int maxsize, line_input_t *st) +--- busybox-1.9.0/shell/msh.c Fri Dec 21 22:00:28 2007 ++++ busybox-1.9.0-msh/shell/msh.c Sat Feb 2 18:57:12 2008 +@@ -2825,11 +2825,13 @@ + + if (pin != NULL) { + xmove_fd(pin[0], 0); +- if (pin[1] != 0) close(pin[1]); ++ if (pin[1] != 0) ++ close(pin[1]); + } + if (pout != NULL) { + xmove_fd(pout[1], 1); +- if (pout[1] != 1) close(pout[0]); ++ if (pout[1] != 1) ++ close(pout[0]); + } + + iopp = t->ioact; +@@ -4162,7 +4164,7 @@ + return 0; + } + if (i != 0) { +- waitpid(i, NULL, 0); ++ waitpid(i, NULL, 0); // safe_waitpid? + global_env.iop->argp->aword = ++cp; + close(pf[1]); + PUSHIO(afile, remap(pf[0]), +@@ -4181,7 +4183,8 @@ + * echo "$files" >zz + */ + xmove_fd(pf[1], 1); +- if (pf[0] != 1) close(pf[0]); ++ if (pf[0] != 1) ++ close(pf[0]); + + argument_list[0] = (char *) DEFAULT_SHELL; + argument_list[1] = (char *) "-c"; +@@ -4834,9 +4837,11 @@ + static int position = 0, size = 0; + + while (size == 0 || position >= size) { +- read_line_input(current_prompt, filechar_cmdbuf, BUFSIZ, line_input_state); +- size = strlen(filechar_cmdbuf); ++ size = read_line_input(current_prompt, filechar_cmdbuf, BUFSIZ, line_input_state); ++ if (size < 0) /* Error/EOF */ ++ exit(0); + position = 0; ++ /* if Ctrl-C, size == 0 and loop will repeat */ + } + c = filechar_cmdbuf[position]; + position++; diff --git a/sys-apps/busybox/files/busybox-1.9.0-nameif.patch b/sys-apps/busybox/files/busybox-1.9.0-nameif.patch new file mode 100644 index 000000000000..146bc29b06c3 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.9.0-nameif.patch @@ -0,0 +1,33 @@ +diff -urN busybox-1.9.0/networking/nameif.c busybox-1.9.0-nameif/networking/nameif.c +--- busybox-1.9.0/networking/nameif.c 2007-12-24 14:08:25.000000000 +0000 ++++ busybox-1.9.0-nameif/networking/nameif.c 2008-01-04 20:05:48.000000000 +0000 +@@ -50,18 +50,18 @@ + #define ETHTOOL_BUSINFO_LEN 32 + /* these strings are set to whatever the driver author decides... */ + struct ethtool_drvinfo { +- __u32 cmd; +- char driver[32]; /* driver short name, "tulip", "eepro100" */ +- char version[32]; /* driver version string */ +- char fw_version[32]; /* firmware version string, if applicable */ +- char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */ ++ uint32_t cmd; ++ char driver[32]; /* driver short name, "tulip", "eepro100" */ ++ char version[32]; /* driver version string */ ++ char fw_version[32]; /* firmware version string, if applicable */ ++ char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */ + /* For PCI devices, use pci_dev->slot_name. */ +- char reserved1[32]; +- char reserved2[16]; +- __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ +- __u32 testinfo_len; +- __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ +- __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ ++ char reserved1[32]; ++ char reserved2[16]; ++ uint32_t n_stats; /* number of u64's from ETHTOOL_GSTATS */ ++ uint32_t testinfo_len; ++ uint32_t eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ ++ uint32_t regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ + }; + #define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */ + #endif diff --git a/sys-apps/busybox/files/busybox-1.9.0-nohup.patch b/sys-apps/busybox/files/busybox-1.9.0-nohup.patch new file mode 100644 index 000000000000..a052401a395b --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.9.0-nohup.patch @@ -0,0 +1,82 @@ +--- trunk/busybox/coreutils/nohup.c 2007/10/11 10:05:36 20219 ++++ trunk/busybox/coreutils/nohup.c 2008/02/04 00:30:06 20940 +@@ -12,21 +12,41 @@ + + #include "libbb.h" + ++/* Compat info: nohup (GNU coreutils 6.8) does this: ++# nohup true ++nohup: ignoring input and appending output to `nohup.out' ++# nohup true 1>/dev/null ++nohup: ignoring input and redirecting stderr to stdout ++# nohup true 2>zz ++# cat zz ++nohup: ignoring input and appending output to `nohup.out' ++# nohup true 2>zz 1>/dev/null ++# cat zz ++nohup: ignoring input ++# nohup true </dev/null 1>/dev/null ++nohup: redirecting stderr to stdout ++# nohup true </dev/null 2>zz 1>/dev/null ++# cat zz ++ (nothing) ++# ++*/ ++ + int nohup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; + int nohup_main(int argc, char **argv) + { +- int nullfd; + const char *nohupout; +- char *home = NULL; ++ char *home; + + xfunc_error_retval = 127; + + if (argc < 2) bb_show_usage(); + +- nullfd = xopen(bb_dev_null, O_WRONLY|O_APPEND); + /* If stdin is a tty, detach from it. */ +- if (isatty(STDIN_FILENO)) +- dup2(nullfd, STDIN_FILENO); ++ if (isatty(STDIN_FILENO)) { ++ /* bb_error_msg("ignoring input"); */ ++ close(STDIN_FILENO); ++ xopen(bb_dev_null, O_RDONLY); /* will be fd 0 (STDIN_FILENO) */ ++ } + + nohupout = "nohup.out"; + /* Redirect stdout to nohup.out, either in "." or in "$HOME". */ +@@ -37,24 +57,22 @@ + if (home) { + nohupout = concat_path_file(home, nohupout); + xopen3(nohupout, O_CREAT|O_WRONLY|O_APPEND, S_IRUSR|S_IWUSR); ++ } else { ++ xopen(bb_dev_null, O_RDONLY); /* will be fd 1 */ + } + } +- } else dup2(nullfd, STDOUT_FILENO); ++ bb_error_msg("appending output to %s", nohupout); ++ } + +- /* If we have a tty on stderr, announce filename and redirect to stdout. +- * Else redirect to /dev/null. +- */ ++ /* If we have a tty on stderr, redirect to stdout. */ + if (isatty(STDERR_FILENO)) { +- bb_error_msg("appending to %s", nohupout); ++ /* if (stdout_wasnt_a_tty) ++ bb_error_msg("redirecting stderr to stdout"); */ + dup2(STDOUT_FILENO, STDERR_FILENO); +- } else dup2(nullfd, STDERR_FILENO); ++ } + +- if (nullfd > 2) +- close(nullfd); + signal(SIGHUP, SIG_IGN); + + BB_EXECVP(argv[1], argv+1); +- if (ENABLE_FEATURE_CLEAN_UP && home) +- free((char*)nohupout); + bb_simple_perror_msg_and_die(argv[1]); + } diff --git a/sys-apps/busybox/files/busybox-1.9.0-stty.patch b/sys-apps/busybox/files/busybox-1.9.0-stty.patch new file mode 100644 index 000000000000..d9e7b2e957fa --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.9.0-stty.patch @@ -0,0 +1,37 @@ +--- busybox-1.9.0/coreutils/stty.c Fri Dec 21 22:00:29 2007 ++++ busybox-1.9.0-stty/coreutils/stty.c Sat Feb 2 18:55:40 2008 +@@ -780,30 +780,14 @@ + + static const struct mode_info *find_mode(const char *name) + { +- int i = 0; +- const char *m = mode_name; +- +- while (*m) { +- if (strcmp(name, m) == 0) +- return &mode_info[i]; +- m += strlen(m) + 1; +- i++; +- } +- return NULL; ++ int i = index_in_strings(mode_name, name); ++ return i >= 0 ? &mode_info[i] : NULL; + } + + static const struct control_info *find_control(const char *name) + { +- int i = 0; +- const char *m = mode_name; +- +- while (*m) { +- if (strcmp(name, m) == 0) +- return &control_info[i]; +- m += strlen(m) + 1; +- i++; +- } +- return NULL; ++ int i = index_in_strings(control_name, name); ++ return i >= 0 ? &control_info[i] : NULL; + } + + enum { diff --git a/sys-apps/busybox/files/busybox-1.9.0-zcip.patch b/sys-apps/busybox/files/busybox-1.9.0-zcip.patch new file mode 100644 index 000000000000..3c173a2bcf56 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.9.0-zcip.patch @@ -0,0 +1,69 @@ +--- busybox-1.9.0/networking/zcip.c Fri Dec 21 22:00:25 2007 ++++ busybox-1.9.0-zcip/networking/zcip.c Mon Feb 4 09:37:14 2008 +@@ -180,7 +180,7 @@ + char *r_opt; + unsigned opts; + +- /* Ugly trick, but I want these zeroed in one go */ ++ // ugly trick, but I want these zeroed in one go + struct { + const struct in_addr null_ip; + const struct ether_addr null_addr; +@@ -214,8 +214,17 @@ + // exactly 2 args; -v accumulates and implies -f + opt_complementary = "=2:vv:vf"; + opts = getopt32(argv, "fqr:v", &r_opt, &verbose); ++#if !BB_MMU ++ // on NOMMU reexec early (or else we will rerun things twice) ++ if (!FOREGROUND) ++ bb_daemonize_or_rexec(DAEMON_CHDIR_ROOT, argv); ++#endif ++ // open an ARP socket ++ // (need to do it before openlog to prevent openlog from taking ++ // fd 3 (sock_fd==3)) ++ xmove_fd(xsocket(AF_PACKET, SOCK_PACKET, htons(ETH_P_ARP)), sock_fd); + if (!FOREGROUND) { +- /* Do it early, before all bb_xx_msg calls */ ++ // do it before all bb_xx_msg calls + openlog(applet_name, 0, LOG_DAEMON); + logmode |= LOGMODE_SYSLOG; + } +@@ -226,11 +235,6 @@ + bb_error_msg_and_die("invalid link address"); + } + } +- // On NOMMU reexec early (or else we will rerun things twice) +-#if !BB_MMU +- if (!FOREGROUND) +- bb_daemonize_or_rexec(DAEMON_CHDIR_ROOT, argv); +-#endif + argc -= optind; + argv += optind; + +@@ -249,8 +253,6 @@ + //TODO: are we leaving sa_family == 0 (AF_UNSPEC)?! + safe_strncpy(saddr.sa_data, intf, sizeof(saddr.sa_data)); + +- // open an ARP socket +- xmove_fd(xsocket(AF_PACKET, SOCK_PACKET, htons(ETH_P_ARP)), sock_fd); + // bind to the interface's ARP socket + xbind(sock_fd, &saddr, sizeof(saddr)); + +@@ -290,7 +292,7 @@ + // restarting after address conflicts: + // - start with some address we want to try + // - short random delay +- // - arp probes to see if another host else uses it ++ // - arp probes to see if another host uses it + // - arp announcements that we're claiming it + // - use it + // - defend it, within limits +@@ -321,7 +323,7 @@ + switch (safe_poll(fds, 1, timeout_ms)) { + + default: +- /*bb_perror_msg("poll"); - done in safe_poll */ ++ //bb_perror_msg("poll"); - done in safe_poll + return EXIT_FAILURE; + + // timeout |