summaryrefslogtreecommitdiffstats
path: root/tools/busybox-patches
diff options
context:
space:
mode:
authorLars Müller2007-01-12 21:45:41 +0100
committerLars Müller2007-01-12 21:45:41 +0100
commit4652fb09bbc68d151b679613e2d7cac5b57f4960 (patch)
tree9542ae03251ccb39ce87676a06c18b2eb68cd598 /tools/busybox-patches
parentRemove superfluous settings. (diff)
downloadcore-4652fb09bbc68d151b679613e2d7cac5b57f4960.tar.gz
core-4652fb09bbc68d151b679613e2d7cac5b57f4960.tar.xz
core-4652fb09bbc68d151b679613e2d7cac5b57f4960.zip
Update patch set and config to bb 1.3.1.
Rename busybox-1.2.2-config to busybox.config. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@621 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'tools/busybox-patches')
-rw-r--r--tools/busybox-patches/busybox-1.3.1.shadow.patch232
-rw-r--r--tools/busybox-patches/bzip2-payload.diff70
-rw-r--r--tools/busybox-patches/libunarchive_get_header_cpio.c.diff16
-rw-r--r--tools/busybox-patches/networking_httpd.diff29
-rw-r--r--tools/busybox-patches/series3
-rw-r--r--tools/busybox-patches/unionfs-run-init.diff8
6 files changed, 301 insertions, 57 deletions
diff --git a/tools/busybox-patches/busybox-1.3.1.shadow.patch b/tools/busybox-patches/busybox-1.3.1.shadow.patch
new file mode 100644
index 00000000..a7994d73
--- /dev/null
+++ b/tools/busybox-patches/busybox-1.3.1.shadow.patch
@@ -0,0 +1,232 @@
+Source: http://www.busybox.net/downloads/fixes-1.3.1/busybox-1.3.1.shadow.patch
+
+--- busybox-1.3.1/include/libbb.h Wed Dec 27 05:56:18 2006
++++ busybox-1.3.1.shadow/include/libbb.h Sat Dec 30 15:24:07 2006
+@@ -46,11 +46,13 @@
+ #ifdef CONFIG_LOCALE_SUPPORT
+ #include <locale.h>
+ #else
+-#define setlocale(x,y)
++#define setlocale(x,y) ((void)0)
+ #endif
+
+ #include "pwd_.h"
+ #include "grp_.h"
++/* ifdef it out, because it may include <shadow.h> */
++/* and we may not even _have_ <shadow.h>! */
+ #if ENABLE_FEATURE_SHADOWPASSWDS
+ #include "shadow_.h"
+ #endif
+@@ -59,7 +61,7 @@
+ #include <limits.h>
+ #include <sys/param.h>
+ #ifndef PATH_MAX
+-#define PATH_MAX 256
++#define PATH_MAX 256
+ #endif
+
+ /* Tested to work correctly (IIRC :]) */
+--- busybox-1.3.1/libpwdgrp/pwd_grp.c Wed Dec 27 05:56:32 2006
++++ busybox-1.3.1.shadow/libpwdgrp/pwd_grp.c Sat Dec 30 15:24:07 2006
+@@ -52,7 +52,9 @@
+
+ extern int __parsepwent(void *pw, char *line);
+ extern int __parsegrent(void *gr, char *line);
++#if ENABLE_USE_BB_SHADOW
+ extern int __parsespent(void *sp, char *line);
++#endif
+
+ extern int __pgsreader(int (*__parserfunc)(void *d, char *line), void *data,
+ char *__restrict line_buff, size_t buflen, FILE *f);
+@@ -103,6 +105,7 @@
+ return rv;
+ }
+
++#if ENABLE_USE_BB_SHADOW
+ int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
+ char *__restrict buffer, size_t buflen,
+ struct spwd **__restrict result)
+@@ -117,6 +120,7 @@
+
+ return rv;
+ }
++#endif
+
+ /**********************************************************************/
+ /* For the various fget??ent funcs, return NULL on failure and a
+@@ -144,6 +148,7 @@
+ return result;
+ }
+
++#if ENABLE_USE_BB_SHADOW
+ extern int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
+ char *__restrict buffer, size_t buflen,
+ struct spwd **__restrict result);
+@@ -184,6 +189,7 @@
+ DONE:
+ return rv;
+ }
++#endif
+
+ /**********************************************************************/
+
+@@ -207,6 +213,7 @@
+ #define DO_GETXXKEY_R_PATHNAME _PATH_GROUP
+ #include "pwd_grp_internal.c"
+
++#if ENABLE_USE_BB_SHADOW
+ #define GETXXKEY_R_FUNC getspnam_R
+ #define GETXXKEY_R_PARSER __parsespent
+ #define GETXXKEY_R_ENTTYPE struct spwd
+@@ -214,6 +221,7 @@
+ #define DO_GETXXKEY_R_KEYTYPE const char *__restrict
+ #define DO_GETXXKEY_R_PATHNAME _PATH_SHADOW
+ #include "pwd_grp_internal.c"
++#endif
+
+ #define GETXXKEY_R_FUNC getpwuid_R
+ #define GETXXKEY_R_PARSER __parsepwent
+@@ -253,6 +261,7 @@
+ return result;
+ }
+
++#if 0 //ENABLE_USE_BB_SHADOW
+ /* This function is non-standard and is currently not built. It seems
+ * to have been created as a reentrant version of the non-standard
+ * functions getspuid. Why getspuid was added, I do not know. */
+@@ -286,6 +295,7 @@
+ getspuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);
+ return result;
+ }
++#endif
+
+ struct passwd *getpwnam(const char *name)
+ {
+@@ -307,6 +317,7 @@
+ return result;
+ }
+
++#if ENABLE_USE_BB_SHADOW
+ struct spwd *getspnam(const char *name)
+ {
+ static char buffer[PWD_BUFFER_SIZE];
+@@ -316,6 +327,7 @@
+ getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
+ return result;
+ }
++#endif
+
+ int getpw(uid_t uid, char *buf)
+ {
+@@ -444,6 +456,7 @@
+ return rv;
+ }
+
++#if ENABLE_USE_BB_SHADOW
+ static FILE *spf /*= NULL*/;
+ void setspent(void)
+ {
+@@ -488,6 +501,7 @@
+ UNLOCK;
+ return rv;
+ }
++#endif
+
+ struct passwd *getpwent(void)
+ {
+@@ -509,6 +523,7 @@
+ return result;
+ }
+
++#if ENABLE_USE_BB_SHADOW
+ struct spwd *getspent(void)
+ {
+ static char line_buff[PWD_BUFFER_SIZE];
+@@ -528,6 +543,7 @@
+ sgetspent_r(string, &spwd, line_buff, sizeof(line_buff), &result);
+ return result;
+ }
++#endif
+
+ int initgroups(const char *user, gid_t gid)
+ {
+@@ -643,6 +659,7 @@
+ return rv;
+ }
+
++#if ENABLE_USE_BB_SHADOW
+ static const unsigned char _sp_off[] = {
+ offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */
+ offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
+@@ -688,6 +705,7 @@
+ DO_UNLOCK:
+ return rv;
+ }
++#endif
+
+ /**********************************************************************/
+ /* Internal uClibc functions. */
+@@ -846,6 +864,7 @@
+
+ /**********************************************************************/
+
++#if ENABLE_USE_BB_SHADOW
+ static const unsigned char sp_off[] = {
+ offsetof(struct spwd, sp_namp), /* 0 */
+ offsetof(struct spwd, sp_pwdp), /* 1 */
+@@ -900,6 +919,7 @@
+
+ return EINVAL;
+ }
++#endif
+
+ /**********************************************************************/
+
+--- busybox-1.3.1/loginutils/passwd.c Wed Dec 27 05:56:20 2006
++++ busybox-1.3.1.shadow/loginutils/passwd.c Sat Dec 30 15:24:07 2006
+@@ -275,7 +275,8 @@
+ }
+
+ filename = bb_path_passwd_file;
+- if (ENABLE_FEATURE_SHADOWPASSWDS) {
++#if ENABLE_FEATURE_SHADOWPASSWDS
++ {
+ struct spwd *sp = getspnam(name);
+ if (!sp) {
+ /* LOGMODE_BOTH */
+@@ -287,6 +288,7 @@
+ pw->pw_passwd = sp->sp_pwdp;
+ }
+ }
++#endif
+
+ /* Decide what the new password will be */
+ newp = NULL;
+--- busybox-1.3.1/loginutils/sulogin.c Wed Dec 27 05:56:20 2006
++++ busybox-1.3.1.shadow/loginutils/sulogin.c Sat Dec 30 15:24:07 2006
+@@ -41,7 +41,6 @@
+ char *timeout_arg;
+ const char * const *p;
+ struct passwd *pwd;
+- struct spwd *spwd;
+ const char *shell;
+
+ logmode = LOGMODE_BOTH;
+@@ -75,13 +74,15 @@
+ goto auth_error;
+ }
+
+- if (ENABLE_FEATURE_SHADOWPASSWDS) {
+- spwd = getspnam(pwd->pw_name);
++#if ENABLE_FEATURE_SHADOWPASSWDS
++ {
++ struct spwd *spwd = getspnam(pwd->pw_name);
+ if (!spwd) {
+ goto auth_error;
+ }
+ pwd->pw_passwd = spwd->sp_pwdp;
+ }
++#endif
+
+ while (1) {
+ /* cp points to a static buffer that is zeroed every time */
diff --git a/tools/busybox-patches/bzip2-payload.diff b/tools/busybox-patches/bzip2-payload.diff
index be2bb883..65863ad9 100644
--- a/tools/busybox-patches/bzip2-payload.diff
+++ b/tools/busybox-patches/bzip2-payload.diff
@@ -4,71 +4,69 @@ URL: http://www.busybox.net/lists/busybox/2004-May/011669.html
CVS: http://www.busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/patches/rpm2cpio_bzip2.patch?rev=9001
BugID: 1141
-Index: busybox-1.2.2/archival/Config.in
+Index: busybox-1.3.1/archival/Config.in
===================================================================
---- busybox-1.2.2.orig/archival/Config.in
-+++ busybox-1.2.2/archival/Config.in
-@@ -127,6 +127,14 @@ config CONFIG_RPM2CPIO
+--- busybox-1.3.1.orig/archival/Config.in
++++ busybox-1.3.1/archival/Config.in
+@@ -127,6 +127,14 @@ config RPM2CPIO
help
Converts an RPM file into a CPIO archive.
-+config CONFIG_FEATURE_RPM2CPIO_BZIP2
++config FEATURE_RPM2CPIO_BZIP2
+ bool " Support bzip2 decompression"
+ default n
-+ depends on CONFIG_RPM2CPIO
++ depends on RPM2CPIO
+ help
+ If you enable this option you'll be able to extract
+ rpms compressed with bzip2.
+
- config CONFIG_RPM
+ config RPM
bool "rpm"
default n
-Index: busybox-1.2.2/archival/libunarchive/Makefile.in
+Index: busybox-1.3.1/archival/libunarchive/Kbuild
===================================================================
---- busybox-1.2.2.orig/archival/libunarchive/Makefile.in
-+++ busybox-1.2.2/archival/libunarchive/Makefile.in
-@@ -59,6 +59,7 @@ LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_LZ
- LIBUNARCHIVE-$(CONFIG_GUNZIP) += $(GUNZIP_FILES)
- LIBUNARCHIVE-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += decompress_uncompress.o
- LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o
-+LIBUNARCHIVE-$(CONFIG_FEATURE_RPM2CPIO_BZIP2) += decompress_bunzip2.o
- LIBUNARCHIVE-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o
- LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o
- LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o
-Index: busybox-1.2.2/archival/rpm2cpio.c
+--- busybox-1.3.1.orig/archival/libunarchive/Kbuild
++++ busybox-1.3.1/archival/libunarchive/Kbuild
+@@ -48,6 +48,7 @@ lib-$(CONFIG_FEATURE_DEB_TAR_LZMA) += de
+ lib-$(CONFIG_GUNZIP) += $(GUNZIP_FILES)
+ lib-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += decompress_uncompress.o
+ lib-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o
++lib-$(CONFIG_FEATURE_RPM2CPIO_BZIP2) += $(GUNZIP_FILES) decompress_bunzip2.o
+ lib-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o
+ lib-$(CONFIG_TAR) += get_header_tar.o
+ lib-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o
+Index: busybox-1.3.1/archival/rpm2cpio.c
===================================================================
---- busybox-1.2.2.orig/archival/rpm2cpio.c
-+++ busybox-1.2.2/archival/rpm2cpio.c
-@@ -91,15 +91,27 @@ int rpm2cpio_main(int argc, char **argv)
+--- busybox-1.3.1.orig/archival/rpm2cpio.c
++++ busybox-1.3.1/archival/rpm2cpio.c
+@@ -74,14 +74,24 @@ int rpm2cpio_main(int argc, char **argv)
skip_header(rpm_fd);
- bb_xread_all(rpm_fd, &magic, 2);
+ xread(rpm_fd, &magic, 2);
- if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
-- bb_error_msg_and_die("Invalid gzip magic");
-+ if ((magic[0] == 0x1f) || (magic[1] == 0x8b)) {
+- bb_error_msg_and_die("invalid gzip magic");
++ if ((magic[0] == 0x1f) && (magic[1] == 0x8b)) {
+ check_header_gzip(rpm_fd);
-+ if (inflate_gunzip(rpm_fd, fileno(stdout)) != 0)
-+ bb_error_msg("Error inflating (gzip)");
++ if (inflate_gunzip(rpm_fd, STDOUT_FILENO) < 0) {
++ bb_error_msg("error inflating (gzip)");
++ }
}
-
+-
- check_header_gzip(rpm_fd);
-- if (inflate_gunzip(rpm_fd, STDOUT_FILENO) != 0) {
-- bb_error_msg("Error inflating");
+- if (inflate_gunzip(rpm_fd, STDOUT_FILENO) < 0) {
+- bb_error_msg("error inflating");
+ else if ((magic[0] == 'B') && (magic[1] == 'Z')) {
+#ifdef CONFIG_FEATURE_RPM2CPIO_BZIP2
+ /* return to position before magic (eek..!) */
+ lseek(rpm_fd, -2, SEEK_CUR);
-+ if(uncompressStream(rpm_fd, fileno(stdout)) != 0)
-+ bb_error_msg("Error inflating (bzip2)");
++ if (uncompressStream(rpm_fd, fileno(stdout)) != 0)
++ bb_error_msg("error inflating (bzip2)");
+#else
+ bb_error_msg_and_die("bzip2 not supported");
+#endif
}
-
+ else
+ bb_error_msg_and_die("not gzip or bzip2 compressed");
-+
-+
+
close(rpm_fd);
- return 0;
diff --git a/tools/busybox-patches/libunarchive_get_header_cpio.c.diff b/tools/busybox-patches/libunarchive_get_header_cpio.c.diff
deleted file mode 100644
index 4166c669..00000000
--- a/tools/busybox-patches/libunarchive_get_header_cpio.c.diff
+++ /dev/null
@@ -1,16 +0,0 @@
-Author: Lars Mueller <lm at openslx dot com>
-Subject: Do not return with an error in this particular case.
-Fixed upstream: Yes; at least in 1.3.1
-
-Index: busybox-1.2.2/archival/libunarchive/get_header_cpio.c
-===================================================================
---- busybox-1.2.2.orig/archival/libunarchive/get_header_cpio.c
-+++ busybox-1.2.2/archival/libunarchive/get_header_cpio.c
-@@ -35,7 +35,6 @@ char get_header_cpio(archive_handle_t *a
- oldtmp = NULL;
-
- while (tmp) {
-- bb_error_msg_and_die("need to fix this\n");
- if (tmp->entry->link_name) { /* Found a hardlink ready to be extracted */
- file_header = tmp->entry;
- if (oldtmp) {
diff --git a/tools/busybox-patches/networking_httpd.diff b/tools/busybox-patches/networking_httpd.diff
new file mode 100644
index 00000000..869c65a2
--- /dev/null
+++ b/tools/busybox-patches/networking_httpd.diff
@@ -0,0 +1,29 @@
+Author: Lars Mueller <lm at openslx dot com>
+Subject: Add missing defines to enable code for a particular
+BugID: 1159
+
+Index: busybox-1.3.1/networking/httpd.c
+===================================================================
+--- busybox-1.3.1.orig/networking/httpd.c
++++ busybox-1.3.1/networking/httpd.c
+@@ -1305,8 +1305,10 @@ static int checkPermIP(void)
+
+ /* This could stand some work */
+ for (cur = config->ip_a_d; cur; cur = cur->next) {
++#if ENABLE_FEATURE_HTTPD_CGI || DEBUG
+ if (DEBUG)
+ fprintf(stderr, "checkPermIP: '%s' ? ", config->rmt_ip_str);
++#endif
+ if (DEBUG)
+ fprintf(stderr, "'%u.%u.%u.%u/%u.%u.%u.%u'\n",
+ (unsigned char)(cur->ip >> 24),
+@@ -1690,7 +1692,9 @@ static void handleIncoming(void)
+ config->ContentLength = -1;
+ } while (0);
+
++#if ENABLE_FEATURE_HTTPD_CGI
+ bail_out:
++#endif
+
+ if (DEBUG)
+ fprintf(stderr, "closing socket\n\n");
diff --git a/tools/busybox-patches/series b/tools/busybox-patches/series
index c5c45f77..d1f5d768 100644
--- a/tools/busybox-patches/series
+++ b/tools/busybox-patches/series
@@ -1,4 +1,5 @@
# series file useable by quilt
+busybox-1.3.1.shadow.patch
bzip2-payload.diff
+networking_httpd.diff
unionfs-run-init.diff
-libunarchive_get_header_cpio.c.diff
diff --git a/tools/busybox-patches/unionfs-run-init.diff b/tools/busybox-patches/unionfs-run-init.diff
index 2163fa98..e7b102ef 100644
--- a/tools/busybox-patches/unionfs-run-init.diff
+++ b/tools/busybox-patches/unionfs-run-init.diff
@@ -3,11 +3,11 @@ root fs on top. We check if we have unionfs available to make the ro fs rw.
Unfortunately the unionfs code is incomplete (mmap issue). Thus the original
mount point of the ro fs part is not moved accordingly.
-Index: busybox-1.2.2/util-linux/switch_root.c
+Index: busybox-1.3.1/util-linux/switch_root.c
===================================================================
---- busybox-1.2.2.orig/util-linux/switch_root.c
-+++ busybox-1.2.2/util-linux/switch_root.c
-@@ -106,6 +106,10 @@ int switch_root_main(int argc, char *arg
+--- busybox-1.3.1.orig/util-linux/switch_root.c
++++ busybox-1.3.1/util-linux/switch_root.c
+@@ -103,6 +103,10 @@ int switch_root_main(int argc, char *arg
// Overmount / with newdir and chroot into it. The chdir is needed to
// recalculate "." and ".." links.