summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJeff Dike <jdike@x86_64.user-mode-linux.org>2010-08-05 14:50:14 -0400
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-20 16:20:10 +0100
commit4df9f11171530ca60043504ce011f34c42e93b46 (patch)
tree81b6b7b565e7645d44d391da0bf80cf897842a34 /scripts
parent6ea1ed5f7b51b7c04e8aca29319c970846ddf1b8 (diff)
downloadpoky-4df9f11171530ca60043504ce011f34c42e93b46.tar.gz
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')
-rwxr-xr-xscripts/poky-qemu-internal24
-rw-r--r--scripts/tunctl-src/Makefile17
2 files changed, 31 insertions, 10 deletions
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal
index 8ff3add511..acb6ff50ff 100755
--- a/scripts/poky-qemu-internal
+++ b/scripts/poky-qemu-internal
@@ -92,6 +92,16 @@ if [ "$TYPE" != "nfs" -a ! -f "$HDIMAGE" ]; then
92 return 92 return
93fi 93fi
94 94
95if [ "$TYPE" = "nfs" ]; then
96 NFS_SERVER=`echo $HDIMAGE | sed 's/^\([^:]*\):.*/\1/'`
97 NFS_DIR=`echo $HDIMAGE | sed 's/^[^:]*:\(.*\)/\1/'`
98fi
99
100if [ "$NFS_SERVER" = "" ]; then
101 NFS_SERVER="192.168.7.1"
102 NFS_DIR=$HDIMAGE
103fi
104
95if [ ! -f "$ZIMAGE" ]; then 105if [ ! -f "$ZIMAGE" ]; then
96 echo "Error: Kernel image file $ZIMAGE doesn't exist" 106 echo "Error: Kernel image file $ZIMAGE doesn't exist"
97 return 107 return
@@ -107,14 +117,11 @@ if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "qemuarmv6" -o "$MACHINE" = "qemuarm
107 QEMUOPTIONS="$QEMU_NETWORK_CMD -M versatilepb -hda $HDIMAGE -no-reboot $QEMU_UI_OPTIONS" 117 QEMUOPTIONS="$QEMU_NETWORK_CMD -M versatilepb -hda $HDIMAGE -no-reboot $QEMU_UI_OPTIONS"
108 fi 118 fi
109 if [ "$TYPE" = "nfs" ]; then 119 if [ "$TYPE" = "nfs" ]; then
110 if [ "x$HDIMAGE" = "x" ]; then 120 if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
111 HDIMAGE=/srv/nfs/qemuarm
112 fi
113 if [ ! -d "$HDIMAGE" ]; then
114 echo "Error: NFS mount point $HDIMAGE doesn't exist" 121 echo "Error: NFS mount point $HDIMAGE doesn't exist"
115 return 122 return
116 fi 123 fi
117 KERNCMDLINE="root=/dev/nfs nfsroot=192.168.7.1:$HDIMAGE rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" 124 KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
118 QEMUOPTIONS="$QEMU_NETWORK_CMD -M versatilepb --no-reboot $QEMU_UI_OPTIONS" 125 QEMUOPTIONS="$QEMU_NETWORK_CMD -M versatilepb --no-reboot $QEMU_UI_OPTIONS"
119 fi 126 fi
120 if [ "$MACHINE" = "qemuarmv6" ]; then 127 if [ "$MACHINE" = "qemuarmv6" ]; then
@@ -133,14 +140,11 @@ if [ "$MACHINE" = "qemux86" ]; then
133 QEMUOPTIONS="$QEMU_NETWORK_CMD -hda $HDIMAGE $QEMU_UI_OPTIONS" 140 QEMUOPTIONS="$QEMU_NETWORK_CMD -hda $HDIMAGE $QEMU_UI_OPTIONS"
134 fi 141 fi
135 if [ "$TYPE" = "nfs" ]; then 142 if [ "$TYPE" = "nfs" ]; then
136 if [ "x$HDIMAGE" = "x" ]; then 143 if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
137 HDIMAGE=/srv/nfs/qemux86
138 fi
139 if [ ! -d "$HDIMAGE" ]; then
140 echo "Error: NFS mount point $HDIMAGE doesn't exist." 144 echo "Error: NFS mount point $HDIMAGE doesn't exist."
141 return 145 return
142 fi 146 fi
143 KERNCMDLINE="root=/dev/nfs nfsroot=192.168.7.1:$HDIMAGE rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY" 147 KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
144 QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS" 148 QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
145 fi 149 fi
146fi 150fi
diff --git a/scripts/tunctl-src/Makefile b/scripts/tunctl-src/Makefile
new file mode 100644
index 0000000000..81cab8a3cd
--- /dev/null
+++ b/scripts/tunctl-src/Makefile
@@ -0,0 +1,17 @@
1OBJS = tunctl.o
2BIN = tunctl
3CFLAGS ?= -g -Wall
4
5BIN_DIR ?= /usr/bin
6
7all : $(BIN)
8
9$(BIN) : $(OBJS)
10 $(CC) $(CFLAGS) -o $(BIN) $(OBJS)
11
12clean :
13 rm -f $(BIN) $(OBJS) *~
14
15install : $(BIN)
16 install -d $(DESTDIR)$(BIN_DIR)
17 install -s $(BIN) $(DESTDIR)$(BIN_DIR)