switch_root: don't bail out when console doesn't exist
authorAndrei Gherzan <andrei@gherzan.com>
Fri, 24 Mar 2017 15:39:08 +0000 (16:39 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 24 Mar 2017 15:39:08 +0000 (16:39 +0100)
commite3b65ab43d2e2d097a4cd2ee5aa1e1606a8a0663
tree0cccd93b486de5994a8f5c998a78a85f479fadf2
parent876c121ccb479d667a1ab00d0cb2d9cb1c298e7d
switch_root: don't bail out when console doesn't exist

Busybox is very often used in initramfs at the end of which usually
there is a switch_root to the actual rootfs. There are many cases where
the console kernel argument is either just a placeholder (for example
RaspberryPi uses serial0 and serial1) or configured as null to avoid any
console messages - usually you would see such of a setup in production
environments.

Currently busybox bails out if can't open the console argument. If this
happenes in initramfs and if the console=null for example, you get in a
blind kernel panic. Avoid this by only warning instead of dying.

function                                             old     new   delta
switch_root_main                                     371     368      -3

Signed-off-by: Andrei Gherzan <andrei@gherzan.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/switch_root.c