aboutsummaryrefslogtreecommitdiff
path: root/toys/other/switch_root.c
AgeCommit message (Collapse)Author
2018-11-02Convert more option vars to the new (single letter) coding style.Rob Landley
2015-08-08Fix switch_root implementation.Alistair Strachan
Add the MS_MOVE of cwd to / and chroot into it. chdir is also called to ensure cwd does not point outside the chroot. The switch_root toy was also blocking any case where NEW_ROOT/init did not exist, even though NEW_INIT was a required parameter and did not have to be '/init'. Change it to handle any NEW_INIT passed as either a relative or absolute path. With this change, the switch_root toy actually works from initramfs.
2014-07-26Move DIRTREE_COMEAGAIN second callback up to when the filehandle is still ↵Rob Landley
open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
2012-11-13Reindent to two spaces per level. Remove vi: directives that haven't worked ↵Rob Landley
right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style. The actual code should be the same afterward, this is just cosmetic refactoring.
2012-10-08New build infrastructure to generate FLAG_ macros and TT alias, #define ↵Rob Landley
FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate.
2012-09-08Add switch_root and fix infrastructure to understand name "switch_root".Rob Landley