aboutsummaryrefslogtreecommitdiffstats
path: root/package/busybox/patches
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2008-08-20 14:00:34 +0000
committerImre Kaloz <kaloz@openwrt.org>2008-08-20 14:00:34 +0000
commit088d86511f9e407a27a62e16af60ced1fb05944f (patch)
treee2bbc127a4a059392f3c5bea27e2944e0c149ecb /package/busybox/patches
parent57db10667068d52282c008a820e50d930c99d3fa (diff)
downloadupstream-088d86511f9e407a27a62e16af60ced1fb05944f.tar.gz
upstream-088d86511f9e407a27a62e16af60ced1fb05944f.tar.bz2
upstream-088d86511f9e407a27a62e16af60ced1fb05944f.zip
upgrade busybox to v1.11.1 and add current upstream fixes
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12348 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/busybox/patches')
-rw-r--r--package/busybox/patches/000-autoconf.patch25
-rw-r--r--package/busybox/patches/001-init_avoid_loop_opening_tty.patch20
-rw-r--r--package/busybox/patches/110-wget_getopt_fix.patch10
-rw-r--r--package/busybox/patches/140-trylink_bash.patch6
-rw-r--r--package/busybox/patches/200-etc_crontabs.patch20
-rw-r--r--package/busybox/patches/240-udhcpc_retries.patch26
-rw-r--r--package/busybox/patches/241-udhcpc-oversized_packets.patch94
-rw-r--r--package/busybox/patches/242-udhcpc_msgs.patch20
-rw-r--r--package/busybox/patches/243-udhcpc_changed_ifindex.patch12
-rw-r--r--package/busybox/patches/250-ash_export-n.patch17
-rw-r--r--package/busybox/patches/300-netmsg.patch50
-rw-r--r--package/busybox/patches/310-passwd_access.patch45
-rw-r--r--package/busybox/patches/340-lock_util.patch50
-rw-r--r--package/busybox/patches/350-httpd_redir.patch58
-rw-r--r--package/busybox/patches/360-awk_multi_f.patch72
-rw-r--r--package/busybox/patches/401-darwin_includes.patch39
-rw-r--r--package/busybox/patches/410-httpd_cgi_headers.patch10
-rw-r--r--package/busybox/patches/430-uniq_memleak.patch12
-rw-r--r--package/busybox/patches/440-httpd_chdir.patch12
-rw-r--r--package/busybox/patches/450-usage_compressed_fix.patch12
-rw-r--r--package/busybox/patches/460-truncated_ping_results.patch10
-rw-r--r--package/busybox/patches/470-insmod_search.patch320
-rw-r--r--package/busybox/patches/480-disable_braindead_optimization.patch40
-rw-r--r--package/busybox/patches/500-ipkg.patch486
-rw-r--r--package/busybox/patches/501-libbb_hash.patch88
-rw-r--r--package/busybox/patches/510-awx.patch103
-rw-r--r--package/busybox/patches/520-ipkg_secure.patch18
-rw-r--r--package/busybox/patches/521-ipkg_upgrade_env.patch6
-rw-r--r--package/busybox/patches/523-conffiles_fix.patch31
-rw-r--r--package/busybox/patches/524-memory_usage.patch28
-rw-r--r--package/busybox/patches/524-udhcpc_renew.patch10
-rw-r--r--package/busybox/patches/525-clean_temp.patch5
-rw-r--r--package/busybox/patches/526-ipkg_fix_pkg_comparison.patch43
-rw-r--r--package/busybox/patches/901-basename.patch9
-rw-r--r--package/busybox/patches/902-tar.patch55
-rw-r--r--package/busybox/patches/903-ash.patch155
-rw-r--r--package/busybox/patches/904-build.patch28
37 files changed, 1075 insertions, 970 deletions
diff --git a/package/busybox/patches/000-autoconf.patch b/package/busybox/patches/000-autoconf.patch
index e798b82e82..14f0b40431 100644
--- a/package/busybox/patches/000-autoconf.patch
+++ b/package/busybox/patches/000-autoconf.patch
@@ -1,13 +1,18 @@
-Index: busybox-1.7.2/applets/Kbuild
-===================================================================
---- busybox-1.7.2.orig/applets/Kbuild 2007-10-30 15:35:00.000000000 -0500
-+++ busybox-1.7.2/applets/Kbuild 2007-10-30 15:35:00.000000000 -0500
-@@ -20,6 +20,6 @@
- HOSTCFLAGS_usage.o = -I$(srctree)/include
-
- applets/applets.o: include/usage_compressed.h
--applets/usage: .config $(srctree)/applets/usage_compressed
+--- a/applets/Kbuild
++++ b/applets/Kbuild
+@@ -18,13 +18,13 @@
+
+ applets/applets.o: include/usage_compressed.h include/applet_tables.h
+
+-applets/usage: .config $(srctree)/applets/usage_compressed
++applets/usage: .config $(srctree)/applets/usage_compressed include/autoconf.h
+ applets/applet_tables: .config
+
+ quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h
+ cmd_gen_usage_compressed = $(srctree)/applets/usage_compressed include/usage_compressed.h applets
+
-include/usage_compressed.h: applets/usage $(srctree)/applets/usage_compressed
-+applets/usage: .config $(srctree)/applets/usage_compressed include/autoconf.h
+include/usage_compressed.h: applets/usage $(srctree)/applets/usage_compressed include/autoconf.h
$(call cmd,gen_usage_compressed)
+
+ quiet_cmd_gen_applet_tables = GEN include/applet_tables.h
diff --git a/package/busybox/patches/001-init_avoid_loop_opening_tty.patch b/package/busybox/patches/001-init_avoid_loop_opening_tty.patch
new file mode 100644
index 0000000000..7027230552
--- /dev/null
+++ b/package/busybox/patches/001-init_avoid_loop_opening_tty.patch
@@ -0,0 +1,20 @@
+--- a/init/init.c
++++ b/init/init.c
+@@ -505,12 +505,11 @@
+ for (a = init_action_list; a; a = tmp) {
+ tmp = a->next;
+ if (a->action_type & action_type) {
+- // Pointless: run() will error out if open of device fails.
+- ///* a->terminal of "" means "init's console" */
+- //if (a->terminal[0] && access(a->terminal, R_OK | W_OK)) {
+- // //message(L_LOG | L_CONSOLE, "Device %s cannot be opened in RW mode", a->terminal /*, strerror(errno)*/);
+- // delete_init_action(a);
+- //} else
++ /* a->terminal of "" means "init's console" */
++ if (a->terminal[0] && access(a->terminal, R_OK | W_OK)) {
++ //message(L_LOG | L_CONSOLE, "Device %s cannot be opened in RW mode", a->terminal /*, strerror(errno)*/);
++ delete_init_action(a);
++ } else
+ if (a->action_type & (SYSINIT | WAIT | CTRLALTDEL | SHUTDOWN | RESTART)) {
+ waitfor(run(a));
+ delete_init_action(a);
diff --git a/package/busybox/patches/110-wget_getopt_fix.patch b/package/busybox/patches/110-wget_getopt_fix.patch
index 6fb7c12867..f188269259 100644
--- a/package/busybox/patches/110-wget_getopt_fix.patch
+++ b/package/busybox/patches/110-wget_getopt_fix.patch
@@ -1,8 +1,6 @@
-Index: busybox-1.7.2/networking/wget.c
-===================================================================
---- busybox-1.7.2.orig/networking/wget.c 2007-10-30 15:35:00.000000000 -0500
-+++ busybox-1.7.2/networking/wget.c 2007-10-30 15:35:00.000000000 -0500
-@@ -140,7 +140,7 @@
+--- a/networking/wget.c
++++ b/networking/wget.c
+@@ -437,7 +437,7 @@
"directory-prefix\0" Required_argument "P"
"proxy\0" Required_argument "Y"
"user-agent\0" Required_argument "U"
@@ -10,4 +8,4 @@ Index: busybox-1.7.2/networking/wget.c
+ "passive-ftp\0" No_argument "\xfd"
"header\0" Required_argument "\xfe"
;
- applet_long_options = wget_longopts;
+ #endif
diff --git a/package/busybox/patches/140-trylink_bash.patch b/package/busybox/patches/140-trylink_bash.patch
index 167f14c06b..f9571fcbc8 100644
--- a/package/busybox/patches/140-trylink_bash.patch
+++ b/package/busybox/patches/140-trylink_bash.patch
@@ -1,7 +1,5 @@
-Index: busybox-1.7.2/scripts/trylink
-===================================================================
---- busybox-1.7.2.orig/scripts/trylink 2007-10-30 15:35:00.000000000 -0500
-+++ busybox-1.7.2/scripts/trylink 2007-10-30 15:35:00.000000000 -0500
+--- a/scripts/trylink
++++ b/scripts/trylink
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
diff --git a/package/busybox/patches/200-etc_crontabs.patch b/package/busybox/patches/200-etc_crontabs.patch
index e9609bd5fa..bc3010ee2a 100644
--- a/package/busybox/patches/200-etc_crontabs.patch
+++ b/package/busybox/patches/200-etc_crontabs.patch
@@ -1,9 +1,7 @@
-Index: busybox-1.7.2/miscutils/crond.c
-===================================================================
---- busybox-1.7.2.orig/miscutils/crond.c 2007-10-30 15:35:00.000000000 -0500
-+++ busybox-1.7.2/miscutils/crond.c 2007-10-30 15:35:00.000000000 -0500
-@@ -15,7 +15,7 @@
- #include "libbb.h"
+--- a/miscutils/crond.c
++++ b/miscutils/crond.c
+@@ -24,7 +24,7 @@
+
#ifndef CRONTABS
-#define CRONTABS "/var/spool/cron/crontabs"
@@ -11,10 +9,8 @@ Index: busybox-1.7.2/miscutils/crond.c
#endif
#ifndef TMPDIR
#define TMPDIR "/var/spool/cron"
-Index: busybox-1.7.2/miscutils/crontab.c
-===================================================================
---- busybox-1.7.2.orig/miscutils/crontab.c 2007-10-30 15:35:00.000000000 -0500
-+++ busybox-1.7.2/miscutils/crontab.c 2007-10-30 15:35:00.000000000 -0500
+--- a/miscutils/crontab.c
++++ b/miscutils/crontab.c
@@ -13,7 +13,7 @@
#include "libbb.h"
@@ -22,5 +18,5 @@ Index: busybox-1.7.2/miscutils/crontab.c
-#define CRONTABS "/var/spool/cron/crontabs"
+#define CRONTABS "/etc/crontabs"
#endif
- #ifndef TMPDIR
- #define TMPDIR "/var/spool/cron"
+ #ifndef CRONUPDATE
+ #define CRONUPDATE "cron.update"
diff --git a/package/busybox/patches/240-udhcpc_retries.patch b/package/busybox/patches/240-udhcpc_retries.patch
index 7a655376dc..2e0ef118f4 100644
--- a/package/busybox/patches/240-udhcpc_retries.patch
+++ b/package/busybox/patches/240-udhcpc_retries.patch
@@ -1,22 +1,20 @@
-Index: busybox-1.7.2/networking/udhcp/dhcpc.c
-===================================================================
---- busybox-1.7.2.orig/networking/udhcp/dhcpc.c 2007-10-30 15:35:00.000000000 -0500
-+++ busybox-1.7.2/networking/udhcp/dhcpc.c 2007-10-30 15:35:01.000000000 -0500
-@@ -334,7 +334,7 @@
- /* timeout dropped to zero */
+--- a/networking/udhcp/dhcpc.c
++++ b/networking/udhcp/dhcpc.c
+@@ -352,7 +352,7 @@
+
switch (state) {
case INIT_SELECTING:
-- if (packet_num < client_config.retries) {
-+ if (!client_config.retries || (packet_num < client_config.retries)) {
+- if (packet_num < discover_retries) {
++ if (!discover_retries || packet_num < discover_retries) {
if (packet_num == 0)
xid = random_xid();
-@@ -360,7 +360,7 @@
- break;
+@@ -382,7 +382,7 @@
+ continue;
case RENEW_REQUESTED:
case REQUESTING:
-- if (packet_num < client_config.retries) {
-+ if (!client_config.retries || (packet_num < client_config.retries)) {
+- if (packet_num < discover_retries) {
++ if (!discover_retries || packet_num < discover_retries) {
/* send request packet */
- if (state == RENEW_REQUESTED)
- send_renew(xid, server_addr, requested_ip); /* unicast */
+ if (state == RENEW_REQUESTED) /* unicast */
+ send_renew(xid, server_addr, requested_ip);
diff --git a/package/busybox/patches/241-udhcpc-oversized_packets.patch b/package/busybox/patches/241-udhcpc-oversized_packets.patch
index 93794916c8..6d5ec3607d 100644
--- a/package/busybox/patches/241-udhcpc-oversized_packets.patch
+++ b/package/busybox/patches/241-udhcpc-oversized_packets.patch
@@ -1,89 +1,75 @@
-Index: busybox-1.7.2/networking/udhcp/packet.c
-===================================================================
---- busybox-1.7.2.orig/networking/udhcp/packet.c 2007-10-30 15:35:00.000000000 -0500
-+++ busybox-1.7.2/networking/udhcp/packet.c 2007-10-30 15:35:01.000000000 -0500
-@@ -121,6 +121,10 @@
+--- a/networking/udhcp/packet.c
++++ b/networking/udhcp/packet.c
+@@ -114,6 +114,10 @@
return ~sum;
}
+int udhcp_get_payload_len(struct dhcpMessage *payload)
+{
-+ return sizeof(struct dhcpMessage) - MAX_OPTIONS_LEN + end_option(payload->options) + sizeof(payload->options[0]);
++ return sizeof(struct dhcpMessage) - DHCP_OPTIONS_BUFSIZE + end_option(payload->options) + sizeof(payload->options[0]);
+}
- /* Construct a ip/udp header for a packet, and specify the source and dest hardware address */
- void BUG_sizeof_struct_udp_dhcp_packet_must_be_576(void);
-@@ -132,6 +136,7 @@
- int result;
- struct sockaddr_ll dest;
- struct udp_dhcp_packet packet;
+ /* Construct a ip/udp header for a packet, send packet */
+ int udhcp_send_raw_packet(struct dhcpMessage *payload,
+@@ -125,11 +129,7 @@
+ int fd;
+ int result = -1;
+ const char *msg;
+-
+- enum {
+- IP_UPD_DHCP_SIZE = sizeof(struct udp_dhcp_packet) - CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS,
+- UPD_DHCP_SIZE = IP_UPD_DHCP_SIZE - offsetof(struct udp_dhcp_packet, udp),
+- };
+ int p_len = udhcp_get_payload_len(payload);
fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP));
if (fd < 0) {
-@@ -141,6 +146,7 @@
+@@ -139,7 +139,7 @@
memset(&dest, 0, sizeof(dest));
memset(&packet, 0, sizeof(packet));
+- packet.data = *payload; /* struct copy */
+ memcpy(&(packet.data), payload, p_len);
dest.sll_family = AF_PACKET;
dest.sll_protocol = htons(ETH_P_IP);
-@@ -158,12 +164,13 @@
+@@ -156,23 +156,18 @@
packet.ip.daddr = dest_ip;
packet.udp.source = htons(source_port);
packet.udp.dest = htons(dest_port);
-- packet.udp.len = htons(sizeof(packet.udp) + sizeof(struct dhcpMessage)); /* cheat on the psuedo-header */
+- /* size, excluding IP header: */
+- packet.udp.len = htons(UPD_DHCP_SIZE);
+- /* for UDP checksumming, ip.len is set to UDP packet len */
+ p_len += sizeof(packet.udp);
+ packet.udp.len = htons(p_len);
packet.ip.tot_len = packet.udp.len;
-- memcpy(&(packet.data), payload, sizeof(struct dhcpMessage));
-- packet.udp.check = udhcp_checksum(&packet, sizeof(struct udp_dhcp_packet));
+- packet.udp.check = udhcp_checksum(&packet, IP_UPD_DHCP_SIZE);
+- /* but for sending, it is set to IP packet len */
+- packet.ip.tot_len = htons(IP_UPD_DHCP_SIZE);
+ p_len += sizeof(packet.ip);
+ packet.udp.check = udhcp_checksum(&packet, p_len);
-
-- packet.ip.tot_len = htons(sizeof(struct udp_dhcp_packet));
+ packet.ip.tot_len = htons(p_len);
packet.ip.ihl = sizeof(packet.ip) >> 2;
packet.ip.version = IPVERSION;
packet.ip.ttl = IPDEFTTL;
-@@ -172,7 +179,7 @@
- if (sizeof(struct udp_dhcp_packet) != 576)
- BUG_sizeof_struct_udp_dhcp_packet_must_be_576();
+ packet.ip.check = udhcp_checksum(&packet.ip, sizeof(packet.ip));
-- result = sendto(fd, &packet, sizeof(struct udp_dhcp_packet), 0,
+- /* Currently we send full-sized DHCP packets (zero padded).
+- * If you need to change this: last byte of the packet is
+- * packet.data.options[end_option(packet.data.options)]
+- */
+- result = sendto(fd, &packet, IP_UPD_DHCP_SIZE, 0,
+ result = sendto(fd, &packet, p_len, 0,
- (struct sockaddr *) &dest, sizeof(dest));
- if (result <= 0) {
- bb_perror_msg("sendto");
-@@ -216,7 +223,7 @@
- return -1;
+ (struct sockaddr *) &dest, sizeof(dest));
+ msg = "sendto";
+ ret_close:
+@@ -224,8 +219,7 @@
+ goto ret_close;
}
-- result = write(fd, payload, sizeof(struct dhcpMessage));
-+ result = write(fd, payload, udhcp_get_payload_len(payload));
+- /* Currently we send full-sized DHCP packets (see above) */
+- result = safe_write(fd, payload, DHCP_SIZE);
++ result = safe_write(fd, payload, udhcp_get_payload_len(payload));
+ msg = "write";
+ ret_close:
close(fd);
- return result;
- }
-Index: busybox-1.7.2/networking/udhcp/common.h
-===================================================================
---- busybox-1.7.2.orig/networking/udhcp/common.h 2007-10-30 15:35:00.000000000 -0500
-+++ busybox-1.7.2/networking/udhcp/common.h 2007-10-30 15:35:01.000000000 -0500
-@@ -21,6 +21,8 @@
- #include <netinet/udp.h>
- #include <netinet/ip.h>
-
-+#define MAX_OPTIONS_LEN 308
-+
- struct dhcpMessage {
- uint8_t op;
- uint8_t htype;
-@@ -37,7 +39,7 @@
- uint8_t sname[64];
- uint8_t file[128];
- uint32_t cookie;
-- uint8_t options[308]; /* 312 - cookie */
-+ uint8_t options[MAX_OPTIONS_LEN]; /* 312 - cookie */
- };
-
- struct udp_dhcp_packet {
diff --git a/package/busybox/patches/242-udhcpc_msgs.patch b/package/busybox/patches/242-udhcpc_msgs.patch
index a201620224..efe8e9ad47 100644
--- a/package/busybox/patches/242-udhcpc_msgs.patch
+++ b/package/busybox/patches/242-udhcpc_msgs.patch
@@ -1,8 +1,6 @@
-Index: busybox-1.7.2/networking/udhcp/clientpacket.c
-===================================================================
---- busybox-1.7.2.orig/networking/udhcp/clientpacket.c 2007-10-30 15:35:00.000000000 -0500
-+++ busybox-1.7.2/networking/udhcp/clientpacket.c 2007-10-30 15:35:02.000000000 -0500
-@@ -74,6 +74,7 @@
+--- a/networking/udhcp/clientpacket.c
++++ b/networking/udhcp/clientpacket.c
+@@ -101,6 +101,7 @@
int send_discover(uint32_t xid, uint32_t requested)
{
struct dhcpMessage packet;
@@ -10,13 +8,11 @@ Index: busybox-1.7.2/networking/udhcp/clientpacket.c
init_packet(&packet, DHCPDISCOVER);
packet.xid = xid;
-@@ -81,7 +82,8 @@
- add_simple_option(packet.options, DHCP_REQUESTED_IP, requested);
+@@ -113,6 +114,7 @@
+
+ add_param_req_option(&packet);
- add_requests(&packet);
-- bb_info_msg("Sending discover...");
+ if (msgs++ < 3)
-+ bb_info_msg("Sending discover...");
- return udhcp_raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST,
+ bb_info_msg("Sending discover...");
+ return udhcp_send_raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST,
SERVER_PORT, MAC_BCAST_ADDR, client_config.ifindex);
- }
diff --git a/package/busybox/patches/243-udhcpc_changed_ifindex.patch b/package/busybox/patches/243-udhcpc_changed_ifindex.patch
index 91e8ac47cf..b48789aca7 100644
--- a/package/busybox/patches/243-udhcpc_changed_ifindex.patch
+++ b/package/busybox/patches/243-udhcpc_changed_ifindex.patch
@@ -1,10 +1,8 @@
-Index: busybox-1.7.2/networking/udhcp/dhcpc.c
-===================================================================
---- busybox-1.7.2.orig/networking/udhcp/dhcpc.c 2007-10-30 15:35:01.000000000 -0500
-+++ busybox-1.7.2/networking/udhcp/dhcpc.c 2007-10-30 15:35:02.000000000 -0500
-@@ -309,6 +309,12 @@
- jump_in:
- tv.tv_usec = 0;
+--- a/networking/udhcp/dhcpc.c
++++ b/networking/udhcp/dhcpc.c
+@@ -319,6 +319,12 @@
+ for (;;) {
+ unsigned timestamp_before_wait;
+ /* When running on a bridge, the ifindex may have changed (e.g. if
+ * member interfaces were added/removed or if the status of the
diff --git a/package/busybox/patches/250-ash_export-n.patch b/package/busybox/patches/250-ash_export-n.patch
index 99f4672565..8243a50521 100644
--- a/package/busybox/patches/250-ash_export-n.patch
+++ b/package/busybox/patches/250-ash_export-n.patch
@@ -1,15 +1,11 @@
-Index: busybox-1.7.2/shell/ash.c
-===================================================================
---- busybox-1.7.2.orig/shell/ash.c 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/shell/ash.c 2007-10-30 15:35:02.000000000 -0500
-@@ -11310,8 +11310,18 @@
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -11875,8 +11875,17 @@
const char *p;
char **aptr;
int flag = argv[0][0] == 'r'? VREADONLY : VEXPORT;
+ int mask = ~0;
+ int nopt;
-
-- if (nextopt("p") != 'p') {
+ while ((nopt = nextopt("np"))) {
+ if (nopt == 'n') {
+ mask = ~flag;
@@ -17,12 +13,13 @@ Index: busybox-1.7.2/shell/ash.c
+ break;
+ }
+ }
-+
+
+- if (nextopt("p") != 'p') {
+ if (nopt != 'p') {
aptr = argptr;
name = *aptr;
if (name) {
-@@ -11323,10 +11333,11 @@
+@@ -11888,10 +11897,12 @@
vp = *findvar(hashvar(name), name);
if (vp) {
vp->flags |= flag;
@@ -30,7 +27,7 @@ Index: busybox-1.7.2/shell/ash.c
continue;
}
}
-- setvar(name, p, flag);
+ setvar(name, p, flag);
+ setvar(name, p, flag & mask);
} while ((name = *++aptr) != NULL);
return 0;
diff --git a/package/busybox/patches/300-netmsg.patch b/package/busybox/patches/300-netmsg.patch
index b4afa05acb..d2372d0505 100644
--- a/package/busybox/patches/300-netmsg.patch
+++ b/package/busybox/patches/300-netmsg.patch
@@ -1,37 +1,43 @@
-Index: busybox-1.7.2/include/applets.h
-===================================================================
---- busybox-1.7.2.orig/include/applets.h 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/include/applets.h 2007-10-30 15:35:03.000000000 -0500
-@@ -241,6 +241,7 @@
+--- a/include/applets.h
++++ b/include/applets.h
+@@ -257,6 +257,7 @@
USE_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_NC(APPLET(nc, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
-+USE_NETMSG(APPLET_NOUSAGE(netmsg, netmsg, _BB_DIR_BIN, _BB_SUID_ALWAYS))
++USE_NETMSG(APPLET(netmsg, _BB_DIR_BIN, _BB_SUID_ALWAYS))
USE_NETSTAT(APPLET(netstat, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_NICE(APPLET(nice, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
-Index: busybox-1.7.2/networking/Config.in
-===================================================================
---- busybox-1.7.2.orig/networking/Config.in 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/networking/Config.in 2007-10-30 15:35:03.000000000 -0500
-@@ -508,6 +508,12 @@
- help
+--- a/include/usage.h
++++ b/include/usage.h
+@@ -2815,6 +2815,9 @@
+
+ #endif
+
++#define netmsg_trivial_usage NOUSAGE_STR
++#define netmsg_full_usage ""
++
+ #define netstat_trivial_usage \
+ "[-laentuwxr"USE_FEATURE_NETSTAT_WIDE("W")"]"
+ #define netstat_full_usage "\n\n" \
+--- a/networking/Config.in
++++ b/networking/Config.in
+@@ -602,6 +602,12 @@
A simple Unix utility which reads and writes data across network
connections.
-+
+
+config NETMSG
+ bool "netmsg"
+ default n
+ help
+ simple program for sending udp broadcast messages
-
++
config NC_SERVER
bool "Netcat server options (-l)"
-Index: busybox-1.7.2/networking/Kbuild
-===================================================================
---- busybox-1.7.2.orig/networking/Kbuild 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/networking/Kbuild 2007-10-30 15:35:03.000000000 -0500
-@@ -21,6 +21,7 @@
+ default n
+--- a/networking/Kbuild
++++ b/networking/Kbuild
+@@ -24,6 +24,7 @@
lib-$(CONFIG_IPCALC) += ipcalc.o
lib-$(CONFIG_NAMEIF) += nameif.o
lib-$(CONFIG_NC) += nc.o
@@ -39,10 +45,8 @@ Index: busybox-1.7.2/networking/Kbuild
lib-$(CONFIG_NETSTAT) += netstat.o
lib-$(CONFIG_NSLOOKUP) += nslookup.o
lib-$(CONFIG_PING) += ping.o
-Index: busybox-1.7.2/networking/netmsg.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.7.2/networking/netmsg.c 2007-10-30 15:35:03.000000000 -0500
+--- /dev/null
++++ b/networking/netmsg.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
diff --git a/package/busybox/patches/310-passwd_access.patch b/package/busybox/patches/310-passwd_access.patch
index bd0db8ff43..e69de29bb2 100644
--- a/package/busybox/patches/310-passwd_access.patch
+++ b/package/busybox/patches/310-passwd_access.patch
@@ -1,45 +0,0 @@
-
- Copyright (C) 2006 OpenWrt.org
-
-Index: busybox-1.7.2/networking/httpd.c
-===================================================================
---- busybox-1.7.2.orig/networking/httpd.c 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/networking/httpd.c 2007-10-30 15:35:03.000000000 -0500
-@@ -1527,12 +1527,26 @@
- if (ENABLE_FEATURE_HTTPD_AUTH_MD5) {
- char *cipher;
- char *pp;
-+ char *ppnew = NULL;
-+ struct passwd *pwd = NULL;
-
- if (strncmp(p, request, u - request) != 0) {
- /* user doesn't match */
- continue;
- }
- pp = strchr(p, ':');
-+ if(pp && pp[1] == '$' && pp[2] == 'p' &&
-+ pp[3] == '$' && pp[4] &&
-+ (pwd = getpwnam(&pp[4])) != NULL) {
-+ if(pwd->pw_passwd && pwd->pw_passwd[0] == '!') {
-+ prev = NULL;
-+ continue;
-+ }
-+ ppnew = xrealloc(ppnew, 5 + strlen(pwd->pw_passwd));
-+ ppnew[0] = ':';
-+ strcpy(ppnew + 1, pwd->pw_passwd);
-+ pp = ppnew;
-+ }
- if (pp && pp[1] == '$' && pp[2] == '1'
- && pp[3] == '$' && pp[4]
- ) {
-@@ -1543,6 +1557,10 @@
- /* unauthorized */
- continue;
- }
-+ if (ppnew) {
-+ free(ppnew);
-+ ppnew = NULL;
-+ }
- }
-
- if (strcmp(p, request) == 0) {
diff --git a/package/busybox/patches/340-lock_util.patch b/package/busybox/patches/340-lock_util.patch
index 1d781f281b..d946f3229c 100644
--- a/package/busybox/patches/340-lock_util.patch
+++ b/package/busybox/patches/340-lock_util.patch
@@ -1,20 +1,28 @@
-Index: busybox-1.8.1/include/applets.h
-===================================================================
---- busybox-1.8.1.orig/include/applets.h 2007-11-10 16:54:28.318054115 +0100
-+++ busybox-1.8.1/include/applets.h 2007-11-10 17:39:21.487529096 +0100
-@@ -218,6 +218,7 @@
+--- a/include/applets.h
++++ b/include/applets.h
+@@ -220,6 +220,7 @@
USE_LOAD_POLICY(APPLET(load_policy, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_LOADFONT(APPLET(loadfont, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_LOADKMAP(APPLET(loadkmap, _BB_DIR_SBIN, _BB_SUID_NEVER))
-+USE_LOCK(APPLET_NOUSAGE(lock, lock, _BB_DIR_BIN, _BB_SUID_NEVER))
++USE_LOCK(APPLET(lock, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_LOGGER(APPLET(logger, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_LOGIN(APPLET(login, _BB_DIR_BIN, _BB_SUID_ALWAYS))
USE_LOGNAME(APPLET_NOFORK(logname, logname, _BB_DIR_USR_BIN, _BB_SUID_NEVER, logname))
-Index: busybox-1.8.1/miscutils/Config.in
-===================================================================
---- busybox-1.8.1.orig/miscutils/Config.in 2007-11-10 16:54:16.477379354 +0100
-+++ busybox-1.8.1/miscutils/Config.in 2007-11-10 16:54:28.366056851 +0100
-@@ -244,6 +244,12 @@
+--- a/include/usage.h
++++ b/include/usage.h
+@@ -2138,6 +2138,9 @@
+ #define loadkmap_example_usage \
+ "$ loadkmap < /etc/i18n/lang-keymap\n"
+
++#define lock_trivial_usage NOUSAGE_STR
++#define lock_full_usage ""
++
+ #define logger_trivial_usage \
+ "[OPTION]... [MESSAGE]"
+ #define logger_full_usage "\n\n" \
+--- a/miscutils/Config.in
++++ b/miscutils/Config.in
+@@ -364,6 +364,12 @@
Enables the 'hdparm -d' option to get/set using_dma flag.
This is dangerous stuff, so you should probably say N.
@@ -27,22 +35,18 @@ Index: busybox-1.8.1/miscutils/Config.in
config MAKEDEVS
bool "makedevs"
default n
-Index: busybox-1.8.1/miscutils/Kbuild
-===================================================================
---- busybox-1.8.1.orig/miscutils/Kbuild 2007-11-10 16:54:16.481379580 +0100
-+++ busybox-1.8.1/miscutils/Kbuild 2007-11-10 16:54:28.370057076 +0100
-@@ -16,6 +16,7 @@
- lib-$(CONFIG_HDPARM) += hdparm.o
- lib-$(CONFIG_LAST) += last.o
+--- a/miscutils/Kbuild
++++ b/miscutils/Kbuild
+@@ -20,6 +20,7 @@
+ lib-$(CONFIG_FEATURE_LAST_SMALL)+= last.o
+ lib-$(CONFIG_FEATURE_LAST_FANCY)+= last_fancy.o
lib-$(CONFIG_LESS) += less.o
+lib-$(CONFIG_LOCK) += lock.o
lib-$(CONFIG_MAKEDEVS) += makedevs.o
+ lib-$(CONFIG_MAN) += man.o
lib-$(CONFIG_MICROCOM) += microcom.o
- lib-$(CONFIG_MOUNTPOINT) += mountpoint.o
-Index: busybox-1.8.1/miscutils/lock.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/miscutils/lock.c 2007-11-10 17:40:37.203843924 +0100
+--- /dev/null
++++ b/miscutils/lock.c
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
diff --git a/package/busybox/patches/350-httpd_redir.patch b/package/busybox/patches/350-httpd_redir.patch
index 57d3b0bef5..aec068ebfb 100644
--- a/package/busybox/patches/350-httpd_redir.patch
+++ b/package/busybox/patches/350-httpd_redir.patch
@@ -1,31 +1,27 @@
-Index: busybox-1.8.1/include/usage.h
-===================================================================
---- busybox-1.8.1.orig/include/usage.h 2007-11-10 16:54:16.433376848 +0100
-+++ busybox-1.8.1/include/usage.h 2007-11-10 16:54:29.970148260 +0100
-@@ -1418,7 +1418,8 @@
+--- a/include/usage.h
++++ b/include/usage.h
+@@ -1558,7 +1558,8 @@
USE_FEATURE_HTTPD_BASIC_AUTH(" [-r realm]") \
USE_FEATURE_HTTPD_AUTH_MD5(" [-m pass]") \
" [-h home]" \
- " [-d/-e string]"
+ " [-d/-e string]" \
+ " [-R <path> [-H <host>]]"
- #define httpd_full_usage \
- "Listen for incoming HTTP requests" \
- "\n\nOptions:" \
-@@ -1436,6 +1437,8 @@
- "\n -h HOME Home directory (default .)" \
- "\n -e STRING HTML encode STRING" \
- "\n -d STRING URL decode STRING" \
-+ "\n -R PATH Redirect target path" \
-+ "\n -H HOST Redirect target host" \
+ #define httpd_full_usage "\n\n" \
+ "Listen for incoming HTTP requests\n" \
+ "\nOptions:" \
+@@ -1576,6 +1577,8 @@
+ "\n -h HOME Home directory (default .)" \
+ "\n -e STRING HTML encode STRING" \
+ "\n -d STRING URL decode STRING" \
++ "\n -R PATH Redirect target path" \
++ "\n -H HOST Redirect target host" \
#define hwclock_trivial_usage \
USE_GETOPT_LONG( \
-Index: busybox-1.8.1/networking/httpd.c
-===================================================================
---- busybox-1.8.1.orig/networking/httpd.c 2007-11-10 16:54:28.346055711 +0100
-+++ busybox-1.8.1/networking/httpd.c 2007-11-10 16:54:56.639668071 +0100
-@@ -253,6 +253,8 @@
+--- a/networking/httpd.c
++++ b/networking/httpd.c
+@@ -247,6 +247,8 @@
const char *found_mime_type;
const char *found_moved_temporarily;
@@ -34,8 +30,8 @@ Index: busybox-1.8.1/networking/httpd.c
Htaccess_IP *ip_a_d; /* config allow/deny lines */
USE_FEATURE_HTTPD_BASIC_AUTH(const char *g_realm;)
-@@ -297,6 +299,8 @@
- #define home_httpd (G.home_httpd )
+@@ -292,6 +294,8 @@
+ #define index_page (G.index_page )
#define found_mime_type (G.found_mime_type )
#define found_moved_temporarily (G.found_moved_temporarily)
+#define redirect_path (G.redirect_path )
@@ -43,7 +39,7 @@ Index: busybox-1.8.1/networking/httpd.c
#define last_mod (G.last_mod )
#define ip_a_d (G.ip_a_d )
#define g_realm (G.g_realm )
-@@ -988,8 +992,11 @@
+@@ -991,8 +995,11 @@
}
#endif
if (responseNum == HTTP_MOVED_TEMPORARILY) {
@@ -56,21 +52,21 @@ Index: busybox-1.8.1/networking/httpd.c
(g_query ? "?" : ""),
(g_query ? g_query : ""));
}
-@@ -1907,8 +1914,12 @@
- *++urlp = '\0'; /* so keep last character */
- tptr = urlp; /* end ptr */
+@@ -1912,8 +1919,12 @@
+ } while (*++tptr);
+ *++urlp = '\0'; /* terminate after last character */
+ /* redirect active */
+ if (redirect_path && (strncmp(urlcopy, redirect_path, strlen(redirect_path)) != 0))
+ found_moved_temporarily = redirect_path;
+
/* If URL is a directory, add '/' */
-- if (tptr[-1] != '/') {
-+ if (!redirect_path && (tptr[-1] != '/')) {
+- if (urlp[-1] != '/') {
++ if (!redirect_path && (urlp[-1] != '/')) {
if (is_directory(urlcopy + 1, 1, &sb)) {
found_moved_temporarily = urlcopy;
}
-@@ -2252,7 +2263,9 @@
+@@ -2263,7 +2274,9 @@
#endif
enum {
@@ -81,10 +77,10 @@ Index: busybox-1.8.1/networking/httpd.c
d_opt_decode_url,
h_opt_home_httpd,
USE_FEATURE_HTTPD_ENCODE_URL_STR(e_opt_encode_url,)
-@@ -2301,12 +2314,13 @@
+@@ -2312,12 +2325,13 @@
/* We do not "absolutize" path given by -h (home) opt.
- * If user gives relative path in -h, $SCRIPT_FILENAME can end up
- * relative too. */
+ * If user gives relative path in -h,
+ * $SCRIPT_FILENAME will not be set. */
- opt = getopt32(argv, "c:d:h:"
+ opt = getopt32(argv, "R:H:c:d:h:"
USE_FEATURE_HTTPD_ENCODE_URL_STR("e:")
diff --git a/package/busybox/patches/360-awk_multi_f.patch b/package/busybox/patches/360-awk_multi_f.patch
index ab753c125a..e69de29bb2 100644
--- a/package/busybox/patches/360-awk_multi_f.patch
+++ b/package/busybox/patches/360-awk_multi_f.patch
@@ -1,72 +0,0 @@
-Index: busybox-1.7.2/editors/awk.c
-===================================================================
---- busybox-1.7.2.orig/editors/awk.c 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/editors/awk.c 2007-10-30 15:35:03.000000000 -0500
-@@ -2757,6 +2757,7 @@
- {
- unsigned opt;
- char *opt_F, *opt_W;
-+ llist_t *opt_f = NULL;
- llist_t *opt_v = NULL;
- int i, j, flen;
- var *v;
-@@ -2816,8 +2817,8 @@
- *s1 = '=';
- }
- }
-- opt_complementary = "v::";
-- opt = getopt32(argv, "F:v:f:W:", &opt_F, &opt_v, &g_progname, &opt_W);
-+ opt_complementary = "v::f::";
-+ opt = getopt32(argv, "F:v:f:W:", &opt_F, &opt_v, &opt_f, &opt_W);
- argv += optind;
- argc -= optind;
- if (opt & 0x1)
-@@ -2826,25 +2827,31 @@
- if (!is_assignment(llist_pop(&opt_v)))
- bb_show_usage();
- }
-- if (opt & 0x4) { // -f
-- char *s = s; /* die, gcc, die */
-- FILE *from_file = afopen(g_progname, "r");
-- /* one byte is reserved for some trick in next_token */
-- if (fseek(from_file, 0, SEEK_END) == 0) {
-- flen = ftell(from_file);
-- s = xmalloc(flen + 4);
-- fseek(from_file, 0, SEEK_SET);
-- i = 1 + fread(s + 1, 1, flen, from_file);
-- } else {
-- for (i = j = 1; j > 0; i += j) {
-- s = xrealloc(s, i + 4096);
-- j = fread(s + i, 1, 4094, from_file);
-+ if (opt_f != NULL) { // -f
-+ while (opt_f != NULL) {
-+ char *s = NULL;
-+ FILE *from_file;
-+
-+ g_progname = opt_f->data;
-+ from_file = afopen(g_progname, "r");
-+ /* one byte is reserved for some trick in next_token */
-+ if (fseek(from_file, 0, SEEK_END) == 0) {
-+ flen = ftell(from_file);
-+ s = xmalloc(flen + 4);
-+ fseek(from_file, 0, SEEK_SET);
-+ i = 1 + fread(s + 1, 1, flen, from_file);
-+ } else {
-+ for (i = j = 1; j > 0; i += j) {
-+ s = xrealloc(s, i + 4096);
-+ j = fread(s + i, 1, 4094, from_file);
-+ }
- }
-+ s[i] = '\0';
-+ fclose(from_file);
-+ parse_program(s + 1);
-+ free(s);
-+ opt_f = opt_f->link;
- }
-- s[i] = '\0';
-- fclose(from_file);
-- parse_program(s + 1);
-- free(s);
- } else { // no -f: take program from 1st parameter
- if (!argc)
- bb_show_usage();
diff --git a/package/busybox/patches/401-darwin_includes.patch b/package/busybox/patches/401-darwin_includes.patch
index 1ee7ea7411..e69de29bb2 100644
--- a/package/busybox/patches/401-darwin_includes.patch
+++ b/package/busybox/patches/401-darwin_includes.patch
@@ -1,39 +0,0 @@
-Index: busybox-1.7.2/include/platform.h
-===================================================================
---- busybox-1.7.2.orig/include/platform.h 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/include/platform.h 2007-10-30 15:35:04.000000000 -0500
-@@ -137,9 +137,11 @@
- # include <netinet/in.h>
- #endif
-
-+#ifndef __APPLE__
- #ifndef __socklen_t_defined
- typedef int socklen_t;
- #endif
-+#endif
-
- /* ---- Compiler dependent settings ------------------------- */
- #if (defined __digital__ && defined __unix__)
-@@ -179,7 +181,7 @@
- #define HAVE_STDINT_H
- #else
- /* Largest integral types. */
--#if __BIG_ENDIAN__
-+#if __BIG_ENDIAN__ && !__APPLE__
- typedef long intmax_t;
- typedef unsigned long uintmax_t;
- #else
-Index: busybox-1.7.2/include/libbb.h
-===================================================================
---- busybox-1.7.2.orig/include/libbb.h 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/include/libbb.h 2007-10-30 15:35:04.000000000 -0500
-@@ -31,7 +31,9 @@
- #include <sys/mman.h>
- #include <sys/socket.h>
- #include <sys/stat.h>
-+#ifndef __APPLE__
- #include <sys/statfs.h>
-+#endif
- #include <sys/time.h>
- #include <sys/types.h>
- #include <sys/wait.h>
diff --git a/package/busybox/patches/410-httpd_cgi_headers.patch b/package/busybox/patches/410-httpd_cgi_headers.patch
index 97f2a3cc2c..7398d974ee 100644
--- a/package/busybox/patches/410-httpd_cgi_headers.patch
+++ b/package/busybox/patches/410-httpd_cgi_headers.patch
@@ -1,9 +1,7 @@
-Index: busybox-1.7.2/networking/httpd.c
-===================================================================
---- busybox-1.7.2.orig/networking/httpd.c 2007-10-30 15:35:03.000000000 -0500
-+++ busybox-1.7.2/networking/httpd.c 2007-10-30 15:35:04.000000000 -0500
-@@ -1316,10 +1316,10 @@
- if (full_write(1, HTTP_200, sizeof(HTTP_200)-1) != sizeof(HTTP_200)-1)
+--- a/networking/httpd.c
++++ b/networking/httpd.c
+@@ -1247,10 +1247,10 @@
+ if (full_write(STDOUT_FILENO, HTTP_200, sizeof(HTTP_200)-1) != sizeof(HTTP_200)-1)
break;
}
- /* Commented out:
diff --git a/package/busybox/patches/430-uniq_memleak.patch b/package/busybox/patches/430-uniq_memleak.patch
index 15a7a358ce..df56bf8103 100644
--- a/package/busybox/patches/430-uniq_memleak.patch
+++ b/package/busybox/patches/430-uniq_memleak.patch
@@ -1,13 +1,11 @@
-Index: busybox-1.7.2/coreutils/uniq.c
-===================================================================
---- busybox-1.7.2.orig/coreutils/uniq.c 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/coreutils/uniq.c 2007-10-30 15:35:04.000000000 -0500
-@@ -83,6 +83,8 @@
+--- a/coreutils/uniq.c
++++ b/coreutils/uniq.c
+@@ -82,6 +82,8 @@
- if (!s0 || strcmp(e0, e1)) {
+ if (!s0 || strncmp(e0, e1, max_chars)) {
break;
+ } else {
+ free(s1);
}
- ++dups; /* Note: Testing for overflow seems excessive. */
+ ++dups; /* note: testing for overflow seems excessive. */
diff --git a/package/busybox/patches/440-httpd_chdir.patch b/package/busybox/patches/440-httpd_chdir.patch
index e7ae3bca77..0cf2b42a56 100644
--- a/package/busybox/patches/440-httpd_chdir.patch
+++ b/package/busybox/patches/440-httpd_chdir.patch
@@ -1,10 +1,8 @@
-Index: busybox-1.7.2/networking/httpd.c
-===================================================================
---- busybox-1.7.2.orig/networking/httpd.c 2007-10-30 15:35:04.000000000 -0500
-+++ busybox-1.7.2/networking/httpd.c 2007-10-30 15:35:04.000000000 -0500
-@@ -1618,6 +1618,7 @@
- #if ENABLE_FEATURE_HTTPD_BASIC_AUTH
- int credentials = -1; /* if not required this is Ok */
+--- a/networking/httpd.c
++++ b/networking/httpd.c
+@@ -1797,6 +1797,7 @@
+ char *header_ptr = header_ptr;
+ Htaccess_Proxy *proxy_entry;
#endif
+ xchdir(home_httpd);
diff --git a/package/busybox/patches/450-usage_compressed_fix.patch b/package/busybox/patches/450-usage_compressed_fix.patch
index 8df14bebe5..e69de29bb2 100644
--- a/package/busybox/patches/450-usage_compressed_fix.patch
+++ b/package/busybox/patches/450-usage_compressed_fix.patch
@@ -1,12 +0,0 @@
-Index: busybox-1.7.2/applets/usage_compressed
-===================================================================
---- busybox-1.7.2.orig/applets/usage_compressed 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/applets/usage_compressed 2007-10-30 15:35:04.000000000 -0500
-@@ -14,6 +14,6 @@
-
- echo 'static const char packed_usage[] ALIGN1 = '
- "$loc/usage" | bzip2 -1 | od -v -t x1 \
--| $SED -e 's/^[^ ]*//' -e 's/ *\(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
-+| $SED -e 's/^[^ ]*//' -e 's/ *\([a-f0-9][a-f0-9]\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
- echo ';'
- echo '#define SIZEOF_usage_messages' `expr 0 + $sz`
diff --git a/package/busybox/patches/460-truncated_ping_results.patch b/package/busybox/patches/460-truncated_ping_results.patch
index 54798860fc..dbb6e0b02b 100644
--- a/package/busybox/patches/460-truncated_ping_results.patch
+++ b/package/busybox/patches/460-truncated_ping_results.patch
@@ -1,7 +1,5 @@
-Index: busybox-1.7.2/networking/ping.c
-===================================================================
---- busybox-1.7.2.orig/networking/ping.c 2007-10-30 15:34:59.000000000 -0500
-+++ busybox-1.7.2/networking/ping.c 2007-10-30 15:35:05.000000000 -0500
+--- a/networking/ping.c
++++ b/networking/ping.c
@@ -91,7 +91,7 @@
struct sockaddr_in pingaddr;
struct icmp *pkt;
@@ -10,7 +8,7 @@ Index: busybox-1.7.2/networking/ping.c
+ char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN];
pingsock = create_icmp_socket();
- pingaddr = lsa->sin;
+ pingaddr = lsa->u.sin;
@@ -101,7 +101,7 @@
pkt->icmp_type = ICMP_ECHO;
pkt->icmp_cksum = in_cksum((unsigned short *) pkt, sizeof(packet));
@@ -28,7 +26,7 @@ Index: busybox-1.7.2/networking/ping.c
+ char packet[datalen + ICMP_MINLEN + MAXIPLEN + MAXICMPLEN];
pingsock = create_icmp6_socket();
- pingaddr = lsa->sin6;
+ pingaddr = lsa->u.sin6;
@@ -147,7 +147,7 @@
sockopt = offsetof(struct icmp6_hdr, icmp6_cksum);
setsockopt(pingsock, SOL_RAW, IPV6_CHECKSUM, &sockopt, sizeof(sockopt));
diff --git a/package/busybox/patches/470-insmod_search.patch b/package/busybox/patches/470-insmod_search.patch
index ef372ecccf..2a08fb74f2 100644
--- a/package/busybox/patches/470-insmod_search.patch
+++ b/package/busybox/patches/470-insmod_search.patch
@@ -1,7 +1,5 @@
-Index: busybox-1.8.1/modutils/insmod.c
-===================================================================
---- busybox-1.8.1.orig/modutils/insmod.c 2007-11-10 02:40:49.000000000 +0100
-+++ busybox-1.8.1/modutils/insmod.c 2007-11-10 17:28:44.391223047 +0100
+--- a/modutils/insmod.c
++++ b/modutils/insmod.c
@@ -61,21 +61,117 @@
#include "libbb.h"
#include <libgen.h>
@@ -27,9 +25,9 @@ Index: busybox-1.8.1/modutils/insmod.c
#if ENABLE_FEATURE_2_6_MODULES
-static int insmod_ng_main(int argc, char **argv);
+int insmod_main_26(int argc, char **argv);
-+#endif
+ #endif
+int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-+
+
+static char *g_filename = NULL;
+#define _PATH_MODULES "/lib/modules"
+
@@ -69,7 +67,7 @@ Index: busybox-1.8.1/modutils/insmod.c
+ if (k_version <= 4)
+ suffix = ".o";
+ else
- #endif
++#endif
+ suffix = ".ko";
+
+ len = strlen(filename);
@@ -111,7 +109,7 @@ Index: busybox-1.8.1/modutils/insmod.c
+ ret = 0;
+ else
+ free(g_filename);
-
++
+done:
+ free(filename);
+
@@ -125,23 +123,50 @@ Index: busybox-1.8.1/modutils/insmod.c
#if ENABLE_FEATURE_INSMOD_LOADINKMEM
#define LOADBITS 0
#else
-@@ -673,7 +769,6 @@
- #endif
+@@ -184,7 +280,6 @@
+ /* Microblaze */
+ #if defined(__microblaze__)
+ #define USE_SINGLE
+-#include <linux/elf-em.h>
+ #define MATCH_MACHINE(x) (x == EM_XILINX_MICROBLAZE)
+ #define SHT_RELM SHT_RELA
+ #define Elf32_RelM Elf32_Rela
+@@ -452,7 +547,7 @@
+ /* The system calls unchanged between 2.0 and 2.1. */
+
+ unsigned long create_module(const char *, size_t);
+-int delete_module(const char *module, unsigned int flags);
++int delete_module(const char *);
--#define _PATH_MODULES "/lib/modules"
+ #endif /* module.h */
+@@ -652,7 +747,7 @@
+
+ static enum obj_reloc arch_apply_relocation(struct obj_file *f,
+ struct obj_section *targsec,
+- /*struct obj_section *symsec,*/
++ struct obj_section *symsec,
+ struct obj_symbol *sym,
+ ElfW(RelM) *rel, ElfW(Addr) value);
+
+@@ -673,6 +768,7 @@
+ #define SPFX ""
+ #endif
+
++
enum { STRVERSIONLEN = 64 };
/*======================================================================*/
-@@ -789,27 +884,6 @@
+@@ -788,28 +884,6 @@
static char *m_fullName;
-/*======================================================================*/
-
-
--static int check_module_name_match(const char *filename, struct stat *statbuf,
-- void *userdata, int depth)
+-static int check_module_name_match(const char *filename,
+- struct stat *statbuf ATTRIBUTE_UNUSED,
+- void *userdata, int depth ATTRIBUTE_UNUSED)
-{
- char *fullname = (char *) userdata;
- char *tmp;
@@ -161,7 +186,170 @@ Index: busybox-1.8.1/modutils/insmod.c
/*======================================================================*/
-@@ -3897,145 +3971,57 @@
+@@ -835,27 +909,18 @@
+ static enum obj_reloc
+ arch_apply_relocation(struct obj_file *f,
+ struct obj_section *targsec,
+- /*struct obj_section *symsec,*/
++ struct obj_section *symsec,
+ struct obj_symbol *sym,
+ ElfW(RelM) *rel, ElfW(Addr) v)
+ {
+-#if defined(__arm__) || defined(__i386__) || defined(__mc68000__) \
+- || defined(__sh__) || defined(__s390__) || defined(__x86_64__)
+ struct arch_file *ifile = (struct arch_file *) f;
+-#endif
+ enum obj_reloc ret = obj_reloc_ok;
+ ElfW(Addr) *loc = (ElfW(Addr) *) (targsec->contents + rel->r_offset);
+-#if defined(__arm__) || defined(__H8300H__) || defined(__H8300S__) \
+- || defined(__i386__) || defined(__mc68000__) || defined(__microblaze__) \
+- || defined(__mips__) || defined(__nios2__) || defined(__powerpc__) \
+- || defined(__s390__) || defined(__sh__) || defined(__x86_64__)
+ ElfW(Addr) dot = targsec->header.sh_addr + rel->r_offset;
+-#endif
+ #if defined(USE_GOT_ENTRIES) || defined(USE_PLT_ENTRIES)
+ struct arch_symbol *isym = (struct arch_symbol *) sym;
+ #endif
+-#if defined(__arm__) || defined(__i386__) || defined(__mc68000__) \
+- || defined(__sh__) || defined(__s390__)
++#if defined(__arm__) || defined(__i386__) || defined(__mc68000__) || defined(__sh__) || defined(__s390__)
+ #if defined(USE_GOT_ENTRIES)
+ ElfW(Addr) got = ifile->got ? ifile->got->header.sh_addr : 0;
+ #endif
+@@ -953,7 +1018,6 @@
+
+ case R_386_PLT32:
+ case R_386_PC32:
+- case R_386_GOTOFF:
+ *loc += v - dot;
+ break;
+
+@@ -972,6 +1036,9 @@
+
+ case R_386_GOT32:
+ goto bb_use_got;
++
++ case R_386_GOTOFF:
++ *loc += v - got;
+ break;
+
+ #elif defined(__microblaze__)
+@@ -1758,7 +1825,7 @@
+
+ #if defined(USE_SINGLE)
+
+-static int arch_single_init(/*ElfW(RelM) *rel,*/ struct arch_single_entry *single,
++static int arch_single_init(ElfW(RelM) *rel, struct arch_single_entry *single,
+ int offset, int size)
+ {
+ if (single->allocated == 0) {
+@@ -1906,7 +1973,7 @@
+ #if defined(USE_GOT_ENTRIES)
+ if (got_allocate) {
+ got_offset += arch_single_init(
+- /*rel,*/ &intsym->gotent,
++ rel, &intsym->gotent,
+ got_offset, GOT_ENTRY_SIZE);
+
+ got_needed = 1;
+@@ -1920,7 +1987,7 @@
+ plt_offset, PLT_ENTRY_SIZE);
+ #else
+ plt_offset += arch_single_init(
+- /*rel,*/ &intsym->pltent,
++ rel, &intsym->pltent,
+ plt_offset, PLT_ENTRY_SIZE);
+ #endif
+ plt_needed = 1;
+@@ -1958,8 +2025,7 @@
+ while (n > 0) {
+ ch = *name++;
+ h = (h << 4) + ch;
+- g = (h & 0xf0000000);
+- if (g != 0) {
++ if ((g = (h & 0xf0000000)) != 0) {
+ h ^= g >> 24;
+ h &= ~g;
+ }
+@@ -2038,7 +2104,7 @@
+ int n_type = ELF_ST_TYPE(info);
+ int n_binding = ELF_ST_BIND(info);
+
+- for (sym = f->symtab[hash]; sym; sym = sym->next) {
++ for (sym = f->symtab[hash]; sym; sym = sym->next)
+ if (f->symbol_cmp(sym->name, name) == 0) {
+ int o_secidx = sym->secidx;
+ int o_info = sym->info;
+@@ -2097,14 +2163,14 @@
+ return sym;
+ }
+ }
+- }
+
+ /* Completely new symbol. */
+ sym = arch_new_symbol();
+ sym->next = f->symtab[hash];
+ f->symtab[hash] = sym;
+ sym->ksymidx = -1;
+- if (ELF_ST_BIND(info) == STB_LOCAL && symidx != (unsigned long)(-1)) {
++
++ if (ELF_ST_BIND(info) == STB_LOCAL && symidx != -1) {
+ if (symidx >= f->local_symtab_size)
+ bb_error_msg("local symbol %s with index %ld exceeds local_symtab_size %ld",
+ name, (long) symidx, (long) f->local_symtab_size);
+@@ -3227,7 +3293,7 @@
+
+ /* Do it! */
+ switch (arch_apply_relocation
+- (f, targsec, /*symsec,*/ intsym, rel, value)
++ (f, targsec, symsec, intsym, rel, value)
+ ) {
+ case obj_reloc_ok:
+ break;
+@@ -3306,11 +3372,11 @@
+
+ /*======================================================================*/
+
+-static struct obj_file *obj_load(FILE * fp, int loadprogbits ATTRIBUTE_UNUSED)
++static struct obj_file *obj_load(FILE * fp, int loadprogbits)
+ {
+ struct obj_file *f;
+ ElfW(Shdr) * section_headers;
+- size_t shnum, i;
++ int shnum, i;
+ char *shstrtab;
+
+ /* Read the file header. */
+@@ -3582,7 +3648,7 @@
+ while (ptr < endptr) {
+ value = strchr(ptr, '=');
+ if (value && strncmp(ptr, "license", value-ptr) == 0) {
+- unsigned i;
++ int i;
+ if (license)
+ *license = value+1;
+ for (i = 0; i < ARRAY_SIZE(gpl_licenses); ++i) {
+@@ -3686,9 +3752,6 @@
+ * start of some sections. this info is used by ksymoops to do better
+ * debugging.
+ */
+-#if !ENABLE_FEATURE_INSMOD_VERSION_CHECKING
+-#define get_module_version(f, str) get_module_version(str)
+-#endif
+ static int
+ get_module_version(struct obj_file *f, char str[STRVERSIONLEN])
+ {
+@@ -3721,8 +3784,7 @@
+ struct obj_symbol *sym;
+ char *name, *absolute_filename;
+ char str[STRVERSIONLEN];
+- unsigned i;
+- int l, lm_name, lfilename, use_ksymtab, version;
++ int i, l, lm_name, lfilename, use_ksymtab, version;
+ struct stat statbuf;
+
+ /* WARNING: was using realpath, but replaced by readlink to stop using
+@@ -3909,145 +3971,57 @@
void print_load_map(struct obj_file *f);
#endif
@@ -257,10 +445,8 @@ Index: busybox-1.8.1/modutils/insmod.c
- } else {
- free(tmp1);
- tmp1 = NULL; /* flag for free(m_name) before exit() */
-+ tmp = xstrdup(arg1);
-+ m_name = basename(tmp);
- }
-
+- }
+-
- /* Get a filedesc for the module. Check that we have a complete path */
- if (stat(arg1, &st) < 0 || !S_ISREG(st.st_mode)
- || (fp = fopen(arg1, "r")) == NULL
@@ -271,7 +457,7 @@ Index: busybox-1.8.1/modutils/insmod.c
- char *module_dir;
- char *tmdn;
-
-- tmdn = concat_path_file(_PATH_MODULES, myuname.release);
+- tmdn = concat_path_file(CONFIG_DEFAULT_MODULES_DIR, myuname.release);
- /* Jump through hoops in case /lib/modules/`uname -r`
- * is a symlink. We do not want recursive_action to
- * follow symlinks, but we do want to follow the
@@ -293,9 +479,9 @@ Index: busybox-1.8.1/modutils/insmod.c
-
- free(m_filename);
- m_filename = NULL;
-- module_dir = xmalloc_readlink(_PATH_MODULES);
+- module_dir = xmalloc_readlink(CONFIG_DEFAULT_MODULES_DIR);
- if (!module_dir)
-- module_dir = xstrdup(_PATH_MODULES);
+- module_dir = xstrdup(CONFIG_DEFAULT_MODULES_DIR);
- /* No module found under /lib/modules/`uname -r`, this
- * time cast the net a bit wider. Search /lib/modules/ */
- r = recursive_action(module_dir, ACTION_RECURSE,
@@ -308,10 +494,12 @@ Index: busybox-1.8.1/modutils/insmod.c
- ) {
- bb_error_msg_and_die("%s: module not found", m_fullName);
- }
-- }
++ tmp = xstrdup(arg1);
++ m_name = basename(tmp);
+ }
- } else
- m_filename = xstrdup(arg1);
--
+
- if (flag_verbose)
- printf("Using %s\n", m_filename);
-
@@ -329,7 +517,7 @@ Index: busybox-1.8.1/modutils/insmod.c
f = obj_load(fp, LOADBITS);
-@@ -4062,7 +4048,7 @@
+@@ -4074,7 +4048,7 @@
"\t%s was compiled for kernel version %s\n"
"\twhile this kernel is version %s",
flag_force_load ? "warning: " : "",
@@ -338,7 +526,7 @@ Index: busybox-1.8.1/modutils/insmod.c
if (!flag_force_load)
goto out;
}
-@@ -4104,7 +4090,7 @@
+@@ -4116,7 +4090,7 @@
hide_special_symbols(f);
#if ENABLE_FEATURE_INSMOD_KSYMOOPS_SYMBOLS
@@ -347,7 +535,37 @@ Index: busybox-1.8.1/modutils/insmod.c
#endif /* FEATURE_INSMOD_KSYMOOPS_SYMBOLS */
new_create_module_ksymtab(f);
-@@ -4147,18 +4133,19 @@
+@@ -4125,7 +4099,7 @@
+ m_size = obj_load_size(f);
+
+ m_addr = create_module(m_name, m_size);
+- if (m_addr == (ElfW(Addr))(-1)) switch (errno) {
++ if (m_addr == -1) switch (errno) {
+ case EEXIST:
+ bb_error_msg_and_die("a module named %s already exists", m_name);
+ case ENOMEM:
+@@ -4141,36 +4115,37 @@
+ * now we can load them directly into the kernel memory
+ */
+ if (!obj_load_progbits(fp, f, (char*)m_addr)) {
+- delete_module(m_name, 0);
++ delete_module(m_name);
+ goto out;
+ }
+ #endif
+
+ if (!obj_relocate(f, m_addr)) {
+- delete_module(m_name, 0);
++ delete_module(m_name);
+ goto out;
+ }
+
+ if (!new_init_module(m_name, f, m_size)) {
+- delete_module(m_name, 0);
++ delete_module(m_name);
+ goto out;
+ }
+
if (flag_print_load_map)
print_load_map(f);
@@ -372,19 +590,34 @@ Index: busybox-1.8.1/modutils/insmod.c
}
#endif /* ENABLE_FEATURE_2_4_MODULES */
-@@ -4190,23 +4177,32 @@
+@@ -4182,15 +4157,8 @@
+ #if ENABLE_FEATURE_2_6_MODULES
+
+ #include <sys/mman.h>
+-
+-#if defined __UCLIBC__ && !ENABLE_FEATURE_2_4_MODULES
+-/* big time suckage. The old prototype above renders our nice fwd-decl wrong */
+-extern int init_module(void *module, unsigned long len, const char *options);
+-#else
+ #include <asm/unistd.h>
+ #include <sys/syscall.h>
+-#define init_module(mod, len, opts) syscall(__NR_init_module, mod, len, opts)
+-#endif
+
+ /* We use error numbers in a loose translation... */
+ static const char *moderror(int err)
+@@ -4209,22 +4177,32 @@
}
}
-#if !ENABLE_FEATURE_2_4_MODULES
-int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
--int insmod_main(int argc, char **argv)
+-int insmod_main(int argc ATTRIBUTE_UNUSED, char **argv)
-#else
--static int insmod_ng_main(int argc, char **argv)
+-static int insmod_ng_main(int argc ATTRIBUTE_UNUSED, char **argv)
-#endif
+int insmod_main_26(int argc, char **argv)
{
-- long ret;
- size_t len;
+ char *filename, *options;
+ struct utsname myuname;
@@ -414,12 +647,20 @@ Index: busybox-1.8.1/modutils/insmod.c
/* Rest is options */
options = xzalloc(1);
optlen = 0;
-@@ -4216,36 +4212,47 @@
+@@ -4234,41 +4212,47 @@
optlen += sprintf(options + optlen, (strchr(*argv,' ') ? "\"%s\" " : "%s "), *argv);
}
-#if 0
-- /* Any special reason why mmap? It isn't performace critical... */
+- /* Any special reason why mmap? It isn't performance critical. -vda */
+- /* Yes, xmalloc'ing can use *alot* of RAM. Don't forget that there are
+- * modules out there that are half a megabyte! mmap()ing is way nicer
+- * for small mem boxes, i guess. */
+- /* But after load, these modules will take up that 0.5mb in kernel
+- * anyway. Using malloc here causes only a transient spike to 1mb,
+- * after module is loaded, we go back to normal 0.5mb usage
+- * (in kernel). Also, mmap isn't magic - when we touch mapped data,
+- * we use memory. -vda */
- int fd;
- struct stat st;
- unsigned long len;
@@ -440,18 +681,19 @@ Index: busybox-1.8.1/modutils/insmod.c
len = MAXINT(ssize_t);
- map = xmalloc_open_read_close(filename, &len);
-#endif
--
+ map = xmalloc_open_read_close(g_filename, &len);
- ret = syscall(__NR_init_module, map, len, options);
- if (ret != 0) {
- bb_perror_msg_and_die("cannot insert '%s': %s (%li)",
-- filename, moderror(errno), ret);
++ ret = syscall(__NR_init_module, map, len, options);
++ if (ret != 0) {
++ bb_perror_msg_and_die("cannot insert '%s': %s (%li)",
+ g_filename, moderror(errno), ret);
- }
++ }
+done:
+ if (g_filename && (g_filename != filename))
+ free(g_filename);
+- if (init_module(map, len, options) != 0)
+- bb_error_msg_and_die("cannot insert '%s': %s",
+- filename, moderror(errno));
- return 0;
+ return ret;
}
diff --git a/package/busybox/patches/480-disable_braindead_optimization.patch b/package/busybox/patches/480-disable_braindead_optimization.patch
index e5664e177f..e69de29bb2 100644
--- a/package/busybox/patches/480-disable_braindead_optimization.patch
+++ b/package/busybox/patches/480-disable_braindead_optimization.patch
@@ -1,40 +0,0 @@
-Index: busybox-1.8.1/editors/awk.c
-===================================================================
---- busybox-1.8.1.orig/editors/awk.c 2007-11-10 23:53:16.950053243 +0100
-+++ busybox-1.8.1/editors/awk.c 2007-11-10 23:53:23.422422084 +0100
-@@ -446,7 +446,7 @@
- tsplitter fsplitter, rsplitter;
- };
- #define G1 (ptr_to_globals[-1])
--#define G (*(struct globals2 *const)ptr_to_globals)
-+#define G (*(struct globals2 *)ptr_to_globals)
- /* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */
- /* char G1size[sizeof(G1)]; - 0x6c */
- /* char Gsize[sizeof(G)]; - 0x1cc */
-Index: busybox-1.8.1/include/libbb.h
-===================================================================
---- busybox-1.8.1.orig/include/libbb.h 2007-11-10 23:53:38.135260518 +0100
-+++ busybox-1.8.1/include/libbb.h 2007-11-10 23:54:15.773405393 +0100
-@@ -1111,8 +1111,10 @@
- struct globals;
- /* '*const' ptr makes gcc optimize code much better.
- * Magic prevents ptr_to_globals from going into rodata.
-- * If you want to assign a value, use PTR_TO_GLOBALS = xxx */
--extern struct globals *const ptr_to_globals;
-+ * If you want to assign a value, use PTR_TO_GLOBALS = xxx
-+ * unfortunately the above hack doesn't work properly :P
-+ */
-+extern struct globals *ptr_to_globals;
- #define PTR_TO_GLOBALS (*(struct globals**)&ptr_to_globals)
-
-
-Index: busybox-1.8.1/libbb/messages.c
-===================================================================
---- busybox-1.8.1.orig/libbb/messages.c 2007-11-10 23:52:47.116353117 +0100
-+++ busybox-1.8.1/libbb/messages.c 2007-11-10 23:52:57.752959269 +0100
-@@ -74,4 +74,4 @@
-
- struct globals;
- /* Make it reside in R/W memory: */
--struct globals *const ptr_to_globals __attribute__ ((section (".data")));
-+struct globals *ptr_to_globals __attribute__ ((section (".data")));
diff --git a/package/busybox/patches/500-ipkg.patch b/package/busybox/patches/500-ipkg.patch
index 7867634fd2..d7e350e406 100644
--- a/package/busybox/patches/500-ipkg.patch
+++ b/package/busybox/patches/500-ipkg.patch
@@ -1,8 +1,6 @@
-Index: busybox-1.8.1/archival/Config.in
-===================================================================
---- busybox-1.8.1.orig/archival/Config.in 2007-11-10 17:39:21.063504932 +0100
-+++ busybox-1.8.1/archival/Config.in 2007-11-10 17:40:53.320762376 +0100
-@@ -131,6 +131,15 @@
+--- a/archival/Config.in
++++ b/archival/Config.in
+@@ -139,6 +139,15 @@
gzip is used to compress files.
It's probably the most widely used UNIX compression program.
@@ -18,11 +16,9 @@ Index: busybox-1.8.1/archival/Config.in
config RPM2CPIO
bool "rpm2cpio"
default n
-Index: busybox-1.8.1/archival/dpkg.c
-===================================================================
---- busybox-1.8.1.orig/archival/dpkg.c 2007-11-10 17:39:21.071505389 +0100
-+++ busybox-1.8.1/archival/dpkg.c 2007-11-10 17:40:53.320762376 +0100
-@@ -1455,6 +1455,10 @@
+--- a/archival/dpkg.c
++++ b/archival/dpkg.c
+@@ -1482,6 +1482,10 @@
return ar_handle->sub_archive->buffer;
}
@@ -33,7 +29,7 @@ Index: busybox-1.8.1/archival/dpkg.c
static void data_extract_all_prefix(archive_handle_t *archive_handle)
{
char *name_ptr = archive_handle->file_header->name;
-@@ -1466,6 +1470,8 @@
+@@ -1493,6 +1497,8 @@
}
}
@@ -42,10 +38,8 @@ Index: busybox-1.8.1/archival/dpkg.c
static void unpack_package(deb_file_t *deb_file)
{
const char *package_name = name_hashtable[package_hashtable[deb_file->package]->name];
-Index: busybox-1.8.1/archival/ipkg.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/ipkg.c 2007-11-10 17:41:16.866104145 +0100
+--- /dev/null
++++ b/archival/ipkg.c
@@ -0,0 +1,27 @@
+/* ipkg.c - the itsy package management system
+
@@ -74,10 +68,8 @@ Index: busybox-1.8.1/archival/ipkg.c
+{
+ return ipkg_op(argc, argv);
+}
-Index: busybox-1.8.1/archival/Kbuild
-===================================================================
---- busybox-1.8.1.orig/archival/Kbuild 2007-11-10 17:39:21.083506071 +0100
-+++ busybox-1.8.1/archival/Kbuild 2007-11-10 17:40:53.332763058 +0100
+--- a/archival/Kbuild
++++ b/archival/Kbuild
@@ -16,6 +16,7 @@
lib-$(CONFIG_DPKG_DEB) += dpkg_deb.o
lib-$(CONFIG_GUNZIP) += bbunzip.o
@@ -86,10 +78,8 @@ Index: busybox-1.8.1/archival/Kbuild
lib-$(CONFIG_RPM2CPIO) += rpm2cpio.o
lib-$(CONFIG_RPM) += rpm.o
lib-$(CONFIG_TAR) += tar.o
-Index: busybox-1.8.1/archival/libipkg/args.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/args.c 2007-11-10 17:40:53.336763287 +0100
+--- /dev/null
++++ b/archival/libipkg/args.c
@@ -0,0 +1,242 @@
+/* args.c - parse command-line args
+
@@ -333,10 +323,8 @@ Index: busybox-1.8.1/archival/libipkg/args.c
+{
+ bb_error_msg("version %s\n", IPKG_VERSION);
+}
-Index: busybox-1.8.1/archival/libipkg/args.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/args.h 2007-11-10 17:40:53.340763516 +0100
+--- /dev/null
++++ b/archival/libipkg/args.h
@@ -0,0 +1,72 @@
+/* args.h - parse command-line args
+
@@ -410,10 +398,8 @@ Index: busybox-1.8.1/archival/libipkg/args.h
+void args_usage(char *complaint);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/conffile.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/conffile.c 2007-11-10 17:40:53.340763516 +0100
+--- /dev/null
++++ b/archival/libipkg/conffile.c
@@ -0,0 +1,64 @@
+/* conffile.c - the itsy package management system
+
@@ -479,10 +465,8 @@ Index: busybox-1.8.1/archival/libipkg/conffile.c
+
+ return ret;
+}
-Index: busybox-1.8.1/archival/libipkg/conffile.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/conffile.h 2007-11-10 17:40:53.340763516 +0100
+--- /dev/null
++++ b/archival/libipkg/conffile.h
@@ -0,0 +1,30 @@
+/* conffile.h - the itsy package management system
+
@@ -514,10 +498,8 @@ Index: busybox-1.8.1/archival/libipkg/conffile.h
+
+#endif
+
-Index: busybox-1.8.1/archival/libipkg/conffile_list.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/conffile_list.c 2007-11-10 17:40:53.340763516 +0100
+--- /dev/null
++++ b/archival/libipkg/conffile_list.c
@@ -0,0 +1,47 @@
+/* conffile_list.c - the itsy package management system
+
@@ -566,10 +548,8 @@ Index: busybox-1.8.1/archival/libipkg/conffile_list.c
+ return nv_pair_list_pop(list);
+}
+
-Index: busybox-1.8.1/archival/libipkg/conffile_list.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/conffile_list.h 2007-11-10 17:40:53.340763516 +0100
+--- /dev/null
++++ b/archival/libipkg/conffile_list.h
@@ -0,0 +1,36 @@
+/* conffile_list.h - the itsy package management system
+
@@ -607,10 +587,8 @@ Index: busybox-1.8.1/archival/libipkg/conffile_list.h
+
+#endif
+
-Index: busybox-1.8.1/archival/libipkg/file_util.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/file_util.c 2007-11-10 17:40:53.340763516 +0100
+--- /dev/null
++++ b/archival/libipkg/file_util.c
@@ -0,0 +1,132 @@
+/* file_util.c - convenience routines for common stat operations
+
@@ -744,10 +722,8 @@ Index: busybox-1.8.1/archival/libipkg/file_util.c
+ return hash_file(file_name, HASH_MD5);
+}
+
-Index: busybox-1.8.1/archival/libipkg/file_util.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/file_util.h 2007-11-10 17:40:53.344763742 +0100
+--- /dev/null
++++ b/archival/libipkg/file_util.h
@@ -0,0 +1,29 @@
+/* file_util.h - convenience routines for common file operations
+
@@ -778,10 +754,8 @@ Index: busybox-1.8.1/archival/libipkg/file_util.h
+char *file_md5sum_alloc(const char *file_name);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/hash_table.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/hash_table.c 2007-11-10 17:40:53.344763742 +0100
+--- /dev/null
++++ b/archival/libipkg/hash_table.c
@@ -0,0 +1,155 @@
+/* hash.c - hash tables for ipkg
+
@@ -938,10 +912,8 @@ Index: busybox-1.8.1/archival/libipkg/hash_table.c
+ }
+}
+
-Index: busybox-1.8.1/archival/libipkg/hash_table.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/hash_table.h 2007-11-10 17:40:53.344763742 +0100
+--- /dev/null
++++ b/archival/libipkg/hash_table.h
@@ -0,0 +1,44 @@
+/* hash.h - hash tables for ipkg
+
@@ -987,10 +959,8 @@ Index: busybox-1.8.1/archival/libipkg/hash_table.h
+void hash_table_foreach(hash_table_t *hash, void (*f)(const char *key, void *entry, void *data), void *data);
+
+#endif /* _HASH_TABLE_H_ */
-Index: busybox-1.8.1/archival/libipkg/ipkg_cmd.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_cmd.c 2007-11-10 17:40:53.344763742 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_cmd.c
@@ -0,0 +1,1431 @@
+/* ipkg_cmd.c - the itsy package management system
+
@@ -2423,10 +2393,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_cmd.c
+}
+
+
-Index: busybox-1.8.1/archival/libipkg/ipkg_cmd.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_cmd.h 2007-11-10 17:40:53.348763971 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_cmd.h
@@ -0,0 +1,46 @@
+/* ipkg_cmd.h - the itsy package management system
+
@@ -2474,10 +2442,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_cmd.h
+int pkg_mark_provides(pkg_t *pkg);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/ipkg_conf.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_conf.c 2007-11-10 17:40:53.348763971 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_conf.c
@@ -0,0 +1,711 @@
+/* ipkg_conf.c - the itsy package management system
+
@@ -3190,10 +3156,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_conf.c
+ sprintf_alloc(&root_filename, "%s%s", (conf->offline_root ? conf->offline_root : ""), filename);
+ return root_filename;
+}
-Index: busybox-1.8.1/archival/libipkg/ipkg_conf.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_conf.h 2007-11-10 17:40:53.348763971 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_conf.h
@@ -0,0 +1,107 @@
+/* ipkg_conf.h - the itsy package management system
+
@@ -3302,10 +3266,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_conf.h
+char *root_filename_alloc(ipkg_conf_t *conf, char *filename);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/ipkg_configure.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_configure.c 2007-11-10 17:40:53.348763971 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_configure.c
@@ -0,0 +1,40 @@
+/* ipkg_configure.c - the itsy package management system
+
@@ -3347,10 +3309,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_configure.c
+ return 0;
+}
+
-Index: busybox-1.8.1/archival/libipkg/ipkg_configure.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_configure.h 2007-11-10 17:40:53.348763971 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_configure.h
@@ -0,0 +1,25 @@
+/* ipkg_configure.h - the itsy package management system
+
@@ -3377,10 +3337,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_configure.h
+int ipkg_configure(ipkg_conf_t *ipkg_conf, pkg_t *pkg);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/ipkg_download.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_download.c 2007-11-10 17:40:53.352764197 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_download.c
@@ -0,0 +1,195 @@
+/* ipkg_download.c - the itsy package management system
+
@@ -3577,10 +3535,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_download.c
+ }
+ return 0;
+}
-Index: busybox-1.8.1/archival/libipkg/ipkg_download.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_download.h 2007-11-10 17:40:53.352764197 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_download.h
@@ -0,0 +1,30 @@
+/* ipkg_download.h - the itsy package management system
+
@@ -3612,10 +3568,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_download.h
+int ipkg_prepare_url_for_install(ipkg_conf_t *conf, const char *url, char **namep);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/ipkg.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg.h 2007-11-10 17:40:53.352764197 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg.h
@@ -0,0 +1,74 @@
+/* ipkg.h - the itsy package management system
+
@@ -3691,10 +3645,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg.h
+extern ipkg_conf_t *global_conf;
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/ipkg_includes.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_includes.h 2007-11-10 17:40:53.352764197 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_includes.h
@@ -0,0 +1,79 @@
+#ifndef IPKG_INCLUDES_H
+#define IPKG_INCLUDES_H
@@ -3775,10 +3727,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_includes.h
+#endif
+
+#endif /* IPKG_INCLUDES_H */
-Index: busybox-1.8.1/archival/libipkg/ipkg_install.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_install.c 2007-11-10 17:40:53.356764426 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_install.c
@@ -0,0 +1,1942 @@
+/* ipkg_install.c - the itsy package management system
+
@@ -5722,10 +5672,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_install.c
+}
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/ipkg_install.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_install.h 2007-11-10 17:40:53.356764426 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_install.h
@@ -0,0 +1,35 @@
+/* ipkg_install.h - the itsy package management system
+
@@ -5762,10 +5710,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_install.h
+int name_mark_dependencies_for_installation(ipkg_conf_t *conf, const char *pkg_name, pkg_vec_t *pkgs_needed);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/ipkg_message.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_message.c 2007-11-10 17:40:53.356764426 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_message.c
@@ -0,0 +1,61 @@
+/* ipkg_message.c - the itsy package management system
+
@@ -5828,10 +5774,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_message.c
+ }
+}
+#endif
-Index: busybox-1.8.1/archival/libipkg/ipkg_message.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_message.h 2007-11-10 17:40:53.356764426 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_message.h
@@ -0,0 +1,32 @@
+/* ipkg_message.h - the itsy package management system
+
@@ -5865,10 +5809,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_message.h
+extern void ipkg_message(ipkg_conf_t *conf, message_level_t level, const char *fmt, ...);
+
+#endif /* _IPKG_MESSAGE_H_ */
-Index: busybox-1.8.1/archival/libipkg/ipkg_remove.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_remove.c 2007-11-10 17:40:53.360764656 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_remove.c
@@ -0,0 +1,383 @@
+/* ipkg_remove.c - the itsy package management system
+
@@ -6253,10 +6195,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_remove.c
+
+ return 0;
+}
-Index: busybox-1.8.1/archival/libipkg/ipkg_remove.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_remove.h 2007-11-10 17:40:53.360764656 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_remove.h
@@ -0,0 +1,33 @@
+/* ipkg_remove.h - the itsy package management system
+
@@ -6291,10 +6231,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_remove.h
+
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/ipkg_upgrade.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_upgrade.c 2007-11-10 17:40:53.360764656 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_upgrade.c
@@ -0,0 +1,77 @@
+/* ipkg_upgrade.c - the itsy package management system
+
@@ -6373,10 +6311,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_upgrade.c
+ new->state_flag |= SF_USER;
+ return ipkg_install_pkg(conf, new,1);
+}
-Index: busybox-1.8.1/archival/libipkg/ipkg_upgrade.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_upgrade.h 2007-11-10 17:40:53.360764656 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_upgrade.h
@@ -0,0 +1,18 @@
+/* ipkg_upgrade.c - the itsy package management system
+
@@ -6396,10 +6332,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_upgrade.h
+#include "ipkg.h"
+
+int ipkg_upgrade_pkg(ipkg_conf_t *conf, pkg_t *old);
-Index: busybox-1.8.1/archival/libipkg/ipkg_utils.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_utils.c 2007-11-10 17:40:53.360764656 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_utils.c
@@ -0,0 +1,181 @@
+/* ipkg_utils.c - the itsy package management system
+
@@ -6582,10 +6516,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_utils.c
+}
+
+
-Index: busybox-1.8.1/archival/libipkg/ipkg_utils.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/ipkg_utils.h 2007-11-10 17:40:53.360764656 +0100
+--- /dev/null
++++ b/archival/libipkg/ipkg_utils.h
@@ -0,0 +1,29 @@
+/* ipkg_utils.h - the itsy package management system
+
@@ -6616,10 +6548,8 @@ Index: busybox-1.8.1/archival/libipkg/ipkg_utils.h
+int line_is_blank(const char *line);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/Kbuild
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/Kbuild 2007-11-10 17:40:53.364764882 +0100
+--- /dev/null
++++ b/archival/libipkg/Kbuild
@@ -0,0 +1,60 @@
+# Makefile for busybox
+#
@@ -6681,10 +6611,8 @@ Index: busybox-1.8.1/archival/libipkg/Kbuild
+IPKG_ARCH:=$(TARGET_ARCH)
+endif
+CFLAGS += -DIPKG_LIB -DIPKGLIBDIR="\"/usr/lib\"" -DHOST_CPU_STR="\"$(IPKG_ARCH)\""
-Index: busybox-1.8.1/archival/libipkg/libipkg.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/libipkg.c 2007-11-10 17:40:53.364764882 +0100
+--- /dev/null
++++ b/archival/libipkg/libipkg.c
@@ -0,0 +1,527 @@
+/* ipkglib.c - the itsy package management system
+
@@ -7213,10 +7141,8 @@ Index: busybox-1.8.1/archival/libipkg/libipkg.c
+}
+
+#endif /* IPKG_LIB */
-Index: busybox-1.8.1/archival/libipkg/libipkg.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/libipkg.h 2007-11-10 17:40:53.364764882 +0100
+--- /dev/null
++++ b/archival/libipkg/libipkg.h
@@ -0,0 +1,88 @@
+/* ipkglib.h - the itsy package management system
+
@@ -7306,10 +7232,8 @@ Index: busybox-1.8.1/archival/libipkg/libipkg.h
+
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/nv_pair.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/nv_pair.c 2007-11-10 17:40:53.364764882 +0100
+--- /dev/null
++++ b/archival/libipkg/nv_pair.c
@@ -0,0 +1,40 @@
+/* nv_pair.c - the itsy package management system
+
@@ -7351,10 +7275,8 @@ Index: busybox-1.8.1/archival/libipkg/nv_pair.c
+}
+
+
-Index: busybox-1.8.1/archival/libipkg/nv_pair.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/nv_pair.h 2007-11-10 17:40:53.372765337 +0100
+--- /dev/null
++++ b/archival/libipkg/nv_pair.h
@@ -0,0 +1,32 @@
+/* nv_pair.h - the itsy package management system
+
@@ -7388,10 +7310,8 @@ Index: busybox-1.8.1/archival/libipkg/nv_pair.h
+
+#endif
+
-Index: busybox-1.8.1/archival/libipkg/nv_pair_list.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/nv_pair_list.c 2007-11-10 17:40:53.372765337 +0100
+--- /dev/null
++++ b/archival/libipkg/nv_pair_list.c
@@ -0,0 +1,98 @@
+/* nv_pair_list.c - the itsy package management system
+
@@ -7491,10 +7411,8 @@ Index: busybox-1.8.1/archival/libipkg/nv_pair_list.c
+ }
+ return NULL;
+}
-Index: busybox-1.8.1/archival/libipkg/nv_pair_list.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/nv_pair_list.h 2007-11-10 17:40:53.372765337 +0100
+--- /dev/null
++++ b/archival/libipkg/nv_pair_list.h
@@ -0,0 +1,60 @@
+/* nv_pair_list.h - the itsy package management system
+
@@ -7556,10 +7474,8 @@ Index: busybox-1.8.1/archival/libipkg/nv_pair_list.h
+
+#endif
+
-Index: busybox-1.8.1/archival/libipkg/pkg.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg.c 2007-11-10 17:40:53.376765566 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg.c
@@ -0,0 +1,1747 @@
+/* pkg.c - the itsy package management system
+
@@ -9308,10 +9224,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg.c
+ }
+ return 0;
+}
-Index: busybox-1.8.1/archival/libipkg/pkg_depends.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_depends.c 2007-11-10 17:40:53.376765566 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_depends.c
@@ -0,0 +1,1031 @@
+/* pkg_depends.c - the itsy package management system
+
@@ -10344,10 +10258,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_depends.c
+
+ return 0;
+}
-Index: busybox-1.8.1/archival/libipkg/pkg_depends.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_depends.h 2007-11-10 17:40:53.376765566 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_depends.h
@@ -0,0 +1,105 @@
+/* pkg_depends.h - the itsy package management system
+
@@ -10454,10 +10366,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_depends.h
+int pkg_dependence_satisfied(ipkg_conf_t *conf, depend_t *depend);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/pkg_dest.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_dest.c 2007-11-10 17:40:53.376765566 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_dest.c
@@ -0,0 +1,92 @@
+/* pkg_dest.c - the itsy package management system
+
@@ -10551,10 +10461,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_dest.c
+
+ dest->root_dir = NULL;
+}
-Index: busybox-1.8.1/archival/libipkg/pkg_dest.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_dest.h 2007-11-10 17:40:53.380765796 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_dest.h
@@ -0,0 +1,38 @@
+/* pkg_dest.h - the itsy package management system
+
@@ -10594,10 +10502,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_dest.h
+
+#endif
+
-Index: busybox-1.8.1/archival/libipkg/pkg_dest_list.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_dest_list.c 2007-11-10 17:40:53.380765796 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_dest_list.c
@@ -0,0 +1,85 @@
+/* pkg_dest_list.c - the itsy package management system
+
@@ -10684,10 +10590,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_dest_list.c
+{
+ return (pkg_dest_list_elt_t *) void_list_pop((void_list_t *) list);
+}
-Index: busybox-1.8.1/archival/libipkg/pkg_dest_list.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_dest_list.h 2007-11-10 17:40:53.380765796 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_dest_list.h
@@ -0,0 +1,50 @@
+/* pkg_dest_list.h - the itsy package management system
+
@@ -10739,10 +10643,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_dest_list.h
+
+#endif
+
-Index: busybox-1.8.1/archival/libipkg/pkg_extract.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_extract.c 2007-11-10 17:40:53.380765796 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_extract.c
@@ -0,0 +1,224 @@
+/* pkg_extract.c - the itsy package management system
+
@@ -10968,10 +10870,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_extract.c
+
+ return 0;
+}
-Index: busybox-1.8.1/archival/libipkg/pkg_extract.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_extract.h 2007-11-10 17:40:53.380765796 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_extract.h
@@ -0,0 +1,32 @@
+/* pkg_extract.c - the itsy package management system
+
@@ -11005,10 +10905,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_extract.h
+int pkg_extract_data_file_names_to_stream(pkg_t *pkg, FILE *file);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/pkg.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg.h 2007-11-10 17:40:53.384766022 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg.h
@@ -0,0 +1,229 @@
+/* pkg.h - the itsy package management system
+
@@ -11239,10 +11137,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg.h
+int pkg_write_changed_filelists(ipkg_conf_t *conf);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/pkg_hash.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_hash.c 2007-11-10 17:40:53.388766251 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_hash.c
@@ -0,0 +1,616 @@
+/* ipkg_hash.c - the itsy package management system
+
@@ -11860,10 +11756,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_hash.c
+}
+
+
-Index: busybox-1.8.1/archival/libipkg/pkg_hash.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_hash.h 2007-11-10 17:40:53.388766251 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_hash.h
@@ -0,0 +1,61 @@
+/* pkg_hash.h - the itsy package management system
+
@@ -11926,10 +11820,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_hash.h
+
+#endif
+
-Index: busybox-1.8.1/archival/libipkg/pkg_parse.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_parse.c 2007-11-10 17:40:53.388766251 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_parse.c
@@ -0,0 +1,366 @@
+/* pkg_parse.c - the itsy package management system
+
@@ -12297,10 +12189,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_parse.c
+
+ return 0;
+}
-Index: busybox-1.8.1/archival/libipkg/pkg_parse.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_parse.h 2007-11-10 17:40:53.392766477 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_parse.h
@@ -0,0 +1,31 @@
+/* pkg_parse.h - the itsy package management system
+
@@ -12333,10 +12223,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_parse.h
+int pkg_valorize_other_field(pkg_t *pkg, char ***raw);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/pkg_src.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_src.c 2007-11-10 17:40:53.392766477 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_src.c
@@ -0,0 +1,43 @@
+/* pkg_src.c - the itsy package management system
+
@@ -12381,10 +12269,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_src.c
+}
+
+
-Index: busybox-1.8.1/archival/libipkg/pkg_src.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_src.h 2007-11-10 17:40:53.392766477 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_src.h
@@ -0,0 +1,34 @@
+/* pkg_src.h - the itsy package management system
+
@@ -12420,10 +12306,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_src.h
+void pkg_src_deinit(pkg_src_t *src);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/pkg_src_list.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_src_list.c 2007-11-10 17:40:53.392766477 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_src_list.c
@@ -0,0 +1,75 @@
+/* pkg_src_list.c - the itsy package management system
+
@@ -12500,10 +12384,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_src_list.c
+{
+ return (pkg_src_list_elt_t *) void_list_pop((void_list_t *) list);
+}
-Index: busybox-1.8.1/archival/libipkg/pkg_src_list.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_src_list.h 2007-11-10 17:40:53.396766706 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_src_list.h
@@ -0,0 +1,57 @@
+/* pkg_src_list.h - the itsy package management system
+
@@ -12562,10 +12444,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_src_list.h
+
+#endif
+
-Index: busybox-1.8.1/archival/libipkg/pkg_vec.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_vec.c 2007-11-10 17:40:53.396766706 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_vec.c
@@ -0,0 +1,230 @@
+/* pkg_vec.c - the itsy package management system
+
@@ -12797,10 +12677,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_vec.c
+ qsort(vec->pkgs, vec->len, sizeof(pkg_t *), (compare_fcn_t)compar);
+}
+
-Index: busybox-1.8.1/archival/libipkg/pkg_vec.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/pkg_vec.h 2007-11-10 17:40:53.396766706 +0100
+--- /dev/null
++++ b/archival/libipkg/pkg_vec.h
@@ -0,0 +1,64 @@
+/* pkg_vec.h - the itsy package management system
+
@@ -12866,10 +12744,8 @@ Index: busybox-1.8.1/archival/libipkg/pkg_vec.h
+void abstract_pkg_vec_sort(pkg_vec_t *vec, int (*compar)(abstract_pkg_t *, abstract_pkg_t *));
+#endif
+
-Index: busybox-1.8.1/archival/libipkg/sprintf_alloc.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/sprintf_alloc.h 2007-11-10 17:40:53.396766706 +0100
+--- /dev/null
++++ b/archival/libipkg/sprintf_alloc.h
@@ -0,0 +1,25 @@
+/* sprintf_alloca.c -- like sprintf with memory allocation
+
@@ -12896,10 +12772,8 @@ Index: busybox-1.8.1/archival/libipkg/sprintf_alloc.h
+#define sprintf_alloc(str, fmt, args...) *str = xasprintf(fmt, ## args)
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/str_list.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/str_list.c 2007-11-10 17:40:53.396766706 +0100
+--- /dev/null
++++ b/archival/libipkg/str_list.c
@@ -0,0 +1,76 @@
+/* str_list.c - the itsy package management system
+
@@ -12977,10 +12851,8 @@ Index: busybox-1.8.1/archival/libipkg/str_list.c
+ (void *)target_str,
+ (void_list_cmp_t)strcmp);
+}
-Index: busybox-1.8.1/archival/libipkg/str_list.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/str_list.h 2007-11-10 17:40:53.400766935 +0100
+--- /dev/null
++++ b/archival/libipkg/str_list.h
@@ -0,0 +1,51 @@
+/* str_list.h - the itsy package management system
+
@@ -13033,10 +12905,8 @@ Index: busybox-1.8.1/archival/libipkg/str_list.h
+char *str_list_remove_elt(str_list_t *list, const char *target_str);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/str_util.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/str_util.c 2007-11-10 17:40:53.400766935 +0100
+--- /dev/null
++++ b/archival/libipkg/str_util.c
@@ -0,0 +1,63 @@
+/* str_utils.c - the itsy package management system
+
@@ -13101,10 +12971,8 @@ Index: busybox-1.8.1/archival/libipkg/str_util.c
+ return str ? strdup(str) : NULL;
+}
+
-Index: busybox-1.8.1/archival/libipkg/str_util.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/str_util.h 2007-11-10 17:40:53.400766935 +0100
+--- /dev/null
++++ b/archival/libipkg/str_util.h
@@ -0,0 +1,27 @@
+/* str_utils.h - the itsy package management system
+
@@ -13133,10 +13001,8 @@ Index: busybox-1.8.1/archival/libipkg/str_util.h
+char *str_dup_safe(const char *str);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/user.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/user.c 2007-11-10 17:40:53.400766935 +0100
+--- /dev/null
++++ b/archival/libipkg/user.c
@@ -0,0 +1,58 @@
+/* user.c - the itsy package management system
+
@@ -13196,10 +13062,8 @@ Index: busybox-1.8.1/archival/libipkg/user.c
+
+ return response;
+}
-Index: busybox-1.8.1/archival/libipkg/user.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/user.h 2007-11-10 17:40:53.400766935 +0100
+--- /dev/null
++++ b/archival/libipkg/user.h
@@ -0,0 +1,23 @@
+/* user.c - the itsy package management system
+
@@ -13224,10 +13088,8 @@ Index: busybox-1.8.1/archival/libipkg/user.h
+
+char *get_user_response(const char *format, ...);
+
-Index: busybox-1.8.1/archival/libipkg/void_list.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/void_list.c 2007-11-10 17:40:53.404767161 +0100
+--- /dev/null
++++ b/archival/libipkg/void_list.c
@@ -0,0 +1,194 @@
+/* void_list.c - the itsy package management system
+
@@ -13423,10 +13285,8 @@ Index: busybox-1.8.1/archival/libipkg/void_list.c
+ else
+ return NULL;
+}
-Index: busybox-1.8.1/archival/libipkg/void_list.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/void_list.h 2007-11-10 17:40:53.404767161 +0100
+--- /dev/null
++++ b/archival/libipkg/void_list.h
@@ -0,0 +1,59 @@
+/* void_list.h - the itsy package management system
+
@@ -13487,10 +13347,8 @@ Index: busybox-1.8.1/archival/libipkg/void_list.h
+void *void_list_remove_elt(void_list_t *list, const void *target_data, void_list_cmp_t cmp);
+
+#endif
-Index: busybox-1.8.1/archival/libipkg/xsystem.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/xsystem.c 2007-11-10 17:40:53.404767161 +0100
+--- /dev/null
++++ b/archival/libipkg/xsystem.c
@@ -0,0 +1,64 @@
+/* xsystem.c - system(3) with error messages
+
@@ -13556,10 +13414,8 @@ Index: busybox-1.8.1/archival/libipkg/xsystem.c
+ return -1;
+}
+
-Index: busybox-1.8.1/archival/libipkg/xsystem.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/archival/libipkg/xsystem.h 2007-11-10 17:40:53.404767161 +0100
+--- /dev/null
++++ b/archival/libipkg/xsystem.h
@@ -0,0 +1,34 @@
+/* xsystem.h - system(3) with error messages
+
@@ -13595,11 +13451,9 @@ Index: busybox-1.8.1/archival/libipkg/xsystem.h
+
+#endif
+
-Index: busybox-1.8.1/archival/libunarchive/data_extract_all.c
-===================================================================
---- busybox-1.8.1.orig/archival/libunarchive/data_extract_all.c 2007-11-10 17:39:21.471528185 +0100
-+++ busybox-1.8.1/archival/libunarchive/data_extract_all.c 2007-11-10 17:40:53.404767161 +0100
-@@ -129,3 +129,17 @@
+--- a/archival/libunarchive/data_extract_all.c
++++ b/archival/libunarchive/data_extract_all.c
+@@ -144,3 +144,17 @@
}
}
}
@@ -13617,10 +13471,8 @@ Index: busybox-1.8.1/archival/libunarchive/data_extract_all.c
+ }
+}
+
-Index: busybox-1.8.1/archival/libunarchive/Kbuild
-===================================================================
---- busybox-1.8.1.orig/archival/libunarchive/Kbuild 2007-11-10 17:39:21.479528641 +0100
-+++ busybox-1.8.1/archival/libunarchive/Kbuild 2007-11-10 17:40:53.408767391 +0100
+--- a/archival/libunarchive/Kbuild
++++ b/archival/libunarchive/Kbuild
@@ -54,6 +54,7 @@
lib-$(CONFIG_FEATURE_DEB_TAR_LZMA) += decompress_unlzma.o get_header_tar_lzma.o
lib-$(CONFIG_GUNZIP) += decompress_unzip.o
@@ -13629,11 +13481,9 @@ Index: busybox-1.8.1/archival/libunarchive/Kbuild
lib-$(CONFIG_RPM2CPIO) += decompress_unzip.o get_header_cpio.o
lib-$(CONFIG_RPM) += decompress_unzip.o get_header_cpio.o
lib-$(CONFIG_FEATURE_RPM_BZ2) += decompress_bunzip2.o
-Index: busybox-1.8.1/include/applets.h
-===================================================================
---- busybox-1.8.1.orig/include/applets.h 2007-11-10 17:39:21.487529096 +0100
-+++ busybox-1.8.1/include/applets.h 2007-11-10 17:40:53.408767391 +0100
-@@ -198,6 +198,7 @@
+--- a/include/applets.h
++++ b/include/applets.h
+@@ -200,6 +200,7 @@
USE_IPCALC(APPLET(ipcalc, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_IPCRM(APPLET(ipcrm, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
USE_IPCS(APPLET(ipcs, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
@@ -13641,11 +13491,9 @@ Index: busybox-1.8.1/include/applets.h
USE_IPLINK(APPLET(iplink, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_IPROUTE(APPLET(iproute, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_IPRULE(APPLET(iprule, _BB_DIR_BIN, _BB_SUID_NEVER))
-Index: busybox-1.8.1/include/unarchive.h
-===================================================================
---- busybox-1.8.1.orig/include/unarchive.h 2007-11-10 17:39:21.495529554 +0100
-+++ busybox-1.8.1/include/unarchive.h 2007-11-10 17:40:53.408767391 +0100
-@@ -74,6 +74,7 @@
+--- a/include/unarchive.h
++++ b/include/unarchive.h
+@@ -82,6 +82,7 @@
extern void data_skip(archive_handle_t *archive_handle);
extern void data_extract_all(archive_handle_t *archive_handle);
@@ -13653,11 +13501,9 @@ Index: busybox-1.8.1/include/unarchive.h
extern void data_extract_to_stdout(archive_handle_t *archive_handle);
extern void data_extract_to_buffer(archive_handle_t *archive_handle);
-Index: busybox-1.8.1/include/usage.h
-===================================================================
---- busybox-1.8.1.orig/include/usage.h 2007-11-10 17:40:53.208755993 +0100
-+++ busybox-1.8.1/include/usage.h 2007-11-10 17:40:53.412767617 +0100
-@@ -1294,6 +1294,82 @@
+--- a/include/usage.h
++++ b/include/usage.h
+@@ -1425,6 +1425,82 @@
"$ ls -la /tmp/busybox*\n" \
"-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
@@ -13739,12 +13585,10 @@ Index: busybox-1.8.1/include/usage.h
+
#define halt_trivial_usage \
"[-d delay] [-n] [-f]"
- #define halt_full_usage \
-Index: busybox-1.8.1/Makefile
-===================================================================
---- busybox-1.8.1.orig/Makefile 2007-11-10 17:39:21.511530465 +0100
-+++ busybox-1.8.1/Makefile 2007-11-10 17:40:53.412767617 +0100
-@@ -428,6 +428,7 @@
+ #define halt_full_usage "\n\n" \
+--- a/Makefile
++++ b/Makefile
+@@ -444,6 +444,7 @@
libs-y := \
archival/ \
diff --git a/package/busybox/patches/501-libbb_hash.patch b/package/busybox/patches/501-libbb_hash.patch
index 9c8d0825d4..89379e270b 100644
--- a/package/busybox/patches/501-libbb_hash.patch
+++ b/package/busybox/patches/501-libbb_hash.patch
@@ -1,8 +1,25 @@
-Index: busybox-1.8.1/coreutils/md5_sha1_sum.c
-===================================================================
---- busybox-1.8.1.orig/coreutils/md5_sha1_sum.c 2007-11-10 02:40:51.000000000 +0100
-+++ busybox-1.8.1/coreutils/md5_sha1_sum.c 2007-11-10 17:05:59.957468399 +0100
-@@ -8,75 +8,10 @@
+--- a/include/libbb.h
++++ b/include/libbb.h
+@@ -1211,6 +1211,7 @@
+ extern const char bb_uuenc_tbl_std[];
+ void bb_uuencode(char *store, const void *s, int length, const char *tbl);
+
++typedef enum { HASH_SHA1, HASH_MD5 } hash_algo_t;
+ typedef struct sha1_ctx_t {
+ uint32_t count[2];
+ uint32_t hash[5];
+@@ -1232,6 +1233,8 @@
+ void md5_begin(md5_ctx_t *ctx);
+ void md5_hash(const void *data, size_t length, md5_ctx_t *ctx);
+ void *md5_end(void *resbuf, md5_ctx_t *ctx);
++unsigned char *hash_bin_to_hex(unsigned char *hash_value, unsigned hash_length);
++uint8_t *hash_file(const char *filename, hash_algo_t hash_algo);
+
+ uint32_t *crc32_filltable(uint32_t *tbl256, int endian);
+
+--- a/coreutils/md5_sha1_sum.c
++++ b/coreutils/md5_sha1_sum.c
+@@ -8,72 +8,10 @@
#include "libbb.h"
@@ -19,7 +36,7 @@ Index: busybox-1.8.1/coreutils/md5_sha1_sum.c
- /* xzalloc zero-terminates */
- char *hex_value = xzalloc((hash_length * 2) + 1);
- bin2hex(hex_value, (char*)hash_value, hash_length);
-- return hex_value;
+- return (unsigned char *)hex_value;
-}
-
-static uint8_t *hash_file(const char *filename, hash_algo_t hash_algo)
@@ -34,12 +51,9 @@ Index: busybox-1.8.1/coreutils/md5_sha1_sum.c
- void (*update)(const void*, size_t, void*);
- void (*final)(void*, void*);
-
-- src_fd = STDIN_FILENO;
-- if (NOT_LONE_DASH(filename)) {
-- src_fd = open_or_warn(filename, O_RDONLY);
-- if (src_fd < 0) {
-- return NULL;
-- }
+- src_fd = open_or_warn_stdin(filename);
+- if (src_fd < 0) {
+- return NULL;
- }
-
- /* figure specific hash algorithims */
@@ -76,46 +90,21 @@ Index: busybox-1.8.1/coreutils/md5_sha1_sum.c
-}
-
int md5_sha1_sum_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
- int md5_sha1_sum_main(int argc, char **argv)
+ int md5_sha1_sum_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
-Index: busybox-1.8.1/include/libbb.h
-===================================================================
---- busybox-1.8.1.orig/include/libbb.h 2007-11-10 16:55:07.048261223 +0100
-+++ busybox-1.8.1/include/libbb.h 2007-11-10 17:04:07.543062264 +0100
-@@ -1022,6 +1022,7 @@
- extern const char bb_uuenc_tbl_std[];
- void bb_uuencode(char *store, const void *s, int length, const char *tbl);
-
-+typedef enum { HASH_SHA1, HASH_MD5 } hash_algo_t;
- typedef struct sha1_ctx_t {
- uint32_t count[2];
- uint32_t hash[5];
-@@ -1043,6 +1044,8 @@
- void md5_begin(md5_ctx_t *ctx);
- void md5_hash(const void *data, size_t length, md5_ctx_t *ctx);
- void *md5_end(void *resbuf, md5_ctx_t *ctx);
-+unsigned char *hash_bin_to_hex(unsigned char *hash_value, unsigned hash_length);
-+uint8_t *hash_file(const char *filename, hash_algo_t hash_algo);
-
- uint32_t *crc32_filltable(uint32_t *tbl256, int endian);
-
-Index: busybox-1.8.1/libbb/Kbuild
-===================================================================
---- busybox-1.8.1.orig/libbb/Kbuild 2007-11-10 02:40:52.000000000 +0100
-+++ busybox-1.8.1/libbb/Kbuild 2007-11-10 17:04:07.547062497 +0100
-@@ -39,6 +39,7 @@
+--- a/libbb/Kbuild
++++ b/libbb/Kbuild
+@@ -40,6 +40,7 @@
lib-y += get_last_path_component.o
lib-y += get_line_from_file.o
lib-y += getopt32.o
+lib-y += hash.o
+ lib-y += getpty.o
lib-y += herror_msg.o
lib-y += herror_msg_and_die.o
- lib-y += human_readable.o
-Index: busybox-1.8.1/libbb/hash.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/libbb/hash.c 2007-11-10 17:04:07.551062729 +0100
-@@ -0,0 +1,81 @@
+--- /dev/null
++++ b/libbb/hash.c
+@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2003 Glenn L. McGrath
+ * Copyright (C) 2003-2004 Erik Andersen
@@ -155,12 +144,9 @@ Index: busybox-1.8.1/libbb/hash.c
+ void (*update)(const void*, size_t, void*);
+ void (*final)(void*, void*);
+
-+ src_fd = STDIN_FILENO;
-+ if (NOT_LONE_DASH(filename)) {
-+ src_fd = open_or_warn(filename, O_RDONLY);
-+ if (src_fd < 0) {
-+ return NULL;
-+ }
++ src_fd = open_or_warn_stdin(filename);
++ if (src_fd < 0) {
++ return NULL;
+ }
+
+ /* figure specific hash algorithims */
diff --git a/package/busybox/patches/510-awx.patch b/package/busybox/patches/510-awx.patch
index 6ae1b9cc05..d0247f1d99 100644
--- a/package/busybox/patches/510-awx.patch
+++ b/package/busybox/patches/510-awx.patch
@@ -1,8 +1,6 @@
-Index: busybox-1.8.1/editors/awk.c
-===================================================================
---- busybox-1.8.1.orig/editors/awk.c 2007-11-10 16:55:07.032260312 +0100
-+++ busybox-1.8.1/editors/awk.c 2007-11-10 17:07:04.493146078 +0100
-@@ -33,6 +33,11 @@
+--- a/editors/awk.c
++++ b/editors/awk.c
+@@ -32,6 +32,11 @@
/* these flags are static, don't change them when value is changed */
#define VF_DONTTOUCH (VF_ARRAY | VF_SPECIAL | VF_WALK | VF_CHILD | VF_DIRTY)
@@ -14,23 +12,22 @@ Index: busybox-1.8.1/editors/awk.c
/* Variable */
typedef struct var_s {
unsigned type; /* flags */
-@@ -54,9 +59,14 @@
+@@ -53,9 +58,14 @@
} chain;
/* Function */
+typedef var *(*awk_cfunc)(var *res, var *args, int nargs);
typedef struct func_s {
unsigned nargs;
-- struct chain_s body;
+ enum { AWKFUNC, CFUNC } type;
+ union {
+ awk_cfunc cfunc;
-+ struct chain_s body;
+ struct chain_s body;
+ } x;
} func;
/* I/O stream */
-@@ -1400,7 +1410,8 @@
+@@ -1395,7 +1405,8 @@
next_token(TC_FUNCTION);
g_pos++;
f = newfunc(t_string);
@@ -40,7 +37,7 @@ Index: busybox-1.8.1/editors/awk.c
f->nargs = 0;
while (next_token(TC_VARIABLE | TC_SEQTERM) & TC_VARIABLE) {
v = findvar(ahash, t_string);
-@@ -1409,7 +1420,7 @@
+@@ -1404,7 +1415,7 @@
if (next_token(TC_COMMA | TC_SEQTERM) & TC_SEQTERM)
break;
}
@@ -49,7 +46,7 @@ Index: busybox-1.8.1/editors/awk.c
chain_group();
clear_array(ahash);
-@@ -2372,7 +2383,8 @@
+@@ -2367,7 +2378,8 @@
break;
case XC( OC_FUNC ):
@@ -59,7 +56,7 @@ Index: busybox-1.8.1/editors/awk.c
syntax_error(EMSG_UNDEF_FUNC);
X.v = R.v = nvalloc(op->r.f->nargs+1);
-@@ -2389,7 +2401,10 @@
+@@ -2384,7 +2396,10 @@
fnargs = X.v;
L.s = g_progname;
@@ -71,7 +68,7 @@ Index: busybox-1.8.1/editors/awk.c
g_progname = L.s;
nvfree(fnargs);
-@@ -2753,6 +2768,12 @@
+@@ -2748,6 +2763,12 @@
}
int awk_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -84,7 +81,7 @@ Index: busybox-1.8.1/editors/awk.c
int awk_main(int argc, char **argv)
{
unsigned opt;
-@@ -2817,6 +2838,11 @@
+@@ -2812,6 +2833,11 @@
*s1 = '=';
}
}
@@ -93,13 +90,11 @@ Index: busybox-1.8.1/editors/awk.c
+ do_awx(argc, argv);
+#endif
+
- opt_complementary = "v::f::";
- opt = getopt32(argv, "F:v:f:W:", &opt_F, &opt_v, &opt_f, &opt_W);
+ opt_complementary = "v::f::"; /* -v and -f can occur multiple times */
+ opt = getopt32(argv, "F:v:f:W:", &opt_F, &list_v, &list_f, &opt_W);
argv += optind;
-Index: busybox-1.8.1/editors/awx.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/editors/awx.c 2007-11-10 17:06:19.258568308 +0100
+--- /dev/null
++++ b/editors/awx.c
@@ -0,0 +1,636 @@
+/*
+ * awk web extension
@@ -737,10 +732,8 @@ Index: busybox-1.8.1/editors/awx.c
+ return awk_main(argc, argv);
+}
+
-Index: busybox-1.8.1/editors/awx_parser.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/editors/awx_parser.h 2007-11-10 17:06:19.266568760 +0100
+--- /dev/null
++++ b/editors/awx_parser.h
@@ -0,0 +1,38 @@
+#ifndef __TEMPLATE_PARSER_H
+#define __TEMPLATE_PARSER_H
@@ -780,10 +773,8 @@ Index: busybox-1.8.1/editors/awx_parser.h
+void free_template(struct template_cb *cb, struct template_element *e);
+
+#endif
-Index: busybox-1.8.1/editors/awx_parser.l
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/editors/awx_parser.l 2007-11-10 17:06:19.270568989 +0100
+--- /dev/null
++++ b/editors/awx_parser.l
@@ -0,0 +1,302 @@
+%{
+#include <stdio.h>
@@ -1087,10 +1078,8 @@ Index: busybox-1.8.1/editors/awx_parser.l
+ free(e);
+ return free_template(cb, next);
+}
-Index: busybox-1.8.1/editors/Config.in
-===================================================================
---- busybox-1.8.1.orig/editors/Config.in 2007-11-10 02:40:54.000000000 +0100
-+++ busybox-1.8.1/editors/Config.in 2007-11-10 17:06:19.274569218 +0100
+--- a/editors/Config.in
++++ b/editors/Config.in
@@ -12,6 +12,13 @@
Awk is used as a pattern scanning and processing language. This is
the BusyBox implementation of that programming language.
@@ -1105,10 +1094,8 @@ Index: busybox-1.8.1/editors/Config.in
config FEATURE_AWK_MATH
bool "Enable math functions (requires libm)"
default y
-Index: busybox-1.8.1/editors/Kbuild
-===================================================================
---- busybox-1.8.1.orig/editors/Kbuild 2007-11-10 02:40:54.000000000 +0100
-+++ busybox-1.8.1/editors/Kbuild 2007-11-10 17:06:19.278569448 +0100
+--- a/editors/Kbuild
++++ b/editors/Kbuild
@@ -12,3 +12,12 @@
lib-$(CONFIG_PATCH) += patch.o
lib-$(CONFIG_SED) += sed.o
@@ -1122,22 +1109,30 @@ Index: busybox-1.8.1/editors/Kbuild
+editors/awx_parser.o: editors/awx_parser.c FORCE
+ $(call cmd,force_checksrc)
+ $(call if_changed_rule,cc_o_c)
-Index: busybox-1.8.1/include/applets.h
-===================================================================
---- busybox-1.8.1.orig/include/applets.h 2007-11-10 17:03:38.957433264 +0100
-+++ busybox-1.8.1/include/applets.h 2007-11-10 17:06:19.282569674 +0100
-@@ -83,6 +83,7 @@
+--- a/include/applets.h
++++ b/include/applets.h
+@@ -77,6 +77,7 @@
USE_ARPING(APPLET(arping, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
- USE_ASH(APPLET_NOUSAGE(ash, ash, _BB_DIR_BIN, _BB_SUID_NEVER))
+ USE_ASH(APPLET(ash, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_NEVER, awk))
-+USE_AWX(APPLET_NOUSAGE(awx, awx, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
++USE_AWK(APPLET_ODDNAME(awx, awk, _BB_DIR_USR_BIN, _BB_SUID_NEVER, awx))
USE_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_NEVER, basename))
USE_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_NEVER))
//USE_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_NEVER))
-Index: busybox-1.8.1/include/cgi.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/include/cgi.h 2007-11-10 17:06:19.282569674 +0100
+--- a/include/usage.h
++++ b/include/usage.h
+@@ -114,6 +114,9 @@
+ "\n -F sep Use sep as field separator" \
+ "\n -f file Read program from file" \
+
++#define awx_trivial_usage NOUSAGE_STR
++#define awx_full_usage ""
++
+ #define basename_trivial_usage \
+ "FILE [SUFFIX]"
+ #define basename_full_usage "\n\n" \
+--- /dev/null
++++ b/include/cgi.h
@@ -0,0 +1,8 @@
+#ifndef CGI_H
+#define CGI_H
@@ -1147,10 +1142,8 @@ Index: busybox-1.8.1/include/cgi.h
+int cgi_init(var_handler);
+
+#endif
-Index: busybox-1.8.1/libbb/cgi.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ busybox-1.8.1/libbb/cgi.c 2007-11-10 17:06:19.282569674 +0100
+--- /dev/null
++++ b/libbb/cgi.c
@@ -0,0 +1,457 @@
+/* --------------------------------------------------------------------------
+ * functions for processing cgi form data
@@ -1609,11 +1602,9 @@ Index: busybox-1.8.1/libbb/cgi.c
+
+ return retval;
+}
-Index: busybox-1.8.1/libbb/Kbuild
-===================================================================
---- busybox-1.8.1.orig/libbb/Kbuild 2007-11-10 17:04:07.547062497 +0100
-+++ busybox-1.8.1/libbb/Kbuild 2007-11-10 17:06:19.282569674 +0100
-@@ -101,6 +101,7 @@
+--- a/libbb/Kbuild
++++ b/libbb/Kbuild
+@@ -112,6 +112,7 @@
lib-y += xreadlink.o
# conditionally compiled objects:
diff --git a/package/busybox/patches/520-ipkg_secure.patch b/package/busybox/patches/520-ipkg_secure.patch
index fec9c2100f..b0ccceec90 100644
--- a/package/busybox/patches/520-ipkg_secure.patch
+++ b/package/busybox/patches/520-ipkg_secure.patch
@@ -1,7 +1,5 @@
-Index: busybox-1.7.2/archival/libipkg/ipkg_conf.c
-===================================================================
---- busybox-1.7.2.orig/archival/libipkg/ipkg_conf.c 2007-10-30 15:38:45.000000000 -0500
-+++ busybox-1.7.2/archival/libipkg/ipkg_conf.c 2007-10-30 15:38:47.000000000 -0500
+--- a/archival/libipkg/ipkg_conf.c
++++ b/archival/libipkg/ipkg_conf.c
@@ -66,6 +66,8 @@
{ "offline_root_pre_script_cmd", IPKG_OPT_TYPE_STRING, &conf->offline_root_pre_script_cmd },
{ "proxy_passwd", IPKG_OPT_TYPE_STRING, &conf->proxy_passwd },
@@ -21,10 +19,8 @@ Index: busybox-1.7.2/archival/libipkg/ipkg_conf.c
pkg_hash_init("pkg-hash", &conf->pkg_hash, IPKG_CONF_DEFAULT_HASH_LEN);
hash_table_init("file-hash", &conf->file_hash, IPKG_CONF_DEFAULT_HASH_LEN);
hash_table_init("obs-file-hash", &conf->obs_file_hash, IPKG_CONF_DEFAULT_HASH_LEN);
-Index: busybox-1.7.2/archival/libipkg/ipkg_conf.h
-===================================================================
---- busybox-1.7.2.orig/archival/libipkg/ipkg_conf.h 2007-10-30 15:38:45.000000000 -0500
-+++ busybox-1.7.2/archival/libipkg/ipkg_conf.h 2007-10-30 15:38:47.000000000 -0500
+--- a/archival/libipkg/ipkg_conf.h
++++ b/archival/libipkg/ipkg_conf.h
@@ -79,6 +79,10 @@
char *proxy_user;
char *proxy_passwd;
@@ -36,10 +32,8 @@ Index: busybox-1.7.2/archival/libipkg/ipkg_conf.h
hash_table_t pkg_hash;
hash_table_t file_hash;
hash_table_t obs_file_hash;
-Index: busybox-1.7.2/archival/libipkg/ipkg_download.c
-===================================================================
---- busybox-1.7.2.orig/archival/libipkg/ipkg_download.c 2007-10-30 15:38:45.000000000 -0500
-+++ busybox-1.7.2/archival/libipkg/ipkg_download.c 2007-10-30 15:38:47.000000000 -0500
+--- a/archival/libipkg/ipkg_download.c
++++ b/archival/libipkg/ipkg_download.c
@@ -69,8 +69,12 @@
}
diff --git a/package/busybox/patches/521-ipkg_upgrade_env.patch b/package/busybox/patches/521-ipkg_upgrade_env.patch
index 0063fa0798..593b8c41fd 100644
--- a/package/busybox/patches/521-ipkg_upgrade_env.patch
+++ b/package/busybox/patches/521-ipkg_upgrade_env.patch
@@ -1,7 +1,5 @@
-Index: busybox-1.7.2/archival/libipkg/ipkg_install.c
-===================================================================
---- busybox-1.7.2.orig/archival/libipkg/ipkg_install.c 2007-10-30 17:15:31.000000000 -0500
-+++ busybox-1.7.2/archival/libipkg/ipkg_install.c 2007-10-30 17:15:33.000000000 -0500
+--- a/archival/libipkg/ipkg_install.c
++++ b/archival/libipkg/ipkg_install.c
@@ -136,6 +136,7 @@
ipkg_error_t ipkg_install_by_name(ipkg_conf_t *conf, const char *pkg_name)
{
diff --git a/package/busybox/patches/523-conffiles_fix.patch b/package/busybox/patches/523-conffiles_fix.patch
index 15ac083cdf..09c93595f5 100644
--- a/package/busybox/patches/523-conffiles_fix.patch
+++ b/package/busybox/patches/523-conffiles_fix.patch
@@ -1,7 +1,5 @@
-Index: busybox-1.8.2/archival/libipkg/pkg.c
-===================================================================
---- busybox-1.8.2.orig/archival/libipkg/pkg.c 2008-01-03 17:25:55.000000000 +0100
-+++ busybox-1.8.2/archival/libipkg/pkg.c 2008-01-03 17:33:57.000000000 +0100
+--- a/archival/libipkg/pkg.c
++++ b/archival/libipkg/pkg.c
@@ -575,25 +575,28 @@
return temp;
}
@@ -36,16 +34,10 @@ Index: busybox-1.8.2/archival/libipkg/pkg.c
} else if (strcasecmp(field, "Conflicts") == 0) {
int i;
-Index: busybox-1.8.2/archival/libipkg/pkg_parse.c
-===================================================================
---- busybox-1.8.2.orig/archival/libipkg/pkg_parse.c 2008-01-03 17:25:55.000000000 +0100
-+++ busybox-1.8.2/archival/libipkg/pkg_parse.c 2008-01-03 17:30:14.000000000 +0100
- -85,20 +85,17 @@
- {
- char file_name[1048], md5sum[1048]; /* please tell me there aren't any longer that 1k */
-
-- if(!strncmp(raw, "Conffiles:", 10))
-+ if(!strncmp(raw, "Conffiles:",10))
+--- a/archival/libipkg/pkg_parse.c
++++ b/archival/libipkg/pkg_parse.c
+@@ -88,17 +88,14 @@
+ if(!strncmp(raw, "Conffiles:", 10))
raw += strlen("Conffiles:");
+ while(*raw && isspace(*raw)) raw++;
@@ -55,14 +47,13 @@ Index: busybox-1.8.2/archival/libipkg/pkg_parse.c
- while (*raw && isspace(*raw)) {
- raw++;
- }
-- raw += strlen(file_name);
+ raw += strlen(file_name);
- while (*raw && isspace(*raw)) {
- raw++;
- }
-- raw += strlen(md5sum);
-+ raw += strlen(file_name);
+ while(*raw && isspace(*raw)) raw++;
-+ raw += strlen(md5sum);
-+ while(*raw && isspace(*raw)) raw++;
+ raw += strlen(md5sum);
++ while(*raw && isspace(*raw)) raw++;
}
- }
+ }
+
diff --git a/package/busybox/patches/524-memory_usage.patch b/package/busybox/patches/524-memory_usage.patch
index 8f009a5381..5aaee76087 100644
--- a/package/busybox/patches/524-memory_usage.patch
+++ b/package/busybox/patches/524-memory_usage.patch
@@ -1,7 +1,5 @@
-Index: busybox-1.8.2/archival/libipkg/pkg.c
-===================================================================
---- busybox-1.8.2.orig/archival/libipkg/pkg.c 2008-01-06 03:14:12.003658206 +0100
-+++ busybox-1.8.2/archival/libipkg/pkg.c 2008-01-06 03:24:18.187737063 +0100
+--- a/archival/libipkg/pkg.c
++++ b/archival/libipkg/pkg.c
@@ -224,8 +224,7 @@
if (err) { return err; }
@@ -12,10 +10,8 @@ Index: busybox-1.8.2/archival/libipkg/pkg.c
fclose(control_file);
-Index: busybox-1.8.2/archival/libipkg/pkg_hash.c
-===================================================================
---- busybox-1.8.2.orig/archival/libipkg/pkg_hash.c 2008-01-06 03:14:12.231671203 +0100
-+++ busybox-1.8.2/archival/libipkg/pkg_hash.c 2008-01-06 03:28:38.218555373 +0100
+--- a/archival/libipkg/pkg_hash.c
++++ b/archival/libipkg/pkg_hash.c
@@ -89,20 +89,20 @@
pkg_src_t *src, pkg_dest_t *dest, int is_status_file)
{
@@ -58,11 +54,9 @@ Index: busybox-1.8.2/archival/libipkg/pkg_hash.c
return 0;
}
-Index: busybox-1.8.2/archival/libipkg/pkg_parse.c
-===================================================================
---- busybox-1.8.2.orig/archival/libipkg/pkg_parse.c 2008-01-06 03:14:12.283674167 +0100
-+++ busybox-1.8.2/archival/libipkg/pkg_parse.c 2008-01-06 03:38:24.111943535 +0100
-@@ -227,6 +227,161 @@
+--- a/archival/libipkg/pkg_parse.c
++++ b/archival/libipkg/pkg_parse.c
+@@ -224,6 +224,161 @@
Enhances, perhaps we could generalize all of these and save some
code duplication.
*/
@@ -224,7 +218,7 @@ Index: busybox-1.8.2/archival/libipkg/pkg_parse.c
int pkg_parse_raw(pkg_t *pkg, char ***raw, pkg_src_t *src, pkg_dest_t *dest)
{
int reading_conffiles, reading_description;
-@@ -345,6 +500,7 @@
+@@ -342,6 +497,7 @@
return EINVAL;
}
}
@@ -232,10 +226,8 @@ Index: busybox-1.8.2/archival/libipkg/pkg_parse.c
int pkg_valorize_other_field(pkg_t *pkg, char ***raw)
{
-Index: busybox-1.8.2/archival/libipkg/pkg_parse.h
-===================================================================
---- busybox-1.8.2.orig/archival/libipkg/pkg_parse.h 2008-01-06 03:14:12.303675307 +0100
-+++ busybox-1.8.2/archival/libipkg/pkg_parse.h 2008-01-06 03:39:03.954214018 +0100
+--- a/archival/libipkg/pkg_parse.h
++++ b/archival/libipkg/pkg_parse.h
@@ -25,7 +25,10 @@
char ** parseDependsString(char * raw, int * depends_count);
int parseVersion(pkg_t *pkg, char *raw);
diff --git a/package/busybox/patches/524-udhcpc_renew.patch b/package/busybox/patches/524-udhcpc_renew.patch
index 07611a5228..b663e32879 100644
--- a/package/busybox/patches/524-udhcpc_renew.patch
+++ b/package/busybox/patches/524-udhcpc_renew.patch
@@ -1,12 +1,10 @@
-Index: busybox-1.8.2/networking/udhcp/dhcpc.c
-===================================================================
---- busybox-1.8.2.orig/networking/udhcp/dhcpc.c 2008-01-03 05:00:31.506419917 +0100
-+++ busybox-1.8.2/networking/udhcp/dhcpc.c 2008-01-03 05:00:44.311149618 +0100
-@@ -65,7 +65,6 @@
+--- a/networking/udhcp/dhcpc.c
++++ b/networking/udhcp/dhcpc.c
+@@ -63,7 +63,6 @@
state = RENEW_REQUESTED;
break;
case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
- udhcp_run_script(NULL, "deconfig");
case REQUESTING:
case RELEASED:
- change_mode(LISTEN_RAW);
+ change_listen_mode(LISTEN_RAW);
diff --git a/package/busybox/patches/525-clean_temp.patch b/package/busybox/patches/525-clean_temp.patch
index 0c3be747cf..d9318a9e9a 100644
--- a/package/busybox/patches/525-clean_temp.patch
+++ b/package/busybox/patches/525-clean_temp.patch
@@ -1,6 +1,5 @@
-diff -urN busybox-1.8.2.old/archival/libipkg/pkg_extract.c busybox-1.8.2.dev/archival/libipkg/pkg_extract.c
---- busybox-1.8.2.old/archival/libipkg/pkg_extract.c 2008-01-23 22:18:44.000000000 +0100
-+++ busybox-1.8.2.dev/archival/libipkg/pkg_extract.c 2008-01-23 22:20:31.000000000 +0100
+--- a/archival/libipkg/pkg_extract.c
++++ b/archival/libipkg/pkg_extract.c
@@ -85,6 +85,7 @@
free(archive->buffer);
free(archive->accept);
diff --git a/package/busybox/patches/526-ipkg_fix_pkg_comparison.patch b/package/busybox/patches/526-ipkg_fix_pkg_comparison.patch
new file mode 100644
index 0000000000..f206f973c6
--- /dev/null
+++ b/package/busybox/patches/526-ipkg_fix_pkg_comparison.patch
@@ -0,0 +1,43 @@
+--- a/archival/libipkg/pkg.c
++++ b/archival/libipkg/pkg.c
+@@ -1139,8 +1139,12 @@
+ return 0;
+ }
+
+-int pkg_name_version_and_architecture_compare(pkg_t *a, pkg_t *b)
++int pkg_name_version_and_architecture_compare(const void *pkg_a, const void *pkg_b)
+ {
++ pkg_t * const *p1 = pkg_a;
++ pkg_t * const *p2 = pkg_b;
++ const pkg_t *a = *p1;
++ const pkg_t *b = *p2;
+ int namecmp;
+ int vercmp;
+ if (!a->name || !b->name) {
+@@ -1167,8 +1171,12 @@
+ return 0;
+ }
+
+-int abstract_pkg_name_compare(abstract_pkg_t *a, abstract_pkg_t *b)
++int abstract_pkg_name_compare(const void *apkg_a, const void *apkg_b)
+ {
++ abstract_pkg_t * const *ap1 = apkg_a;
++ abstract_pkg_t * const *ap2 = apkg_b;
++ const abstract_pkg_t *a = *ap1;
++ const abstract_pkg_t *b = *ap2;
+ if (!a->name || !b->name) {
+ fprintf(stderr, "abstract_pkg_name_compare: a=%p a->name=%p b=%p b->name=%p\n",
+ a, a->name, b, b->name);
+--- a/archival/libipkg/pkg.h
++++ b/archival/libipkg/pkg.h
+@@ -191,8 +191,8 @@
+ char *pkg_version_str_alloc(pkg_t *pkg);
+
+ int pkg_compare_versions(const pkg_t *pkg, const pkg_t *ref_pkg);
+-int pkg_name_version_and_architecture_compare(pkg_t *a, pkg_t *b);
+-int abstract_pkg_name_compare(abstract_pkg_t *a, abstract_pkg_t *b);
++int pkg_name_version_and_architecture_compare(const void *pkg_a, const void *pkg_b);
++int abstract_pkg_name_compare(const void *apkg_a, const void *apkg_b);
+
+ char * pkg_formatted_info(pkg_t *pkg );
+ char * pkg_formatted_field(pkg_t *pkg, const char *field );
diff --git a/package/busybox/patches/901-basename.patch b/package/busybox/patches/901-basename.patch
new file mode 100644
index 0000000000..180cf7b755
--- /dev/null
+++ b/package/busybox/patches/901-basename.patch
@@ -0,0 +1,9 @@
+--- a/coreutils/basename.c
++++ b/coreutils/basename.c
+@@ -48,5 +48,5 @@
+
+ /* puts(s) will do, but we can do without stdio this way: */
+ s[m++] = '\n';
+- return full_write(STDOUT_FILENO, s, m) == (ssize_t)m;
++ return full_write(STDOUT_FILENO, s, m) != (ssize_t)m;
+ }
diff --git a/package/busybox/patches/902-tar.patch b/package/busybox/patches/902-tar.patch
new file mode 100644
index 0000000000..d9bf7cd0c6
--- /dev/null
+++ b/package/busybox/patches/902-tar.patch
@@ -0,0 +1,55 @@
+--- a/archival/libunarchive/get_header_tar.c
++++ b/archival/libunarchive/get_header_tar.c
+@@ -261,26 +261,33 @@
+ case '0':
+ #if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY
+ if (last_char_is(file_header->name, '/')) {
+- file_header->mode |= S_IFDIR;
+- } else
++ goto set_dir;
++ }
+ #endif
+ file_header->mode |= S_IFREG;
+ break;
+ case '2':
+ file_header->mode |= S_IFLNK;
++ /* have seen tarballs with size field containing
++ * the size of the link target's name */
++ size0:
++ file_header->size = 0;
+ break;
+ case '3':
+ file_header->mode |= S_IFCHR;
+- break;
++ goto size0; /* paranoia */
+ case '4':
+ file_header->mode |= S_IFBLK;
+- break;
++ goto size0;
+ case '5':
++#if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY
++ set_dir:
++#endif
+ file_header->mode |= S_IFDIR;
+- break;
++ goto size0;
+ case '6':
+ file_header->mode |= S_IFIFO;
+- break;
++ goto size0;
+ #if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
+ case 'L':
+ /* free: paranoia: tar with several consecutive longnames */
+--- a/archival/libunarchive/seek_by_jump.c
++++ b/archival/libunarchive/seek_by_jump.c
+@@ -8,7 +8,9 @@
+
+ void seek_by_jump(const archive_handle_t *archive_handle, unsigned amount)
+ {
+- if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) {
++ if (amount
++ && lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1
++ ) {
+ if (errno == ESPIPE)
+ seek_by_read(archive_handle, amount);
+ else
diff --git a/package/busybox/patches/903-ash.patch b/package/busybox/patches/903-ash.patch
new file mode 100644
index 0000000000..efc1bc3439
--- /dev/null
+++ b/package/busybox/patches/903-ash.patch
@@ -0,0 +1,155 @@
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -1569,14 +1569,14 @@
+ static char *optptr; /* used by nextopt */
+
+ /*
+- * XXX - should get rid of. have all builtins use getopt(3). the
+- * library getopt must have the BSD extension static variable "optreset"
+- * otherwise it can't be used within the shell safely.
++ * XXX - should get rid of. Have all builtins use getopt(3).
++ * The library getopt must have the BSD extension static variable
++ * "optreset", otherwise it can't be used within the shell safely.
+ *
+- * Standard option processing (a la getopt) for builtin routines. The
+- * only argument that is passed to nextopt is the option string; the
+- * other arguments are unnecessary. It return the character, or '\0' on
+- * end of input.
++ * Standard option processing (a la getopt) for builtin routines.
++ * The only argument that is passed to nextopt is the option string;
++ * the other arguments are unnecessary. It returns the character,
++ * or '\0' on end of input.
+ */
+ static int
+ nextopt(const char *optstring)
+@@ -1587,13 +1587,20 @@
+
+ p = optptr;
+ if (p == NULL || *p == '\0') {
++ /* We ate entire "-param", take next one */
+ p = *argptr;
+- if (p == NULL || *p != '-' || *++p == '\0')
++ if (p == NULL)
++ return '\0';
++ if (*p != '-')
++ return '\0';
++ if (*++p == '\0') /* just "-" ? */
+ return '\0';
+ argptr++;
+- if (LONE_DASH(p)) /* check for "--" */
++ if (LONE_DASH(p)) /* "--" ? */
+ return '\0';
++ /* p => next "-param" */
+ }
++ /* p => some option char in the middle of a "-param" */
+ c = *p++;
+ for (q = optstring; *q != c;) {
+ if (*q == '\0')
+@@ -1602,8 +1609,11 @@
+ q++;
+ }
+ if (*++q == ':') {
+- if (*p == '\0' && (p = *argptr++) == NULL)
+- ash_msg_and_raise_error("no arg for -%c option", c);
++ if (*p == '\0') {
++ p = *argptr++;
++ if (p == NULL)
++ ash_msg_and_raise_error("no arg for -%c option", c);
++ }
+ optionarg = p;
+ p = NULL;
+ }
+@@ -7428,8 +7438,10 @@
+ else if (c != 'p')
+ abort();
+ #endif
+- if (verify)
++ /* Mimic bash: just "command -v" doesn't complain, it's a nop */
++ if (verify && (*argptr != NULL)) {
+ return describe_command(*argptr, verify - VERIFY_BRIEF);
++ }
+
+ return 0;
+ }
+@@ -7788,16 +7800,33 @@
+ static void
+ evaltree(union node *n, int flags)
+ {
++
++ struct jmploc *volatile savehandler = exception_handler;
++ struct jmploc jmploc;
+ int checkexit = 0;
+ void (*evalfn)(union node *, int);
+- unsigned isor;
+ int status;
++
+ if (n == NULL) {
+ TRACE(("evaltree(NULL) called\n"));
+- goto out;
++ goto out1;
+ }
+ TRACE(("pid %d, evaltree(%p: %d, %d) called\n",
+ getpid(), n, n->type, flags));
++
++ exception_handler = &jmploc;
++ {
++ int err = setjmp(jmploc.loc);
++ if (err) {
++ /* if it was a signal, check for trap handlers */
++ if (exception == EXSIG)
++ goto out;
++ /* continue on the way out */
++ exception_handler = savehandler;
++ longjmp(exception_handler->loc, err);
++ }
++ }
++
+ switch (n->type) {
+ default:
+ #if DEBUG
+@@ -7843,19 +7872,20 @@
+ goto calleval;
+ case NAND:
+ case NOR:
+- case NSEMI:
++ case NSEMI: {
++
+ #if NAND + 1 != NOR
+ #error NAND + 1 != NOR
+ #endif
+ #if NOR + 1 != NSEMI
+ #error NOR + 1 != NSEMI
+ #endif
+- isor = n->type - NAND;
++ unsigned is_or = n->type - NAND;
+ evaltree(
+ n->nbinary.ch1,
+- (flags | ((isor >> 1) - 1)) & EV_TESTED
++ (flags | ((is_or >> 1) - 1)) & EV_TESTED
+ );
+- if (!exitstatus == isor)
++ if (!exitstatus == is_or)
+ break;
+ if (!evalskip) {
+ n = n->nbinary.ch2;
+@@ -7866,6 +7896,7 @@
+ break;
+ }
+ break;
++ }
+ case NIF:
+ evaltree(n->nif.test, EV_TESTED);
+ if (evalskip)
+@@ -7886,8 +7917,11 @@
+ exitstatus = status;
+ break;
+ }
++
+ out:
+- if ((checkexit & exitstatus))
++ exception_handler = savehandler;
++ out1:
++ if (checkexit & exitstatus)
+ evalskip |= SKIPEVAL;
+ else if (pendingsig && dotrap())
+ goto exexit;
diff --git a/package/busybox/patches/904-build.patch b/package/busybox/patches/904-build.patch
new file mode 100644
index 0000000000..d15570c093
--- /dev/null
+++ b/package/busybox/patches/904-build.patch
@@ -0,0 +1,28 @@
+--- a/applets/usage_compressed
++++ b/applets/usage_compressed
+@@ -14,14 +14,21 @@
+
+ echo 'static const char packed_usage[] ALIGN1 = {'
+
+-# Extra effort to avoid using "od -t x1": -t is not available
+-# in non-CONFIG_DESKTOPed busybox od
++## Breaks on big-endian systems!
++## # Extra effort to avoid using "od -t x1": -t is not available
++## # in non-CONFIG_DESKTOPed busybox od
++##
++## "$loc/usage" | bzip2 -1 | od -v -x \
++## | $SED -e 's/^[^ ]*//' \
++## | $SED -e 's/ //g' \
++## | grep -v '^$' \
++## | $SED -e 's/\(..\)\(..\)/0x\2,0x\1,/g'
+
+-"$loc/usage" | bzip2 -1 | od -v -x \
++"$loc/usage" | bzip2 -1 | od -v -t x1 \
+ | $SED -e 's/^[^ ]*//' \
+ | $SED -e 's/ //g' \
+ | grep -v '^$' \
+-| $SED -e 's/\(..\)\(..\)/0x\2,0x\1,/g'
++| $SED -e 's/\(..\)/0x\1,/g'
+
+ echo '};'
+ echo '#define SIZEOF_usage_messages' `expr 0 + $sz`