init: Remove use of switch_root

The proposed renaming of run-init to switch_root in klibc never happened.
switch_root is only ever provided by busybox.  We're about to add a further
dependency on run-init, so always use that.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Ben Hutchings 2016-01-17 18:57:59 +00:00
parent 425139729d
commit c6d067cc87

6
init
View File

@ -324,10 +324,6 @@ mount -n -o move /sys ${rootmnt}/sys
mount -n -o move /proc ${rootmnt}/proc
# Chain to real filesystem
if [ -z "$drop_caps" ] && command -v switch_root >/dev/null 2>&1; then
exec switch_root ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
elif command -v run-init >/dev/null 2>&1; then
exec run-init ${drop_caps} ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
fi
exec run-init ${drop_caps} ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
echo "Something went badly wrong in the initramfs."
panic "Please file a bug on initramfs-tools."