From: Christopher M. <chr...@ya...> - 2006-10-25 17:46:06
|
--- Nix <ni...@es...> wrote: > > (switch_root is a tool in busybox that recursively deletes everything on > the same filesystem as /, as initramfses are nonswappable and anything > left there will eat memory forever. Then it chroots to the new > filesystem and exec's init. --- so look out, you'd better make sure you > still have PID 1 at that point... > Thanks for all the information about initramfs, that was a very informative post. It also looks like you may have solved a long standing mystery to me. Back when I was experimenting with the initrd process linuxrc, pivot_root, chroot, and init, I noticed that unless I invoked init with the "-i" argument, which tells init to assume it was called from the kernel to boot the system, init would always exit with an error message to the effect that it didn't know what to do. I'll bet init was doing that because it's PID was not 1, as you allude to above. So it assumed it was not being called from the kernel. Since it had no other arguments, it didn't know what to do and printed out a syntax guide. I'll have to see if I can reproduce that bug sometime and see if the PID was something other than 1. Chris Marshall |