linux-container: Mount a new /dev/pts instance in the container.

Fixes <https://bugs.gnu.org/36463>.
Reported by Steffen Rytter Postas <nc@scalehost.eu>.

* gnu/build/linux-container.scm (mount-file-systems): When /dev/ptmx
exists on the host, explicitly mount a new instance of devpts and make
/dev/ptmx a symlink to /dev/pts/ptmx.
This commit is contained in:
Ludovic Courtès 2019-07-06 00:18:18 +02:00
parent c356e5f7a0
commit 935e79af61
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 6 additions and 1 deletions

View File

@ -130,9 +130,14 @@ for the process."
"/dev/random" "/dev/random"
"/dev/urandom" "/dev/urandom"
"/dev/tty" "/dev/tty"
"/dev/ptmx"
"/dev/fuse")) "/dev/fuse"))
;; Mount a new devpts instance on /dev/pts.
(when (file-exists? "/dev/ptmx")
(mount* "none" (scope "/dev/pts") "devpts" 0
"newinstance,mode=0620")
(symlink "/dev/pts/ptmx" (scope "/dev/ptmx")))
;; Setup the container's /dev/console by bind mounting the pseudo-terminal ;; Setup the container's /dev/console by bind mounting the pseudo-terminal
;; associated with standard input when there is one. ;; associated with standard input when there is one.
(let* ((in (current-input-port)) (let* ((in (current-input-port))