diff options
author | Scott Garman <scott.a.garman@intel.com> | 2010-09-28 16:23:54 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-07 19:51:36 +0100 |
commit | fcbd67c047f02052cc87f2d0dcbfde83a23921bd (patch) | |
tree | 6ab238d5ff5e4a23ab585afb8cd89c5c0466e971 /scripts/poky-qemu | |
parent | c8a181e847660bb9d7faedad0bed7d05afbe8103 (diff) | |
download | openembedded-core-fcbd67c047f02052cc87f2d0dcbfde83a23921bd.tar.gz openembedded-core-fcbd67c047f02052cc87f2d0dcbfde83a23921bd.tar.bz2 openembedded-core-fcbd67c047f02052cc87f2d0dcbfde83a23921bd.zip |
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 <scott.a.garman@intel.com>
Diffstat (limited to 'scripts/poky-qemu')
-rwxr-xr-x | scripts/poky-qemu | 44 |
1 files changed, 23 insertions, 21 deletions
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 |