Mount a few missing device nodes in chroot bootstrap modes

The gap between the chroot and non-chroot bootstrap modes started in,
7ecad37 because BuildStream's sandbox was missing some device nodes.

With the latest version of buildbox-run-bubblewrap, a few of the
missing devices were made available to BuildStream's sandbox and
there is no longer a need to keep this gap. In fact, compatibilty
with newer BuildStream versions now requires these devices to be
present.

This change also partially reverts d0a5221, which had to remove
/dev/ptmx as a consequence of the aforementioned gap.
This commit is contained in:
Dor Askayo 2023-07-15 11:54:22 +03:00
parent b3ffe8bb19
commit 2227a2053a
3 changed files with 16 additions and 10 deletions

View file

@ -472,12 +472,14 @@ populate_device_nodes() {
test -c "/dev/random" || mknod -m 444 "/dev/random" c 1 8
test -c "/dev/urandom" || mknod -m 444 "/dev/urandom" c 1 9
test -c "/dev/ptmx" || mknod -m 666 "/dev/ptmx" c 5 2
test -c "/dev/tty" || mknod -m 666 "/dev/tty" c 5 0
if command -v mount >/dev/null 2>&1; then
test -d "/dev/shm" || (mkdir /dev/shm && mount -t tmpfs tmpfs /dev/shm)
fi
if [ "${CHROOT}" = False ]; then
test -c "/dev/tty" || mknod -m 666 "/dev/tty" c 5 0
test -c "/dev/console" || mknod -m 666 "/dev/console" c 5 1
fi
}