diff options
author | Jeff Dike <jdike@x86_64.user-mode-linux.org> | 2010-08-05 14:50:14 -0400 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-20 16:20:10 +0100 |
commit | 4df9f11171530ca60043504ce011f34c42e93b46 (patch) | |
tree | 81b6b7b565e7645d44d391da0bf80cf897842a34 /scripts/poky-qemu-internal | |
parent | 6ea1ed5f7b51b7c04e8aca29319c970846ddf1b8 (diff) | |
download | openembedded-core-4df9f11171530ca60043504ce011f34c42e93b46.tar.gz openembedded-core-4df9f11171530ca60043504ce011f34c42e93b46.tar.bz2 openembedded-core-4df9f11171530ca60043504ce011f34c42e93b46.tar.xz openembedded-core-4df9f11171530ca60043504ce011f34c42e93b46.zip |
poky-qemu-internal: Support NFS boots better
The image specification can now be in the form nfs-server:directory.
This makes it possible to nfs-boot from servers other than the host.
poky-qemu-internal will properly construct the kernel command line
given such a specification.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Diffstat (limited to 'scripts/poky-qemu-internal')
-rwxr-xr-x | scripts/poky-qemu-internal | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal index 8ff3add51..acb6ff50f 100755 --- a/scripts/poky-qemu-internal +++ b/scripts/poky-qemu-internal @@ -92,6 +92,16 @@ if [ "$TYPE" != "nfs" -a ! -f "$HDIMAGE" ]; then return fi +if [ "$TYPE" = "nfs" ]; then + NFS_SERVER=`echo $HDIMAGE | sed 's/^\([^:]*\):.*/\1/'` + NFS_DIR=`echo $HDIMAGE | sed 's/^[^:]*:\(.*\)/\1/'` +fi + +if [ "$NFS_SERVER" = "" ]; then + NFS_SERVER="192.168.7.1" + NFS_DIR=$HDIMAGE +fi + if [ ! -f "$ZIMAGE" ]; then echo "Error: Kernel image file $ZIMAGE doesn't exist" return @@ -107,14 +117,11 @@ if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "qemuarmv6" -o "$MACHINE" = "qemuarm QEMUOPTIONS="$QEMU_NETWORK_CMD -M versatilepb -hda $HDIMAGE -no-reboot $QEMU_UI_OPTIONS" fi if [ "$TYPE" = "nfs" ]; then - if [ "x$HDIMAGE" = "x" ]; then - HDIMAGE=/srv/nfs/qemuarm - fi - if [ ! -d "$HDIMAGE" ]; then + if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then echo "Error: NFS mount point $HDIMAGE doesn't exist" return fi - KERNCMDLINE="root=/dev/nfs nfsroot=192.168.7.1:$HDIMAGE rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" + KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" QEMUOPTIONS="$QEMU_NETWORK_CMD -M versatilepb --no-reboot $QEMU_UI_OPTIONS" fi if [ "$MACHINE" = "qemuarmv6" ]; then @@ -133,14 +140,11 @@ if [ "$MACHINE" = "qemux86" ]; then QEMUOPTIONS="$QEMU_NETWORK_CMD -hda $HDIMAGE $QEMU_UI_OPTIONS" fi if [ "$TYPE" = "nfs" ]; then - if [ "x$HDIMAGE" = "x" ]; then - HDIMAGE=/srv/nfs/qemux86 - fi - if [ ! -d "$HDIMAGE" ]; then + if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then echo "Error: NFS mount point $HDIMAGE doesn't exist." return fi - KERNCMDLINE="root=/dev/nfs nfsroot=192.168.7.1:$HDIMAGE rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" + KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS" fi fi |