3 [[ -w / ]] || exec sudo "$0" "$@"
4 [[ $# -eq 0 ]] && set -- env HOME=/root /bin/bash -l
5 mounts="proc sys dev dev/pts"
14 local src=$1 dst=${2:-$1}
16 grep -sq "${chroot}/${dst}" /proc/mounts || mount --bind "/${src}" "${chroot}/${dst}"
18 for m in ${mounts} ; do
24 *x86-64*) echo x86_64;;
25 *"Intel 80386"*) echo i386;;
28 bin_dst=$(get_type bin/bash)
29 bin_src=$(get_type /bin/bash)
30 if [[ ${bin_dst} == ${bin_src} ]] ; then
33 setarch="setarch ${bin_dst}"
36 if [[ ! -L etc/mtab ]] ; then
38 ln -sf /proc/mounts etc/mtab
51 $(printf 'etc/%s ' ${etc}) \
59 unset LS_COLORS # format changes over time