mirror of
https://github.com/clearlinux/rkt.git
synced 2026-11-26 14:10:24 +00:00
stage1: prepare-app: prepare /dev/pts for apps
Interactive containers expect /dev/pts. Also, make /dev/ptmx a symlink to /dev/pts/ptmx. See https://www.kernel.org/doc/Documentation/filesystems/devpts.txt
This commit is contained in:
@@ -56,6 +56,7 @@ int main(int argc, char *argv[])
|
||||
dir("proc", 0755),
|
||||
dir("sys", 0755),
|
||||
dir("tmp", 01777),
|
||||
dir("dev/pts", 0755),
|
||||
};
|
||||
static const char *devnodes[] = {
|
||||
"/dev/null",
|
||||
@@ -72,6 +73,7 @@ int main(int argc, char *argv[])
|
||||
"/proc",
|
||||
"/sys",
|
||||
"/dev/shm",
|
||||
"/dev/pts",
|
||||
NULL
|
||||
};
|
||||
const char *root;
|
||||
@@ -170,5 +172,11 @@ int main(int argc, char *argv[])
|
||||
"Mounting \"%s\" on \"%s\" failed", from, to);
|
||||
}
|
||||
|
||||
/* /dev/ptmx -> /dev/pts/ptmx */
|
||||
exit_if(snprintf(to, sizeof(to), "%s/dev/ptmx", root) >= sizeof(to),
|
||||
"Path too long: \"%s\"", to);
|
||||
pexit_if(symlink("/dev/pts/ptmx", to) == -1,
|
||||
"Failed to create /dev/ptmx symlink");
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user