Skip to content

Commit

Permalink
common: fix unshare chroot /dev symlinks
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
new-sashok724 authored and Сашка724ая committed Sep 5, 2023
1 parent a5b772d commit dbef490
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions common
Original file line number Diff line number Diff line change
Expand Up @@ -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" &&
Expand Down

0 comments on commit dbef490

Please sign in to comment.