00-rootdev.sh: handle the case where init=/linuxrc and real_init= is not set

master v46
Fabio Erculiani 11 years ago
parent 73d56597d5
commit 93770cfff5

@ -153,13 +153,21 @@ real_root_init() {
if [ -z "${REAL_ROOT}" ] && [ "${FAKE_ROOT}" != "/dev/ram0" ]; then if [ -z "${REAL_ROOT}" ] && [ "${FAKE_ROOT}" != "/dev/ram0" ]; then
REAL_ROOT="${FAKE_ROOT}" REAL_ROOT="${FAKE_ROOT}"
fi fi
local default_init="/sbin/init"
if [ -z "${REAL_INIT}" ] && [ -z "${FAKE_INIT}" ]; then if [ -z "${REAL_INIT}" ] && [ -z "${FAKE_INIT}" ]; then
# if none of REAL_INIT and FAKE_INIT are set, default # if none of REAL_INIT and FAKE_INIT are set, default
# to /sbin/init # to ${default_init}
REAL_INIT="/sbin/init" REAL_INIT="${default_init}"
elif [ -z "${REAL_INIT}" ] && [ "${FAKE_INIT}" != "/linuxrc" ]; then elif [ -z "${REAL_INIT}" ]; then
if [ "${FAKE_INIT}" = "/linuxrc" ]; then
# if init=/linuxrc is given, ignore linuxrc
# this is for backward compatibility with very old setups
REAL_INIT="${default_init}"
else
REAL_INIT="${FAKE_INIT}" REAL_INIT="${FAKE_INIT}"
fi fi
fi
if [ -z "${REAL_ROOTFLAGS}" ]; then if [ -z "${REAL_ROOTFLAGS}" ]; then
REAL_ROOTFLAGS="${FAKE_ROOTFLAGS}" REAL_ROOTFLAGS="${FAKE_ROOTFLAGS}"
fi fi

Loading…
Cancel
Save