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:
Iago López Galeiras
2015-03-23 12:58:57 +01:00
parent 7e125c03ec
commit ba2b1f52d9
+8
View File
@@ -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;
}