linuxrc: fix check against REAL_INIT and FAKE_INIT

Prioritize the latter (init=) if it's set and no real_init= is set.
This, while keeping backward compatibility, makes possible to
directly use init= to boot the preferred init system.
master
Fabio Erculiani 11 years ago
parent 8dd6215099
commit ac5324d3f0

@ -153,7 +153,11 @@ real_root_init() {
if [ -z "${REAL_ROOT}" ] && [ "${FAKE_ROOT}" != "/dev/ram0" ]; then
REAL_ROOT="${FAKE_ROOT}"
fi
if [ -z "${REAL_INIT}" ] && [ "${FAKE_INIT}" != "/linuxrc" ]; then
if [ -z "${REAL_INIT}" ] && [ -z "${FAKE_INIT}" ]; then
# if none of REAL_INIT and FAKE_INIT is set, default
# to /sbin/init
REAL_INIT="/sbin/init"
elif [ -z "${REAL_INIT}" ] && [ "${FAKE_INIT}" != "/linuxrc" ]; then
REAL_INIT="${FAKE_INIT}"
fi
if [ -z "${REAL_ROOTFLAGS}" ]; then

@ -31,7 +31,7 @@ PATH="${PATH}:/sbin:/usr/sbin"
CMDLINE=$(cat /proc/cmdline)
FAKE_ROOT=""
FAKE_INIT=""
REAL_INIT="/sbin/init"
REAL_INIT=""
FAKE_ROOTFLAGS=""
INIT_OPTS=""
CRYPT_SILENT=0

Loading…
Cancel
Save