-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/zdtm: mount a new tmpfs to the zdtm root /dev
The current file system can be mounted with nodev. Fixes #2441 Signed-off-by: Andrei Vagin <avagin@google.com>
- Loading branch information
Showing
3 changed files
with
62 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ extern int pivot_root(const char *new_root, const char *put_old); | |
static int prepare_mntns(void) | ||
{ | ||
int dfd, ret; | ||
char *root, *criu_path; | ||
char *root, *criu_path, *dev_path; | ||
char path[PATH_MAX]; | ||
|
||
root = getenv("ZDTM_ROOT"); | ||
|
@@ -51,6 +51,19 @@ static int prepare_mntns(void) | |
return -1; | ||
} | ||
|
||
dev_path = getenv("ZDTM_DEV"); | ||
if (dev_path) { | ||
snprintf(path, sizeof(path), "%s/dev", root); | ||
if (mount(dev_path, path, NULL, MS_BIND, NULL)) { | ||
pr_perror("Unable to mount %s", path); | ||
Check warning on line 58 in test/zdtm/lib/ns.c GitHub Actions / build
|
||
return -1; | ||
} | ||
if (mount(NULL, path, NULL, MS_PRIVATE, NULL)) { | ||
pr_perror("Unable to mount %s", path); | ||
return -1; | ||
} | ||
} | ||
|
||
criu_path = getenv("ZDTM_CRIU"); | ||
if (criu_path) { | ||
snprintf(path, sizeof(path), "%s%s", root, criu_path); | ||
|