# HG changeset patch # User Paul Boddie # Date 1371337184 -7200 # Node ID 66a4f2ef64b492285baeb51a3c6c5cf23cf1d0a8 # Parent de10f57af91deba3f6c965cf6318b2fe02e1aaeb Added a "no filesystem" option to the script for situations where the root file will be used by an installer as a device to be partitioned and populated, instead of being treated as a single filesystem partition. diff -r de10f57af91d -r 66a4f2ef64b4 uml-make-image --- a/uml-make-image Tue Apr 30 19:41:59 2013 +0200 +++ b/uml-make-image Sun Jun 16 00:59:44 2013 +0200 @@ -26,7 +26,7 @@ fi if [ "$1" = '--help' ]; then - echo "Usage: `basename $0` [ --root ] [ --do-not-populate ] " 1>&2 + echo "Usage: `basename $0` [ --root ] [ --no-fs ] [ --do-not-populate ] " 1>&2 exit 1 fi @@ -37,6 +37,13 @@ AS_USER= fi +if [ "$1" = '--no-fs' ]; then + shift 1 + NO_FS=$1 +else + NO_FS= +fi + if [ "$1" = '--do-not-populate' ]; then shift 1 DO_NOT_POPULATE=$1 @@ -58,7 +65,7 @@ SWAPSIZE=$2 THISDIR=`dirname "$0"` -if [ ! -e "$PACKAGEROOT" ] && [ ! "$DO_NOT_POPULATE" ]; then +if [ ! -e "$PACKAGEROOT" ] && [ ! "$NO_FS" ] && [ ! "$DO_NOT_POPULATE" ]; then echo "A package root must first be made using user-setup." 1>&2 exit 1 fi @@ -68,9 +75,16 @@ exit 1 fi +# Make image files. + echo "Making the filesystem with size ${IMAGESIZE}GB..." if dd if=/dev/zero of=$IMAGE bs=1024 count=1 seek=$(($IMAGESIZE*1024*1024-1024)) ; then - mkfs.ext3 $IMAGE + + # Make a filesystem unless otherwise requested. + + if [ ! "$NO_FS" ]; then + mkfs.ext3 $IMAGE + fi else cat 1>&2 <