Mercurial > hg > aboriginal
changeset 372:37c8a6c9a493
Teach qemu-setup.sh to use oneit so ctrl-c works under the emulator. Also
factor out some more generic emulator info from the configs (the real console
device, which oneit needs to know, and the root device.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 19 Jul 2008 08:02:37 -0500 |
parents | b59c2561166e |
children | 9e2e6d04af86 |
files | package-mini-native.sh sources/configs/armv4l sources/configs/armv5l sources/configs/i586 sources/configs/i686 sources/configs/m68k sources/configs/mips sources/configs/mipsel sources/configs/powerpc sources/configs/sh4 sources/configs/sparc sources/configs/x86_64 sources/native/bin/qemu-setup.sh |
diffstat | 13 files changed, 60 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/package-mini-native.sh Sat Jul 19 01:44:22 2008 -0500 +++ b/package-mini-native.sh Sat Jul 19 08:02:37 2008 -0500 @@ -58,16 +58,18 @@ function qemu_defaults() { echo "-nographic -no-reboot \$WITH_HDB" \ - "-hda \"$1\" -kernel \"$2\" -append \"$3" + "-hda \"$1\" -kernel \"$2\"" \ + "-append \"root=/dev/$ROOT console=$CONSOLE CONSOLE=$CONSOLE" \ + "rw init=/tools/bin/qemu-setup.sh panic=1" \ + 'PATH=$DISTCC_PATH_PREFIX/tools/bin $KERNEL_EXTRA"' \ + } # Call the appropriate emulator. We split out the 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_BASE. -emulator_command image-$ARCH.ext2 zImage-$ARCH \ - 'rw init=/tools/bin/qemu-setup.sh panic=1 PATH=$DISTCC_PATH_PREFIX/tools/bin $KERNEL_EXTRA' \ - > "$WORK/run-emulator.sh" && +emulator_command image-$ARCH.ext2 zImage-$ARCH > "$WORK/run-emulator.sh" && chmod +x "$WORK/run-emulator.sh"
--- a/sources/configs/armv4l Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/armv4l Sat Jul 19 08:02:37 2008 -0500 @@ -15,10 +15,14 @@ GCC_FLAGS="--with-float=soft" BINUTILS_FLAGS= QEMU_TEST=$KARCH + +ROOT=sda +CONSOLE=ttyAMA0 + emulator_command() { echo qemu-system-arm -M versatilepb $(qemu_defaults "$@") \ - "root=/dev/sda console=ttyAMA0\"" -net nic,model=rtl8139 -net user + -net nic,model=rtl8139 -net user } # Write out uClibc .config file.
--- a/sources/configs/armv5l Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/armv5l Sat Jul 19 08:02:37 2008 -0500 @@ -7,10 +7,14 @@ GCC_FLAGS= BINUTILS_FLAGS= QEMU_TEST=$KARCH + +ROOT=sda +CONSOLE=ttyAMA0 + emulator_command() { echo qemu-system-arm -M versatilepb $(qemu_defaults "$@") \ - "root=/dev/sda console=ttyAMA0\"" -net nic,model=rtl8139 -net user + -net nic,model=rtl8139 -net user } # Write out uClibc .config file.
--- a/sources/configs/i586 Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/i586 Sat Jul 19 08:02:37 2008 -0500 @@ -7,9 +7,12 @@ GCC_FLAGS= QEMU_TEST=$KARCH +ROOT=hda +CONSOLE=ttyS0 + emulator_command() { - echo qemu -cpu pentium $(qemu_defaults "$@") "root=/dev/hda console=ttyS0\"" + echo qemu -cpu pentium $(qemu_defaults "$@") } # Write out uClibc .config file.
--- a/sources/configs/i686 Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/i686 Sat Jul 19 08:02:37 2008 -0500 @@ -6,9 +6,12 @@ GCC_FLAGS= QEMU_TEST=$KARCH +CONSOLE=ttyS0 +ROOT=hda + emulator_command() { - echo qemu -cpu pentium2 $(qemu_defaults "$@") "root=/dev/hda console=ttyS0\"" + echo qemu -cpu pentium2 $(qemu_defaults "$@") } # Write out uClibc .config file.
--- a/sources/configs/m68k Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/m68k Sat Jul 19 08:02:37 2008 -0500 @@ -6,10 +6,14 @@ GCC_FLAGS= #"--with-float=soft" BINUTILS_FLAGS= QEMU_TEST= #$KARCH + +ROOT=sda +CONSOLE=ttyAMA0 + emulator_command() { # echo qemu-system-arm -M versatilepb $(qemu_defaults "$@") \ -# "root=/dev/sda console=ttyAMA0\"" -net nic,model=rtl8139 -net user +# -net nic,model=rtl8139 -net user echo }
--- a/sources/configs/mips Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/mips Sat Jul 19 08:02:37 2008 -0500 @@ -6,10 +6,12 @@ GCC_FLAGS= QEMU_TEST=mips +ROOT=hda +CONSOLE=ttyS0 + emulator_command() { - echo qemu-system-mips -M malta $(qemu_defaults "$@") \ - "console=ttyS0 root=/dev/hda\"" + echo qemu-system-mips -M malta $(qemu_defaults "$@") } # Write out uClibc .config file.
--- a/sources/configs/mipsel Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/mipsel Sat Jul 19 08:02:37 2008 -0500 @@ -6,10 +6,12 @@ GCC_FLAGS= QEMU_TEST=mipsel +ROOT=hda +CONSOLE=ttyS0 + emulator_command() { - echo qemu-system-mipsel -M malta $(qemu_defaults "$@") \ - "console=ttyS0 root=/dev/hda\"" + echo qemu-system-mipsel -M malta $(qemu_defaults "$@") } # Write out uClibc .config file.
--- a/sources/configs/powerpc Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/powerpc Sat Jul 19 08:02:37 2008 -0500 @@ -5,10 +5,13 @@ GCC_FLAGS= BINUTILS_FLAGS= QEMU_TEST= #ppc + +ROOT=hda +CONSOLE=ttyS0 + emulator_command() { - echo qemu-system-ppc -M prep $(qemu_defaults "$@") \ - "root=/dev/hda console=ttyS0\"" -L . + echo qemu-system-ppc -M prep $(qemu_defaults "$@") -L . } # Write out Linux kernel .config file
--- a/sources/configs/sh4 Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/sh4 Sat Jul 19 08:02:37 2008 -0500 @@ -4,10 +4,14 @@ GCC_FLAGS= BINUTILS_FLAGS= QEMU_TEST=$KARCH + +ROOT=sda +CONSOLE=TTYAMA0 + emulator_command() { # echo qemu-system-arm -M versatilepb $(qemu_defaults "$@") \ -# "root=/dev/sda console=ttyAMA0\"" -net nic,model=rtl8139 -net user +# -net nic,model=rtl8139 -net user echo }
--- a/sources/configs/sparc Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/sparc Sat Jul 19 08:02:37 2008 -0500 @@ -7,9 +7,13 @@ BINUTILS_FLAGS= GCC_FLAGS= QEMU_TEST=$KARCH + +ROOT=sda +CONSOLE=ttyS0 + emulator_command() { - echo qemu-system-sparc $(qemu_defaults "$@") "root=/dev/sda console=ttyS0\"" + echo qemu-system-sparc $(qemu_defaults "$@") }
--- a/sources/configs/x86_64 Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/configs/x86_64 Sat Jul 19 08:02:37 2008 -0500 @@ -4,10 +4,12 @@ BINUTILS_FLAGS="--enable-64-bit-bfd" QEMU_TEST= +ROOT=hda +CONSOLE=ttyS0 + emulator_command() { - echo qemu-system-x86_64 -m 256 $(qemu_defaults "$@") \ - "root=/dev/hda console=ttyS0\"" + echo qemu-system-x86_64 -m 256 $(qemu_defaults "$@") } # Write out uClibc .config file.
--- a/sources/native/bin/qemu-setup.sh Sat Jul 19 01:44:22 2008 -0500 +++ b/sources/native/bin/qemu-setup.sh Sat Jul 19 08:02:37 2008 -0500 @@ -46,6 +46,8 @@ fi fi +echo Type exit when done. + # Switch to a shell with command history. -exec /tools/bin/busybox ash - +[ -z "$CONSOLE" ] && exec /tools/bin/ash +exec /tools/bin/oneit -c /dev/$CONSOLE /tools/bin/ash