mcexec: support for /sys mounted by mcoverlayfs

This commit is contained in:
Yoichi Umezawa
2016-02-08 11:36:03 +09:00
parent e601248bdc
commit 0ce698eb1f
2 changed files with 24 additions and 0 deletions

View File

@@ -1304,6 +1304,7 @@ int main(int argc, char **argv)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
__dprintf("mcoverlay enable\n");
char mcos_procdir[PATH_MAX];
char mcos_sysdir[PATH_MAX];
error = isunshare();
if (error == 0) {
@@ -1319,6 +1320,13 @@ int main(int argc, char **argv)
strerror(errno));
return 1;
}
sprintf(mcos_sysdir, "/tmp/mcos/mcos%d_sys", mcosid);
if (mount(mcos_sysdir, "/sys", NULL, MS_BIND, NULL)) {
fprintf(stderr, "Error: Failed to mount. (%s)\n",
strerror(errno));
return 1;
}
} else if (error == -1) {
return 1;
}