changeset 893:9ae3c9520bec

Split out kernel_cmdline from qemu-defaults.
author Rob Landley <rob@landley.net>
date Wed, 18 Nov 2009 21:15:19 -0600
parents a3ab17ecff3f
children 343fb4f8ffda
files sources/targets/x86_64/settings system-image.sh
diffstat 2 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/sources/targets/x86_64/settings	Wed Nov 18 19:21:03 2009 -0600
+++ b/sources/targets/x86_64/settings	Wed Nov 18 21:15:19 2009 -0600
@@ -18,5 +18,5 @@
 
 emulator_command()
 {
-  echo qemu-system-x86_64 -m 256 $(qemu_defaults "$@")
+  echo qemu-system-x86_64 $(qemu_defaults "$@")
 }
--- a/system-image.sh	Wed Nov 18 19:21:03 2009 -0600
+++ b/system-image.sh	Wed Nov 18 21:15:19 2009 -0600
@@ -173,20 +173,22 @@
 
 cleanup
 
-# Provide qemu's common command line options between architectures.  The lack
-# of ending quotes on -append is intentional, callers append more kernel
-# command line arguments and provide their own ending quote.
+# Provide qemu's common command line options between architectures.
+
+function kernel_cmdline()
+{
+  [ "$SYSIMAGE_TYPE" != "initramfs" ] &&
+    echo -n "root=/dev/$ROOT rw init=$USRDIR/sbin/init.sh "
+
+  echo -n "panic=1 PATH=\$DISTCC_PATH_PREFIX${USRDIR}/bin console=$CONSOLE"
+  echo -n " HOST=$ARCH ${KERNEL_EXTRA}\$KERNEL_EXTRA"
+}
+
 function qemu_defaults()
 {
-  if [ "$SYSIMAGE_TYPE" != "initramfs" ]
-  then
-    HDA="-hda \"$1\" "
-    APPEND="root=/dev/$ROOT rw init=$USRDIR/sbin/init.sh "
-  fi
-
-  echo "-nographic -no-reboot -kernel \"$2\" \$WITH_HDC \$WITH_HDB ${HDA}" \
-    "-append \"${APPEND}panic=1 PATH=\$DISTCC_PATH_PREFIX${USRDIR}/bin" \
-    "console=$CONSOLE \$KERNEL_EXTRA\" \$QEMU_EXTRA"
+  echo -n "-nographic -no-reboot -kernel \"$2\" \$WITH_HDC \$WITH_HDB"
+  [ "$SYSIMAGE_TYPE" != "initramfs" ] && echo -n " -hda \"$1\""
+  echo -n " -append \"$(kernel_cmdline)\" \$QEMU_EXTRA"
 }
 
 # Write out a script to call the appropriate emulator.  We split out the