# HG changeset patch # User Rob Landley # Date 1309174825 18000 # Node ID f1d2afdf203487f9115b6ac0ecf9f24f78f8a49a # Parent 0b1022dc9a3605f0606f33210a5746d07bf2fec4 Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target. diff -r 0b1022dc9a36 -r f1d2afdf2034 root-filesystem.sh --- a/root-filesystem.sh Sun Jun 26 20:09:37 2011 -0500 +++ b/root-filesystem.sh Mon Jun 27 06:40:25 2011 -0500 @@ -6,6 +6,8 @@ load_target "$1" +check_for_base_arch || exit 0 + [ ! -d "$BUILD/simple-root-filesystem-$ARCH" ] && echo "No $BUILD/simple-root-filesystem-$ARCH" >&2 && exit 1 diff -r 0b1022dc9a36 -r f1d2afdf2034 root-image.sh --- a/root-image.sh Sun Jun 26 20:09:37 2011 -0500 +++ b/root-image.sh Mon Jun 27 06:40:25 2011 -0500 @@ -8,6 +8,8 @@ load_target "$1" +check_for_base_arch || exit 0 + # Which directory do we package up? if [ -z "$NATIVE_ROOT" ] diff -r 0b1022dc9a36 -r f1d2afdf2034 sources/functions.sh --- a/sources/functions.sh Sun Jun 26 20:09:37 2011 -0500 +++ b/sources/functions.sh Mon Jun 27 06:40:25 2011 -0500 @@ -17,23 +17,29 @@ echo -n "$i:" } +base_architecture() +{ + ARCH="$1" + source "$CONFIG_DIR/$1" +} + load_target() { # Get target platform from first command line argument. ARCH_NAME="$1" - ARCH="$ARCH_NAME" CONFIG_DIR="$SOURCES/targets" # Read the relevant config file. - if [ -f "$CONFIG_DIR/$ARCH" ] + if [ -f "$CONFIG_DIR/$1" ] then - source "$CONFIG_DIR/$ARCH" + base_architecture "$ARCH_NAME" CONFIG_DIR= - elif [ -f "$CONFIG_DIR/$ARCH/settings" ] + elif [ -f "$CONFIG_DIR/$1/settings" ] then - source "$CONFIG_DIR/$ARCH/settings" ] + source "$CONFIG_DIR/$1/settings" + [ -z "$ARCH" ] && dienow "No base_architecture" else echo "Supported architectures: " ls "$CONFIG_DIR" diff -r 0b1022dc9a36 -r f1d2afdf2034 sources/targets/hw-tct-hammer/settings --- a/sources/targets/hw-tct-hammer/settings Sun Jun 26 20:09:37 2011 -0500 +++ b/sources/targets/hw-tct-hammer/settings Mon Jun 27 06:40:25 2011 -0500 @@ -1,6 +1,3 @@ -ARCH=armv4tl -source "$CONFIG_DIR/$ARCH/settings" - DESCRIPTION=" The Tin Can Tools hammer board is an ARM920T system on a chip, with 32 megs DRAM and 16 megs flash, and several integrated peripherals. @@ -9,3 +6,5 @@ board and http://www.tincantools.com/product.php?productid=16143 for the \"nail board\" (a USB-powered mounting kit for the hammer). " + +base_architecture armv4tl diff -r 0b1022dc9a36 -r f1d2afdf2034 sources/targets/hw-wrt610n/settings --- a/sources/targets/hw-wrt610n/settings Sun Jun 26 20:09:37 2011 -0500 +++ b/sources/targets/hw-wrt610n/settings Mon Jun 27 06:40:25 2011 -0500 @@ -12,8 +12,7 @@ See http://www.linksysbycisco.com/US/en/products/WRT610N " -ARCH=mipsel -source "$CONFIG_DIR/$ARCH/settings" +base_architecture mipsel KERNEL_PATH=arch/mips/boot/vmlinux.bin LINUX_FLAGS=vmlinux.bin diff -r 0b1022dc9a36 -r f1d2afdf2034 sources/targets/i586 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/targets/i586 Mon Jun 27 06:40:25 2011 -0500 @@ -0,0 +1,42 @@ +DESCRIPTION=" +An i586 board, such as the original Pentium/Pentium Pro/Pentium II/Via Samuel + +This demonstrates how creating code which runs on the host can still be cross +compiling, because the target may only support a subset of the host's +instruction set. Thus target code runs on the host, but host code won't +run on the target, so you still can't afford to leak context. +" + +KARCH=i386 +KERNEL_PATH=arch/${KARCH}/boot/bzImage +BINUTILS_FLAGS= +GCC_FLAGS= +QEMU_TEST=$KARCH + +ROOT=hda +CONSOLE=ttyS0 + +# Gentoo from Scratch +GFS_CHOST="i586-gentoo-linux-uclibc" +GFS_ARCH="x86" + +UCLIBC_CONFIG=" +TARGET_i386=y +CONFIG_586=y +UCLIBC_HAS_FPU=y +" + +LINUX_CONFIG=" +CONFIG_M586=y +CONFIG_ACPI=y +CONFIG_BLK_DEV_PIIX=y +CONFIG_NETDEV_1000=y +CONFIG_E1000=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +" + +emulator_command() +{ + echo qemu -cpu pentium $(qemu_defaults "$@") +} diff -r 0b1022dc9a36 -r f1d2afdf2034 sources/targets/i586/settings --- a/sources/targets/i586/settings Sun Jun 26 20:09:37 2011 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -DESCRIPTION=" -An i586 board, such as the original Pentium/Pentium Pro/Pentium II/Via Samuel - -This demonstrates how creating code which runs on the host can still be cross -compiling, because the target may only support a subset of the host's -instruction set. Thus target code runs on the host, but host code won't -run on the target, so you still can't afford to leak context. -" - -KARCH=i386 -KERNEL_PATH=arch/${KARCH}/boot/bzImage -BINUTILS_FLAGS= -GCC_FLAGS= -QEMU_TEST=$KARCH - -ROOT=vda -CONSOLE=ttyS0 - -# Gentoo from Scratch -GFS_CHOST="i586-gentoo-linux-uclibc" -GFS_ARCH="x86" - -UCLIBC_CONFIG=" -TARGET_i386=y -CONFIG_586=y -UCLIBC_HAS_FPU=y -" - -LINUX_CONFIG=" -CONFIG_M586=y -CONFIG_ACPI=y -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_HW_RANDOM_VIRTIO=y -CONFIG_PARAVIRT_GUEST=y -CONFIG_VIRTIO_BLK=y -CONFIG_VIRTIO_CONSOLE=y -CONFIG_KVM_CLOCK=y -CONFIG_KVM_GUEST=y -" - -emulator_command() -{ -# echo qemu -cpu pentium $(qemu_defaults "$@") - echo "if [ \"\$WITH_HDC\"X\"\" != \"X\" ]; then WITH_HDC=\"-drive file=\$HDC,if=virtio\"; fi" - echo "if [ \"\$WITH_HDB\"X\"\" != \"X\" ]; then WITH_HDB=\"-drive file=\$HDB,if=virtio\"; fi" - echo -n "qemu -cpu pentium -nographic -no-reboot -kernel $KERNEL \$WITH_HDC \$WITH_HDB" - [ "$SYSIMAGE_TYPE" != "initramfs" ] && echo -n " -drive file=$IMAGE,if=virtio" - echo -n " -append \"$(kernel_cmdline)\" \$QEMU_EXTRA -net nic,model=virtio -net user" -} diff -r 0b1022dc9a36 -r f1d2afdf2034 sources/targets/i686-kvm/settings --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/targets/i686-kvm/settings Mon Jun 27 06:40:25 2011 -0500 @@ -0,0 +1,36 @@ +DESCRIPTION=" +Variant of i686 target using kvm with virtio (different kernel/emulator config). +" + +# Use the i686 base architecture + +base_architecture i686 + +ROOT=vda +CONSOLE=ttyS0 + +LINUX_CONFIG=" +CONFIG_MPENTIUMII=y +CONFIG_ACPI=y + +# VIRTIO_CONSOLE not used yet +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_VIRTIO_CONSOLE=y + +CONFIG_HW_RANDOM_VIRTIO=y +CONFIG_PARAVIRT_GUEST=y +CONFIG_VIRTIO_BLK=y +CONFIG_KVM_CLOCK=y +CONFIG_KVM_GUEST=y +" + +emulator_command() +{ +# echo qemu -cpu pentium $(qemu_defaults "$@") + echo "if [ \"\$WITH_HDC\"X\"\" != \"X\" ]; then WITH_HDC=\"-drive file=\$HDC,if=virtio\"; fi" + echo "if [ \"\$WITH_HDB\"X\"\" != \"X\" ]; then WITH_HDB=\"-drive file=\$HDB,if=virtio\"; fi" + echo -n "qemu -cpu pentium -nographic -no-reboot -kernel $KERNEL \$WITH_HDC \$WITH_HDB" + [ "$SYSIMAGE_TYPE" != "initramfs" ] && echo -n " -drive file=$IMAGE,if=virtio" + echo -n " -append \"$(kernel_cmdline)\" \$QEMU_EXTRA -net nic,model=virtio -net user" +} diff -r 0b1022dc9a36 -r f1d2afdf2034 sources/targets/powerpc-440fp/settings --- a/sources/targets/powerpc-440fp/settings Sun Jun 26 20:09:37 2011 -0500 +++ b/sources/targets/powerpc-440fp/settings Mon Jun 27 06:40:25 2011 -0500 @@ -1,8 +1,7 @@ -source "$CONFIG_DIR/powerpc/settings" - DESCRIPTION="Power PC 440, with hardware floating point." -CROSS_TARGET=powerpc-unknown-linux +base_architecture powerpc + GCC_FLAGS="--with-cpu=440fp --with-tune=440fp ${GCC_FLAGS}" BINUTILS_FLAGS="--with-cpu=440fp --with-tune=440fp"