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 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="" 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 # 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="" 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 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="" 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 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 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 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 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 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 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 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 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 # 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 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 # 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 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) 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"); 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 @@ //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"); }