3 [[ -w / ]] || exec sudo "$0" "$@"
4 [[ $# -eq 0 ]] && set -- /bin/bash -l
5 mounts="proc sys dev dev/pts"
11 local src=$1 dst=${2:-$1}
13 grep -sq "${chroot}/${dst}" /proc/mounts || mount --bind "/${src}" "${chroot}/${dst}"
15 for m in ${mounts} ; do
21 *x86-64*) echo x86_64;;
22 *"Intel 80386"*) echo i386;;
25 bin_dst=$(get_type bin/bash)
26 bin_src=$(get_type /bin/bash)
27 if [[ ${bin_dst} == ${bin_src} ]] ; then
30 setarch="setarch ${bin_dst}"
33 if [[ ! -L /etc/mtab ]] ; then
35 ln -sf /proc/mounts etc/mtab
48 $(printf 'etc/%s ' ${etc}) \
49 $(printf 'root/%s ' ${root}) \
54 unset LS_COLORS # format changes over time
55 exec ${setarch} chroot "${chroot}" "$@"