1.1 --- a/user-postsetup Mon Mar 29 00:10:33 2010 +0200
1.2 +++ b/user-postsetup Thu Apr 15 00:44:21 2010 +0200
1.3 @@ -1,5 +1,5 @@
1.4 #!/bin/bash
1.5 -# Usage: user-postsetup [ <country> ]
1.6 +# Usage: user-postsetup [ --root ] [ <country> ]
1.7
1.8 # Configuration:
1.9 if [ -e userinstall-defaults ]; then
1.10 @@ -11,6 +11,15 @@
1.11 exit 1
1.12 fi
1.13
1.14 +if [[ $1 && $1 == '--root' ]]; then
1.15 + export AS_ROOT=' --root'
1.16 + export COUNTRY=$2
1.17 +else
1.18 + export COUNTRY=$1
1.19 +fi
1.20 +
1.21 +export THIS_DIR=`dirname $0`
1.22 +
1.23 echo "Copying host DNS configuration..."
1.24 cp /etc/resolv.conf $PACKAGEROOT/etc/
1.25
1.26 @@ -28,5 +37,25 @@
1.27 cp $USERINSTALL_CODENAME/sources.list $PACKAGEROOT/etc/apt/
1.28 else
1.29 echo "Attempting to generate a repository definition for $USERINSTALL_CODENAME."
1.30 - `dirname $0`/user-makesources $PACKAGEROOT/etc/apt/sources.list $1
1.31 + $THIS_DIR/user-makesources $PACKAGEROOT/etc/apt/sources.list $COUNTRY
1.32 +fi
1.33 +
1.34 +if [[ $AS_ROOT ]]; then
1.35 + echo "Mounting filesystems..."
1.36 + $THIS_DIR/user-do$AS_ROOT mount -t proc proc /proc
1.37 fi
1.38 +
1.39 +echo "Updating package details and upgrading..."
1.40 +$THIS_DIR/user-do$AS_ROOT apt-get update
1.41 +$THIS_DIR/user-do$AS_ROOT apt-get upgrade
1.42 +
1.43 +if [[ $AS_ROOT ]]; then
1.44 + echo "Configuring a root installation..."
1.45 + $THIS_DIR/user-do$AS_ROOT apt-get install locales console-data
1.46 + $THIS_DIR/user-do$AS_ROOT dpkg-reconfigure locales
1.47 + $THIS_DIR/user-do$AS_ROOT dpkg-reconfigure tzdata
1.48 + $THIS_DIR/user-do$AS_ROOT dpkg-reconfigure console-data
1.49 +
1.50 + echo "Unmounting filesystems..."
1.51 + $THIS_DIR/user-do$AS_ROOT umount /proc
1.52 +fi