# HG changeset patch # User Rob Landley # Date 1209846598 18000 # Node ID 51bcd6de223d6f7b1365487fd9d11a2dae0aefed # Parent 966e397abd6051a039f8ede604c51b875db0f6a9 Redo plumbing that constructs run-emulator.sh. Group common qemu command line options (while still allowing the whole thing to be overridden for a target using a different emulator). This clears the way to hook up run-with-home.sh and run-with-dist.sh diff -r 966e397abd60 -r 51bcd6de223d package-mini-native.sh --- a/package-mini-native.sh Sat May 03 15:22:55 2008 -0500 +++ b/package-mini-native.sh Sat May 03 15:29:58 2008 -0500 @@ -30,7 +30,6 @@ # Write out a script to control user mode linux TARDEST="mini-native-$ARCH" -tar c cat > "${WORK}/uml-package.sh" << EOF && #!/bin/sh mount -n -t ramfs /dev /dev @@ -50,9 +49,16 @@ sync EOF chmod +x ${WORK}/uml-package.sh && -linux rootfstype=hostfs rw quiet ARCH=${ARCH} PATH=/bin:/usr/bin:/sbin:/usr/sbin init="${HOSTTOOLS}/oneit -p ${WORK}/uml-package.sh" +linux rootfstype=hostfs rw quiet ARCH=${ARCH} PATH=/bin:/usr/bin:/sbin:/usr/sbin init="${HOSTTOOLS}/oneit -p ${WORK}/uml-package.sh" || dienow -# Call the appropriate emulator +function qemu_defaults() +{ + echo "-nographic -no-reboot -hda \"$1\" -kernel \"$2\" -append \"$3" +} + +# 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 $DISTCC_VARS' \ @@ -64,11 +70,12 @@ function shipit() { - cd "$WORK" && + cd "$WORK" || dienow + rm -rf qemu-image-$ARCH mkdir qemu-image-$ARCH && ln {image-$ARCH.ext2,zImage-$ARCH,run-*.sh} \ "$SOURCES"/toys/run-with-{distcc,home}.sh \ - qemu-image-$ARCH && + qemu-image-$ARCH [ $? -ne 0 ] && dienow diff -r 966e397abd60 -r 51bcd6de223d sources/configs/armv4l --- a/sources/configs/armv4l Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/armv4l Sat May 03 15:29:58 2008 -0500 @@ -17,9 +17,8 @@ QEMU_TEST=$KARCH emulator_command() { - echo qemu-system-arm -M versatilepb -nographic -no-reboot -hda "$1" \ - -kernel "$2" -append "\"$3 root=/dev/sda console=ttyAMA0\"" \ - -net nic,model=rtl8139 -net user + echo qemu-system-arm -M versatilepb $(qemu_defaults "$@") \ + "root=/dev/sda console=ttyAMA0\"" -net nic,model=rtl8139 -net user } # Write out uClibc .config file. diff -r 966e397abd60 -r 51bcd6de223d sources/configs/armv5l --- a/sources/configs/armv5l Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/armv5l Sat May 03 15:29:58 2008 -0500 @@ -9,9 +9,8 @@ QEMU_TEST=$KARCH emulator_command() { - echo qemu-system-arm -M versatilepb -nographic -no-reboot -hda "$1" \ - -kernel "$2" -append "\"$3 root=/dev/sda console=ttyAMA0\"" \ - -net nic,model=rtl8139 -net user + echo qemu-system-arm -M versatilepb $(qemu_defaults "$@") \ + "root=/dev/sda console=ttyAMA0\"" -net nic,model=rtl8139 -net user } # Write out uClibc .config file. diff -r 966e397abd60 -r 51bcd6de223d sources/configs/i586 --- a/sources/configs/i586 Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/i586 Sat May 03 15:29:58 2008 -0500 @@ -9,8 +9,7 @@ emulator_command() { - echo qemu -cpu pentium -nographic -hda "$1" -kernel "$2" \ - -append "\"$3 root=/dev/hda console=ttyS0\"" + echo qemu -cpu pentium $(qemu_defaults "$@") "root=/dev/hda console=ttyS0\"" } # Write out uClibc .config file. diff -r 966e397abd60 -r 51bcd6de223d sources/configs/i686 --- a/sources/configs/i686 Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/i686 Sat May 03 15:29:58 2008 -0500 @@ -8,8 +8,7 @@ emulator_command() { - echo qemu -cpu pentium2 -nographic -hda "$1" -kernel "$2" \ - -append "\"$3 root=/dev/hda console=ttyS0\"" + echo qemu -cpu pentium2 $(qemu_defaults "$@") "root=/dev/hda console=ttyS0\"" } # Write out uClibc .config file. diff -r 966e397abd60 -r 51bcd6de223d sources/configs/m68k --- a/sources/configs/m68k Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/m68k Sat May 03 15:29:58 2008 -0500 @@ -8,9 +8,8 @@ QEMU_TEST= #$KARCH emulator_command() { -# echo qemu-system-arm -M versatilepb -nographic -no-reboot -hda "$1" \ -# -kernel "$2" -append "\"$3 root=/dev/sda console=ttyAMA0\"" \ -# -net nic,model=rtl8139 -net user +# echo qemu-system-arm -M versatilepb $(qemu_defaults "$@") \ +# "root=/dev/sda console=ttyAMA0\"" -net nic,model=rtl8139 -net user echo } diff -r 966e397abd60 -r 51bcd6de223d sources/configs/mips --- a/sources/configs/mips Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/mips Sat May 03 15:29:58 2008 -0500 @@ -8,8 +8,8 @@ emulator_command() { - echo qemu-system-mips -M mips -no-reboot -nographic -hda "$1" -kernel "$2" \ - -append "\"$3 console=ttyS0 root=/dev/hda\"" + echo qemu-system-mips -M mips $(qemu_defaults "$@") \ + "console=ttyS0 root=/dev/hda\"" } # Write out uClibc .config file. diff -r 966e397abd60 -r 51bcd6de223d sources/configs/mipsel --- a/sources/configs/mipsel Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/mipsel Sat May 03 15:29:58 2008 -0500 @@ -8,8 +8,8 @@ emulator_command() { - echo qemu-system-mipsel -M mips -no-reboot -nographic -hda "$1" -kernel "$2" \ - -append "\"$3 console=ttyS0 root=/dev/hda\"" + echo qemu-system-mipsel -M mips $(qemu_defaults "$@") \ + "console=ttyS0 root=/dev/hda\"" } # Write out uClibc .config file. diff -r 966e397abd60 -r 51bcd6de223d sources/configs/powerpc --- a/sources/configs/powerpc Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/powerpc Sat May 03 15:29:58 2008 -0500 @@ -1,10 +1,5 @@ # Power PC system -# XXX Status: Builds but doesn't run under qemu system emulation, due to Open Firmware being -# evil and workarounds not quite making it into the linux kernel tree yet. This is as much a qemu -# problem as a Linux problem, supply the appropriate kernel .config and it should run on real -# hardware just fine. - KARCH=powerpc KERNEL_PATH=arch/${KARCH}/boot/zImage GCC_FLAGS= @@ -12,8 +7,8 @@ QEMU_TEST= #ppc emulator_command() { - echo qemu-system-ppc -M prep -nographic -hda "$1" \ - -kernel "$2" -append "\"$3 root=/dev/hda console=ttyS0\"" -L . + echo qemu-system-ppc -M prep $(qemu_defaults "$@") \ + "root=/dev/hda console=ttyS0\"" -L . } # Write out Linux kernel .config file diff -r 966e397abd60 -r 51bcd6de223d sources/configs/sh4 --- a/sources/configs/sh4 Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/sh4 Sat May 03 15:29:58 2008 -0500 @@ -6,9 +6,8 @@ QEMU_TEST=$KARCH emulator_command() { -# echo qemu-system-arm -M versatilepb -nographic -no-reboot -hda "$1" \ -# -kernel "$2" -append "\"$3 root=/dev/sda console=ttyAMA0\"" \ -# -net nic,model=rtl8139 -net user +# echo qemu-system-arm -M versatilepb $(qemu_defaults "$@") \ +# "root=/dev/sda console=ttyAMA0\"" -net nic,model=rtl8139 -net user echo } diff -r 966e397abd60 -r 51bcd6de223d sources/configs/sparc --- a/sources/configs/sparc Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/sparc Sat May 03 15:29:58 2008 -0500 @@ -9,8 +9,7 @@ QEMU_TEST=$KARCH emulator_command() { - echo qemu-system-sparc -nographic -no-reboot -hda "$1" \ - -kernel "$2" -append "\"$3 root=/dev/sda console=ttyS0\"" + echo qemu-system-sparc $(qemu_defaults "$@") "root=/dev/sda console=ttyS0\"" } diff -r 966e397abd60 -r 51bcd6de223d sources/configs/x86_64 --- a/sources/configs/x86_64 Sat May 03 15:22:55 2008 -0500 +++ b/sources/configs/x86_64 Sat May 03 15:29:58 2008 -0500 @@ -6,8 +6,7 @@ emulator_command() { - echo qemu-system-x86_64 -nographic -hda "$1" -kernel "$2" \ - -append "\"$3 root=/dev/hda console=ttyS0\"" + echo qemu-system-x86_64 $(qemu_defaults "$@") "root=/dev/hda console=ttyS0\"" } # Write out uClibc .config file.