On Thu, 17 Jan 2019 11:45:00 +0000 Dmitry Monakhov <dmonakhov@xxxxxxxxxx> wrote: Hi, > From: Dmitry Monakhov <dmtrmonakhov@xxxxxxxxxxxxxx> > > It is not good idea to pass empty 'source' argument to mount(2) > because libmount complains about incorrect /proc/self/mountinfo > structure. This affect many applications such as findmnt, umount and > etc. Let's add fake source argument to sysfs mount command as we do > with all other filesystems. Yes, makes sense. > #TESTCASE_BEGIN: > ## findmount will complain like this 'findmnt: /proc/self/mountinfo: > parse error at line 4 -- ignored' echo "/bin/findmnt" > ./test.sh > ./lkvm setup init-mount-test > ./lkvm run -d init-mount-test --sandbox test.sh > rm -rf ~/.lkvm/init-mount-test > #TESTCASE_END > --- > guest/init.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/guest/init.c b/guest/init.c > index 46e3fa4..22fe765 100644 > --- a/guest/init.c > +++ b/guest/init.c > @@ -32,8 +32,8 @@ static void do_mounts(void) > { > #ifndef CONFIG_GUEST_PRE_INIT > mount("hostfs", "/host", "9p", MS_RDONLY, > "trans=virtio,version=9p2000.L"); -#endif > - mount("", "/sys", "sysfs", 0, NULL); > +#endif That adds a stray tab at the end of the line. The diff should just be the mount line. Otherwise: Reviewed-by: Andre Przywara <andre.przywara@xxxxxxx> Cheers, Andre. > + mount("sysfs", "/sys", "sysfs", 0, NULL); > mount("proc", "/proc", "proc", 0, NULL); > mount("devtmpfs", "/dev", "devtmpfs", 0, NULL); > mkdir("/dev/pts", 0755);