devprocsys.sh (337B)
1 #!/bin/sh 2 set -e 3 4 [ -n "$2" ] || exit 1 5 6 case "$1" in 7 mount) 8 mkdir -p "$2/dev" "$2/proc" "$2/sys" 9 mount --types proc /proc "$2/proc" 10 mount --rbind /sys "$2/sys" 11 mount --make-rslave "$2/sys" 12 mount --rbind /dev "$2/dev" 13 mount --make-rslave "$2/dev" 14 exit 0 15 ;; 16 umount) 17 umount -R "$2/dev" "$2/proc" "$2/sys" 18 exit 0 19 ;; 20 esac 21 22 exit 1