Re: pivot_root broken in 2.6.15-rc1-mm2

From: Rob Landley
Date: Wed Nov 23 2005 - 07:03:16 EST


On Tuesday 22 November 2005 21:01, Neil Brown wrote:
> Ah, OK.
> It's just that pivot_root works in this context in 2.6.11.9, so I
> figured it was a breakage.

And if you then umount the ramfs you just pivoted, the kernel locks hard.

That was a bug.

What you're looking for is switch_root, which has variants buried in klib, or
in the current CVS version of busybox, or glued into Red Hat's weird little
multi-function ramdisk shell, and probably a few other places by now.

Rather than unmounting rootfs, it deletes everything out of it to free up the
space. (It basically does the functional equivalent of "find / -xdev | xargs
rm -rf", overmounts the old root with the new root, does a chroot, and execs
the new init out of the new root. Actually getting it right's a bit tricky,
of course. I still need to test the busybox version a whole lot more. It's
on my to-do list...)

Rob
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/