diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-09-17 03:46:33 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-09-17 03:46:33 +0000 |
commit | 44c4b4fb4266290c4d90fd89b6eac26cc8fd6cd0 (patch) | |
tree | 64260ab811ed0e22a4c1f25a7794fabfba1de089 /sys-apps/busybox/files | |
parent | Switch between jobs and cpus, it should be way smarter this way. (diff) | |
download | gentoo-2-44c4b4fb4266290c4d90fd89b6eac26cc8fd6cd0.tar.gz gentoo-2-44c4b4fb4266290c4d90fd89b6eac26cc8fd6cd0.tar.bz2 gentoo-2-44c4b4fb4266290c4d90fd89b6eac26cc8fd6cd0.zip |
Version bump. Also update init.d script for openrc only #383301 by Nathan Phillip Brink.
(Portage version: 2.2.0_alpha58/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/busybox/files')
-rw-r--r-- | sys-apps/busybox/files/busybox-1.19.2-android.patch | 11 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.19.2-buildsys.patch | 19 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.19.2-chpasswd.patch | 55 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.19.2-crond.patch | 12 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.19.2-inetd.patch | 47 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.19.2-syslogd.patch | 20 | ||||
-rw-r--r-- | sys-apps/busybox/files/busybox-1.19.2-tail.patch | 43 | ||||
-rwxr-xr-x | sys-apps/busybox/files/mdev.rc.1 | 98 |
8 files changed, 305 insertions, 0 deletions
diff --git a/sys-apps/busybox/files/busybox-1.19.2-android.patch b/sys-apps/busybox/files/busybox-1.19.2-android.patch new file mode 100644 index 000000000000..e2e6528a2fce --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.19.2-android.patch @@ -0,0 +1,11 @@ +--- busybox-1.19.2/include/platform.h ++++ busybox-1.19.2-android/include/platform.h +@@ -433,7 +433,7 @@ typedef unsigned smalluint; + # undef HAVE_STPCPY + #endif + +-#if defined(ANDROID) ++#if defined(ANDROID) || defined(__ANDROID__) + # undef HAVE_DPRINTF + # undef HAVE_GETLINE + # undef HAVE_STPCPY diff --git a/sys-apps/busybox/files/busybox-1.19.2-buildsys.patch b/sys-apps/busybox/files/busybox-1.19.2-buildsys.patch new file mode 100644 index 000000000000..8e0c4c33eefa --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.19.2-buildsys.patch @@ -0,0 +1,19 @@ +--- busybox-1.19.2/applets/applet_tables.c ++++ busybox-1.19.2-buildsys/applets/applet_tables.c +@@ -80,8 +80,15 @@ int main(int argc, char **argv) + + printf("#define NUM_APPLETS %u\n", NUM_APPLETS); + if (NUM_APPLETS == 1) { ++ char *dash_to_underscore, *p; + printf("#define SINGLE_APPLET_STR \"%s\"\n", applets[0].name); +- printf("#define SINGLE_APPLET_MAIN %s_main\n", applets[0].name); ++ /* Example: "ether-wake" -> "ether_wake" */ ++ p = dash_to_underscore = strdup(applets[0].name); ++ p--; ++ while (*++p) ++ if (*p == '-') ++ *p = '_'; ++ printf("#define SINGLE_APPLET_MAIN %s_main\n", dash_to_underscore); + } + printf("\n"); + diff --git a/sys-apps/busybox/files/busybox-1.19.2-chpasswd.patch b/sys-apps/busybox/files/busybox-1.19.2-chpasswd.patch new file mode 100644 index 000000000000..0cba0e219a5c --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.19.2-chpasswd.patch @@ -0,0 +1,55 @@ +--- busybox-1.19.2/loginutils/chpasswd.c ++++ busybox-1.19.2-chpasswd/loginutils/chpasswd.c +@@ -33,9 +33,8 @@ static const char chpasswd_longopts[] AL + int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; + int chpasswd_main(int argc UNUSED_PARAM, char **argv) + { +- char *name, *pass; +- char salt[sizeof("$N$XXXXXXXX")]; +- int opt, rc; ++ char *name; ++ int opt; + + if (getuid() != 0) + bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); +@@ -45,6 +44,10 @@ int chpasswd_main(int argc UNUSED_PARAM, + opt = getopt32(argv, "em"); + + while ((name = xmalloc_fgetline(stdin)) != NULL) { ++ char *free_me; ++ char *pass; ++ int rc; ++ + pass = strchr(name, ':'); + if (!pass) + bb_error_msg_and_die("missing new password"); +@@ -52,7 +55,10 @@ int chpasswd_main(int argc UNUSED_PARAM, + + xuname2uid(name); /* dies if there is no such user */ + ++ free_me = NULL; + if (!(opt & OPT_ENC)) { ++ char salt[sizeof("$N$XXXXXXXX")]; ++ + crypt_make_salt(salt, 1); + if (opt & OPT_MD5) { + salt[0] = '$'; +@@ -60,7 +66,7 @@ int chpasswd_main(int argc UNUSED_PARAM, + salt[2] = '$'; + crypt_make_salt(salt + 3, 4); + } +- pass = pw_encrypt(pass, salt, 0); ++ free_me = pass = pw_encrypt(pass, salt, 0); + } + + /* This is rather complex: if user is not found in /etc/shadow, +@@ -81,8 +87,7 @@ int chpasswd_main(int argc UNUSED_PARAM, + bb_info_msg("Password for '%s' changed", name); + logmode = LOGMODE_STDIO; + free(name); +- if (!(opt & OPT_ENC)) +- free(pass); ++ free(free_me); + } + return EXIT_SUCCESS; + } diff --git a/sys-apps/busybox/files/busybox-1.19.2-crond.patch b/sys-apps/busybox/files/busybox-1.19.2-crond.patch new file mode 100644 index 000000000000..043a846ca4a5 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.19.2-crond.patch @@ -0,0 +1,12 @@ +--- busybox-1.19.2/miscutils/crond.c ++++ busybox-1.19.2-crond/miscutils/crond.c +@@ -861,7 +861,8 @@ int crond_main(int argc UNUSED_PARAM, ch + + /* "-b after -f is ignored", and so on for every pair a-b */ + opt_complementary = "f-b:b-f:S-L:L-S" IF_FEATURE_CROND_D(":d-l") +- ":l+:d+"; /* -l and -d have numeric param */ ++ /* -l and -d have numeric param */ ++ ":l+" IF_FEATURE_CROND_D(":d+"); + opts = getopt32(argv, "l:L:fbSc:" IF_FEATURE_CROND_D("d:"), + &G.log_level, &G.log_filename, &G.crontab_dir_name + IF_FEATURE_CROND_D(,&G.log_level)); diff --git a/sys-apps/busybox/files/busybox-1.19.2-inetd.patch b/sys-apps/busybox/files/busybox-1.19.2-inetd.patch new file mode 100644 index 000000000000..e1395a6b3bd0 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.19.2-inetd.patch @@ -0,0 +1,47 @@ +--- busybox-1.19.2/networking/inetd.c ++++ busybox-1.19.2-inetd/networking/inetd.c +@@ -1278,6 +1278,7 @@ int inetd_main(int argc UNUSED_PARAM, ch + sep->se_count = 0; + rearm_alarm(); /* will revive it in RETRYTIME sec */ + restore_sigmask(&omask); ++ maybe_close(new_udp_fd); + maybe_close(accepted_fd); + continue; /* -> check next fd in fd set */ + } +@@ -1298,17 +1299,18 @@ int inetd_main(int argc UNUSED_PARAM, ch + bb_perror_msg("vfork"+1); + sleep(1); + restore_sigmask(&omask); ++ maybe_close(new_udp_fd); + maybe_close(accepted_fd); + continue; /* -> check next fd in fd set */ + } + if (pid == 0) + pid--; /* -1: "we did fork and we are child" */ + } +- /* if pid == 0 here, we never forked */ ++ /* if pid == 0 here, we didn't fork */ + + if (pid > 0) { /* parent */ + if (sep->se_wait) { +- /* tcp wait: we passed listening socket to child, ++ /* wait: we passed socket to child, + * will wait for child to terminate */ + sep->se_wait = pid; + remove_fd_from_set(sep->se_fd); +@@ -1345,9 +1347,13 @@ int inetd_main(int argc UNUSED_PARAM, ch + setsid(); + /* "nowait" udp */ + if (new_udp_fd >= 0) { +- len_and_sockaddr *lsa = xzalloc_lsa(sep->se_family); ++ len_and_sockaddr *lsa; ++ int r; ++ ++ close(new_udp_fd); ++ lsa = xzalloc_lsa(sep->se_family); + /* peek at the packet and remember peer addr */ +- int r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT, ++ r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT, + &lsa->u.sa, &lsa->len); + if (r < 0) + goto do_exit1; diff --git a/sys-apps/busybox/files/busybox-1.19.2-syslogd.patch b/sys-apps/busybox/files/busybox-1.19.2-syslogd.patch new file mode 100644 index 000000000000..d54f5d4307b4 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.19.2-syslogd.patch @@ -0,0 +1,20 @@ +--- busybox-1.19.2/sysklogd/syslogd.c ++++ busybox-1.19.2-syslogd/sysklogd/syslogd.c +@@ -278,7 +278,7 @@ static void parse_syslogdcfg(const char + parser_t *parser; + + parser = config_open2(file ? file : "/etc/syslog.conf", +- file ? xfopen_for_read : fopen_or_warn_stdin); ++ file ? xfopen_for_read : fopen_for_read); + if (!parser) + /* didn't find default /etc/syslog.conf */ + /* proceed as if we built busybox without config support */ +@@ -678,7 +678,7 @@ static void timestamp_and_log(int pri, c + if (LOG_PRI(pri) < G.logLevel) { + #if ENABLE_FEATURE_IPC_SYSLOG + if ((option_mask32 & OPT_circularlog) && G.shbuf) { +- log_to_shmem(msg); ++ log_to_shmem(G.printbuf); + return; + } + #endif diff --git a/sys-apps/busybox/files/busybox-1.19.2-tail.patch b/sys-apps/busybox/files/busybox-1.19.2-tail.patch new file mode 100644 index 000000000000..f3cc79814e58 --- /dev/null +++ b/sys-apps/busybox/files/busybox-1.19.2-tail.patch @@ -0,0 +1,43 @@ +--- busybox-1.19.2/coreutils/tail.c ++++ busybox-1.19.2-tail/coreutils/tail.c +@@ -203,7 +203,7 @@ int tail_main(int argc, char **argv) + int fd = fds[i]; + + if (ENABLE_FEATURE_FANCY_TAIL && fd < 0) +- continue; /* may happen with -E */ ++ continue; /* may happen with -F */ + + if (nfiles > header_threshhold) { + tail_xprint_header(fmt, argv[i]); +@@ -252,14 +252,14 @@ int tail_main(int argc, char **argv) + * Used only by +N code ("start from Nth", 1-based): */ + seen = 1; + newlines_seen = 0; +- while ((nread = tail_read(fd, buf, tailbufsize-taillen)) > 0) { ++ while ((nread = tail_read(fd, buf, tailbufsize - taillen)) > 0) { + if (G.from_top) { + int nwrite = nread; + if (seen < count) { + /* We need to skip a few more bytes/lines */ + if (COUNT_BYTES) { + nwrite -= (count - seen); +- seen = count; ++ seen += nread; + } else { + char *s = buf; + do { +--- busybox-1.19.2/testsuite/tail.tests ++++ busybox-1.19.2-tail/testsuite/tail.tests +@@ -14,4 +14,12 @@ testing "tail: +N with N > file length" + "0\n" \ + "" "qw" + ++testing "tail: -c +N with largish N" \ ++ " ++ dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8200 | wc -c; ++ dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8208 | wc -c; ++ " \ ++ "8185\n8177\n" \ ++ "" "" ++ + exit $FAILCOUNT diff --git a/sys-apps/busybox/files/mdev.rc.1 b/sys-apps/busybox/files/mdev.rc.1 new file mode 100755 index 000000000000..4d400a17f575 --- /dev/null +++ b/sys-apps/busybox/files/mdev.rc.1 @@ -0,0 +1,98 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/mdev.rc.1,v 1.1 2011/09/17 03:46:33 vapier Exp $ + +depend() +{ + provide dev + 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 +} |