From dbef490b034485fa30aa78d7677301e7c8d77677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D1=88=D0=BA=D0=B0724=D0=B0=D1=8F?= Date: Sat, 12 Aug 2023 06:11:17 +0300 Subject: [PATCH] common: fix unshare chroot /dev symlinks Fixes invalid symlink paths for /dev/fd, /dev/stderr, /dev/stdin, /dev/stdout in arch-chroot when run in unshare mode. Signed-off-by: Aleksandr Ksenofontov --- common | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common b/common index b6e885c..0e5ab19 100644 --- a/common +++ b/common @@ -67,10 +67,10 @@ unshare_setup() { chroot_add_mount_lazy "$1" "$1" --bind && chroot_add_mount proc "$1/proc" -t proc -o nosuid,noexec,nodev && chroot_add_mount_lazy /sys "$1/sys" --rbind && - chroot_add_link "$1/proc/self/fd" "$1/dev/fd" && - chroot_add_link "$1/proc/self/fd/0" "$1/dev/stdin" && - chroot_add_link "$1/proc/self/fd/1" "$1/dev/stdout" && - chroot_add_link "$1/proc/self/fd/2" "$1/dev/stderr" && + chroot_add_link /proc/self/fd "$1/dev/fd" && + chroot_add_link /proc/self/fd/0 "$1/dev/stdin" && + chroot_add_link /proc/self/fd/1 "$1/dev/stdout" && + chroot_add_link /proc/self/fd/2 "$1/dev/stderr" && chroot_bind_device /dev/full "$1/dev/full" && chroot_bind_device /dev/null "$1/dev/null" && chroot_bind_device /dev/random "$1/dev/random" &&