svn commit: trunk/busybox: init scripts
vda at busybox.net
vda at busybox.net
Tue Oct 21 17:14:26 UTC 2008
Author: vda
Date: 2008-10-21 10:14:26 -0700 (Tue, 21 Oct 2008)
New Revision: 23757
Log:
init: downgrade ENABLE_DEBUG_INIT to just a #define to prevent people
from selecting it in error. It has to be used ONLY for debugging
init, never in production, as resulting init has serious differences.
Modified:
trunk/busybox/TODO_config_nommu
trunk/busybox/init/Config.in
trunk/busybox/init/init.c
trunk/busybox/scripts/defconfig
Changeset:
Modified: trunk/busybox/TODO_config_nommu
===================================================================
--- trunk/busybox/TODO_config_nommu 2008-10-21 15:06:06 UTC (rev 23756)
+++ trunk/busybox/TODO_config_nommu 2008-10-21 17:14:26 UTC (rev 23757)
@@ -369,7 +369,6 @@
# Init Utilities
#
CONFIG_INIT=y
-# CONFIG_DEBUG_INIT is not set
CONFIG_FEATURE_USE_INITTAB=y
CONFIG_FEATURE_KILL_REMOVED=y
CONFIG_FEATURE_KILL_DELAY=1
Modified: trunk/busybox/init/Config.in
===================================================================
--- trunk/busybox/init/Config.in 2008-10-21 15:06:06 UTC (rev 23756)
+++ trunk/busybox/init/Config.in 2008-10-21 17:14:26 UTC (rev 23757)
@@ -12,14 +12,6 @@
help
init is the first program run when the system boots.
-config DEBUG_INIT
- bool "Debugging aid"
- default n
- depends on INIT
- help
- Turn this on to disable all the dangerous
- rebooting stuff when debugging.
-
config FEATURE_USE_INITTAB
bool "Support reading an inittab file"
default y
Modified: trunk/busybox/init/init.c
===================================================================
--- trunk/busybox/init/init.c 2008-10-21 15:06:06 UTC (rev 23756)
+++ trunk/busybox/init/init.c 2008-10-21 17:14:26 UTC (rev 23757)
@@ -14,6 +14,10 @@
#include <paths.h>
#include <sys/reboot.h>
+/* Was a CONFIG_xxx option. A lot of people were building
+ * not fully functional init by switching it on! */
+#define DEBUG_INIT 0
+
#define COMMAND_SIZE 256
#define CONSOLE_NAME_SIZE 32
#define MAXENV 16 /* Number of env. vars */
@@ -103,7 +107,7 @@
* "where" may be bitwise-or'd from L_LOG | L_CONSOLE
* NB: careful, we can be called after vfork!
*/
-#define messageD(...) do { if (ENABLE_DEBUG_INIT) message(__VA_ARGS__); } while (0)
+#define messageD(...) do { if (DEBUG_INIT) message(__VA_ARGS__); } while (0)
static void message(int where, const char *fmt, ...)
__attribute__ ((format(printf, 2, 3)));
static void message(int where, const char *fmt, ...)
@@ -275,7 +279,7 @@
tty_name, strerror(errno));
if (exit_on_failure)
_exit(EXIT_FAILURE);
- if (ENABLE_DEBUG_INIT)
+ if (DEBUG_INIT)
_exit(2);
/* NB: we don't reach this if we were called after vfork.
* Thus halt_reboot_pwoff() itself need not be vfork-safe. */
@@ -788,7 +792,7 @@
return kill(1, SIGHUP);
}
- if (!ENABLE_DEBUG_INIT) {
+ if (!DEBUG_INIT) {
/* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
if (getpid() != 1
&& (!ENABLE_FEATURE_INITRD || !strstr(applet_name, "linuxrc"))
Modified: trunk/busybox/scripts/defconfig
===================================================================
--- trunk/busybox/scripts/defconfig 2008-10-21 15:06:06 UTC (rev 23756)
+++ trunk/busybox/scripts/defconfig 2008-10-21 17:14:26 UTC (rev 23757)
@@ -367,7 +367,6 @@
# Init Utilities
#
CONFIG_INIT=y
-# CONFIG_DEBUG_INIT is not set
CONFIG_FEATURE_USE_INITTAB=y
# CONFIG_FEATURE_KILL_REMOVED is not set
CONFIG_FEATURE_KILL_DELAY=0
More information about the busybox-cvs
mailing list