switch_root: zap the last directory for the mount point of new-root

阿保 純一 abo_junghichi at yahoo.co.jp
Sat Aug 10 11:08:39 UTC 2019


On Fri, 2 Aug 2019 22:40:01 +0800
Kang-Che Sung <explorer09 at gmail.com> wrote:

> What I suggested is to remove these lines:
> 
> if (st.st_dev == rootdev) {
> // Show usage, it says new root must be a mountpoint
> bb_show_usage();
> }
> 
> Because mount(..., MS_MOVE) will do the same check before moving the mount
> point, and the check would be done before deleting anything if your patch
> is applied. (And there is no point to show the program usage when it's
> already PID 1. You would rather see error message of what specifically goes
> wrong. The kernel will panic when PID 1 dies, leaving you no option but
> reboot.)

Thank you for your suggestion.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 967 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20190810/8835a7c1/attachment.obj>


More information about the busybox mailing list