On Wed, May 30, 2007 at 12:19:51PM +0200, Gabor HALASZ wrote:
> Amikor utoljara neztem, meg nem torolte semmi.
klibc forras, usr/kinit/run-init/runinitlib.c:
/* Delete rootfs contents */
if (nuke_dir("/"))
return "nuking initramfs contents";
/* Overmount the root */
if (mount(".", "/", NULL, MS_MOVE, NULL))
return "overmounting root";
busybox forras, util_linux/switch_root.c:
// Zap everything out of rootdev
delete_contents("/");
// Overmount / with newdir and chroot into it. The chdir is needed to
// recalculate "." and ".." links.
if (mount(".", "/", NULL, MS_MOVE, NULL) || chroot(".") || chdir("/"))
bb_error_msg_and_die("moving root");
Gabor
--
---------------------------------------------------------
MTA SZTAKI Computer and Automation Research Institute
Hungarian Academy of Sciences
---------------------------------------------------------
_________________________________________________
linux lista - [email protected]
http://mlf2.linux.rulez.org/mailman/listinfo/linux