1.1 --- a/TO_DO.txt Fri Apr 13 00:16:46 2012 +0200
1.2 +++ b/TO_DO.txt Mon May 07 00:32:42 2012 +0200
1.3 @@ -4,9 +4,11 @@
1.4
1.5 Support "full" installations by installing kernels and configuring various
1.6 things including timezones and locales, and setting up the bootloader.
1.7 +
1.8 +Support first stage debootstrap followed by second stage debootstrap in UML.
1.9 +
1.10 Complete the UML configuration to provide X capabilities and a proper network
1.11 -interfaces file.
1.12 -Use install-guest.sh and xephyr-guest.sh from UMLconfig.
1.13 +interfaces file. Use install-guest.sh and xephyr-guest.sh from UMLconfig.
1.14
1.15 Resizing UML images (perhaps better with a smaller block size):
1.16
2.1 --- a/user-do-root Fri Apr 13 00:16:46 2012 +0200
2.2 +++ b/user-do-root Mon May 07 00:32:42 2012 +0200
2.3 @@ -10,26 +10,46 @@
2.4 exit 1
2.5 fi
2.6
2.7 +# Root installations benefit from having the proc and sys filesystems mounted.
2.8 +
2.9 mount -o bind /proc "$PACKAGEROOT/proc"
2.10 mount -o bind /sys "$PACKAGEROOT/sys"
2.11 +
2.12 if [ "$1" = '--dev' ]; then
2.13 DEV=$1
2.14 shift 1
2.15 - if [ -e "$PACKAGEROOT/dev.orig" ]; then
2.16 - echo "Devices may already be defined for the installation." 1>&2
2.17 +
2.18 + # Backup any existing device directory.
2.19 +
2.20 + if [ ! -e "$PACKAGEROOT/dev.orig" ] && [ -e "$PACKAGEROOT/dev" ]; then
2.21 + mv "$PACKAGEROOT/dev" "$PACKAGEROOT/dev.orig"
2.22 + fi
2.23 +
2.24 + # Make an empty device directory if appropriate.
2.25 +
2.26 + if [ ! -e "$PACKAGEROOT/dev" ] || rmdir "$PACKAGEROOT/dev" ; then
2.27 + mkdir "$PACKAGEROOT/dev"
2.28 + mount -o bind /dev "$PACKAGEROOT/dev"
2.29 else
2.30 - if [ -e "$PACKAGEROOT/dev" ]; then
2.31 - mv "$PACKAGEROOT/dev" "$PACKAGEROOT/dev.orig"
2.32 - fi
2.33 - if [ ! -e "$PACKAGEROOT/dev" ]; then
2.34 - mkdir "$PACKAGEROOT/dev"
2.35 - fi
2.36 - mount -o bind /dev "$PACKAGEROOT/dev"
2.37 + echo "Devices may already be defined for the installation." 1>&2
2.38 fi
2.39 +elif [ ! -e "$PACKAGEROOT/dev" ]; then
2.40 + echo 1>&2 <<EOF
2.41 +Devices are not defined for the installation.
2.42 +To mount the host system's devices, use the --dev option.
2.43 +EOF
2.44 + exit 1
2.45 fi
2.46 +
2.47 +# Enter the installation.
2.48 +
2.49 chroot "$PACKAGEROOT" $*
2.50 +
2.51 +# Unmount the filesystems.
2.52 +
2.53 umount "$PACKAGEROOT/proc"
2.54 umount "$PACKAGEROOT/sys"
2.55 +
2.56 if [ "$DEV" ]; then
2.57 umount "$PACKAGEROOT/dev" && rmdir "$PACKAGEROOT/dev"
2.58 if [ -e "$PACKAGEROOT/dev.orig" ] && [ ! -e "$PACKAGEROOT/dev" ]; then
3.1 --- a/user-postsetup Fri Apr 13 00:16:46 2012 +0200
3.2 +++ b/user-postsetup Mon May 07 00:32:42 2012 +0200
3.3 @@ -38,32 +38,30 @@
3.4 "$AS_USER" cp /etc/network/interfaces "$PACKAGEROOT/etc/network/"
3.5
3.6 echo "Copying package repository configuration..." 1>&2
3.7 +
3.8 +# For installations of the same distribution, copy the host's sources list.
3.9 +
3.10 if [ "$USERINSTALL_CODENAME" = "$DISTRIB_CODENAME" ]; then
3.11 "$AS_USER" cp /etc/apt/sources.list "$PACKAGEROOT/etc/apt/"
3.12 -elif [ -e "$USERINSTALL_CODENAME/sources.list" ]; then
3.13 - "$AS_USER" cp "$USERINSTALL_CODENAME/sources.list" "$PACKAGEROOT/etc/apt/"
3.14 +
3.15 +# Otherwise, attempt to make a new sources list.
3.16 +
3.17 else
3.18 echo "Attempting to generate a repository definition for $USERINSTALL_CODENAME." 1>&2
3.19 "$AS_USER" USERINSTALL_ID="$USERINSTALL_ID" USERINSTALL_CODENAME="$USERINSTALL_CODENAME" \
3.20 "$THIS_DIR/user-makesources" "$PACKAGEROOT/etc/apt/sources.list" "$COUNTRY"
3.21 fi
3.22
3.23 -if [ "$AS_ROOT" ]; then
3.24 - echo "Mounting filesystems..." 1>&2
3.25 - "$THIS_DIR/user-do" $AS_ROOT mount -t proc proc /proc
3.26 -fi
3.27 -
3.28 echo "Updating package details and upgrading..." 1>&2
3.29 "$THIS_DIR/user-do" $AS_ROOT apt-get update
3.30 "$THIS_DIR/user-do" $AS_ROOT apt-get upgrade
3.31
3.32 +# Root installations also need further configuration.
3.33 +
3.34 if [ "$AS_ROOT" ]; then
3.35 echo "Configuring a root installation..." 1>&2
3.36 "$THIS_DIR/user-do" $AS_ROOT apt-get install locales console-data
3.37 "$THIS_DIR/user-do" $AS_ROOT dpkg-reconfigure locales
3.38 "$THIS_DIR/user-do" $AS_ROOT dpkg-reconfigure tzdata
3.39 "$THIS_DIR/user-do" $AS_ROOT dpkg-reconfigure console-data
3.40 -
3.41 - echo "Unmounting filesystems..." 1>&2
3.42 - "$THIS_DIR/user-do" $AS_ROOT umount /proc
3.43 fi