All of lore.kernel.org
 help / color / mirror / Atom feed
From: jacmet at uclibc.org <jacmet@uclibc.org>
To: buildroot@busybox.net
Subject: [Buildroot] svn commit: trunk/buildroot/package/busybox
Date: Mon, 10 Sep 2007 00:38:04 -0700 (PDT)	[thread overview]
Message-ID: <20070910073804.A687630050@busybox.net> (raw)

Author: jacmet
Date: 2007-09-10 00:38:03 -0700 (Mon, 10 Sep 2007)
New Revision: 19808

Log:
Busybox 1.7.0 patches

Added:
   trunk/buildroot/package/busybox/busybox-1.7.0-gettimeofday_ns.patch
   trunk/buildroot/package/busybox/busybox-1.7.0-readlink.patch
   trunk/buildroot/package/busybox/busybox-1.7.0-targz_nommu.patch
   trunk/buildroot/package/busybox/busybox-1.7.0-trylink.patch


Changeset:
Added: trunk/buildroot/package/busybox/busybox-1.7.0-gettimeofday_ns.patch
===================================================================
--- trunk/buildroot/package/busybox/busybox-1.7.0-gettimeofday_ns.patch	                        (rev 0)
+++ trunk/buildroot/package/busybox/busybox-1.7.0-gettimeofday_ns.patch	2007-09-10 07:38:03 UTC (rev 19808)
@@ -0,0 +1,95 @@
+diff -urN busybox-1.7.0/networking/isrv.c busybox-1.7.0-gettimeofday_ns/networking/isrv.c
+--- busybox-1.7.0/networking/isrv.c	2007-08-24 11:49:41.000000000 +0100
++++ busybox-1.7.0-gettimeofday_ns/networking/isrv.c	2007-09-06 17:39:55.000000000 +0100
+@@ -21,20 +21,6 @@
+ 
+ /* Helpers */
+ 
+-/* Even if _POSIX_MONOTONIC_CLOCK is defined, this
+- * may require librt */
+-#if 0 /*def _POSIX_MONOTONIC_CLOCK*/
+-static time_t monotonic_time(void)
+-{
+-	struct timespec ts;
+-	if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0)
+-		time(&ts.tv_sec);
+-	return ts.tv_sec;
+-}
+-#else
+-#define monotonic_time() (time(NULL))
+-#endif
+-
+ /* Opaque structure */
+ 
+ struct isrv_state_t {
+@@ -258,7 +244,7 @@
+ 			/* this peer is gone */
+ 			remove_peer(state, peer);
+ 		} else if (TIMEOUT) {
+-			TIMEO_TBL[peer] = monotonic_time();
++			TIMEO_TBL[peer] = monotonic_sec();
+ 		}
+ 	}
+ }
+@@ -335,7 +321,7 @@
+ 			break;
+ 
+ 		if (timeout) {
+-			time_t t = monotonic_time();
++			time_t t = monotonic_sec();
+ 			if (t != CURTIME) {
+ 				CURTIME = t;
+ 				handle_timeout(state, do_timeout);
+diff -urN busybox-1.7.0/runit/runsv.c busybox-1.7.0-gettimeofday_ns/runit/runsv.c
+--- busybox-1.7.0/runit/runsv.c	2007-08-24 11:50:01.000000000 +0100
++++ busybox-1.7.0-gettimeofday_ns/runit/runsv.c	2007-09-06 17:39:55.000000000 +0100
+@@ -33,6 +33,34 @@
+ #include "libbb.h"
+ #include "runit_lib.h"
+ 
++#if ENABLE_MONOTONIC_SYSCALL
++#include <sys/syscall.h>
++
++/* libc has incredibly messy way of doing this,
++ * typically requiring -lrt. We just skip all this mess */
++static void gettimeofday_ns(struct timespec *ts)
++{
++	syscall(__NR_clock_gettime, CLOCK_REALTIME, ts);
++}
++#else
++static void gettimeofday_ns(struct timespec *ts)
++{
++	if (sizeof(struct timeval) == sizeof(struct timespec)
++	 && sizeof(((struct timeval*)ts)->tv_usec) == sizeof(ts->tv_nsec)
++	) {
++		/* Cheat */
++		gettimeofday((void*)ts, NULL);
++		ts->tv_nsec *= 1000;
++	} else {
++		extern void BUG_need_to_implement_gettimeofday_ns(void);
++		BUG_need_to_implement_gettimeofday_ns();
++	}
++}
++#endif
++
++/* Compare possibly overflowing unsigned counters */
++#define LESS(a,b) ((int)((unsigned)(b) - (unsigned)(a)) > 0)
++
+ static int selfpipe[2];
+ 
+ /* state */
+@@ -126,14 +154,6 @@
+ 	return 0;
+ }
+ 
+-#define LESS(a,b) ((int)((unsigned)(b) - (unsigned)(a)) > 0)
+-
+-#include <sys/syscall.h>
+-static void gettimeofday_ns(struct timespec *ts)
+-{
+-	syscall(__NR_clock_gettime, CLOCK_REALTIME, ts);
+-}
+-
+ static void update_status(struct svdir *s)
+ {
+ 	ssize_t sz;

Added: trunk/buildroot/package/busybox/busybox-1.7.0-readlink.patch
===================================================================
--- trunk/buildroot/package/busybox/busybox-1.7.0-readlink.patch	                        (rev 0)
+++ trunk/buildroot/package/busybox/busybox-1.7.0-readlink.patch	2007-09-10 07:38:03 UTC (rev 19808)
@@ -0,0 +1,107 @@
+diff -urN busybox-1.7.0/applets/applets.c busybox-1.7.0-readlink/applets/applets.c
+--- busybox-1.7.0/applets/applets.c	2007-08-24 11:50:02.000000000 +0100
++++ busybox-1.7.0-readlink/applets/applets.c	2007-09-06 17:41:38.000000000 +0100
+@@ -546,7 +546,7 @@
+  help:
+ 		output_width = 80;
+ 		if (ENABLE_FEATURE_AUTOWIDTH) {
+-			/* Obtain the terminal width.  */
++			/* Obtain the terminal width */
+ 			get_terminal_width_height(0, &output_width, NULL);
+ 		}
+ 		/* leading tab and room to wrap */
+@@ -580,12 +580,11 @@
+ 
+ 	if (ENABLE_FEATURE_INSTALLER && strcmp(argv[1], "--install") == 0) {
+ 		const char *busybox;
+-		busybox = xmalloc_readlink_or_warn(bb_busybox_exec_path);
++		busybox = xmalloc_readlink(bb_busybox_exec_path);
+ 		if (!busybox)
+ 			busybox = bb_busybox_exec_path;
+ 		/* -s makes symlinks */
+-		install_links(busybox,
+-				 argv[2] && strcmp(argv[2], "-s") == 0);
++		install_links(busybox, argv[2] && strcmp(argv[2], "-s") == 0);
+ 		return 0;
+ 	}
+ 
+diff -urN busybox-1.7.0/include/libbb.h busybox-1.7.0-readlink/include/libbb.h
+--- busybox-1.7.0/include/libbb.h	2007-08-24 11:49:55.000000000 +0100
++++ busybox-1.7.0-readlink/include/libbb.h	2007-09-06 17:41:38.000000000 +0100
+@@ -248,9 +248,10 @@
+ DIR *xopendir(const char *path);
+ DIR *warn_opendir(const char *path);
+ 
+-char *xrealloc_getcwd_or_warn(char *cwd);
++/* UNUSED: char *xmalloc_realpath(const char *path); */
++char *xmalloc_readlink(const char *path);
+ char *xmalloc_readlink_or_warn(const char *path);
+-char *xmalloc_realpath(const char *path);
++char *xrealloc_getcwd_or_warn(char *cwd);
+ 
+ 
+ //TODO: signal(sid, f) is the same? then why?
+@@ -316,8 +317,8 @@
+ };
+ /* Create stream socket, and allocate suitable lsa.
+  * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6))
+- * af == AF_UNSPEC will result in trying to create IPv6, and
+- * if kernel doesn't support it, IPv4.
++ * af == AF_UNSPEC will result in trying to create IPv6 socket,
++ * and if kernel doesn't support it, IPv4.
+  */
+ int xsocket_type(len_and_sockaddr **lsap, USE_FEATURE_IPV6(int af,) int sock_type);
+ int xsocket_stream(len_and_sockaddr **lsap);
+diff -urN busybox-1.7.0/libbb/xreadlink.c busybox-1.7.0-readlink/libbb/xreadlink.c
+--- busybox-1.7.0/libbb/xreadlink.c	2007-08-24 11:49:51.000000000 +0100
++++ busybox-1.7.0-readlink/libbb/xreadlink.c	2007-09-06 17:41:38.000000000 +0100
+@@ -10,8 +10,7 @@
+  * NOTE: This function returns a malloced char* that you will have to free
+  * yourself. You have been warned.
+  */
+-
+-char *xmalloc_readlink_or_warn(const char *path)
++char *xmalloc_readlink(const char *path)
+ {
+ 	enum { GROWBY = 80 }; /* how large we will grow strings by */
+ 
+@@ -20,20 +19,30 @@
+ 
+ 	do {
+ 		buf = xrealloc(buf, bufsize += GROWBY);
+-		readsize = readlink(path, buf, bufsize); /* 1st try */
++		readsize = readlink(path, buf, bufsize);
+ 		if (readsize == -1) {
+-			bb_perror_msg("%s", path);
+ 			free(buf);
+ 			return NULL;
+ 		}
+-	}
+-	while (bufsize < readsize + 1);
++	} while (bufsize < readsize + 1);
+ 
+ 	buf[readsize] = '\0';
+ 
+ 	return buf;
+ }
+ 
++char *xmalloc_readlink_or_warn(const char *path)
++{
++	char *buf = xmalloc_readlink(path);
++	if (!buf) {
++		/* EINVAL => "file: Invalid argument" => puzzled user */
++		bb_error_msg("%s: cannot read link (not a symlink?)", path);
++	}
++	return buf;
++}
++
++/* UNUSED */
++#if 0
+ char *xmalloc_realpath(const char *path)
+ {
+ #if defined(__GLIBC__) && !defined(__UCLIBC__)
+@@ -46,3 +55,4 @@
+ 	return xstrdup(realpath(path, buf));
+ #endif
+ }
++#endif

Added: trunk/buildroot/package/busybox/busybox-1.7.0-targz_nommu.patch
===================================================================
--- trunk/buildroot/package/busybox/busybox-1.7.0-targz_nommu.patch	                        (rev 0)
+++ trunk/buildroot/package/busybox/busybox-1.7.0-targz_nommu.patch	2007-09-10 07:38:03 UTC (rev 19808)
@@ -0,0 +1,282 @@
+diff -urN busybox-1.7.0/archival/bbunzip.c busybox-1.7.0-targz_nommu/archival/bbunzip.c
+--- busybox-1.7.0/archival/bbunzip.c	2007-08-24 11:49:45.000000000 +0100
++++ busybox-1.7.0-targz_nommu/archival/bbunzip.c	2007-09-06 17:42:02.000000000 +0100
+@@ -298,7 +298,7 @@
+ int unlzma_main(int argc, char **argv);
+ int unlzma_main(int argc, char **argv)
+ {
+-	getopt32(argv, "c");
++	getopt32(argv, "cf");
+ 	argv += optind;
+ 	/* lzmacat? */
+ 	if (applet_name[4] == 'c')
+diff -urN busybox-1.7.0/archival/libunarchive/Kbuild busybox-1.7.0-targz_nommu/archival/libunarchive/Kbuild
+--- busybox-1.7.0/archival/libunarchive/Kbuild	2007-08-24 11:49:45.000000000 +0100
++++ busybox-1.7.0-targz_nommu/archival/libunarchive/Kbuild	2007-09-06 17:42:02.000000000 +0100
+@@ -35,36 +35,34 @@
+ 	get_header_tar.o \
+ 	filter_accept_list_reassign.o
+ 
+-# open_transformer uses fork(). Compile it only if absolutely necessary
+ lib-$(CONFIG_RPM)                       += open_transformer.o
+-lib-$(CONFIG_FEATURE_TAR_BZIP2)	        += open_transformer.o
+-lib-$(CONFIG_FEATURE_TAR_LZMA)	        += open_transformer.o
+-lib-$(CONFIG_FEATURE_TAR_GZIP)		+= open_transformer.o
+-lib-$(CONFIG_FEATURE_TAR_COMPRESS)	+= open_transformer.o
+-lib-$(CONFIG_FEATURE_DEB_TAR_GZ)	+= open_transformer.o
+-lib-$(CONFIG_FEATURE_DEB_TAR_BZ2)	+= open_transformer.o
+-lib-$(CONFIG_FEATURE_DEB_TAR_LZMA)	+= open_transformer.o
+-
+-lib-$(CONFIG_AR)			+= get_header_ar.o unpack_ar_archive.o
+-lib-$(CONFIG_BUNZIP2)			+= decompress_bunzip2.o
+-lib-$(CONFIG_UNLZMA)			+= decompress_unlzma.o
+-lib-$(CONFIG_CPIO)			+= get_header_cpio.o
+-lib-$(CONFIG_DPKG)			+= $(DPKG_FILES)
+-lib-$(CONFIG_DPKG_DEB)			+= $(DPKG_FILES)
+-lib-$(CONFIG_FEATURE_DEB_TAR_GZ)	+= $(GUNZIP_FILES) get_header_tar_gz.o
+-lib-$(CONFIG_FEATURE_DEB_TAR_BZ2)	+= decompress_bunzip2.o get_header_tar_bz2.o
+-lib-$(CONFIG_FEATURE_DEB_TAR_LZMA)	+= decompress_unlzma.o get_header_tar_lzma.o
+-lib-$(CONFIG_GUNZIP)			+= $(GUNZIP_FILES)
+-lib-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS)	+= decompress_uncompress.o
+-lib-$(CONFIG_RPM2CPIO)			+= $(GUNZIP_FILES) get_header_cpio.o
+-lib-$(CONFIG_RPM)			+= $(GUNZIP_FILES) get_header_cpio.o
+-lib-$(CONFIG_FEATURE_RPM_BZ2)		+= decompress_bunzip2.o
+-lib-$(CONFIG_TAR)			+= get_header_tar.o
+-lib-$(CONFIG_FEATURE_TAR_BZIP2)		+= decompress_bunzip2.o get_header_tar_bz2.o
+-lib-$(CONFIG_FEATURE_TAR_LZMA)		+= decompress_unlzma.o get_header_tar_lzma.o
+-lib-$(CONFIG_FEATURE_TAR_GZIP)		+= $(GUNZIP_FILES) get_header_tar_gz.o
+-lib-$(CONFIG_FEATURE_TAR_COMPRESS)	+= decompress_uncompress.o
+-lib-$(CONFIG_UNCOMPRESS)		+= decompress_uncompress.o
+-lib-$(CONFIG_UNZIP)			+= $(GUNZIP_FILES)
+-lib-$(CONFIG_FEATURE_COMPRESS_USAGE)	+= decompress_bunzip2.o
++lib-$(CONFIG_FEATURE_TAR_BZIP2)         += open_transformer.o
++lib-$(CONFIG_FEATURE_TAR_LZMA)          += open_transformer.o
++lib-$(CONFIG_FEATURE_TAR_GZIP)          += open_transformer.o
++lib-$(CONFIG_FEATURE_TAR_COMPRESS)      += open_transformer.o
++lib-$(CONFIG_FEATURE_DEB_TAR_GZ)        += open_transformer.o
++lib-$(CONFIG_FEATURE_DEB_TAR_BZ2)       += open_transformer.o
++lib-$(CONFIG_FEATURE_DEB_TAR_LZMA)      += open_transformer.o
+ 
++lib-$(CONFIG_AR)                        += get_header_ar.o unpack_ar_archive.o
++lib-$(CONFIG_BUNZIP2)                   += decompress_bunzip2.o
++lib-$(CONFIG_UNLZMA)                    += decompress_unlzma.o
++lib-$(CONFIG_CPIO)                      += get_header_cpio.o
++lib-$(CONFIG_DPKG)                      += $(DPKG_FILES)
++lib-$(CONFIG_DPKG_DEB)                  += $(DPKG_FILES)
++lib-$(CONFIG_FEATURE_DEB_TAR_GZ)        += $(GUNZIP_FILES) get_header_tar_gz.o
++lib-$(CONFIG_FEATURE_DEB_TAR_BZ2)       += decompress_bunzip2.o get_header_tar_bz2.o
++lib-$(CONFIG_FEATURE_DEB_TAR_LZMA)      += decompress_unlzma.o get_header_tar_lzma.o
++lib-$(CONFIG_GUNZIP)                    += $(GUNZIP_FILES)
++lib-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += decompress_uncompress.o
++lib-$(CONFIG_RPM2CPIO)                  += $(GUNZIP_FILES) get_header_cpio.o
++lib-$(CONFIG_RPM)                       += $(GUNZIP_FILES) get_header_cpio.o
++lib-$(CONFIG_FEATURE_RPM_BZ2)           += decompress_bunzip2.o
++lib-$(CONFIG_TAR)                       += get_header_tar.o
++lib-$(CONFIG_FEATURE_TAR_BZIP2)         += decompress_bunzip2.o get_header_tar_bz2.o
++lib-$(CONFIG_FEATURE_TAR_LZMA)          += decompress_unlzma.o get_header_tar_lzma.o
++lib-$(CONFIG_FEATURE_TAR_GZIP)          += $(GUNZIP_FILES) get_header_tar_gz.o
++lib-$(CONFIG_FEATURE_TAR_COMPRESS)      += decompress_uncompress.o
++lib-$(CONFIG_UNCOMPRESS)                += decompress_uncompress.o
++lib-$(CONFIG_UNZIP)                     += $(GUNZIP_FILES)
++lib-$(CONFIG_FEATURE_COMPRESS_USAGE)    += decompress_bunzip2.o
+diff -urN busybox-1.7.0/archival/libunarchive/get_header_tar_bz2.c busybox-1.7.0-targz_nommu/archival/libunarchive/get_header_tar_bz2.c
+--- busybox-1.7.0/archival/libunarchive/get_header_tar_bz2.c	2007-08-24 11:49:45.000000000 +0100
++++ busybox-1.7.0-targz_nommu/archival/libunarchive/get_header_tar_bz2.c	2007-09-06 17:42:02.000000000 +0100
+@@ -11,7 +11,7 @@
+ 	/* Can't lseek over pipes */
+ 	archive_handle->seek = seek_by_read;
+ 
+-	archive_handle->src_fd = open_transformer(archive_handle->src_fd, unpack_bz2_stream);
++	archive_handle->src_fd = open_transformer(archive_handle->src_fd, unpack_bz2_stream, "bunzip2", "bunzip2", "-cf", "-", NULL);
+ 	archive_handle->offset = 0;
+ 	while (get_header_tar(archive_handle) == EXIT_SUCCESS) /**/;
+ 
+diff -urN busybox-1.7.0/archival/libunarchive/get_header_tar_gz.c busybox-1.7.0-targz_nommu/archival/libunarchive/get_header_tar_gz.c
+--- busybox-1.7.0/archival/libunarchive/get_header_tar_gz.c	2007-08-24 11:49:45.000000000 +0100
++++ busybox-1.7.0-targz_nommu/archival/libunarchive/get_header_tar_gz.c	2007-09-06 17:42:02.000000000 +0100
+@@ -8,19 +8,26 @@
+ 
+ char get_header_tar_gz(archive_handle_t *archive_handle)
+ {
++#if BB_MMU
+ 	unsigned char magic[2];
++#endif
+ 
+ 	/* Can't lseek over pipes */
+ 	archive_handle->seek = seek_by_read;
+ 
++	/* Check gzip magic only if open_transformer will invoke unpack_gz_stream (MMU case).
++	 * Otherwise, it will invoke an external helper "gunzip -cf" (NOMMU case) which will
++	 * need the header. */
++#if BB_MMU
+ 	xread(archive_handle->src_fd, &magic, 2);
+ 	if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
+ 		bb_error_msg_and_die("invalid gzip magic");
+ 	}
+ 
+ 	check_header_gzip_or_die(archive_handle->src_fd);
++#endif
+ 
+-	archive_handle->src_fd = open_transformer(archive_handle->src_fd, unpack_gz_stream);
++	archive_handle->src_fd = open_transformer(archive_handle->src_fd, unpack_gz_stream, "gunzip", "gunzip", "-cf", "-", NULL);
+ 	archive_handle->offset = 0;
+ 	while (get_header_tar(archive_handle) == EXIT_SUCCESS) /**/;
+ 
+diff -urN busybox-1.7.0/archival/libunarchive/get_header_tar_lzma.c busybox-1.7.0-targz_nommu/archival/libunarchive/get_header_tar_lzma.c
+--- busybox-1.7.0/archival/libunarchive/get_header_tar_lzma.c	2007-08-24 11:49:45.000000000 +0100
++++ busybox-1.7.0-targz_nommu/archival/libunarchive/get_header_tar_lzma.c	2007-09-06 17:42:02.000000000 +0100
+@@ -14,7 +14,7 @@
+ 	/* Can't lseek over pipes */
+ 	archive_handle->seek = seek_by_read;
+ 
+-	archive_handle->src_fd = open_transformer(archive_handle->src_fd, unpack_lzma_stream);
++	archive_handle->src_fd = open_transformer(archive_handle->src_fd, unpack_lzma_stream, "unlzma", "unlzma", "-cf", "-", NULL);
+ 	archive_handle->offset = 0;
+ 	while (get_header_tar(archive_handle) == EXIT_SUCCESS) /**/;
+ 
+diff -urN busybox-1.7.0/archival/libunarchive/open_transformer.c busybox-1.7.0-targz_nommu/archival/libunarchive/open_transformer.c
+--- busybox-1.7.0/archival/libunarchive/open_transformer.c	2007-08-24 11:49:45.000000000 +0100
++++ busybox-1.7.0-targz_nommu/archival/libunarchive/open_transformer.c	2007-09-05 12:28:55.000000000 +0100
+@@ -7,27 +7,48 @@
+ #include "unarchive.h"
+ 
+ /* transformer(), more than meets the eye */
++/*
++ * On MMU machine, the transform_prog and ... are stripped
++ * by a macro in include/unarchive.h. On NOMMU, transformer is stripped.
++ */
+ int open_transformer(int src_fd,
+-	USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd))
++	USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd),
++	const char *transform_prog, ...)
+ {
+ 	int fd_pipe[2];
+ 	int pid;
+ 
+ 	xpipe(fd_pipe);
+ 
++#if BB_MMU
+ 	pid = fork();
+-	if (pid == -1) {
++#else
++	pid = vfork();
++#endif
++	if (pid == -1)
+ 		bb_perror_msg_and_die("fork failed");
+-	}
+ 
+ 	if (pid == 0) {
++#if !BB_MMU
++		va_list ap;
++#endif
+ 		/* child process */
+ 		close(fd_pipe[0]); /* We don't wan't to read from the parent */
+ 		// FIXME: error check?
++#if BB_MMU
+ 		transformer(src_fd, fd_pipe[1]);
+-		close(fd_pipe[1]); /* Send EOF */
+-		close(src_fd);
++		if (ENABLE_FEATURE_CLEAN_UP) {
++			close(fd_pipe[1]); /* Send EOF */
++			close(src_fd);
++		}
+ 		exit(0);
++#else
++		xmove_fd(src_fd, 0);
++		xmove_fd(fd_pipe[1], 1);
++		va_start(ap, transform_prog);
++		BB_EXECVP(transform_prog, ap);
++		bb_perror_and_die("exec failed");
++#endif
+ 		/* notreached */
+ 	}
+ 
+diff -urN busybox-1.7.0/archival/rpm.c busybox-1.7.0-targz_nommu/archival/rpm.c
+--- busybox-1.7.0/archival/rpm.c	2007-08-24 11:49:45.000000000 +0100
++++ busybox-1.7.0-targz_nommu/archival/rpm.c	2007-09-06 17:42:02.000000000 +0100
+@@ -187,9 +187,15 @@
+ 
+ static void extract_cpio_gz(int fd)
+ {
+-	USE_DESKTOP(long long) int (*xformer)(int src_fd, int dst_fd);
+ 	archive_handle_t *archive_handle;
+ 	unsigned char magic[2];
++#if BB_MMU
++	USE_DESKTOP(long long) int (*xformer)(int src_fd, int dst_fd);
++	enum { xformer_prog = 0 };
++#else
++	enum { xformer = 0 };
++	const char *xformer_prog;
++#endif
+ 
+ 	/* Initialize */
+ 	archive_handle = init_handle();
+@@ -202,11 +208,19 @@
+ 	archive_handle->offset = 0;
+ 
+ 	xread(archive_handle->src_fd, &magic, 2);
++#if BB_MMU
+ 	xformer = unpack_gz_stream;
++#else
++	xformer_prog = "gunzip";
++#endif
+ 	if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
+ 		if (ENABLE_FEATURE_RPM_BZ2
+ 		 && (magic[0] == 0x42) && (magic[1] == 0x5a)) {
++#if BB_MMU
+ 			xformer = unpack_bz2_stream;
++#else
++			xformer_prog = "bunzip2";
++#endif
+ 	/* We can do better, need modifying unpack_bz2_stream to not require
+ 	 * first 2 bytes. Not very hard to do... I mean, TODO :) */
+ 			xlseek(archive_handle->src_fd, -2, SEEK_CUR);
+@@ -214,11 +228,17 @@
+ 			bb_error_msg_and_die("no gzip"
+ 				USE_FEATURE_RPM_BZ2("/bzip")
+ 				" magic");
+-	} else
++	} else {
+ 		check_header_gzip_or_die(archive_handle->src_fd);
++#if !BB_MMU
++		/* NOMMU version of open_transformer execs an external unzipper that should
++		 * have the file position at the start of the file */
++		xlseek(archive_handle->src_fd, 0, SEEK_SET);
++#endif
++	}
+ 
+ 	xchdir("/"); /* Install RPM's to root */
+-	archive_handle->src_fd = open_transformer(archive_handle->src_fd, xformer);
++	archive_handle->src_fd = open_transformer(archive_handle->src_fd, xformer, xformer_prog, xformer_prog, "-cf", "-", NULL);
+ 	archive_handle->offset = 0;
+ 	while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
+ 		continue;
+diff -urN busybox-1.7.0/archival/tar.c busybox-1.7.0-targz_nommu/archival/tar.c
+--- busybox-1.7.0/archival/tar.c	2007-08-24 11:49:45.000000000 +0100
++++ busybox-1.7.0-targz_nommu/archival/tar.c	2007-09-06 17:42:02.000000000 +0100
+@@ -648,7 +648,7 @@
+ 		bb_error_msg_and_die("invalid magic");
+ 	}
+ 
+-	archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompress);
++	archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompress, "uncompress", "uncompress", "-cf", "-", NULL);
+ 	archive_handle->offset = 0;
+ 	while (get_header_tar(archive_handle) == EXIT_SUCCESS)
+ 		/* nothing */;
+diff -urN busybox-1.7.0/include/unarchive.h busybox-1.7.0-targz_nommu/include/unarchive.h
+--- busybox-1.7.0/include/unarchive.h	2007-08-24 11:49:55.000000000 +0100
++++ busybox-1.7.0-targz_nommu/include/unarchive.h	2007-09-06 17:42:02.000000000 +0100
+@@ -115,7 +115,13 @@
+ extern USE_DESKTOP(long long) int unpack_gz_stream(int src_fd, int dst_fd);
+ extern USE_DESKTOP(long long) int unpack_lzma_stream(int src_fd, int dst_fd);
+ 
++#if BB_MMU
+ extern int open_transformer(int src_fd,
+ 	USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd));
++#define open_transformer(src_fd, transformer, transform_prog, ...) open_transformer(src_fd, transformer)
++#else
++extern int open_transformer(int src_fd, const char *transform_prog, ...);
++#define open_transformer(src_fd, transformer, transform_prog, ...) open_transformer(src_fd, transform_prog, __VA_ARGS__)
++#endif
+ 
+ #endif

Added: trunk/buildroot/package/busybox/busybox-1.7.0-trylink.patch
===================================================================
--- trunk/buildroot/package/busybox/busybox-1.7.0-trylink.patch	                        (rev 0)
+++ trunk/buildroot/package/busybox/busybox-1.7.0-trylink.patch	2007-09-10 07:38:03 UTC (rev 19808)
@@ -0,0 +1,89 @@
+diff -urN busybox-1.7.0/scripts/trylink busybox-1.7.0-trylink/scripts/trylink
+--- busybox-1.7.0/scripts/trylink	2007-08-24 11:49:43.000000000 +0100
++++ busybox-1.7.0-trylink/scripts/trylink	2007-09-03 12:08:18.000000000 +0100
+@@ -14,37 +14,30 @@
+ BBOX_LIB_LIST=`echo "$BBOX_LIB_LIST" | xargs -n1 | sort | uniq | xargs`
+ 
+ # First link with all libs. If it fails, bail out
+-l_list=`echo "$BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/'`
+ echo "Trying libraries: $BBOX_LIB_LIST"
+-try "-Wl,--start-group $l_list -Wl,--end-group" "$@" \
++l_list=`echo "$BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
++test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group"
++try "$l_list" "$@" \
+ || {
+     echo "Failed: $* -Wl,--start-group $l_list -Wl,--end-group"
+     cat busybox_ld.err
+     exit 1
+ }
+ 
+-#### Hack disabled: conflicts with ld --verbose flag in last link phase
+-
+-##### Hack: we are not supposed to know executable name,
+-##### but this hack cuts down link time
+-####mv busybox_unstripped busybox_unstripped.tmp
+-####mv busybox.map        busybox.map.tmp
+-
+ # Now try to remove each lib and build without it.
+ # Stop when no lib can be removed.
+-####ever_discarded=false
+ while test "$BBOX_LIB_LIST"; do
+     $debug && echo "Trying libraries: $BBOX_LIB_LIST"
+     all_needed=true
+     for one in $BBOX_LIB_LIST; do
+ 	without_one=`echo " $BBOX_LIB_LIST " | sed "s/ $one / /g" | xargs`
+-	l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/'`
+-	$debug && echo "Trying -l options: $l_list"
+-	if try "-Wl,--start-group $l_list -Wl,--end-group" "$@"; then
++	l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
++	test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group"
++	$debug && echo "Trying -l options: '$l_list'"
++	if try "$l_list" "$@"; then
+ 		echo "Library $one is not needed"
+ 		BBOX_LIB_LIST="$without_one"
+ 		all_needed=false
+-####		ever_discarded=true
+ 	else
+ 		echo "Library $one is needed"
+ 	fi
+@@ -57,24 +50,19 @@
+     #{ echo "$BBOX_LIB_LIST" | grep -q ' '; } || break
+ done
+ 
+-####mv busybox_unstripped.tmp busybox_unstripped
+-####mv busybox.map.tmp        busybox.map
+-####$ever_discarded && {
+-    # Make the binary with final, minimal list of libs
+-    echo "Final link with: $BBOX_LIB_LIST"
+-    l_list=`echo "$BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/'`
+-    # --verbose gives us gobs of info to stdout (e.g. linker script used)
+-    if ! test -f busybox_ldscript; then
+-	try "-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose" "$@" >busybox_ld.out ####|| exit 1
+-    else
+-	echo "Custom linker script 'busybox_ldscript' found, using it"
+-	# Add SORT_BY_ALIGNMENT to linker script (found in busybox_ld.out):
+-	#  .rodata         : { *(.rodata SORT_BY_ALIGNMENT(.rodata.*) .gnu.linkonce.r.*) }
+-	#  *(.data SORT_BY_ALIGNMENT(.data.*) .gnu.linkonce.d.*)
+-	#  *(.bss SORT_BY_ALIGNMENT(.bss.*) .gnu.linkonce.b.*)
+-	# This will eliminate most of the data padding (~3kb).
+-	try "-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose -Wl,-T -Wl,busybox_ldscript" "$@" >busybox_ld.out
+-    fi
+-####}
+-####rm busybox_ld.err
+-####exit 0  # Ensure "success" exit code
++# Make the binary with final, minimal list of libs
++echo "Final link with: $BBOX_LIB_LIST"
++l_list=`echo "$BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
++test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose"
++# --verbose gives us gobs of info to stdout (e.g. linker script used)
++if ! test -f busybox_ldscript; then
++    try "$l_list -Wl,--verbose" "$@" >busybox_ld.out
++else
++    echo "Custom linker script 'busybox_ldscript' found, using it"
++    # Add SORT_BY_ALIGNMENT to linker script (found in busybox_ld.out):
++    #  .rodata         : { *(.rodata SORT_BY_ALIGNMENT(.rodata.*) .gnu.linkonce.r.*) }
++    #  *(.data SORT_BY_ALIGNMENT(.data.*) .gnu.linkonce.d.*)
++    #  *(.bss SORT_BY_ALIGNMENT(.bss.*) .gnu.linkonce.b.*)
++    # This will eliminate most of the data padding (~3kb).
++    try "$l_list -Wl,--verbose -Wl,-T -Wl,busybox_ldscript" "$@" >busybox_ld.out
++fi

             reply	other threads:[~2007-09-10  7:38 UTC|newest]

Thread overview: 161+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-10  7:38 jacmet at uclibc.org [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-03-02 15:33 [Buildroot] svn commit: trunk/buildroot/package/busybox jacmet at uclibc.org
2009-02-18 14:16 jacmet at uclibc.org
2009-02-01 19:36 jacmet at uclibc.org
2009-01-29 11:29 jacmet at uclibc.org
2009-01-29 11:27 jacmet at uclibc.org
2009-01-20 19:26 jacmet at uclibc.org
2009-01-19 12:34 jacmet at uclibc.org
2009-01-12  9:36 jacmet at uclibc.org
2008-12-31  9:35 jacmet at uclibc.org
2008-12-30 19:15 jacmet at uclibc.org
2008-12-29 10:09 jacmet at uclibc.org
2008-12-11  9:35 jacmet at uclibc.org
2008-12-10 13:46 jacmet at uclibc.org
2008-12-07 21:22 jacmet at uclibc.org
2008-12-04 13:21 jacmet at uclibc.org
2008-11-29 20:12 jacmet at uclibc.org
2008-11-28  8:19 jacmet at uclibc.org
2008-11-22  6:49 jacmet at uclibc.org
2008-11-21 14:36 jacmet at uclibc.org
2008-11-21 10:59 jacmet at uclibc.org
2008-11-20  6:49 jacmet at uclibc.org
2008-11-17  7:40 jacmet at uclibc.org
2008-11-16 17:22 jacmet at uclibc.org
2008-11-16 23:46 ` Hamish Moffatt
2008-11-17  7:13   ` Peter Korsgaard
2008-11-17 12:38     ` Hamish Moffatt
2008-11-17 12:45       ` Peter Korsgaard
2008-11-15 21:25 jacmet at uclibc.org
2008-11-13 16:32 jacmet at uclibc.org
2008-11-14 16:42 ` hartleys
2008-11-15 21:29   ` Peter Korsgaard
2008-11-16 23:42     ` Hamish Moffatt
2008-11-17  7:13       ` Peter Korsgaard
2008-11-13 16:32 jacmet at uclibc.org
2008-11-07 10:16 jacmet at uclibc.org
2008-11-02 13:06 jacmet at uclibc.org
2008-10-13 12:42 jacmet at uclibc.org
2008-10-06 18:52 jacmet at uclibc.org
2008-09-28 19:28 jacmet at uclibc.org
2008-09-22 11:54 jacmet at uclibc.org
2008-09-09  8:50 jacmet at uclibc.org
2008-09-09  8:50 jacmet at uclibc.org
2008-09-10  1:32 ` Hamish Moffatt
2008-09-10  6:57   ` Peter Korsgaard
2008-08-31 21:45 jacmet at uclibc.org
2008-08-28  4:57 jacmet at uclibc.org
2008-08-26  1:05 hamish at uclibc.org
2008-08-21  5:08 jacmet at uclibc.org
2008-08-06 12:56 jacmet at uclibc.org
2008-08-06  6:37 jacmet at uclibc.org
2008-08-04 19:06 jacmet at uclibc.org
2008-07-23  6:01 jacmet at uclibc.org
2008-07-22 11:19 jacmet at uclibc.org
2008-07-11 22:19 jacmet at uclibc.org
2008-07-06 13:55 jacmet at uclibc.org
2008-07-01 14:04 jacmet at uclibc.org
2008-07-01 13:37 jacmet at uclibc.org
2008-06-28 20:53 jacmet at uclibc.org
2008-06-26  6:51 jacmet at uclibc.org
2008-06-26  6:51 jacmet at uclibc.org
2008-06-26  6:58 ` Peter Korsgaard
2008-06-27  9:05   ` Daniel Laird
2008-06-27  9:20     ` Peter Korsgaard
2008-06-27 12:00       ` Bernhard Fischer
2008-06-27 12:46         ` sjhill at realitydiluted.com
2008-06-27 12:53           ` Bernhard Fischer
2008-06-27 14:07           ` Peter Korsgaard
2008-06-27 12:49         ` Daniel Laird
2008-06-27 13:19           ` Peter Korsgaard
2008-06-26  6:51 jacmet at uclibc.org
2008-06-20 18:38 jacmet at uclibc.org
2008-06-13 20:49 jacmet at uclibc.org
2008-06-07  7:46 jacmet at uclibc.org
2008-05-31 12:58 jacmet at uclibc.org
2008-05-31  7:28 jacmet at uclibc.org
2008-05-31  7:39 ` Cristian Ionescu-Idbohrn
2008-05-31 12:59   ` Peter Korsgaard
2008-05-09 10:01 jacmet at uclibc.org
2008-05-05 17:17 jacmet at uclibc.org
2008-04-29  6:53 jacmet at uclibc.org
2008-04-22  9:37 jacmet at uclibc.org
2008-04-04  7:17 jacmet at uclibc.org
2008-04-01 10:00 jacmet at uclibc.org
2008-03-30 14:37 jacmet at uclibc.org
2008-03-26 21:53 jacmet at uclibc.org
2008-03-26 21:49 jacmet at uclibc.org
2008-03-25 14:38 jacmet at uclibc.org
2008-03-21 17:56 ninevoltz at uclibc.org
2008-03-21 10:14 jacmet at uclibc.org
2008-03-17 19:44 jacmet at uclibc.org
2008-03-11  8:17 jacmet at uclibc.org
2008-02-28 14:38 jacmet at uclibc.org
2008-02-14 15:49 jacmet at uclibc.org
2008-02-14 14:45 jacmet at uclibc.org
2008-02-02 21:49 jacmet at uclibc.org
2008-01-08 12:51 jacmet at uclibc.org
2008-01-03 13:33 jacmet at uclibc.org
2008-01-03 13:33 jacmet at uclibc.org
2008-01-03 13:33 jacmet at uclibc.org
2008-01-03 13:33 jacmet at uclibc.org
2008-01-03 13:33 jacmet at uclibc.org
2008-01-03 13:31 jacmet at uclibc.org
2007-09-30 12:50 aldot at uclibc.org
2007-09-30 12:48 aldot at uclibc.org
2007-09-22 17:29 aldot at uclibc.org
2007-09-22 10:25 aldot at uclibc.org
2007-09-20 16:58 aldot at uclibc.org
2007-09-15 18:14 aldot at uclibc.org
2007-09-02 22:09 aldot at uclibc.org
2007-09-02 14:56 aldot at uclibc.org
2007-09-01 17:33 aldot at uclibc.org
2007-08-24 14:23 aldot at uclibc.org
2007-07-08 12:10 aldot at uclibc.org
2007-07-08 12:04 aldot at uclibc.org
2007-07-08 11:56 aldot at uclibc.org
2007-07-02 15:20 aldot at uclibc.org
2007-07-02  9:54 aldot at uclibc.org
2007-06-27 21:07 aldot at uclibc.org
2007-06-25 11:07 aldot at uclibc.org
2007-06-14 13:09 jacmet at uclibc.org
2007-06-02 13:13 aldot at uclibc.org
2007-05-15  9:34 aldot at uclibc.org
2007-05-07  4:07 sjhill at uclibc.org
2007-05-07  4:04 sjhill at uclibc.org
2007-04-25  7:11 jacmet at uclibc.org
2007-04-05  7:04 jacmet at uclibc.org
2007-03-24 12:09 aldot at uclibc.org
2007-03-23 13:26 aldot at uclibc.org
2007-03-23 13:24 aldot at uclibc.org
2007-03-20  9:51 aldot at uclibc.org
2007-03-20  8:53 aldot at uclibc.org
2007-03-15  8:36 jacmet at uclibc.org
2007-03-14 13:02 aldot at uclibc.org
2007-02-27  9:04 jacmet at uclibc.org
2007-02-23 11:55 jacmet at uclibc.org
2007-02-16 15:19 aldot at uclibc.org
2007-02-12 14:43 jacmet at uclibc.org
2007-02-06 16:34 jacmet at uclibc.org
2007-02-06 16:31 jacmet at uclibc.org
2007-02-06 16:23 jacmet at uclibc.org
2007-02-06 16:20 jacmet at uclibc.org
2007-02-06 16:18 jacmet at uclibc.org
2007-02-02 16:15 aldot at uclibc.org
2007-02-01 12:30 aldot at uclibc.org
2007-01-31 14:21 aldot at uclibc.org
2007-01-30 16:47 jacmet at uclibc.org
2007-01-30 13:37 jacmet at uclibc.org
2007-01-30 13:36 jacmet at uclibc.org
2006-12-13  6:58 andersen at uclibc.org
2006-12-13  6:18 andersen at uclibc.org
2006-12-07 16:31 aldot at uclibc.org
2006-12-02 19:36 aldot at uclibc.org
2006-12-02 18:36 aldot at uclibc.org
2006-12-02 17:03 aldot at uclibc.org
2006-11-17 12:57 aldot at uclibc.org
2006-11-17 11:37 aldot at uclibc.org
2006-10-25  8:10 jacmet at uclibc.org
2006-08-29 16:45 aldot at uclibc.org
2006-08-24 19:48 aldot at uclibc.org
2006-07-31  9:01 jacmet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070910073804.A687630050@busybox.net \
    --to=jacmet@uclibc.org \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.