changeset 1401:f1d2afdf2034

Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
author Rob Landley <rob@landley.net>
date Mon, 27 Jun 2011 06:40:25 -0500
parents 0b1022dc9a36
children 90f0a771a736
files root-filesystem.sh root-image.sh sources/functions.sh sources/targets/hw-tct-hammer/settings sources/targets/hw-wrt610n/settings sources/targets/i586 sources/targets/i586/settings sources/targets/i686-kvm/settings sources/targets/powerpc-440fp/settings
diffstat 9 files changed, 98 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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" ]
--- 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"
--- 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
--- 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
--- /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 "$@")
+}
--- 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"
-}
--- /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"
+}
--- 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"