Rename FEATURE_INITRD to LINUXRC and make it separate, not an alias to init

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-03-31 00:42:57 +02:00
parent a27dc33f97
commit 52977a7d60
11 changed files with 31 additions and 30 deletions

View File

@ -390,7 +390,7 @@ CONFIG_FEATURE_INIT_SCTTY=y
CONFIG_FEATURE_INIT_SYSLOG=y
CONFIG_FEATURE_EXTRA_QUIET=y
CONFIG_FEATURE_INIT_COREDUMPS=y
CONFIG_FEATURE_INITRD=y
CONFIG_LINUXRC=y
CONFIG_HALT=y
# CONFIG_FEATURE_CALL_TELINIT is not set
CONFIG_TELINIT_PATH=""

View File

@ -395,7 +395,7 @@ CONFIG_FEATURE_KILL_DELAY=0
# CONFIG_FEATURE_INIT_SYSLOG is not set
# CONFIG_FEATURE_EXTRA_QUIET is not set
# CONFIG_FEATURE_INIT_COREDUMPS is not set
# CONFIG_FEATURE_INITRD is not set
# CONFIG_LINUXRC is not set
# CONFIG_HALT is not set
# CONFIG_FEATURE_CALL_TELINIT is not set
CONFIG_TELINIT_PATH=""

View File

@ -407,7 +407,7 @@ CONFIG_FEATURE_INIT_SCTTY=y
CONFIG_FEATURE_INIT_SYSLOG=y
CONFIG_FEATURE_EXTRA_QUIET=y
CONFIG_FEATURE_INIT_COREDUMPS=y
CONFIG_FEATURE_INITRD=y
CONFIG_LINUXRC=y
CONFIG_HALT=y
# CONFIG_FEATURE_CALL_TELINIT is not set
CONFIG_TELINIT_PATH=""

View File

@ -425,7 +425,7 @@ CONFIG_FEATURE_INIT_SCTTY=y
CONFIG_FEATURE_INIT_SYSLOG=y
CONFIG_FEATURE_EXTRA_QUIET=y
CONFIG_FEATURE_INIT_COREDUMPS=y
CONFIG_FEATURE_INITRD=y
CONFIG_LINUXRC=y
CONFIG_INIT_TERMINAL_TYPE="linux"
CONFIG_MESG=y
CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y

View File

@ -532,7 +532,7 @@ CONFIG_FEATURE_INIT_SCTTY=y
CONFIG_FEATURE_INIT_SYSLOG=y
CONFIG_FEATURE_EXTRA_QUIET=y
CONFIG_FEATURE_INIT_COREDUMPS=y
CONFIG_FEATURE_INITRD=y
CONFIG_LINUXRC=y
CONFIG_INIT_TERMINAL_TYPE="linux"
CONFIG_FEATURE_INIT_MODIFY_CMDLINE=y
CONFIG_MESG=y

View File

@ -448,7 +448,7 @@ CONFIG_FEATURE_INIT_SCTTY=y
CONFIG_FEATURE_INIT_SYSLOG=y
CONFIG_FEATURE_EXTRA_QUIET=y
CONFIG_FEATURE_INIT_COREDUMPS=y
CONFIG_FEATURE_INITRD=y
CONFIG_LINUXRC=y
CONFIG_INIT_TERMINAL_TYPE="linux"
CONFIG_MESG=y
CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y

View File

@ -458,7 +458,7 @@ CONFIG_FEATURE_INIT_SCTTY=y
CONFIG_FEATURE_INIT_SYSLOG=y
CONFIG_FEATURE_EXTRA_QUIET=y
CONFIG_FEATURE_INIT_COREDUMPS=y
CONFIG_FEATURE_INITRD=y
CONFIG_LINUXRC=y
CONFIG_INIT_TERMINAL_TYPE="linux"
CONFIG_MESG=y
CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y

View File

@ -425,7 +425,7 @@ CONFIG_FEATURE_KILL_DELAY=0
# CONFIG_FEATURE_INIT_SYSLOG is not set
# CONFIG_FEATURE_EXTRA_QUIET is not set
# CONFIG_FEATURE_INIT_COREDUMPS is not set
# CONFIG_FEATURE_INITRD is not set
# CONFIG_LINUXRC is not set
CONFIG_INIT_TERMINAL_TYPE=""
CONFIG_MESG=y
CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y

View File

@ -422,7 +422,7 @@ CONFIG_FEATURE_KILL_DELAY=0
# CONFIG_FEATURE_INIT_SYSLOG is not set
# CONFIG_FEATURE_EXTRA_QUIET is not set
# CONFIG_FEATURE_INIT_COREDUMPS is not set
# CONFIG_FEATURE_INITRD is not set
# CONFIG_LINUXRC is not set
CONFIG_INIT_TERMINAL_TYPE=""
# CONFIG_MESG is not set

View File

@ -135,7 +135,7 @@ int halt_main(int argc UNUSED_PARAM, char **argv)
if (!(flags & 4)) { /* no -f */
//TODO: I tend to think that signalling linuxrc is wrong
// pity original author didn't comment on it...
if (ENABLE_FEATURE_INITRD) {
if (ENABLE_LINUXRC) {
/* talk to linuxrc */
/* bbox init/linuxrc assumed */
pid_t *pidlist = find_pid_by_name("linuxrc");

View File

@ -16,10 +16,21 @@
//config: help
//config: init is the first program run when the system boots.
//config:
//config:config LINUXRC
//config: bool "Support running init from within an initrd (not initramfs)"
//config: default y
//config: select FEATURE_SYSLOG
//config: help
//config: Legacy support for running init under the old-style initrd. Allows
//config: the name linuxrc to act as init, and it doesn't assume init is PID 1.
//config:
//config: This does not apply to initramfs, which runs /init as PID 1 and
//config: requires no special support.
//config:
//config:config FEATURE_USE_INITTAB
//config: bool "Support reading an inittab file"
//config: default y
//config: depends on INIT
//config: depends on INIT || LINUXRC
//config: help
//config: Allow init to read an inittab file when the system boot.
//config:
@ -46,7 +57,7 @@
//config:config FEATURE_INIT_SCTTY
//config: bool "Run commands with leading dash with controlling tty"
//config: default y
//config: depends on INIT
//config: depends on INIT || LINUXRC
//config: help
//config: If this option is enabled, init will try to give a controlling
//config: tty to any command which has leading hyphen (often it's "-/bin/sh").
@ -61,40 +72,29 @@
//config:config FEATURE_INIT_SYSLOG
//config: bool "Enable init to write to syslog"
//config: default y
//config: depends on INIT
//config: depends on INIT || LINUXRC
//config:
//config:config FEATURE_EXTRA_QUIET
//config: bool "Be _extra_ quiet on boot"
//config: default y
//config: depends on INIT
//config: depends on INIT || LINUXRC
//config: help
//config: Prevent init from logging some messages to the console during boot.
//config:
//config:config FEATURE_INIT_COREDUMPS
//config: bool "Support dumping core for child processes (debugging only)"
//config: default y
//config: depends on INIT
//config: depends on INIT || LINUXRC
//config: help
//config: If this option is enabled and the file /.init_enable_core
//config: exists, then init will call setrlimit() to allow unlimited
//config: core file sizes. If this option is disabled, processes
//config: will not generate any core files.
//config:
//config:config FEATURE_INITRD
//config: bool "Support running init from within an initrd (not initramfs)"
//config: default y
//config: depends on INIT
//config: help
//config: Legacy support for running init under the old-style initrd. Allows
//config: the name linuxrc to act as init, and it doesn't assume init is PID 1.
//config:
//config: This does not apply to initramfs, which runs /init as PID 1 and
//config: requires no special support.
//config:
//config:config INIT_TERMINAL_TYPE
//config: string "Initial terminal type"
//config: default "linux"
//config: depends on INIT
//config: depends on INIT || LINUXRC
//config: help
//config: This is the initial value set by init for the TERM environment
//config: variable. This variable is used by programs which make use of
@ -106,7 +106,7 @@
//config:config FEATURE_INIT_MODIFY_CMDLINE
//config: bool "Modify the command-line to \"init\""
//config: default y
//config: depends on INIT
//config: depends on INIT || LINUXRC
//config: help
//config: When launched as PID 1 and after parsing its arguments, init
//config: wipes all the arguments but argv[0] and rewrites argv[0] to
@ -119,9 +119,10 @@
//config: retrieved in /proc/1/cmdline on Linux, for example.
//applet:IF_INIT(APPLET(init, BB_DIR_SBIN, BB_SUID_DROP))
//applet:IF_FEATURE_INITRD(APPLET_ODDNAME(linuxrc, init, BB_DIR_ROOT, BB_SUID_DROP, linuxrc))
//applet:IF_LINUXRC(APPLET_ODDNAME(linuxrc, init, BB_DIR_ROOT, BB_SUID_DROP, linuxrc))
//kbuild:lib-$(CONFIG_INIT) += init.o
//kbuild:lib-$(CONFIG_LINUXRC) += init.o
#define DEBUG_SEGV_HANDLER 0
@ -1057,7 +1058,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
if (!DEBUG_INIT) {
/* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
if (getpid() != 1
&& (!ENABLE_FEATURE_INITRD || applet_name[0] != 'l') /* not linuxrc? */
&& (!ENABLE_LINUXRC || applet_name[0] != 'l') /* not linuxrc? */
) {
bb_error_msg_and_die("must be run as PID 1");
}