1 #!/bin/bash 2 # Usage: user-enter [ --root ] [ <command and options> ] 3 4 # Configuration: 5 if [ -e userinstall-defaults ]; then 6 source userinstall-defaults 7 elif [ -e /etc/default/userinstall ]; then 8 source /etc/default/userinstall 9 else 10 echo "No defaults found for userinstall." 11 exit 1 12 fi 13 14 if [[ $1 == '--root' ]]; then 15 shift 1 16 mount -o bind /proc $PACKAGEROOT/proc 17 mount -o bind /sys $PACKAGEROOT/sys 18 chroot $PACKAGEROOT $* 19 umount $PACKAGEROOT/proc 20 umount $PACKAGEROOT/sys 21 else 22 fakeroot fakechroot $FAKECHROOT_OPTIONS chroot $PACKAGEROOT $* 23 fi