commit | 430bf378418e655b06d518a7cd62ae680301af80 | [log] [tgz] |
---|---|---|
author | Alistair Strachan <alistair.strachan@imgtec.com> | Wed May 06 15:20:19 2015 -0700 |
committer | Rob Landley <rob@landley.net> | Sat Aug 08 16:57:30 2015 -0500 |
tree | ad5a0364976f57f7210d59f73f0f5b8eb9084b25 | |
parent | 5fb2766a9b51ee326a14ec9909066b20a2bfa9ac [diff] |
Fix switch_root implementation. 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.