Trouble getting busybox switch_root to work
The reason that switch_root
is not working on the command line is this code in busybox:
if (st.st_dev == rootdev || getpid() != 1) {
// Show usage, it says new root must be a mountpoint
// and we must be PID 1
bb_show_usage();
}
You are not PID 1, so you are falling through into this bb_show_usage
. The implication is that the switch_root
command in your initramfs init script should run switch_root
with exec
. i.e.
exec switch_root ...
The other issue with your "not found" errors is likely because the shared libraries needed by the executables are not found, because the initramfs root filesystem does not have them. If you can get switch_root
to work with exec
, then is likely the "not found" error will go away.