On 04/25/2012 08:28 AM, Sergey Naumov wrote:
> Hello.
> 
> Could anyone explain what is the purpose of mount move in switch_root?
>>From this answer
> (http://lists.busybox.net/pipermail/busybox/2009-June/069609.html) I
> got reasons why we need to make chroot AND chdir, but can we do it
> without mount move?

The intent was to line up the system view of the mount tree with
reality, but these days chroot() itself does some of that adjustment (it
didn't used to).

I remember testing various corner cases of this and that was needed to
get the right behavior out of _something_, but it was more than 5 years
ago. If you don't need it, you don't need it.

A quick glance at the util-linux switch root implementation shows that
they're doing the mount(MS_MOVE) too, but they could easily have copied
that from me. :)

(Am I allowed to track down the github developers who implemented some
horrible java animation for switching pages and play Weird Al's
"bohemian polka" at them in a loop until they promise to yank it out and
never do it again?  *shudder*)

> My problem is that I want to disable ability to remount root to rw by
> rsbac, but I need to call rsbac_init in initramfs after all necessary
> mounts are done, so at the time switch_root is called
> mounting/remounting of root device is prohibited. Simple chroot works,
> but I want to clean initramfs content too.

It sounds like you're saying you _don't_ want to let people do "mount
--remount,rw /", that with the current switch_root you can and with your
proposed modification you can't?

That sounds like exactly the sort of thing this would be aimed at...

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to