summaryrefslogtreecommitdiffhomepage
path: root/patches
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-03-15 08:29:22 +0000
committerEric Andersen <andersen@codepoet.org>2004-03-15 08:29:22 +0000
commitc7bda1ce659294d6e22c06e087f6f265983c7578 (patch)
tree4c6d2217f4d8306c59cf1096f8664e1cfd167213 /patches
parent8854004b41065b3d081af7f3df13a100b0c8bfbe (diff)
Remove trailing whitespace. Update copyright to include 2004.
Diffstat (limited to 'patches')
-rw-r--r--patches/eject.diff10
-rw-r--r--patches/tftp_timeout_multicast.diff192
-rw-r--r--patches/udhcp_additional_items.diff16
-rw-r--r--patches/udhcp_config_paths.diff108
-rw-r--r--patches/udhcpd_foreground.diff8
5 files changed, 167 insertions, 167 deletions
diff --git a/patches/eject.diff b/patches/eject.diff
index 3efd449c0..fcc234d02 100644
--- a/patches/eject.diff
+++ b/patches/eject.diff
@@ -6,15 +6,15 @@ diff -u -r1.40 AUTHORS
--- a/AUTHORS 9 Oct 2003 21:19:21 -0000 1.40
+++ b/AUTHORS 5 Mar 2004 07:23:17 -0000
@@ -8,6 +8,9 @@
-
+
-----------
-
+
+Peter Willis <psyphreak@phreaker.net>
+ eject
+
Emanuele Aina <emanuele.aina@tiscali.it>
run-parts
-
+
Index: coreutils/Config.in
===================================================================
RCS file: /var/cvs/busybox/coreutils/Config.in,v
@@ -25,7 +25,7 @@ diff -u -r1.23 Config.in
@@ -164,6 +164,13 @@
a command; without options it displays the current
environment.
-
+
+config CONFIG_EJECT
+ bool "eject"
+ default n
@@ -151,7 +151,7 @@ diff -u -r1.191 usage.h
@@ -537,6 +537,13 @@
"\t-, -i\tstart with an empty environment\n" \
"\t-u\tremove variable from the environment\n"
-
+
+#define eject_trivial_usage \
+ "[-t] [FILE]"
+#define eject_full_usage \
diff --git a/patches/tftp_timeout_multicast.diff b/patches/tftp_timeout_multicast.diff
index a76a18c61..0f09d4a04 100644
--- a/patches/tftp_timeout_multicast.diff
+++ b/patches/tftp_timeout_multicast.diff
@@ -6,15 +6,15 @@ diff -u -r1.40 AUTHORS
--- a/AUTHORS 9 Oct 2003 21:19:21 -0000 1.40
+++ b/AUTHORS 5 Mar 2004 15:45:47 -0000
@@ -92,6 +92,9 @@
- Original author of BusyBox in 1995, 1996. Some of his code can
+ Original author of BusyBox in 1995, 1996. Some of his code can
still be found hiding here and there...
-
+
+John Powers <jpp@ti.com>
+ Added multicast option (rfc2090) and timeout option (rfc2349) to tftp.
+
Tim Riker <Tim@Rikers.org>
bug fixes, member of fan club
-
+
Index: include/usage.h
===================================================================
RCS file: /var/cvs/busybox/include/usage.h,v
@@ -41,7 +41,7 @@ diff -u -r1.191 usage.h
+#else
+ #define USAGE_TFTP_DEBUG(a)
+#endif
-
+
#define tftp_trivial_usage \
"[OPTION]... HOST [PORT]"
@@ -2508,6 +2523,16 @@
@@ -71,7 +71,7 @@ diff -u -r1.27 Config.in
@@ -522,6 +522,13 @@
Add support for the GET command within the TFTP client. This allows
a client to retrieve a file from a TFTP server.
-
+
+config CONFIG_FEATURE_TFTP_MULTICAST
+ bool " Enable \"multicast\" option"
+ default n
@@ -84,7 +84,7 @@ diff -u -r1.27 Config.in
default y
@@ -531,12 +538,19 @@
a client to transfer a file to a TFTP server.
-
+
config CONFIG_FEATURE_TFTP_BLOCKSIZE
- bool " Enable \"blocksize\" command"
+ bool " Enable \"blksize\" option"
@@ -92,7 +92,7 @@ diff -u -r1.27 Config.in
depends on CONFIG_TFTP
help
Allow the client to specify the desired block size for transfers.
-
+
+config CONFIG_FEATURE_TFTP_TIMEOUT
+ bool " Enable \"timeout\" option"
+ default n
@@ -138,15 +138,15 @@ diff -u -r1.25 tftp.c
/* */
/* Parts of the code based on: */
@@ -46,8 +61,20 @@
-
+
#include "busybox.h"
-
+
+#if defined(CONFIG_FEATURE_TFTP_BLOCKSIZE) || defined(CONFIG_FEATURE_TFTP_MULTICAST) || defined(CONFIG_FEATURE_TFTP_TIMEOUT)
+ #define TFTP_OPTIONS
+#endif
+
//#define CONFIG_FEATURE_TFTP_DEBUG
-
+
+#ifdef CONFIG_FEATURE_TFTP_DEBUG
+ static void printtime(void);
+ #define dprintf(fmt...) if (debug) {printtime(); printf(fmt);}
@@ -157,7 +157,7 @@ diff -u -r1.25 tftp.c
+
#define TFTP_BLOCKSIZE_DEFAULT 512 /* according to RFC 1350, don't change */
#define TFTP_TIMEOUT 5 /* seconds */
-
+
@@ -68,12 +95,24 @@
"Illegal TFTP operation",
"Unknown transfer ID",
@@ -168,10 +168,10 @@ diff -u -r1.25 tftp.c
+ "Unsupported option",
+#endif
};
-
+
const int tftp_cmd_get = 1;
const int tftp_cmd_put = 2;
-
+
+
+struct tftp_option {
+ int multicast;
@@ -182,12 +182,12 @@ diff -u -r1.25 tftp.c
+
+
#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
-
- static int tftp_blocksize_check(int blocksize, int bufsize)
+
+ static int tftp_blocksize_check(int blocksize, int bufsize)
@@ -93,16 +132,158 @@
return blocksize;
}
-
+
+#endif
+
+#ifdef CONFIG_FEATURE_TFTP_TIMEOUT
@@ -332,15 +332,15 @@ diff -u -r1.25 tftp.c
+
+#ifdef TFTP_OPTIONS
+
- static char *tftp_option_get(char *buf, int len, char *option)
+ static char *tftp_option_get(char *buf, int len, char *option)
{
- int opt_val = 0;
+ int opt_val = 0;
int opt_found = 0;
int k;
--
+-
- while (len > 0) {
-
+
+ while (len > 0) {
/* Make sure the options are terminated correctly */
-
@@ -351,7 +351,7 @@ diff -u -r1.25 tftp.c
if (strcasecmp(buf, option) == 0) {
opt_found = 1;
}
-- }
+- }
- else {
- if (opt_found) {
+ } else {
@@ -361,7 +361,7 @@ diff -u -r1.25 tftp.c
}
@@ -138,7 +318,8 @@
#endif
-
+
static inline int tftp(const int cmd, const struct hostent *host,
- const char *remotefile, int localfd, const unsigned short port, int tftp_bufsize)
+ const char *remotefile, int localfd, const unsigned short port,
@@ -376,7 +376,7 @@ diff -u -r1.25 tftp.c
- int timeout = bb_tftp_num_retries;
+ int retry = bb_tftp_num_retries;
unsigned short block_nr = 1;
-
+
-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
- int want_option_ack = 0;
+#ifdef CONFIG_FEATURE_TFTP_MULTICAST
@@ -393,21 +393,21 @@ diff -u -r1.25 tftp.c
+ #define master_client 1
+ #define ack_oack 0
#endif
-
+
/* Can't use RESERVE_CONFIG_BUFFER here since the allocation
* size varies meaning BUFFERS_GO_ON_STACK would fail */
- char *buf=xmalloc(tftp_bufsize + 4);
+ char *buf=xmalloc(option->blksize + 4);
-
+
- tftp_bufsize += 4;
+ int tftp_bufsize = option->blksize + 4;
-
+
if ((socketfd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
bb_perror_msg("socket");
@@ -183,15 +375,21 @@
memcpy(&sa.sin_addr, (struct in_addr *) host->h_addr,
sizeof(sa.sin_addr));
-
+
- /* build opcode */
-
- if (cmd_get) {
@@ -423,48 +423,48 @@ diff -u -r1.25 tftp.c
+ memset(mcblockmap, 0, bmsize+1);
}
+#endif
-
+
- if (cmd_put) {
- opcode = TFTP_WRQ;
- }
+ /* build opcode */
+
+ opcode = cmd_get ? TFTP_RRQ : TFTP_WRQ;
-
+
while (1) {
-
+
@@ -203,7 +401,7 @@
-
+
cp += 2;
-
+
- /* add filename and mode */
+ /* First packet of file transfer includes file name, mode, and options */
-
+
if ((cmd_get && (opcode == TFTP_RRQ)) ||
(cmd_put && (opcode == TFTP_WRQ))) {
@@ -223,7 +421,7 @@
}
-
+
if (too_long || ((&buf[tftp_bufsize - 1] - cp) < 6)) {
- bb_error_msg("too long remote-filename");
+ bb_error_msg("too long: remote filename");
break;
}
-
+
@@ -238,8 +436,8 @@
-
+
if (len != TFTP_BLOCKSIZE_DEFAULT) {
-
+
- if ((&buf[tftp_bufsize - 1] - cp) < 15) {
- bb_error_msg("too long remote-filename");
+ if ((&buf[tftp_bufsize - 1] - cp) < 15) {
+ bb_error_msg("buffer too small for blksize option");
break;
}
-
+
@@ -249,16 +447,65 @@
cp += 8;
-
+
cp += snprintf(cp, 6, "%d", len) + 1;
+ }
+#endif
@@ -480,7 +480,7 @@ diff -u -r1.25 tftp.c
+ }
+
+ /* add "multicast" option */
-
+
- want_option_ack = 1;
+ memcpy(cp, "multicast\0", 11);
+ cp += 11;
@@ -509,9 +509,9 @@ diff -u -r1.25 tftp.c
+#endif
+
}
-
+
/* add ack and data */
-
+
- if ((cmd_get && (opcode == TFTP_ACK)) ||
- (cmd_put && (opcode == TFTP_DATA))) {
+#ifdef CONFIG_FEATURE_TFTP_MULTICAST
@@ -528,33 +528,33 @@ diff -u -r1.25 tftp.c
+#endif
+ else if ((cmd_get && opcode == TFTP_ACK) ||
+ (cmd_put && opcode == TFTP_DATA)) {
-
+
*((unsigned short *) cp) = htons(block_nr);
-
+
@@ -275,7 +522,7 @@
}
-
+
if (len != (tftp_bufsize - 4)) {
- finished++;
+ finished = 1;
}
-
+
cp += len;
@@ -283,82 +530,119 @@
}
-
-
+
+
- /* send packet */
+ /* send packet and receive reply */
-
-
+
+
- timeout = bb_tftp_num_retries; /* re-initialize */
+ retry = bb_tftp_num_retries; /* re-initialize */
do {
-
+ int selectrc;
len = cp - buf;
-
+
-#ifdef CONFIG_FEATURE_TFTP_DEBUG
- fprintf(stderr, "sending %u bytes\n", len);
- for (cp = buf; cp < &buf[len]; cp++)
@@ -570,7 +570,7 @@ diff -u -r1.25 tftp.c
-
+ /* send packet */
+ if ((len > 2) && (! option->multicast || master_client || ack_oack)) {
-
+
- if (finished && (opcode == TFTP_ACK)) {
- break;
+#ifdef CONFIG_FEATURE_TFTP_DEBUG
@@ -593,17 +593,17 @@ diff -u -r1.25 tftp.c
+ break;
+ }
}
-
+
- /* receive packet */
+ /* receive reply packet */
-
+
memset(&from, 0, sizeof(from));
fromlen = sizeof(from);
-
+
- tv.tv_sec = TFTP_TIMEOUT;
+ tv.tv_sec = option->client_timeout;
tv.tv_usec = 0;
-
+
FD_ZERO(&rfds);
FD_SET(socketfd, &rfds);
+ dprintf("set to receive from socketfd (%d)\n", socketfd);
@@ -613,7 +613,7 @@ diff -u -r1.25 tftp.c
+ dprintf("set to receive from mcfd (%d)\n", mcfd);
+ }
+#endif
-
+
- switch (select(FD_SETSIZE, &rfds, NULL, NULL, &tv)) {
- case 1:
- len = recvfrom(socketfd, buf, tftp_bufsize, 0,
@@ -646,7 +646,7 @@ diff -u -r1.25 tftp.c
+ }
+ }
}
-
+
- timeout = 0;
-
- if (sa.sin_port == port) {
@@ -677,13 +677,13 @@ diff -u -r1.25 tftp.c
- /* discard the packet - treat as timeout */
- timeout = bb_tftp_num_retries;
+#endif
-
+
- case 0:
+ } else if (selectrc == 0) {
+ /* Time out */
+ dprintf("timeout\n");
bb_error_msg("timeout");
-
+
- timeout--;
- if (timeout == 0) {
+ retry--;
@@ -700,59 +700,59 @@ diff -u -r1.25 tftp.c
bb_perror_msg("select");
len = -1;
}
-
+
- } while (timeout && (len >= 0));
+ } while (retry && len >= 0);
-
+
if ((finished) || (len < 0)) {
break;
@@ -370,9 +654,8 @@
opcode = ntohs(*((unsigned short *) buf));
tmp = ntohs(*((unsigned short *) &buf[2]));
-
+
-#ifdef CONFIG_FEATURE_TFTP_DEBUG
- fprintf(stderr, "received %d bytes: %04x %04x\n", len, opcode, tmp);
-#endif
+ dprintf("received %d bytes: %04x %04x\n", len, opcode, tmp);
+ dprintf("master_client=%d\n", master_client);
-
+
if (opcode == TFTP_ERROR) {
char *msg = NULL;
@@ -393,55 +676,116 @@
break;
}
-
+
-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
- if (want_option_ack) {
+#ifdef TFTP_OPTIONS
-
+
- want_option_ack = 0;
+ if (opcode == TFTP_OACK) {
-
+
- if (opcode == TFTP_OACK) {
+ /* server seems to support options */
-
+
- /* server seems to support options */
+ char *res;
-+
++
+ block_nr = 0; /* acknowledge option packet with block number 0 */
+ opcode = cmd_put ? TFTP_DATA : TFTP_ACK;
-
+
- char *res;
-
-- res = tftp_option_get(&buf[2], len-2,
+
+- res = tftp_option_get(&buf[2], len-2,
- "blksize");
+#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
+ res = tftp_option_get(&buf[2], len-2, "blksize");
-
+
- if (res) {
- int blksize = atoi(res);
--
+-
- if (tftp_blocksize_check(blksize,
- tftp_bufsize - 4)) {
+ if (res) {
+ int blksize = atoi(res);
-
+
- if (cmd_put) {
- opcode = TFTP_DATA;
- }
@@ -782,10 +782,10 @@ diff -u -r1.25 tftp.c
- bb_error_msg("bad server option");
- break;
- }
-
+
- bb_error_msg("warning: blksize not supported by server"
- " - reverting to 512");
-
+
- tftp_bufsize = TFTP_BLOCKSIZE_DEFAULT + 4;
+#ifdef CONFIG_FEATURE_TFTP_MULTICAST
+ res = tftp_option_get(&buf[2], len-2, "multicast");
@@ -837,9 +837,9 @@ diff -u -r1.25 tftp.c
}
+ else
#endif
-
+
if (cmd_get && (opcode == TFTP_DATA)) {
-
+
+#ifdef CONFIG_FEATURE_TFTP_MULTICAST
+ if (option->multicast) {
+ int bn = tmp - 1;
@@ -867,35 +867,35 @@ diff -u -r1.25 tftp.c
+#endif
+
if (tmp == block_nr) {
-
+
len = write(localfd, &buf[4], len - 4);
@@ -452,15 +796,14 @@
}
-
+
if (len != (tftp_bufsize - 4)) {
- finished++;
+ finished = 1;
}
-
+
opcode = TFTP_ACK;
- continue;
}
}
-
+
- if (cmd_put && (opcode == TFTP_ACK)) {
+ else if (cmd_put && opcode == TFTP_ACK) {
-
+
if (tmp == (unsigned short)(block_nr - 1)) {
if (finished) {
@@ -468,15 +811,19 @@
}
-
+
opcode = TFTP_DATA;
- continue;
}
}
}
-
+
#ifdef CONFIG_FEATURE_CLEAN_UP
close(socketfd);
+ free(buf);
@@ -904,10 +904,10 @@ diff -u -r1.25 tftp.c
+ if (mcblockmap != NULL)
+ free(mcblockmap);
+#endif
-
+
- free(buf);
#endif
-
+
return finished ? EXIT_SUCCESS : EXIT_FAILURE;
@@ -487,13 +834,18 @@
struct hostent *host = NULL;
@@ -927,13 +927,13 @@ diff -u -r1.25 tftp.c
+ .client_timeout = TFTP_TIMEOUT,
+ .server_timeout = TFTP_TIMEOUT,
+ };
-
+
/* figure out what to pass to getopt */
-
+
@@ -515,13 +867,45 @@
- #define PUT
+ #define PUT
#endif
-
+
- while ((opt = getopt(argc, argv, BS GET PUT "l:r:")) != -1) {
+#ifdef CONFIG_FEATURE_TFTP_TIMEOUT
+#define TO "T:t:"
@@ -994,7 +994,7 @@ diff -u -r1.25 tftp.c
+ debug = 1;
+ break;
+#endif
- case 'l':
+ case 'l':
localfile = bb_xstrdup(optarg);
break;
case 'r':
@@ -1004,7 +1004,7 @@ diff -u -r1.25 tftp.c
+ bb_show_usage();
}
}
-
+
if ((cmd == 0) || (optind == argc)) {
bb_show_usage();
}
@@ -1018,7 +1018,7 @@ diff -u -r1.25 tftp.c
@@ -566,14 +966,12 @@
host = xgethostbyname(argv[optind]);
port = bb_lookup_port(argv[optind + 1], "udp", 69);
-
+
-#ifdef CONFIG_FEATURE_TFTP_DEBUG
- fprintf(stderr, "using server \"%s\", remotefile \"%s\", "
+ dprintf("using server \"%s\", remotefile \"%s\", "
@@ -1026,10 +1026,10 @@ diff -u -r1.25 tftp.c
inet_ntoa(*((struct in_addr *) host->h_addr)),
remotefile, localfile);
-#endif
-
+
- result = tftp(cmd, host, remotefile, fd, port, blocksize);
+ result = tftp(cmd, host, remotefile, fd, port, &option);
-
+
#ifdef CONFIG_FEATURE_CLEAN_UP
if (!(fd == fileno(stdout) || fd == fileno(stdin))) {
@@ -582,3 +980,18 @@
diff --git a/patches/udhcp_additional_items.diff b/patches/udhcp_additional_items.diff
index 262ccc266..933be2ad4 100644
--- a/patches/udhcp_additional_items.diff
+++ b/patches/udhcp_additional_items.diff
@@ -12,7 +12,7 @@ diff -u -r1.191 usage.h
+ "\t-R,\t--require=NAME\tAdd NAME to request\n" \
"\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
"\t-v,\t--version\tDisplay version"
-
+
Index: networking/udhcp/README.udhcpc
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpc,v
@@ -29,12 +29,12 @@ diff -u -r1.3 README.udhcpc
/usr/share/udhcpc/default.script)
-v, --version Display version
@@ -101,6 +102,8 @@
-
+
additional options are easily added in options.c.
-
+
+By default, only a few basic items are requested. To request additional
+items use the -R option. Example: "-R rootpath"
-
+
note on udhcpc's random seed
---------------------------
Index: networking/udhcp/dhcpc.c
@@ -67,7 +67,7 @@ diff -u -r1.16 dhcpc.c
- c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:v", arg_options, &option_index);
+ c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:R:s:v", arg_options, &option_index);
if (c == -1) break;
-
+
switch (c) {
@@ -254,6 +256,11 @@
case 'r':
@@ -91,7 +91,7 @@ diff -u -r1.7 options.c
@@ -57,7 +57,19 @@
[OPTION_S32] = 4
};
-
+
-
+/* find and mark requested item as required */
+int require_option(char *name)
@@ -105,7 +105,7 @@ diff -u -r1.7 options.c
+ }
+ return 1;
+}
-+
++
/* get an option with bounds checking (warning, not aligned). */
uint8_t *get_option(struct dhcpMessage *packet, int code)
{
@@ -119,7 +119,7 @@ diff -u -r1.5 options.h
@@ -30,6 +30,7 @@
extern struct dhcp_option dhcp_options[];
extern int option_lengths[];
-
+
+int require_option(char *name);
uint8_t *get_option(struct dhcpMessage *packet, int code);
int end_option(uint8_t *optionptr);
diff --git a/patches/udhcp_config_paths.diff b/patches/udhcp_config_paths.diff
index 299a68a8e..1d3a6b4b0 100644
--- a/patches/udhcp_config_paths.diff
+++ b/patches/udhcp_config_paths.diff
@@ -13,7 +13,7 @@ diff -u -r1.191 usage.h
+ "\t-s,\t--script=file\tRun file at dhcp events (default: " \
+ CONFIG_UDHCPC_SCRIPT_PATH ")\n" \
"\t-v,\t--version\tDisplay version"
-
+
#define udhcpd_trivial_usage \
Index: networking/udhcp/AUTHORS
===================================================================
@@ -24,11 +24,11 @@ diff -u -r1.3 AUTHORS
+++ b/networking/udhcp/AUTHORS 5 Mar 2004 13:20:11 -0000
@@ -10,5 +10,5 @@
Moreton Bay (http://www.moretonbay.com/)
- Lineo (http://opensource.lineo.com)
Vladimir Oleynik <dzo@simtrea.ru> Size optimizations
+
-
+Tony J. White <tjw@tjw.org> additional busybox build options
-
+
Index: networking/udhcp/Config.in
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/Config.in,v
@@ -37,32 +37,32 @@ diff -u -r1.5 Config.in
--- a/networking/udhcp/Config.in 22 Oct 2003 09:58:38 -0000 1.5
+++ b/networking/udhcp/Config.in 5 Mar 2004 13:20:11 -0000
@@ -58,5 +58,62 @@
-
+
See http://udhcp.busybox.net for further details.
-
+
+menu "udhcpd Configuration Options"
+ depends on CONFIG_UDHCPD
-+
++
+config CONFIG_UDHCPD_CONF_PATH
+ string "Path to default udhcpd.conf"
-+ default "/etc/udhcpd.conf"
-+ depends on CONFIG_UDHCPD
++ default "/etc/udhcpd.conf"
++ depends on CONFIG_UDHCPD
+ help
+ The full path to udhcpd's default configuration file.
+ (default is: /etc/udhcpd.conf)
+
+config CONFIG_UDHCPD_LEASE_PATH
+ string "Path to default udhcpd.leases"
-+ default "/var/lib/misc/udhcpd.leases"
-+ depends on CONFIG_UDHCPD
++ default "/var/lib/misc/udhcpd.leases"
++ depends on CONFIG_UDHCPD
+ help
+ The full path to udhcpd's default leases file.
+ (default is: /var/lib/misc/udhcpd.leases)
+
+config CONFIG_UDHCPD_PID_PATH
+ string "Path to default udhcpd PID file"
-+ default "/var/run/udhcpd.pid"
-+ depends on CONFIG_UDHCPD
++ default "/var/run/udhcpd.pid"
++ depends on CONFIG_UDHCPD
+ help
+ The full path to udhcpd's default pid file.
+ (default is: /var/run/udhcpd.pid)
@@ -79,26 +79,26 @@ diff -u -r1.5 Config.in
+ The full path to udhcpc's default event script file.
+ (default is: /usr/share/udhcpc/default.script OR
+ /share/udhcpc/default.script if CONFIG_INSTALL_NO_USR is set)
-+
++
+ When udhcpc is started it executes this script to take care
+ of system tasks after it completes DHCP communication. Such
-+ tasks include putting network interfaces up or down, setting
++ tasks include putting network interfaces up or down, setting
+ DNS info, adding routing information, etc.
+
+if CONFIG_INSTALL_NO_USR
+config CONFIG_UDHCPC_SCRIPT_PATH
-+ default "/share/udhcpc/default.script"
++ default "/share/udhcpc/default.script"
+endif
+
+if !CONFIG_INSTALL_NO_USR
+config CONFIG_UDHCPC_SCRIPT_PATH
-+ default "/usr/share/udhcpc/default.script"
++ default "/usr/share/udhcpc/default.script"
+endif
-+
++
+endmenu
+
endmenu
-
+
Index: networking/udhcp/README
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/README,v
@@ -109,33 +109,33 @@ diff -u -r1.3 README
@@ -9,27 +9,42 @@
compile time options
-------------------
-
+
-The Makefile contains three of the compile time options:
+The following options can be adjusted when configuring busybox:
-
+
- UDHCP_DEBUG: If UDHCP_DEBUG is defined, udhcpd will output extra
- debugging output, compile with -g, and not fork to the background when
- run.
- UDHCP_SYSLOG: If UDHCP_SYSLOG is defined, udhcpd will log all its
- messages syslog, otherwise, it will attempt to log them to stdout.
--
+-
- COMBINED_BINARY: If COMBINED_BINARY is define, one binary, udhcpd,
- is created. If called as udhcpd, the dhcp server will be started.
- If called as udhcpc, the dhcp client will be started.
--
+-
-dhcpd.h contains the other three compile time options:
--
+-
- LEASE_TIME: The default lease time if not specified in the config
- file.
-+ CONFIG_FEATURE_UDHCP_DEBUG:
-+ If this is defined, udhcpd will output extra debugging output,
++ CONFIG_FEATURE_UDHCP_DEBUG:
++ If this is defined, udhcpd will output extra debugging output,
+ compile with -g, and not fork to the background when run.
-
+
- LEASES_FILE: The default file for storing leases.
--
+-
- DHCPD_CONFIG_FILE: The defualt config file to use.
-+ CONFIG_FEATURE_UDHCP_SYSLOG:
-+ If this is defined, udhcpd will log all its messages syslog,
++ CONFIG_FEATURE_UDHCP_SYSLOG:
++ If this is defined, udhcpd will log all its messages syslog,
+ otherwise, it will attempt to log them to stdout.
+
+ CONFIG_UDHCPD_CONF_PATH:
@@ -158,14 +158,14 @@ diff -u -r1.3 README
+
+
+dhcpd.h contains the another compile time option:
-
-+ LEASE_TIME:
-+ The default lease time if not specified in the config file.
-+ This option can also be changed at runtime with the 'lease'
-+ configuration option.
+
++ LEASE_TIME:
++ The default lease time if not specified in the config file.
++ This option can also be changed at runtime with the 'lease'
++ configuration option.
+
options.c contains a set of dhcp options for the client:
-
+
name[10]: The name of the option as it will appear in scripts
Index: networking/udhcp/README.udhcpc
===================================================================
@@ -182,8 +182,8 @@ diff -u -r1.3 README.udhcpc
+ /usr/share/udhcpc/default.script or
+ CONFIG_UDHCPC_SCRIPT_PATH at build time)
-v, --version Display version
-
-
+
+
Index: networking/udhcp/README.udhcpd
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpd,v
@@ -192,21 +192,21 @@ diff -u -r1.1 README.udhcpd
--- a/networking/udhcp/README.udhcpd 31 Oct 2002 19:21:27 -0000 1.1
+++ b/networking/udhcp/README.udhcpd 5 Mar 2004 13:20:11 -0000
@@ -50,10 +50,14 @@
-
+
compile time options
-------------------
+
-+During busybox configuration, you can change the default paths for
-+udhcpd.conf, udhcpd.leases, and udhcpd.pid files. See README for
++During busybox configuration, you can change the default paths for
++udhcpd.conf, udhcpd.leases, and udhcpd.pid files. See README for
+more details.
-
+
-dhcpd.h contains the other two compile time options:
+dhcpd.h contains the compile time option:
-
+
LEASE_TIME: The default lease time if not specified in the config
file.
+
-
+
- DHCPD_CONFIG_FILE: The defualt config file to use.
Index: networking/udhcp/dhcpc.h
===================================================================
@@ -218,14 +218,14 @@ diff -u -r1.4 dhcpc.h
@@ -2,7 +2,11 @@
#ifndef _DHCPC_H
#define _DHCPC_H
-
+
-#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
+#ifdef CONFIG_UDHCPC_SCRIPT_PATH
+ #define DEFAULT_SCRIPT CONFIG_UDHCPC_SCRIPT_PATH
+#else
+ #define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
+#endif
-
+
/* allow libbb_udhcp.h to redefine DEFAULT_SCRIPT */
#include "libbb_udhcp.h"
Index: networking/udhcp/dhcpd.c
@@ -240,25 +240,25 @@ diff -u -r1.5 dhcpd.c
int max_sock;
unsigned long num_ips;
+ int daemonize = 1;
-+
++
+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) {
+ daemonize = 0;
+ argv++;
+ argc--;
+ }
-
+
memset(&server_config, 0, sizeof(struct server_config_t));
read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
@@ -99,9 +106,8 @@
&server_config.server, server_config.arp) < 0)
return 1;
-
+
-#ifndef UDHCP_DEBUG
- background(server_config.pidfile); /* hold lock during fork. */
-#endif
+ if(daemonize)
+ background(server_config.pidfile); /* hold lock during fork. */
-
+
/* Setup the signal pipe */
udhcp_sp_setup();
Index: networking/udhcp/dhcpd.h
@@ -269,7 +269,7 @@ diff -u -r1.5 dhcpd.h
--- a/networking/udhcp/dhcpd.h 30 Jan 2004 23:45:12 -0000 1.5
+++ b/networking/udhcp/dhcpd.h 5 Mar 2004 13:20:12 -0000
@@ -15,11 +15,25 @@
-
+
/* the period of time the client is allowed to use that address */
#define LEASE_TIME (60*60*24*10) /* 10 days of seconds */
-#define LEASES_FILE "/var/lib/misc/udhcpd.leases"
@@ -279,7 +279,7 @@ diff -u -r1.5 dhcpd.h
+#else
+ #define LEASES_FILE "/var/lib/misc/udhcpd.leases"
+#endif
-
+
/* where to find the DHCP server configuration file */
-#define DHCPD_CONF_FILE "/etc/udhcpd.conf"
+#ifdef CONFIG_UDHCPD_CONF_PATH
@@ -287,7 +287,7 @@ diff -u -r1.5 dhcpd.h
+#else
+ #define DHCPD_CONF_FILE "/etc/udhcpd.conf"
+#endif
-
+
+#ifdef CONFIG_UDHCPD_PID_PATH
+ #define DHCPD_PID_FILE CONFIG_UDHCPD_PID_PATH
+#else
@@ -322,7 +322,7 @@ diff -u -r1.5 libbb_udhcp.h
@@ -3,11 +3,6 @@
/* bit of a hack, do this no matter what the order of the includes.
* (for busybox) */
-
+
-#ifdef CONFIG_INSTALL_NO_USR
-#undef DEFUALT_SCRIPT
-#define DEFAULT_SCRIPT "/share/udhcpc/default.script"
@@ -330,4 +330,4 @@ diff -u -r1.5 libbb_udhcp.h
-
#ifndef _LIBBB_UDHCP_H
#define _LIBBB_UDHCP_H
-
+
diff --git a/patches/udhcpd_foreground.diff b/patches/udhcpd_foreground.diff
index 9f1e3b913..3b8c7eb0c 100644
--- a/patches/udhcpd_foreground.diff
+++ b/patches/udhcpd_foreground.diff
@@ -10,24 +10,24 @@ diff -u -r1.5 dhcpd.c
int max_sock;
unsigned long num_ips;
+ int daemonize = 1;
-+
++
+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) {
+ daemonize = 0;
+ argv++;
+ argc--;
+ }
-
+
memset(&server_config, 0, sizeof(struct server_config_t));
read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
@@ -99,9 +106,8 @@
&server_config.server, server_config.arp) < 0)
return 1;
-
+
-#ifndef UDHCP_DEBUG
- background(server_config.pidfile); /* hold lock during fork. */
-#endif
+ if(daemonize)
+ background(server_config.pidfile); /* hold lock during fork. */
-
+
/* Setup the signal pipe */
udhcp_sp_setup();