# HG changeset patch # User Paul Boddie # Date 1336343562 -7200 # Node ID b6d822c0302f1bcdf9f3eb7b4b545fa1dd1fbb66 # Parent e4ddc7ff375848d75a63a83b5575ccfb5c7edc95 Removed superfluous and non-functioning mount-related commands from the postsetup script, along with an attempt at copying sources lists from special distribution-specific directories. Attempted to tidy up device directory handling for user-do-root, making an empty dev directory where one is missing in --dev mode, and exiting if no dev directory is present in normal mode. Added some comments to the scripts and updated the "to do" items. diff -r e4ddc7ff3758 -r b6d822c0302f TO_DO.txt --- a/TO_DO.txt Fri Apr 13 00:16:46 2012 +0200 +++ b/TO_DO.txt Mon May 07 00:32:42 2012 +0200 @@ -4,9 +4,11 @@ Support "full" installations by installing kernels and configuring various things including timezones and locales, and setting up the bootloader. + +Support first stage debootstrap followed by second stage debootstrap in UML. + Complete the UML configuration to provide X capabilities and a proper network -interfaces file. -Use install-guest.sh and xephyr-guest.sh from UMLconfig. +interfaces file. Use install-guest.sh and xephyr-guest.sh from UMLconfig. Resizing UML images (perhaps better with a smaller block size): diff -r e4ddc7ff3758 -r b6d822c0302f user-do-root --- a/user-do-root Fri Apr 13 00:16:46 2012 +0200 +++ b/user-do-root Mon May 07 00:32:42 2012 +0200 @@ -10,26 +10,46 @@ exit 1 fi +# Root installations benefit from having the proc and sys filesystems mounted. + mount -o bind /proc "$PACKAGEROOT/proc" mount -o bind /sys "$PACKAGEROOT/sys" + if [ "$1" = '--dev' ]; then DEV=$1 shift 1 - if [ -e "$PACKAGEROOT/dev.orig" ]; then - echo "Devices may already be defined for the installation." 1>&2 + + # Backup any existing device directory. + + if [ ! -e "$PACKAGEROOT/dev.orig" ] && [ -e "$PACKAGEROOT/dev" ]; then + mv "$PACKAGEROOT/dev" "$PACKAGEROOT/dev.orig" + fi + + # Make an empty device directory if appropriate. + + if [ ! -e "$PACKAGEROOT/dev" ] || rmdir "$PACKAGEROOT/dev" ; then + mkdir "$PACKAGEROOT/dev" + mount -o bind /dev "$PACKAGEROOT/dev" else - if [ -e "$PACKAGEROOT/dev" ]; then - mv "$PACKAGEROOT/dev" "$PACKAGEROOT/dev.orig" - fi - if [ ! -e "$PACKAGEROOT/dev" ]; then - mkdir "$PACKAGEROOT/dev" - fi - mount -o bind /dev "$PACKAGEROOT/dev" + echo "Devices may already be defined for the installation." 1>&2 fi +elif [ ! -e "$PACKAGEROOT/dev" ]; then + echo 1>&2 <&2 + +# For installations of the same distribution, copy the host's sources list. + if [ "$USERINSTALL_CODENAME" = "$DISTRIB_CODENAME" ]; then "$AS_USER" cp /etc/apt/sources.list "$PACKAGEROOT/etc/apt/" -elif [ -e "$USERINSTALL_CODENAME/sources.list" ]; then - "$AS_USER" cp "$USERINSTALL_CODENAME/sources.list" "$PACKAGEROOT/etc/apt/" + +# Otherwise, attempt to make a new sources list. + else echo "Attempting to generate a repository definition for $USERINSTALL_CODENAME." 1>&2 "$AS_USER" USERINSTALL_ID="$USERINSTALL_ID" USERINSTALL_CODENAME="$USERINSTALL_CODENAME" \ "$THIS_DIR/user-makesources" "$PACKAGEROOT/etc/apt/sources.list" "$COUNTRY" fi -if [ "$AS_ROOT" ]; then - echo "Mounting filesystems..." 1>&2 - "$THIS_DIR/user-do" $AS_ROOT mount -t proc proc /proc -fi - echo "Updating package details and upgrading..." 1>&2 "$THIS_DIR/user-do" $AS_ROOT apt-get update "$THIS_DIR/user-do" $AS_ROOT apt-get upgrade +# Root installations also need further configuration. + if [ "$AS_ROOT" ]; then echo "Configuring a root installation..." 1>&2 "$THIS_DIR/user-do" $AS_ROOT apt-get install locales console-data "$THIS_DIR/user-do" $AS_ROOT dpkg-reconfigure locales "$THIS_DIR/user-do" $AS_ROOT dpkg-reconfigure tzdata "$THIS_DIR/user-do" $AS_ROOT dpkg-reconfigure console-data - - echo "Unmounting filesystems..." 1>&2 - "$THIS_DIR/user-do" $AS_ROOT umount /proc fi