diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-03-31 00:42:57 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-03-31 00:42:57 +0200 |
commit | 52977a7d600c7db0f7c4935fd501427fd6b580d0 (patch) | |
tree | 9f5fdb91626f0201118e400cd16a72ce277e7932 | |
parent | a27dc33f976b15ccfe9180d652ed16579638c48c (diff) | |
download | busybox-w32-52977a7d600c7db0f7c4935fd501427fd6b580d0.tar.gz busybox-w32-52977a7d600c7db0f7c4935fd501427fd6b580d0.tar.bz2 busybox-w32-52977a7d600c7db0f7c4935fd501427fd6b580d0.zip |
Rename FEATURE_INITRD to LINUXRC and make it separate, not an alias to init
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | configs/TEST_nommu_defconfig | 2 | ||||
-rw-r--r-- | configs/TEST_noprintf_defconfig | 2 | ||||
-rw-r--r-- | configs/TEST_rh9_defconfig | 2 | ||||
-rw-r--r-- | configs/android2_defconfig | 2 | ||||
-rw-r--r-- | configs/android_502_defconfig | 2 | ||||
-rw-r--r-- | configs/android_defconfig | 2 | ||||
-rw-r--r-- | configs/android_ndk_defconfig | 2 | ||||
-rw-r--r-- | configs/cygwin_defconfig | 2 | ||||
-rw-r--r-- | configs/freebsd_defconfig | 2 | ||||
-rw-r--r-- | init/halt.c | 2 | ||||
-rw-r--r-- | init/init.c | 41 |
11 files changed, 31 insertions, 30 deletions
diff --git a/configs/TEST_nommu_defconfig b/configs/TEST_nommu_defconfig index b45afd956..5f822e598 100644 --- a/configs/TEST_nommu_defconfig +++ b/configs/TEST_nommu_defconfig | |||
@@ -390,7 +390,7 @@ CONFIG_FEATURE_INIT_SCTTY=y | |||
390 | CONFIG_FEATURE_INIT_SYSLOG=y | 390 | CONFIG_FEATURE_INIT_SYSLOG=y |
391 | CONFIG_FEATURE_EXTRA_QUIET=y | 391 | CONFIG_FEATURE_EXTRA_QUIET=y |
392 | CONFIG_FEATURE_INIT_COREDUMPS=y | 392 | CONFIG_FEATURE_INIT_COREDUMPS=y |
393 | CONFIG_FEATURE_INITRD=y | 393 | CONFIG_LINUXRC=y |
394 | CONFIG_HALT=y | 394 | CONFIG_HALT=y |
395 | # CONFIG_FEATURE_CALL_TELINIT is not set | 395 | # CONFIG_FEATURE_CALL_TELINIT is not set |
396 | CONFIG_TELINIT_PATH="" | 396 | CONFIG_TELINIT_PATH="" |
diff --git a/configs/TEST_noprintf_defconfig b/configs/TEST_noprintf_defconfig index 809b60cd8..c56781e32 100644 --- a/configs/TEST_noprintf_defconfig +++ b/configs/TEST_noprintf_defconfig | |||
@@ -395,7 +395,7 @@ CONFIG_FEATURE_KILL_DELAY=0 | |||
395 | # CONFIG_FEATURE_INIT_SYSLOG is not set | 395 | # CONFIG_FEATURE_INIT_SYSLOG is not set |
396 | # CONFIG_FEATURE_EXTRA_QUIET is not set | 396 | # CONFIG_FEATURE_EXTRA_QUIET is not set |
397 | # CONFIG_FEATURE_INIT_COREDUMPS is not set | 397 | # CONFIG_FEATURE_INIT_COREDUMPS is not set |
398 | # CONFIG_FEATURE_INITRD is not set | 398 | # CONFIG_LINUXRC is not set |
399 | # CONFIG_HALT is not set | 399 | # CONFIG_HALT is not set |
400 | # CONFIG_FEATURE_CALL_TELINIT is not set | 400 | # CONFIG_FEATURE_CALL_TELINIT is not set |
401 | CONFIG_TELINIT_PATH="" | 401 | CONFIG_TELINIT_PATH="" |
diff --git a/configs/TEST_rh9_defconfig b/configs/TEST_rh9_defconfig index 565b826d0..28daa6273 100644 --- a/configs/TEST_rh9_defconfig +++ b/configs/TEST_rh9_defconfig | |||
@@ -407,7 +407,7 @@ CONFIG_FEATURE_INIT_SCTTY=y | |||
407 | CONFIG_FEATURE_INIT_SYSLOG=y | 407 | CONFIG_FEATURE_INIT_SYSLOG=y |
408 | CONFIG_FEATURE_EXTRA_QUIET=y | 408 | CONFIG_FEATURE_EXTRA_QUIET=y |
409 | CONFIG_FEATURE_INIT_COREDUMPS=y | 409 | CONFIG_FEATURE_INIT_COREDUMPS=y |
410 | CONFIG_FEATURE_INITRD=y | 410 | CONFIG_LINUXRC=y |
411 | CONFIG_HALT=y | 411 | CONFIG_HALT=y |
412 | # CONFIG_FEATURE_CALL_TELINIT is not set | 412 | # CONFIG_FEATURE_CALL_TELINIT is not set |
413 | CONFIG_TELINIT_PATH="" | 413 | CONFIG_TELINIT_PATH="" |
diff --git a/configs/android2_defconfig b/configs/android2_defconfig index 1095094fe..fbc0da091 100644 --- a/configs/android2_defconfig +++ b/configs/android2_defconfig | |||
@@ -425,7 +425,7 @@ CONFIG_FEATURE_INIT_SCTTY=y | |||
425 | CONFIG_FEATURE_INIT_SYSLOG=y | 425 | CONFIG_FEATURE_INIT_SYSLOG=y |
426 | CONFIG_FEATURE_EXTRA_QUIET=y | 426 | CONFIG_FEATURE_EXTRA_QUIET=y |
427 | CONFIG_FEATURE_INIT_COREDUMPS=y | 427 | CONFIG_FEATURE_INIT_COREDUMPS=y |
428 | CONFIG_FEATURE_INITRD=y | 428 | CONFIG_LINUXRC=y |
429 | CONFIG_INIT_TERMINAL_TYPE="linux" | 429 | CONFIG_INIT_TERMINAL_TYPE="linux" |
430 | CONFIG_MESG=y | 430 | CONFIG_MESG=y |
431 | CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y | 431 | CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y |
diff --git a/configs/android_502_defconfig b/configs/android_502_defconfig index c5146c719..7ef1585fb 100644 --- a/configs/android_502_defconfig +++ b/configs/android_502_defconfig | |||
@@ -532,7 +532,7 @@ CONFIG_FEATURE_INIT_SCTTY=y | |||
532 | CONFIG_FEATURE_INIT_SYSLOG=y | 532 | CONFIG_FEATURE_INIT_SYSLOG=y |
533 | CONFIG_FEATURE_EXTRA_QUIET=y | 533 | CONFIG_FEATURE_EXTRA_QUIET=y |
534 | CONFIG_FEATURE_INIT_COREDUMPS=y | 534 | CONFIG_FEATURE_INIT_COREDUMPS=y |
535 | CONFIG_FEATURE_INITRD=y | 535 | CONFIG_LINUXRC=y |
536 | CONFIG_INIT_TERMINAL_TYPE="linux" | 536 | CONFIG_INIT_TERMINAL_TYPE="linux" |
537 | CONFIG_FEATURE_INIT_MODIFY_CMDLINE=y | 537 | CONFIG_FEATURE_INIT_MODIFY_CMDLINE=y |
538 | CONFIG_MESG=y | 538 | CONFIG_MESG=y |
diff --git a/configs/android_defconfig b/configs/android_defconfig index 082994b6c..4e0224207 100644 --- a/configs/android_defconfig +++ b/configs/android_defconfig | |||
@@ -448,7 +448,7 @@ CONFIG_FEATURE_INIT_SCTTY=y | |||
448 | CONFIG_FEATURE_INIT_SYSLOG=y | 448 | CONFIG_FEATURE_INIT_SYSLOG=y |
449 | CONFIG_FEATURE_EXTRA_QUIET=y | 449 | CONFIG_FEATURE_EXTRA_QUIET=y |
450 | CONFIG_FEATURE_INIT_COREDUMPS=y | 450 | CONFIG_FEATURE_INIT_COREDUMPS=y |
451 | CONFIG_FEATURE_INITRD=y | 451 | CONFIG_LINUXRC=y |
452 | CONFIG_INIT_TERMINAL_TYPE="linux" | 452 | CONFIG_INIT_TERMINAL_TYPE="linux" |
453 | CONFIG_MESG=y | 453 | CONFIG_MESG=y |
454 | CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y | 454 | CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y |
diff --git a/configs/android_ndk_defconfig b/configs/android_ndk_defconfig index 63fafb468..d657d33e9 100644 --- a/configs/android_ndk_defconfig +++ b/configs/android_ndk_defconfig | |||
@@ -458,7 +458,7 @@ CONFIG_FEATURE_INIT_SCTTY=y | |||
458 | CONFIG_FEATURE_INIT_SYSLOG=y | 458 | CONFIG_FEATURE_INIT_SYSLOG=y |
459 | CONFIG_FEATURE_EXTRA_QUIET=y | 459 | CONFIG_FEATURE_EXTRA_QUIET=y |
460 | CONFIG_FEATURE_INIT_COREDUMPS=y | 460 | CONFIG_FEATURE_INIT_COREDUMPS=y |
461 | CONFIG_FEATURE_INITRD=y | 461 | CONFIG_LINUXRC=y |
462 | CONFIG_INIT_TERMINAL_TYPE="linux" | 462 | CONFIG_INIT_TERMINAL_TYPE="linux" |
463 | CONFIG_MESG=y | 463 | CONFIG_MESG=y |
464 | CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y | 464 | CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y |
diff --git a/configs/cygwin_defconfig b/configs/cygwin_defconfig index 2c02be743..38d580ad1 100644 --- a/configs/cygwin_defconfig +++ b/configs/cygwin_defconfig | |||
@@ -425,7 +425,7 @@ CONFIG_FEATURE_KILL_DELAY=0 | |||
425 | # CONFIG_FEATURE_INIT_SYSLOG is not set | 425 | # CONFIG_FEATURE_INIT_SYSLOG is not set |
426 | # CONFIG_FEATURE_EXTRA_QUIET is not set | 426 | # CONFIG_FEATURE_EXTRA_QUIET is not set |
427 | # CONFIG_FEATURE_INIT_COREDUMPS is not set | 427 | # CONFIG_FEATURE_INIT_COREDUMPS is not set |
428 | # CONFIG_FEATURE_INITRD is not set | 428 | # CONFIG_LINUXRC is not set |
429 | CONFIG_INIT_TERMINAL_TYPE="" | 429 | CONFIG_INIT_TERMINAL_TYPE="" |
430 | CONFIG_MESG=y | 430 | CONFIG_MESG=y |
431 | CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y | 431 | CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y |
diff --git a/configs/freebsd_defconfig b/configs/freebsd_defconfig index ec3ed03c4..ae62f1389 100644 --- a/configs/freebsd_defconfig +++ b/configs/freebsd_defconfig | |||
@@ -422,7 +422,7 @@ CONFIG_FEATURE_KILL_DELAY=0 | |||
422 | # CONFIG_FEATURE_INIT_SYSLOG is not set | 422 | # CONFIG_FEATURE_INIT_SYSLOG is not set |
423 | # CONFIG_FEATURE_EXTRA_QUIET is not set | 423 | # CONFIG_FEATURE_EXTRA_QUIET is not set |
424 | # CONFIG_FEATURE_INIT_COREDUMPS is not set | 424 | # CONFIG_FEATURE_INIT_COREDUMPS is not set |
425 | # CONFIG_FEATURE_INITRD is not set | 425 | # CONFIG_LINUXRC is not set |
426 | CONFIG_INIT_TERMINAL_TYPE="" | 426 | CONFIG_INIT_TERMINAL_TYPE="" |
427 | # CONFIG_MESG is not set | 427 | # CONFIG_MESG is not set |
428 | 428 | ||
diff --git a/init/halt.c b/init/halt.c index ad12d9148..572d751b0 100644 --- a/init/halt.c +++ b/init/halt.c | |||
@@ -135,7 +135,7 @@ int halt_main(int argc UNUSED_PARAM, char **argv) | |||
135 | if (!(flags & 4)) { /* no -f */ | 135 | if (!(flags & 4)) { /* no -f */ |
136 | //TODO: I tend to think that signalling linuxrc is wrong | 136 | //TODO: I tend to think that signalling linuxrc is wrong |
137 | // pity original author didn't comment on it... | 137 | // pity original author didn't comment on it... |
138 | if (ENABLE_FEATURE_INITRD) { | 138 | if (ENABLE_LINUXRC) { |
139 | /* talk to linuxrc */ | 139 | /* talk to linuxrc */ |
140 | /* bbox init/linuxrc assumed */ | 140 | /* bbox init/linuxrc assumed */ |
141 | pid_t *pidlist = find_pid_by_name("linuxrc"); | 141 | pid_t *pidlist = find_pid_by_name("linuxrc"); |
diff --git a/init/init.c b/init/init.c index 25bfaec8c..6eb76b80e 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -16,10 +16,21 @@ | |||
16 | //config: help | 16 | //config: help |
17 | //config: init is the first program run when the system boots. | 17 | //config: init is the first program run when the system boots. |
18 | //config: | 18 | //config: |
19 | //config:config LINUXRC | ||
20 | //config: bool "Support running init from within an initrd (not initramfs)" | ||
21 | //config: default y | ||
22 | //config: select FEATURE_SYSLOG | ||
23 | //config: help | ||
24 | //config: Legacy support for running init under the old-style initrd. Allows | ||
25 | //config: the name linuxrc to act as init, and it doesn't assume init is PID 1. | ||
26 | //config: | ||
27 | //config: This does not apply to initramfs, which runs /init as PID 1 and | ||
28 | //config: requires no special support. | ||
29 | //config: | ||
19 | //config:config FEATURE_USE_INITTAB | 30 | //config:config FEATURE_USE_INITTAB |
20 | //config: bool "Support reading an inittab file" | 31 | //config: bool "Support reading an inittab file" |
21 | //config: default y | 32 | //config: default y |
22 | //config: depends on INIT | 33 | //config: depends on INIT || LINUXRC |
23 | //config: help | 34 | //config: help |
24 | //config: Allow init to read an inittab file when the system boot. | 35 | //config: Allow init to read an inittab file when the system boot. |
25 | //config: | 36 | //config: |
@@ -46,7 +57,7 @@ | |||
46 | //config:config FEATURE_INIT_SCTTY | 57 | //config:config FEATURE_INIT_SCTTY |
47 | //config: bool "Run commands with leading dash with controlling tty" | 58 | //config: bool "Run commands with leading dash with controlling tty" |
48 | //config: default y | 59 | //config: default y |
49 | //config: depends on INIT | 60 | //config: depends on INIT || LINUXRC |
50 | //config: help | 61 | //config: help |
51 | //config: If this option is enabled, init will try to give a controlling | 62 | //config: If this option is enabled, init will try to give a controlling |
52 | //config: tty to any command which has leading hyphen (often it's "-/bin/sh"). | 63 | //config: tty to any command which has leading hyphen (often it's "-/bin/sh"). |
@@ -61,40 +72,29 @@ | |||
61 | //config:config FEATURE_INIT_SYSLOG | 72 | //config:config FEATURE_INIT_SYSLOG |
62 | //config: bool "Enable init to write to syslog" | 73 | //config: bool "Enable init to write to syslog" |
63 | //config: default y | 74 | //config: default y |
64 | //config: depends on INIT | 75 | //config: depends on INIT || LINUXRC |
65 | //config: | 76 | //config: |
66 | //config:config FEATURE_EXTRA_QUIET | 77 | //config:config FEATURE_EXTRA_QUIET |
67 | //config: bool "Be _extra_ quiet on boot" | 78 | //config: bool "Be _extra_ quiet on boot" |
68 | //config: default y | 79 | //config: default y |
69 | //config: depends on INIT | 80 | //config: depends on INIT || LINUXRC |
70 | //config: help | 81 | //config: help |
71 | //config: Prevent init from logging some messages to the console during boot. | 82 | //config: Prevent init from logging some messages to the console during boot. |
72 | //config: | 83 | //config: |
73 | //config:config FEATURE_INIT_COREDUMPS | 84 | //config:config FEATURE_INIT_COREDUMPS |
74 | //config: bool "Support dumping core for child processes (debugging only)" | 85 | //config: bool "Support dumping core for child processes (debugging only)" |
75 | //config: default y | 86 | //config: default y |
76 | //config: depends on INIT | 87 | //config: depends on INIT || LINUXRC |
77 | //config: help | 88 | //config: help |
78 | //config: If this option is enabled and the file /.init_enable_core | 89 | //config: If this option is enabled and the file /.init_enable_core |
79 | //config: exists, then init will call setrlimit() to allow unlimited | 90 | //config: exists, then init will call setrlimit() to allow unlimited |
80 | //config: core file sizes. If this option is disabled, processes | 91 | //config: core file sizes. If this option is disabled, processes |
81 | //config: will not generate any core files. | 92 | //config: will not generate any core files. |
82 | //config: | 93 | //config: |
83 | //config:config FEATURE_INITRD | ||
84 | //config: bool "Support running init from within an initrd (not initramfs)" | ||
85 | //config: default y | ||
86 | //config: depends on INIT | ||
87 | //config: help | ||
88 | //config: Legacy support for running init under the old-style initrd. Allows | ||
89 | //config: the name linuxrc to act as init, and it doesn't assume init is PID 1. | ||
90 | //config: | ||
91 | //config: This does not apply to initramfs, which runs /init as PID 1 and | ||
92 | //config: requires no special support. | ||
93 | //config: | ||
94 | //config:config INIT_TERMINAL_TYPE | 94 | //config:config INIT_TERMINAL_TYPE |
95 | //config: string "Initial terminal type" | 95 | //config: string "Initial terminal type" |
96 | //config: default "linux" | 96 | //config: default "linux" |
97 | //config: depends on INIT | 97 | //config: depends on INIT || LINUXRC |
98 | //config: help | 98 | //config: help |
99 | //config: This is the initial value set by init for the TERM environment | 99 | //config: This is the initial value set by init for the TERM environment |
100 | //config: variable. This variable is used by programs which make use of | 100 | //config: variable. This variable is used by programs which make use of |
@@ -106,7 +106,7 @@ | |||
106 | //config:config FEATURE_INIT_MODIFY_CMDLINE | 106 | //config:config FEATURE_INIT_MODIFY_CMDLINE |
107 | //config: bool "Modify the command-line to \"init\"" | 107 | //config: bool "Modify the command-line to \"init\"" |
108 | //config: default y | 108 | //config: default y |
109 | //config: depends on INIT | 109 | //config: depends on INIT || LINUXRC |
110 | //config: help | 110 | //config: help |
111 | //config: When launched as PID 1 and after parsing its arguments, init | 111 | //config: When launched as PID 1 and after parsing its arguments, init |
112 | //config: wipes all the arguments but argv[0] and rewrites argv[0] to | 112 | //config: wipes all the arguments but argv[0] and rewrites argv[0] to |
@@ -119,9 +119,10 @@ | |||
119 | //config: retrieved in /proc/1/cmdline on Linux, for example. | 119 | //config: retrieved in /proc/1/cmdline on Linux, for example. |
120 | 120 | ||
121 | //applet:IF_INIT(APPLET(init, BB_DIR_SBIN, BB_SUID_DROP)) | 121 | //applet:IF_INIT(APPLET(init, BB_DIR_SBIN, BB_SUID_DROP)) |
122 | //applet:IF_FEATURE_INITRD(APPLET_ODDNAME(linuxrc, init, BB_DIR_ROOT, BB_SUID_DROP, linuxrc)) | 122 | //applet:IF_LINUXRC(APPLET_ODDNAME(linuxrc, init, BB_DIR_ROOT, BB_SUID_DROP, linuxrc)) |
123 | 123 | ||
124 | //kbuild:lib-$(CONFIG_INIT) += init.o | 124 | //kbuild:lib-$(CONFIG_INIT) += init.o |
125 | //kbuild:lib-$(CONFIG_LINUXRC) += init.o | ||
125 | 126 | ||
126 | #define DEBUG_SEGV_HANDLER 0 | 127 | #define DEBUG_SEGV_HANDLER 0 |
127 | 128 | ||
@@ -1057,7 +1058,7 @@ int init_main(int argc UNUSED_PARAM, char **argv) | |||
1057 | if (!DEBUG_INIT) { | 1058 | if (!DEBUG_INIT) { |
1058 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ | 1059 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ |
1059 | if (getpid() != 1 | 1060 | if (getpid() != 1 |
1060 | && (!ENABLE_FEATURE_INITRD || applet_name[0] != 'l') /* not linuxrc? */ | 1061 | && (!ENABLE_LINUXRC || applet_name[0] != 'l') /* not linuxrc? */ |
1061 | ) { | 1062 | ) { |
1062 | bb_error_msg_and_die("must be run as PID 1"); | 1063 | bb_error_msg_and_die("must be run as PID 1"); |
1063 | } | 1064 | } |