1 #!/bin/sh 2 # Usage: user-setup [ --root ] [ <mirror> ] 3 4 # Configuration: 5 if [ -e userinstall-defaults ]; then 6 . "$PWD/userinstall-defaults" 7 elif [ -e /etc/default/userinstall ]; then 8 . /etc/default/userinstall 9 else 10 echo "No defaults found for userinstall." 11 exit 1 12 fi 13 14 if [ "$1" = "--help" ]; then 15 echo "Usage: user-setup [ --root ] [ <mirror> ]" 16 echo 17 echo "Examples:" 18 echo 19 echo "user-setup" 20 echo "user-setup file:///tmp/$USERINSTALL_CODENAME/" 21 echo "user-setup http://ftp.xx.debian.org/debian/" 22 echo "user-setup --root http://ftp.xx.debian.org/debian/" 23 exit 1 24 fi 25 26 if [[ "$1" && "$1" = '--root' ]]; then 27 export AS_ROOT=' --root' 28 export MIRROR="$2" 29 else 30 export MIRROR="$1" 31 fi 32 33 if [ "$AS_ROOT" ]; then 34 debootstrap --include="gnupg,$KEYRING" "$USERINSTALL_CODENAME" "$PACKAGEROOT" "$MIRROR" 35 else 36 fakeroot fakechroot $FAKECHROOT_OPTIONS debootstrap --variant=fakechroot --include="gnupg,$KEYRING" \ 37 "$USERINSTALL_CODENAME" "$PACKAGEROOT" "$MIRROR" 38 fi 39 40 echo 41 echo "Don't forget to run the following before installing packages:" 42 echo 43 echo "user-postsetup$AS_ROOT [ <country> ]"