Fix switch_root implementation.

Add the MS_MOVE of cwd to / and chroot into it. chdir is also
called to ensure cwd does not point outside the chroot.

The switch_root toy was also blocking any case where NEW_ROOT/init
did not exist, even though NEW_INIT was a required parameter and
did not have to be '/init'. Change it to handle any NEW_INIT
passed as either a relative or absolute path.

With this change, the switch_root toy actually works from initramfs.
1 file changed