未验证 提交 3c55c9b2 编写于 作者: O openharmony_ci 提交者: Gitee

!2147 【weekly】挂载/mnt为MS_SLAVE,/mnt/data为MS_SHARED

Merge pull request !2147 from 张凯祥/cherry-pick-1690197087
......@@ -34,7 +34,16 @@ void MountBasicFs(void)
if (mount("tmpfs", "/mnt", "tmpfs", MS_NOSUID, "mode=0755") != 0) {
INIT_LOGE("Mount tmpfs failed. %s", strerror(errno));
}
if (mount(NULL, "/mnt", NULL, MS_SHARED, NULL) != 0) {
if (mount(NULL, "/mnt", NULL, MS_SLAVE, NULL) != 0) {
INIT_LOGE("Mount tmpfs slave failed. %s", strerror(errno));
}
if (mkdir("/mnt/data", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) {
INIT_LOGE("mkdir /mnt/data failed. %s", strerror(errno));
}
if (mount("tmpfs", "/mnt/data", "tmpfs", MS_NOSUID, "mode=0755") != 0) {
INIT_LOGE("Mount tmpfs failed. %s", strerror(errno));
}
if (mount(NULL, "/mnt/data", NULL, MS_SHARED, NULL) != 0) {
INIT_LOGE("Mount tmpfs shared failed. %s", strerror(errno));
}
if (mount("tmpfs", "/storage", "tmpfs", MS_NOEXEC | MS_NODEV| MS_NOSUID, "mode=0755") != 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册