#!/bin/sh 
#150618 sfs
[ ! "$1" ] && echo "Use $0 chroot-dir" && exit
[ -f "$1/etc/pacman.conf" ] && sed -i 's/CheckSpace/#CheckSpace/g' "$1/etc/pacman.conf"
chroot="$1"
[ "$1" ] || exit
mkdir -p "$chroot"/proc 
mkdir -p "$chroot"/sys
mkdir -p "$chroot"/dev
 mount -t proc none "$chroot"/proc
 mount -t sysfs none "$chroot"/sys
 mount -o bind /dev "$chroot"/dev
 mount -o bind /dev/pts "$chroot"/dev/pts # important for pacman (for signature check)
# Now everything is prepared to chroot into your newly installed Arch environment 
 chroot "$chroot" bash

umount "$chroot"/proc
umount "$chroot"/dev/pts
umount "$chroot"/dev
umount "$chroot"/sys
#umount "$chroot"/pr
[ -f "$1/etc/pacman.conf" ] && sed -i 's/#CheckSpace/CheckSpace/g' "$1/etc/pacman.conf"
