# HG changeset patch # User Rob Landley # Date 1268729923 18000 # Node ID 6a6a9e8de6efc09c64a844a55d4a7ab2d82daa76 # Parent 4bd1bc15a744763a6cd63504db2a6c95fc6b9115 Finish previous commit: fix HDB and HDC and make run_emulator() a function. (And finally, if you say DEBUG=1 you get the emulator command output! Yay!) diff -r 4bd1bc15a744 -r 6a6a9e8de6ef sources/toys/dev-environment.sh --- a/sources/toys/dev-environment.sh Mon Mar 15 06:01:36 2010 -0500 +++ b/sources/toys/dev-environment.sh Tue Mar 16 03:58:43 2010 -0500 @@ -113,7 +113,7 @@ # The actual emulator invocation command gets appended here by system-image.sh -[ ! -z "$HDC" ] && QEMU_EXTRA="-hdc $HDC $KERNEL_EXTRA" -[ ! -z "$HDB" ] && QEMU_EXTRA="-hdb $HDB $KERNEL_EXTRA" +[ ! -z "$HDC" ] && QEMU_EXTRA="-hdc $HDC $QEMU_EXTRA" +[ ! -z "$HDB" ] && QEMU_EXTRA="-hdb $HDB $QEMU_EXTRA" run_emulator diff -r 4bd1bc15a744 -r 6a6a9e8de6ef system-image.sh --- a/system-image.sh Mon Mar 15 06:01:36 2010 -0500 +++ b/system-image.sh Tue Mar 16 03:58:43 2010 -0500 @@ -173,9 +173,19 @@ # filesystem, kernel, and base kernel command line arguments in case you want # to use an emulator other than qemu, but put the default case in qemu_defaults -(echo -e "ARCH=$ARCH\nrun_emulator()\n{" && - emulator_command "$IMAGE" zImage-$ARCH && - echo "}" || dienow) > "$STAGE_DIR/run-emulator.sh" +cat > "$STAGE_DIR/run-emulator.sh" << EOF || dienow +ARCH=$ARCH +run_emulator() +{ + [ ! -z "\$DEBUG" ] && set -x + $(emulator_command "$IMAGE" zImage-$ARCH) +} + +if [ "\$1" != "--norun" ] +then + run_emulator +fi +EOF cat "$SOURCES"/toys/{unique-port,dev-environment}.sh >> "$STAGE_DIR/dev-environment.sh" && chmod +x "$STAGE_DIR/dev-environment.sh" || dienow