1.1 --- a/uml-make-image Tue Apr 30 19:41:59 2013 +0200
1.2 +++ b/uml-make-image Sun Jun 16 00:59:44 2013 +0200
1.3 @@ -26,7 +26,7 @@
1.4 fi
1.5
1.6 if [ "$1" = '--help' ]; then
1.7 - echo "Usage: `basename $0` [ --root ] [ --do-not-populate ] <root image size in GB> <swap image size in MB>" 1>&2
1.8 + echo "Usage: `basename $0` [ --root ] [ --no-fs ] [ --do-not-populate ] <root image size in GB> <swap image size in MB>" 1>&2
1.9 exit 1
1.10 fi
1.11
1.12 @@ -37,6 +37,13 @@
1.13 AS_USER=
1.14 fi
1.15
1.16 +if [ "$1" = '--no-fs' ]; then
1.17 + shift 1
1.18 + NO_FS=$1
1.19 +else
1.20 + NO_FS=
1.21 +fi
1.22 +
1.23 if [ "$1" = '--do-not-populate' ]; then
1.24 shift 1
1.25 DO_NOT_POPULATE=$1
1.26 @@ -58,7 +65,7 @@
1.27 SWAPSIZE=$2
1.28 THISDIR=`dirname "$0"`
1.29
1.30 -if [ ! -e "$PACKAGEROOT" ] && [ ! "$DO_NOT_POPULATE" ]; then
1.31 +if [ ! -e "$PACKAGEROOT" ] && [ ! "$NO_FS" ] && [ ! "$DO_NOT_POPULATE" ]; then
1.32 echo "A package root must first be made using user-setup." 1>&2
1.33 exit 1
1.34 fi
1.35 @@ -68,9 +75,16 @@
1.36 exit 1
1.37 fi
1.38
1.39 +# Make image files.
1.40 +
1.41 echo "Making the filesystem with size ${IMAGESIZE}GB..."
1.42 if dd if=/dev/zero of=$IMAGE bs=1024 count=1 seek=$(($IMAGESIZE*1024*1024-1024)) ; then
1.43 - mkfs.ext3 $IMAGE
1.44 +
1.45 + # Make a filesystem unless otherwise requested.
1.46 +
1.47 + if [ ! "$NO_FS" ]; then
1.48 + mkfs.ext3 $IMAGE
1.49 + fi
1.50 else
1.51 cat 1>&2 <<EOF
1.52 Unable to create an image file for the root partition.
1.53 @@ -90,7 +104,7 @@
1.54
1.55 # Image population activities.
1.56
1.57 -if [ ! "$DO_NOT_POPULATE" ]; then
1.58 +if [ ! "$DO_NOT_POPULATE" ] && [ ! "$NO_FS" ]; then
1.59 $AS_USER "$THISDIR/uml-access-image" "$THISDIR/uml-populate-image"
1.60 $AS_USER "$THISDIR/uml-access-image" "$THISDIR/uml-make-network"
1.61 fi