poky-qemu 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. # Handle running Poky images standalone with QEMU
  3. #
  4. # Copyright (C) 2006-2007 OpenedHand Ltd.
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License version 2 as
  8. # published by the Free Software Foundation.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License along
  16. # with this program; if not, write to the Free Software Foundation, Inc.,
  17. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. if [ "x$1" = "x" ]; then
  19. MYNAME=`basename $0`
  20. echo "Run as MACHINE=xyz $MYNAME ZIMAGE IMAGEFILE"
  21. echo "where:"
  22. echo " ZIMAGE - the kernel image file to use"
  23. echo " IMAGEFILE - the image file/location to use"
  24. echo " (NFS booting assumed if IMAGEFILE not specified)"
  25. echo " MACHINE=xyz - the machine name (optional, autodetected from ZIMAGE if unspecified)"
  26. exit 1
  27. else
  28. ZIMAGE=$1
  29. fi
  30. if [ "x$MACHINE" = "x" ]; then
  31. MACHINE=`basename $ZIMAGE | sed -r -e 's#.*-([a-z]+[0-9]*)-?[0-9]*..*#\1#'`
  32. fi
  33. if [ "x$2" = "x" ]; then
  34. TYPE="nfs"
  35. else
  36. TYPE="ext2"
  37. if [ "$MACHINE" = "akita" ]; then
  38. TYPE="jffs2"
  39. fi
  40. if [ "$MACHINE" = "spitz" ]; then
  41. TYPE="ext3"
  42. fi
  43. HDIMAGE=$2
  44. fi
  45. INTERNAL_SCRIPT=`which poky-qemu-internal`
  46. . $INTERNAL_SCRIPT