只是一个内存里的小文件系统
int pivot_root(const char *new_root, const char *put_old);
pivot_root()
changes the root mount in the mount namespace of the calling process. More precisely, it moves the root mount to the directory put_old
and makes new_root
the new root mount. The calling process must have the CAP_SYS_ADMIN
capability in the user namespace that owns the caller's mount namespace./usr/sbin
(Kernel 的 init 选项)在 init 时多做一些事
export PATH=/bin
busybox mknod /dev/sda b 8 0
busybox mkdir -p /newroot
busybox mount -t ext2 /dev/sda /newroot
exec busybox switch_root /newroot/ /etc/init