# HG changeset patch # User Paul Boddie # Date 1384298090 -3600 # Node ID 8219d62bde0f008317260da58ee8558840995187 # Parent 2b83ea4f8e5eaaee93f09a1371ab80c4564bc2d8 Added a root device option and tidied up the code. diff -r 2b83ea4f8e5e -r 8219d62bde0f uml-do --- a/uml-do Wed Nov 13 00:14:19 2013 +0100 +++ b/uml-do Wed Nov 13 00:14:50 2013 +0100 @@ -28,7 +28,7 @@ PROGNAME=`basename "$0"` if [ ! "$1" ] || [ "$1" = '--help' ]; then - echo "Usage: $PROGNAME [ --net ] [ --initrd ]" 1>&2 + echo "Usage: $PROGNAME [ --net ] [ --initrd [ --root ] ]" 1>&2 exit 1 fi @@ -49,13 +49,23 @@ # Test for initrd. if [ "$1" = '--initrd' ]; then + INITRD=$2 + shift 2 + if [ "$1" = '--root' ]; then + ROOTDEVICE=$2 + shift 2 + else + ROOTDEVICE=/dev/ram + fi + ISOIMAGE=$1 + INITRD_OPTIONS="initrd=$INITRD root=$ROOTDEVICE load_ramdisk=1 ubd2=$ISOIMAGE" shift 1 - INITRD_OPTIONS="initrd=$1 root=/dev/ram load_ramdisk=1 ubd2=$2" - shift 2 else INITRD_OPTIONS= fi -# Now we start the virtual machine... +# Now we start the virtual machine. +# Note that con0 is not necessarily a login console, so a login prompt may not +# appear on standard input/output. ./linux ubd0="$IMAGE" rw ubd1="$SWAPIMAGE" rw mem="$UML_MEMORY" con0=fd:0,fd:1 con=pts "$UML_NETWORKING" $INITRD_OPTIONS $*