From fcbd67c047f02052cc87f2d0dcbfde83a23921bd Mon Sep 17 00:00:00 2001 From: Scott Garman Date: Tue, 28 Sep 2010 16:23:54 -0700 Subject: poky-qemu: integrate userspace nfsroot support This is the first phase of some refactoring the poky-qemu control scripts are getting. This integrates userspace nfsroot support into poky-qemu, making runqemu-nfs obsolete. This fixes [BUGID #295] Signed-off-by: Scott Garman --- scripts/poky-qemu | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'scripts/poky-qemu') diff --git a/scripts/poky-qemu b/scripts/poky-qemu index 6fe6f5e99b..111aa15b70 100755 --- a/scripts/poky-qemu +++ b/scripts/poky-qemu @@ -20,40 +20,42 @@ if [ "x$1" = "x" ]; then MYNAME=`basename $0` - echo "Run as MACHINE=xyz $MYNAME ZIMAGE IMAGEFILE [OPTIONS]" + echo "Run as MACHINE=xyz $MYNAME KERNEL ROOTFS [OPTIONS]" echo "where:" - echo " ZIMAGE - the kernel image file to use" - echo " IMAGEFILE - the image file/location to use" - echo " (NFS booting assumed if IMAGEFILE not specified)" - echo " MACHINE=xyz - the machine name (optional, autodetected from ZIMAGE if unspecified)" + echo " KERNEL - the kernel image file to use" + echo " ROOTFS - the rootfs image file or nfsroot directory to use" +# echo " (NFS booting assumed if ROOTFS not specified)" + echo " MACHINE=xyz - the machine name (optional, autodetected from KERNEL filename if unspecified)" echo " OPTIONS - extra options to pass to QEMU" exit 1 else - ZIMAGE=$1 + KERNEL=$1 shift fi if [ "x$MACHINE" = "x" ]; then - MACHINE=`basename $ZIMAGE | sed -r -e 's#.*-([a-z]+[0-9]*)-?[0-9]*..*#\1#'` + MACHINE=`basename $KERNEL | sed -r -e 's#.*-([a-z]+[0-9\-]*)-?[0-9]*..*#\1#'` fi if [ "x$1" = "x" ]; then - TYPE="nfs" + FSTYPE="nfs" + echo "Error: NFS booting without an explicit ROOTFS path is not yet supported" + exit 1 else - TYPE="ext3" - if [ "$MACHINE" = "akita" ]; then - TYPE="jffs2" - fi - if [ "$MACHINE" = "spitz" ]; then - TYPE="ext3" - fi - if [ "$MACHINE" = "nokia800" ]; then - TYPE="jffs2" - fi - if [ "$MACHINE" = "nokia800-maemo" ]; then - TYPE="jffs2" + ROOTFS=$1 + + if [ -d "$1" ]; then + echo "$ROOTFS is a directory, assuming nfsroot" + FSTYPE="nfs" + else + FSTYPE="ext3" + EXT=${ROOTFS##.*} + if [[ "x$EXT" == "xext2" || "x$EXT" == "xext3" || + "x$EXT" == "xjffs2" ]]; then + FSTYPE=$EXT + fi + echo "Using $FSTYPE as filesytem type for $ROOTFS" fi - HDIMAGE=$1 shift fi -- cgit v1.2.3-54-g00ecf