Hi ! On 05-12-2013 14:59 ChenQi <[email protected]> wrote: >I noticed that switch_root in our busybox supports an extra >option '-c DEV' which is not supported by the same command from >util-linux. According to the source file, it's used to 'reopen >stdio to DEV after switch'. > >Does anyone know why we need this option? Is there any use case >where this option is useful or maybe necessary?
You probably need to reopen stdio after switching your root. As long as you keep devices open, there are open file descriptors in the kernel and the device i-nodes on the old file system can't be deleted. Some programs do there own handling of devices and reopen stdio in the new root, other may miss this reopen step and you have to care of it for your own. In this case the -c option simplify the switch usage, as it bundles the reopen in same step as switching the root file system. -- Harald _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
