3
0

udhcp_config_paths.diff 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. Index: include/usage.h
  2. ===================================================================
  3. RCS file: /var/cvs/busybox/include/usage.h,v
  4. retrieving revision 1.191
  5. diff -u -r1.191 usage.h
  6. --- a/include/usage.h 25 Feb 2004 10:35:55 -0000 1.191
  7. +++ b/include/usage.h 5 Mar 2004 13:20:11 -0000
  8. @@ -2606,7 +2606,8 @@
  9. "\t-p,\t--pidfile=file\tStore process ID of daemon in file\n" \
  10. "\t-q,\t--quit\tQuit after obtaining lease\n" \
  11. "\t-r,\t--request=IP\tIP address to request (default: none)\n" \
  12. - "\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
  13. + "\t-s,\t--script=file\tRun file at dhcp events (default: " \
  14. + CONFIG_UDHCPC_SCRIPT_PATH ")\n" \
  15. "\t-v,\t--version\tDisplay version"
  16. #define udhcpd_trivial_usage \
  17. Index: networking/udhcp/AUTHORS
  18. ===================================================================
  19. RCS file: /var/cvs/busybox/networking/udhcp/AUTHORS,v
  20. retrieving revision 1.3
  21. diff -u -r1.3 AUTHORS
  22. --- a/networking/udhcp/AUTHORS 18 Dec 2003 22:25:38 -0000 1.3
  23. +++ b/networking/udhcp/AUTHORS 5 Mar 2004 13:20:11 -0000
  24. @@ -10,5 +10,5 @@
  25. Moreton Bay (http://www.moretonbay.com/)
  26. Vladimir Oleynik <dzo@simtrea.ru> Size optimizations
  27. -
  28. +Tony J. White <tjw@tjw.org> additional busybox build options
  29. Index: networking/udhcp/Config.in
  30. ===================================================================
  31. RCS file: /var/cvs/busybox/networking/udhcp/Config.in,v
  32. retrieving revision 1.5
  33. diff -u -r1.5 Config.in
  34. --- a/networking/udhcp/Config.in 22 Oct 2003 09:58:38 -0000 1.5
  35. +++ b/networking/udhcp/Config.in 5 Mar 2004 13:20:11 -0000
  36. @@ -58,5 +58,62 @@
  37. See http://udhcp.busybox.net for further details.
  38. +menu "udhcpd Configuration Options"
  39. + depends on CONFIG_UDHCPD
  40. +
  41. +config CONFIG_UDHCPD_CONF_PATH
  42. + string "Path to default udhcpd.conf"
  43. + default "/etc/udhcpd.conf"
  44. + depends on CONFIG_UDHCPD
  45. + help
  46. + The full path to udhcpd's default configuration file.
  47. + (default is: /etc/udhcpd.conf)
  48. +
  49. +config CONFIG_UDHCPD_LEASE_PATH
  50. + string "Path to default udhcpd.leases"
  51. + default "/var/lib/misc/udhcpd.leases"
  52. + depends on CONFIG_UDHCPD
  53. + help
  54. + The full path to udhcpd's default leases file.
  55. + (default is: /var/lib/misc/udhcpd.leases)
  56. +
  57. +config CONFIG_UDHCPD_PID_PATH
  58. + string "Path to default udhcpd PID file"
  59. + default "/var/run/udhcpd.pid"
  60. + depends on CONFIG_UDHCPD
  61. + help
  62. + The full path to udhcpd's default pid file.
  63. + (default is: /var/run/udhcpd.pid)
  64. +
  65. +endmenu
  66. +
  67. +menu "udhcpc Configuration Options"
  68. + depends on CONFIG_UDHCPC
  69. +
  70. +config CONFIG_UDHCPC_SCRIPT_PATH
  71. + string "Path to default udhcpc event script"
  72. + depends on CONFIG_UDHCPC
  73. + help
  74. + The full path to udhcpc's default event script file.
  75. + (default is: /usr/share/udhcpc/default.script OR
  76. + /share/udhcpc/default.script if CONFIG_INSTALL_NO_USR is set)
  77. +
  78. + When udhcpc is started it executes this script to take care
  79. + of system tasks after it completes DHCP communication. Such
  80. + tasks include putting network interfaces up or down, setting
  81. + DNS info, adding routing information, etc.
  82. +
  83. +if CONFIG_INSTALL_NO_USR
  84. +config CONFIG_UDHCPC_SCRIPT_PATH
  85. + default "/share/udhcpc/default.script"
  86. +endif
  87. +
  88. +if !CONFIG_INSTALL_NO_USR
  89. +config CONFIG_UDHCPC_SCRIPT_PATH
  90. + default "/usr/share/udhcpc/default.script"
  91. +endif
  92. +
  93. +endmenu
  94. +
  95. endmenu
  96. Index: networking/udhcp/README
  97. ===================================================================
  98. RCS file: /var/cvs/busybox/networking/udhcp/README,v
  99. retrieving revision 1.3
  100. diff -u -r1.3 README
  101. --- a/networking/udhcp/README 18 Dec 2003 22:25:38 -0000 1.3
  102. +++ b/networking/udhcp/README 5 Mar 2004 13:20:11 -0000
  103. @@ -9,27 +9,42 @@
  104. compile time options
  105. -------------------
  106. -The Makefile contains three of the compile time options:
  107. +The following options can be adjusted when configuring busybox:
  108. - UDHCP_DEBUG: If UDHCP_DEBUG is defined, udhcpd will output extra
  109. - debugging output, compile with -g, and not fork to the background when
  110. - run.
  111. - UDHCP_SYSLOG: If UDHCP_SYSLOG is defined, udhcpd will log all its
  112. - messages syslog, otherwise, it will attempt to log them to stdout.
  113. -
  114. - COMBINED_BINARY: If COMBINED_BINARY is define, one binary, udhcpd,
  115. - is created. If called as udhcpd, the dhcp server will be started.
  116. - If called as udhcpc, the dhcp client will be started.
  117. -
  118. -dhcpd.h contains the other three compile time options:
  119. -
  120. - LEASE_TIME: The default lease time if not specified in the config
  121. - file.
  122. + CONFIG_FEATURE_UDHCP_DEBUG:
  123. + If this is defined, udhcpd will output extra debugging output,
  124. + compile with -g, and not fork to the background when run.
  125. - LEASES_FILE: The default file for storing leases.
  126. -
  127. - DHCPD_CONFIG_FILE: The defualt config file to use.
  128. + CONFIG_FEATURE_UDHCP_SYSLOG:
  129. + If this is defined, udhcpd will log all its messages syslog,
  130. + otherwise, it will attempt to log them to stdout.
  131. +
  132. + CONFIG_UDHCPD_CONF_PATH:
  133. + The full path to udhcpd's default configuration file.
  134. +
  135. + CONFIG_UDHCPD_LEASE_PATH:
  136. + The full path to udhcpd's default leases file.
  137. +
  138. + CONFIG_UDHCPD_PID_PATH:
  139. + The full path to udhcpd's default pid file.
  140. +
  141. + CONFIG_UDHCPC_SCRIPT_PATH:
  142. + The full path to udhcpc's default event script file.
  143. + (default is: /usr/share/udhcpc/default.script)
  144. +
  145. + When udhcpc is started it executes this script to take care
  146. + of system tasks after it completes DHCP communication. Such
  147. + tasks include putting network interfaces up or down, setting
  148. + DNS info, adding routing information, etc.
  149. +
  150. +
  151. +dhcpd.h contains the another compile time option:
  152. + LEASE_TIME:
  153. + The default lease time if not specified in the config file.
  154. + This option can also be changed at runtime with the 'lease'
  155. + configuration option.
  156. +
  157. options.c contains a set of dhcp options for the client:
  158. name[10]: The name of the option as it will appear in scripts
  159. Index: networking/udhcp/README.udhcpc
  160. ===================================================================
  161. RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpc,v
  162. retrieving revision 1.3
  163. diff -u -r1.3 README.udhcpc
  164. --- a/networking/udhcp/README.udhcpc 11 Dec 2002 21:12:44 -0000 1.3
  165. +++ b/networking/udhcp/README.udhcpc 5 Mar 2004 13:20:11 -0000
  166. @@ -23,7 +23,8 @@
  167. -q, --quit Quit after obtaining lease
  168. -r, --request=IP IP address to request (default: none)
  169. -s, --script=file Run file at dhcp events (default:
  170. - /usr/share/udhcpc/default.script)
  171. + /usr/share/udhcpc/default.script or
  172. + CONFIG_UDHCPC_SCRIPT_PATH at build time)
  173. -v, --version Display version
  174. Index: networking/udhcp/README.udhcpd
  175. ===================================================================
  176. RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpd,v
  177. retrieving revision 1.1
  178. diff -u -r1.1 README.udhcpd
  179. --- a/networking/udhcp/README.udhcpd 31 Oct 2002 19:21:27 -0000 1.1
  180. +++ b/networking/udhcp/README.udhcpd 5 Mar 2004 13:20:11 -0000
  181. @@ -50,10 +50,14 @@
  182. compile time options
  183. -------------------
  184. +
  185. +During busybox configuration, you can change the default paths for
  186. +udhcpd.conf, udhcpd.leases, and udhcpd.pid files. See README for
  187. +more details.
  188. -dhcpd.h contains the other two compile time options:
  189. +dhcpd.h contains the compile time option:
  190. LEASE_TIME: The default lease time if not specified in the config
  191. file.
  192. +
  193. - DHCPD_CONFIG_FILE: The defualt config file to use.
  194. Index: networking/udhcp/dhcpc.h
  195. ===================================================================
  196. RCS file: /var/cvs/busybox/networking/udhcp/dhcpc.h,v
  197. retrieving revision 1.4
  198. diff -u -r1.4 dhcpc.h
  199. --- a/networking/udhcp/dhcpc.h 30 Jan 2004 23:45:12 -0000 1.4
  200. +++ b/networking/udhcp/dhcpc.h 5 Mar 2004 13:20:11 -0000
  201. @@ -2,7 +2,11 @@
  202. #ifndef _DHCPC_H
  203. #define _DHCPC_H
  204. -#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
  205. +#ifdef CONFIG_UDHCPC_SCRIPT_PATH
  206. + #define DEFAULT_SCRIPT CONFIG_UDHCPC_SCRIPT_PATH
  207. +#else
  208. + #define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
  209. +#endif
  210. /* allow libbb_udhcp.h to redefine DEFAULT_SCRIPT */
  211. #include "libbb_udhcp.h"
  212. Index: networking/udhcp/dhcpd.c
  213. ===================================================================
  214. RCS file: /var/cvs/busybox/networking/udhcp/dhcpd.c,v
  215. retrieving revision 1.5
  216. diff -u -r1.5 dhcpd.c
  217. --- a/networking/udhcp/dhcpd.c 30 Jan 2004 23:45:12 -0000 1.5
  218. +++ b/networking/udhcp/dhcpd.c 5 Mar 2004 13:20:11 -0000
  219. @@ -70,6 +70,13 @@
  220. struct dhcpOfferedAddr *lease;
  221. int max_sock;
  222. unsigned long num_ips;
  223. + int daemonize = 1;
  224. +
  225. + while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) {
  226. + daemonize = 0;
  227. + argv++;
  228. + argc--;
  229. + }
  230. memset(&server_config, 0, sizeof(struct server_config_t));
  231. read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
  232. @@ -99,9 +106,8 @@
  233. &server_config.server, server_config.arp) < 0)
  234. return 1;
  235. -#ifndef UDHCP_DEBUG
  236. - background(server_config.pidfile); /* hold lock during fork. */
  237. -#endif
  238. + if(daemonize)
  239. + background(server_config.pidfile); /* hold lock during fork. */
  240. /* Setup the signal pipe */
  241. udhcp_sp_setup();
  242. Index: networking/udhcp/dhcpd.h
  243. ===================================================================
  244. RCS file: /var/cvs/busybox/networking/udhcp/dhcpd.h,v
  245. retrieving revision 1.5
  246. diff -u -r1.5 dhcpd.h
  247. --- a/networking/udhcp/dhcpd.h 30 Jan 2004 23:45:12 -0000 1.5
  248. +++ b/networking/udhcp/dhcpd.h 5 Mar 2004 13:20:12 -0000
  249. @@ -15,11 +15,25 @@
  250. /* the period of time the client is allowed to use that address */
  251. #define LEASE_TIME (60*60*24*10) /* 10 days of seconds */
  252. -#define LEASES_FILE "/var/lib/misc/udhcpd.leases"
  253. +
  254. +#ifdef CONFIG_UDHCPD_LEASE_PATH
  255. + #define LEASES_FILE CONFIG_UDHCPD_LEASE_PATH
  256. +#else
  257. + #define LEASES_FILE "/var/lib/misc/udhcpd.leases"
  258. +#endif
  259. /* where to find the DHCP server configuration file */
  260. -#define DHCPD_CONF_FILE "/etc/udhcpd.conf"
  261. +#ifdef CONFIG_UDHCPD_CONF_PATH
  262. + #define DHCPD_CONF_FILE CONFIG_UDHCPD_CONF_PATH
  263. +#else
  264. + #define DHCPD_CONF_FILE "/etc/udhcpd.conf"
  265. +#endif
  266. +#ifdef CONFIG_UDHCPD_PID_PATH
  267. + #define DHCPD_PID_FILE CONFIG_UDHCPD_PID_PATH
  268. +#else
  269. + #define DHCPD_PID_FILE "/var/run/udhcpd.pid"
  270. +#endif
  271. /*****************************************************************/
  272. /* Do not modify below here unless you know what you are doing!! */
  273. /*****************************************************************/
  274. Index: networking/udhcp/files.c
  275. ===================================================================
  276. RCS file: /var/cvs/busybox/networking/udhcp/files.c,v
  277. retrieving revision 1.13
  278. diff -u -r1.13 files.c
  279. --- a/networking/udhcp/files.c 30 Jan 2004 23:45:12 -0000 1.13
  280. +++ b/networking/udhcp/files.c 5 Mar 2004 13:20:13 -0000
  281. @@ -166,7 +166,7 @@
  282. {"offer_time", read_u32, &(server_config.offer_time), "60"},
  283. {"min_lease", read_u32, &(server_config.min_lease), "60"},
  284. {"lease_file", read_str, &(server_config.lease_file), LEASES_FILE},
  285. - {"pidfile", read_str, &(server_config.pidfile), "/var/run/udhcpd.pid"},
  286. + {"pidfile", read_str, &(server_config.pidfile), DHCPD_PID_FILE},
  287. {"notify_file", read_str, &(server_config.notify_file), ""},
  288. {"siaddr", read_ip, &(server_config.siaddr), "0.0.0.0"},
  289. {"sname", read_str, &(server_config.sname), ""},
  290. Index: networking/udhcp/libbb_udhcp.h
  291. ===================================================================
  292. RCS file: /var/cvs/busybox/networking/udhcp/libbb_udhcp.h,v
  293. retrieving revision 1.5
  294. diff -u -r1.5 libbb_udhcp.h
  295. --- a/networking/udhcp/libbb_udhcp.h 18 Dec 2003 22:25:38 -0000 1.5
  296. +++ b/networking/udhcp/libbb_udhcp.h 5 Mar 2004 13:20:13 -0000
  297. @@ -3,11 +3,6 @@
  298. /* bit of a hack, do this no matter what the order of the includes.
  299. * (for busybox) */
  300. -#ifdef CONFIG_INSTALL_NO_USR
  301. -#undef DEFUALT_SCRIPT
  302. -#define DEFAULT_SCRIPT "/share/udhcpc/default.script"
  303. -#endif
  304. -
  305. #ifndef _LIBBB_UDHCP_H
  306. #define _LIBBB_UDHCP_H