Re: switch_root

From: Laurent Bercot <>
Date: Wed, 16 Oct 2013 20:55:08 +0100

> The reason you can't do this in a shell script is after the "rm -rf" step,
> the shell script hasn't got a "mount" command to run anymore...

  That's my point: switch_root is ugly.
  The way it's implemented in C isn't any less ugly: it's duplicating the
relevant part of the rm -rf code in the switch_root utility itself.
  What Rob is forgetting is that you have access to another filesystem
under newroot/ and that filesystem may - and should - have utilities
that allow you to complete the task, if you know the path to call them.
And if it does not, then you can do what I did: create a tmpfs under
newroot/, dump all the static binaries you need into it, and call them
from here. There's really nothing serious preventing you from implementing
switch_root as a script.

Received on Wed Oct 16 2013 - 19:55:08 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC