SHA256
1
0
forked from pool/busybox

Accepting request 64020 from home:computersalat:devel:Base

OBS-URL: https://build.opensuse.org/request/show/64020
OBS-URL: https://build.opensuse.org/package/show/Base:System/busybox?expand=0&rev=12
This commit is contained in:
Stephan Kulow 2011-03-18 18:51:17 +00:00 committed by Git OBS Bridge
parent 109810fbea
commit 124ada3f00
15 changed files with 4873 additions and 46 deletions

4530
BusyBox.1 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7a4c9d59098734c86c3bfef421719c3239ca213bba071e284e2352ff4a01cac6
size 2094392

View File

@ -0,0 +1,10 @@
--- busybox-1.18.3/Config.in
+++ busybox-1.18.3-buildsys/Config.in
@@ -126,7 +126,6 @@ config FEATURE_INSTALLER
config INSTALL_NO_USR
bool "Don't use /usr"
default n
- depends on FEATURE_INSTALLER
help
Disable use of /usr. busybox --install and "make install"
will install applets only to /bin and /sbin,

View File

@ -0,0 +1,10 @@
--- busybox-1.18.3/coreutils/cksum.c
+++ busybox-1.18.3-cksum/coreutils/cksum.c
@@ -38,6 +38,7 @@ int cksum_main(int argc UNUSED_PARAM, ch
#define read_buf bb_common_bufsiz1
while ((bytes_read = safe_read(fd, read_buf, sizeof(read_buf))) > 0) {
+ length += bytes_read;
crc = crc32_block_endian1(crc, read_buf, bytes_read, crc32_table);
}
close(fd);

View File

@ -0,0 +1,45 @@
--- busybox-1.18.3/sysklogd/klogd.c
+++ busybox-1.18.3-klogd/sysklogd/klogd.c
@@ -150,12 +150,41 @@ int klogd_main(int argc UNUSED_PARAM, ch
*/
klogd_open();
openlog("kernel", 0, LOG_KERN);
+ /*
+ * glibc problem: for some reason, glibc changes LOG_KERN to LOG_USER
+ * above. The logic behind this is that standard
+ * http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html
+ * says the following about openlog and syslog:
+ * "LOG_USER
+ * Messages generated by arbitrary processes.
+ * This is the default facility identifier if none is specified."
+ *
+ * I believe glibc misinterpreted this text as "if openlog's
+ * third parameter is 0 (=LOG_KERN), treat it as LOG_USER".
+ * Whereas it was meant to say "if *syslog* is called with facility
+ * 0 in its 1st parameter without prior call to openlog, then perform
+ * implicit openlog(LOG_USER)".
+ *
+ * As a result of this, eh, feature, standard klogd was forced
+ * to open-code its own openlog and syslog implementation (!).
+ *
+ * Note that prohibiting openlog(LOG_KERN) on libc level does not
+ * add any security: any process can open a socket to "/dev/log"
+ * and write a string "<0>Voila, a LOG_KERN + LOG_EMERG message"
+ *
+ * Google code search tells me there is no widespread use of
+ * openlog("foo", 0, 0), thus fixing glibc won't break userspace.
+ *
+ * The bug against glibc was filed:
+ * bugzilla.redhat.com/show_bug.cgi?id=547000
+ */
if (i)
klogd_setloglevel(i);
- bb_signals(BB_FATAL_SIGS, record_signo);
signal(SIGHUP, SIG_IGN);
+ /* We want klogd_read to not be restarted, thus _norestart: */
+ bb_signals_recursive_norestart(BB_FATAL_SIGS, record_signo);
syslog(LOG_NOTICE, "klogd started: %s", bb_banner);

View File

@ -0,0 +1,13 @@
diff -ruN busybox-1.18.3-orig/archival/libarchive/get_header_tar.c busybox-1.18.3/archival/libarchive/get_header_tar.c
--- busybox-1.18.3-orig/archival/libarchive/get_header_tar.c 2011-02-08 18:24:57.000000000 +0100
+++ busybox-1.18.3/archival/libarchive/get_header_tar.c 2011-03-12 23:28:59.000000000 +0100
@@ -287,6 +287,9 @@
}
file_header->link_target = NULL;
if (!p_linkname && parse_names && tar.linkname[0]) {
+ /* we trash magic[0] here to terminate tar.linkname, it's ok */
+ tar.magic[0] = '\0';
+
file_header->link_target = xstrndup(tar.linkname, sizeof(tar.linkname));
/* FIXME: what if we have non-link object with link_target? */
/* Will link_target be free()ed? */

View File

@ -0,0 +1,11 @@
--- busybox-1.18.3/scripts/kconfig/mconf.c
+++ busybox-1.18.3-menuconfig/scripts/kconfig/mconf.c
@@ -256,7 +256,7 @@ search_help[] = N_(
" USB$ => find all CONFIG_ symbols ending with USB\n"
"\n");
-static char buf[4096], *bufptr = buf;
+static char buf[4096*10], *bufptr = buf;
static char input_buf[4096];
static const char filename[] = ".config";
static char *args[1024], **argptr = args;

View File

@ -0,0 +1,36 @@
--- busybox-1.18.3/modutils/modutils-24.c
+++ busybox-1.18.3-modutils24/modutils/modutils-24.c
@@ -2474,6 +2474,7 @@ new_process_module_arguments(struct obj_
n = 0;
p = val;
while (*p != 0) {
+ char sv_ch;
char *endp;
if (++n > max)
@@ -2482,14 +2483,17 @@ new_process_module_arguments(struct obj_
switch (*pinfo) {
case 's':
len = strcspn(p, ",");
+ sv_ch = p[len];
p[len] = 0;
obj_string_patch(f, sym->secidx,
loc - contents, p);
loc += tgt_sizeof_char_p;
p += len;
+ *p = sv_ch;
break;
case 'c':
len = strcspn(p, ",");
+ sv_ch = p[len];
p[len] = 0;
if (len >= charssize)
bb_error_msg_and_die("string too long for %s (max %ld)", param,
@@ -2497,6 +2501,7 @@ new_process_module_arguments(struct obj_
strcpy((char *) loc, p);
loc += charssize;
p += len;
+ *p = sv_ch;
break;
case 'b':
*loc++ = strtoul(p, &endp, 0);

128
busybox-1.18.3-wget.patch Normal file
View File

@ -0,0 +1,128 @@
--- busybox-1.18.3/networking/wget.c
+++ busybox-1.18.3-wget/networking/wget.c
@@ -446,7 +446,7 @@ static FILE* prepare_ftp_session(FILE **
static void NOINLINE retrieve_file_data(FILE *dfp, int output_fd)
{
- char buf[512];
+ char buf[4*1024]; /* made bigger to speed up local xfers */
#if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT
# if ENABLE_FEATURE_WGET_TIMEOUT
unsigned second_cnt;
@@ -455,7 +455,6 @@ static void NOINLINE retrieve_file_data(
polldata.fd = fileno(dfp);
polldata.events = POLLIN | POLLPRI;
- ndelay_on(polldata.fd);
#endif
progress_meter(PROGRESS_START);
@@ -464,6 +463,10 @@ static void NOINLINE retrieve_file_data(
/* Loops only if chunked */
while (1) {
+
+#if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT
+ ndelay_on(polldata.fd);
+#endif
while (1) {
int n;
unsigned rdsz;
@@ -493,22 +496,46 @@ static void NOINLINE retrieve_file_data(
progress_meter(PROGRESS_BUMP);
}
#endif
+ /* fread internally uses read loop, which in our case
+ * is usually exited when we get EAGAIN.
+ * In this case, libc sets error marker on the stream.
+ * Need to clear it before next fread to avoid possible
+ * rare false positive ferror below. Rare because usually
+ * fread gets more than zero bytes, and we don't fall
+ * into if (n <= 0) ...
+ */
+ clearerr(dfp);
+ errno = 0;
n = safe_fread(buf, rdsz, dfp);
+ /* man fread:
+ * If error occurs, or EOF is reached, the return value
+ * is a short item count (or zero).
+ * fread does not distinguish between EOF and error.
+ */
if (n <= 0) {
- if (ferror(dfp)) {
- /* perror will not work: ferror doesn't set errno */
- bb_error_msg_and_die(bb_msg_read_error);
- }
- break;
+#if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT
+ if (errno == EAGAIN) /* poll lied, there is no data? */
+ continue; /* yes */
+#endif
+ if (ferror(dfp))
+ bb_perror_msg_and_die(bb_msg_read_error);
+ break; /* EOF, not error */
}
+
xwrite(output_fd, buf, n);
#if ENABLE_FEATURE_WGET_STATUSBAR
G.transferred += n;
progress_meter(PROGRESS_BUMP);
#endif
- if (G.got_clen)
+ if (G.got_clen) {
G.content_len -= n;
+ if (G.content_len == 0)
+ break;
+ }
}
+#if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT
+ ndelay_off(polldata.fd);
+#endif
if (!G.chunked)
break;
@@ -706,6 +733,11 @@ int wget_main(int argc UNUSED_PARAM, cha
fprintf(sfp, "Host: %s\r\nUser-Agent: %s\r\n",
target.host, user_agent);
+ /* Ask server to close the connection as soon as we are done
+ * (IOW: we do not intend to send more requests)
+ */
+ fprintf(sfp, "Connection: close\r\n");
+
#if ENABLE_FEATURE_WGET_AUTHENTICATION
if (target.user) {
fprintf(sfp, "Proxy-Authorization: Basic %s\r\n"+6,
@@ -719,22 +751,25 @@ int wget_main(int argc UNUSED_PARAM, cha
if (G.beg_range)
fprintf(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range);
+
#if ENABLE_FEATURE_WGET_LONG_OPTIONS
if (extra_headers)
fputs(extra_headers, sfp);
if (opt & WGET_OPT_POST_DATA) {
char *estr = URL_escape(post_data);
- fprintf(sfp, "Content-Type: application/x-www-form-urlencoded\r\n");
- fprintf(sfp, "Content-Length: %u\r\n" "\r\n" "%s",
- (int) strlen(estr), estr);
- /*fprintf(sfp, "Connection: Keep-Alive\r\n\r\n");*/
- /*fprintf(sfp, "%s\r\n", estr);*/
+ fprintf(sfp,
+ "Content-Type: application/x-www-form-urlencoded\r\n"
+ "Content-Length: %u\r\n"
+ "\r\n"
+ "%s",
+ (int) strlen(estr), estr
+ );
free(estr);
} else
#endif
- { /* If "Connection:" is needed, document why */
- fprintf(sfp, /* "Connection: close\r\n" */ "\r\n");
+ {
+ fprintf(sfp, "\r\n");
}
fflush(sfp);

3
busybox-1.18.3.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:83f112ee88b7eb85bea1cac0b1af33f61387a1036f1898c5ecd79813191a619b
size 2119251

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Sat Mar 12 23:03:39 UTC 2011 - chris@computersalat.de
- update to 1.18.13
see http://www.busybox.net/ for full changelog
- add upstream patches
o buildsys.patch
o cksum.patch
o klogd.patch
o menuconfig.patch
o modutils24.patch
o wget.patch
- rework libunarchive-array patch
o -> libarchive patch
- remove .gitignore files
- added missing BusyBox.1 as S:1
- added export CFLAGS="{optflags} -fno-strict-aliasing"
-------------------------------------------------------------------
Sun Oct 31 12:37:02 UTC 2010 - jengelh@medozas.de

View File

@ -1,5 +1,5 @@
#
# spec file for package busybox-static (Version 1.17.2)
# spec file for package busybox-static
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -15,24 +15,30 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: busybox-static
Url: http://www.busybox.net/
Version: 1.17.2
Version: 1.18.3
Release: 1
Summary: The Swiss Army Knife of Embedded Linux
License: GPLv2+
Group: System/Base
AutoReqProv: on
Source: http://busybox.net/downloads/busybox-%{version}.tar.bz2
Source1: BusyBox.1
Source2: busybox.SuSE.config
Source3: mkinitrd-setup.sh
Source4: mkinitrd-boot.sh
Patch1: busybox.uClibc-build-fix.patch
# upstream patches
Patch0: busybox-1.18.3-buildsys.patch
Patch1: busybox-1.18.3-cksum.patch
Patch2: busybox-1.18.3-klogd.patch
Patch3: busybox-1.18.3-menuconfig.patch
Patch4: busybox-1.18.3-modutils24.patch
Patch5: busybox-1.18.3-wget.patch
# other patches
Patch99: busybox.uClibc-build-fix.patch
Patch100: busybox.install.patch
Patch101: busybox.libunarchive-array.patch
Patch101: busybox-1.18.3-libarchive.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: uClibc-devel
ExcludeArch: s390 s390x ppc64
@ -50,16 +56,26 @@ counterparts.
%prep
%setup -q -n busybox-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch99 -p1
%patch100 -p1
%patch101 -p1
%{__cp} -a %{S:1} docs/
%{__cp} -a %{S:2} .config
find -name CVS | xargs rm -rf
find -name .cvsignore | xargs rm -rf
find -name .svn | xargs rm -rf
find -name .gitignore | xargs rm -rf
%build
cp -avL %{S:2} .config
find -name CVS | xargs rm -rf
find -name .svn | xargs rm -rf
export VERBOSE=-v
export BUILD_VERBOSE=2
export CFLAGS="%{optflags} -fno-strict-aliasing"
# somehow uClibc prefers it's own ar.h header, so rename it
mv include/ar.h include/b_ar.h
sed -i -e 's/"ar.h"/"b_ar.h"/' archival/*.c archival/*/*.c
@ -67,7 +83,6 @@ make -e oldconfig
make -e CC=gcc-uClibc %{?_smp_mflags}
%install
find -name ".cvsignore" -exec rm {} \;
install -d $RPM_BUILD_ROOT/usr/bin
install busybox $RPM_BUILD_ROOT/usr/bin/busybox-static

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Sat Mar 12 23:03:39 UTC 2011 - chris@computersalat.de
- update to 1.18.13
see http://www.busybox.net/ for full changelog
- add upstream patches
o buildsys.patch
o cksum.patch
o klogd.patch
o menuconfig.patch
o modutils24.patch
o wget.patch
- rework libunarchive-array patch
o -> libarchive patch
- remove .gitignore files
- added missing BusyBox.1 as S:1
- added export CFLAGS="{optflags} -fno-strict-aliasing"
-------------------------------------------------------------------
Sun Oct 31 12:37:02 UTC 2010 - jengelh@medozas.de

View File

@ -1,22 +0,0 @@
archival/libunarchive/get_header_tar.c: In function 'get_header_tar':
archival/libunarchive/get_header_tar.c:140: warning: array subscript is above array bounds
archival/libunarchive/get_header_tar.c:155: warning: array subscript is above array bounds
archival/libunarchive/get_header_tar.c:158: warning: array subscript is above array bounds
make[1]: *** [archival/libunarchive/get_header_tar.o] Error 1
---
archival/libunarchive/get_header_tar.c | 3 +++
1 file changed, 3 insertions(+)
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -225,6 +225,9 @@ char FAST_FUNC get_header_tar(archive_ha
}
file_header->link_target = NULL;
if (!p_linkname && parse_names && tar.linkname[0]) {
+ /* we trash magic[0] here to terminate tar.linkname, it's ok */
+ tar.magic[0] = '\0';
+
file_header->link_target = xstrndup(tar.linkname, sizeof(tar.linkname));
/* FIXME: what if we have non-link object with link_target? */
/* Will link_target be free()ed? */

View File

@ -1,5 +1,5 @@
#
# spec file for package busybox (Version 1.17.2)
# spec file for package busybox
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -15,23 +15,29 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: busybox
Url: http://www.busybox.net/
Version: 1.17.2
Version: 1.18.3
Release: 1
Summary: The Swiss Army Knife of Embedded Linux
License: GPLv2+
Group: System/Base
AutoReqProv: on
Source: http://busybox.net/downloads/%{name}-%{version}.tar.bz2
Source1: BusyBox.1
Source2: busybox.SuSE.config
Source3: mkinitrd-setup.sh
Source4: mkinitrd-boot.sh
# upstream patches
Patch0: %{name}-1.18.3-buildsys.patch
Patch1: %{name}-1.18.3-cksum.patch
Patch2: %{name}-1.18.3-klogd.patch
Patch3: %{name}-1.18.3-menuconfig.patch
Patch4: %{name}-1.18.3-modutils24.patch
Patch5: %{name}-1.18.3-wget.patch
# other patches
Patch100: busybox.install.patch
Patch101: busybox.libunarchive-array.patch
Patch101: %{name}-1.18.3-libarchive.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -47,21 +53,30 @@ counterparts.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch100 -p1
%patch101 -p1
%{__cp} -a %{S:1} docs/
%{__cp} -a %{S:2} .config
find -name CVS | xargs rm -rf
find -name .cvsignore | xargs rm -rf
find -name .svn | xargs rm -rf
find -name .gitignore | xargs rm -rf
%build
cp -avL %{S:2} .config
find -name CVS | xargs rm -rf
find -name .svn | xargs rm -rf
export VERBOSE=-v
export BUILD_VERBOSE=2
export CFLAGS="%{optflags} -fno-strict-aliasing"
make -e oldconfig
make -e %{?_smp_mflags}
make -e doc busybox.links %{?_smp_mflags}
%install
find -name ".cvsignore" -exec rm {} \;
install -d $RPM_BUILD_ROOT/usr/bin
install -d $RPM_BUILD_ROOT/usr/share/busybox
install busybox.links $RPM_BUILD_ROOT/usr/share/busybox