From a367e0d95b61ecee7b9ad5407637464df252bbd5 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Sat, 19 Feb 2022 21:35:03 -0800 Subject: [PATCH] pmb.chroot.mount: create /dev/fd (MR 2170) Specifically, this fixes issues with process substitution in bash in the chroot. For example, the following lines from a NetworkManager build script: ... | grep -Fx -f <(get_symbols_explicit) -v | grep -Fx -f <(get_symbols_nm) fail with: ninja: job failed: /home/pmos/build/src/NetworkManager-1.35.92/tools/create-exports-NetworkManager.sh --called-from-build /home/pmos/build/src/NetworkManager-1.35.92 grep: /dev/fd/63: No such file or directory grep: /dev/fd/63: No such file or directory --- pmb/chroot/mount.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmb/chroot/mount.py b/pmb/chroot/mount.py index d1d01305..3907ca59 100644 --- a/pmb/chroot/mount.py +++ b/pmb/chroot/mount.py @@ -72,6 +72,9 @@ def mount_dev_tmpfs(args, suffix="native"): "tmpfs", dev + "/shm"]) create_device_nodes(args, suffix) + # Setup /dev/fd as a symlink + pmb.helpers.run.root(args, ["ln", "-sf", "/proc/self/fd", f"{dev}/"]) + def mount(args, suffix="native"): # Mount tmpfs as the chroot's /dev