From 253097314c918211cf2c58f454b42383b68e2847 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 21 Dec 2016 08:16:12 +0100 Subject: [PATCH] Add unified build directories to create_builddir This patch makes the benefit of the recently introduced unified Genode ABI available to developers by enabling the use of multiple kernels from within a single build directory. The create_builddir tool has gained a new set of kernel-agnostic platform arguments such as x86_32, or panda. Most build targets within directories are in principle compatible with all kernels that support the selected hardware platform. To execute a scenario via the run tool, one has to select the kernel to use by setting the 'KERNEL' argument in the build configuration (etc/build.conf). Alternatively, the 'KERNEL' can be specified as command-line argument of the Genode build system, e.g.: make run/log KERNEL=nova This allows us to easily switch from one kernel to another without rebuilding any Genode component except for the very few kernel-specific ones. The new version of the 'create_builddir' tool is still compatible with the old version. The old kernel-specific build directories can still be created. However, those variants will eventually be removed. Note that the commit removes the 'ports-foc' repository from the generated 'build.conf' files. As this is only meaningful for 'foc', I did not want to include it in the list of regular repositories (as visible in a 'x86_32' build directory). Hence, the repository must now be manually added in order to use L4Linux. Issue #2190 --- repos/base-fiasco/etc/specs.conf | 2 +- repos/base-foc/etc/specs.conf | 2 +- repos/base-foc/lib/mk/kernel-foc.inc | 3 + repos/base-linux/etc/specs.conf | 24 +- repos/base-nova/etc/specs.conf | 2 +- repos/base-okl4/etc/specs.conf | 2 +- repos/base-pistachio/etc/specs.conf | 2 +- repos/base-sel4/etc/specs.conf | 2 +- repos/base/mk/spec/x86.mk | 3 + repos/base/mk/spec/x86_32.mk | 1 + repos/base/mk/spec/x86_64.mk | 2 +- .../virtualbox-hwaccl.mk | 0 tool/builddir/{etc => build.conf}/README | 0 .../foc_arndale} | 0 .../foc_imx53} | 0 .../foc_odroid_x2} | 0 .../foc_panda} | 0 .../foc_pbxa9} | 0 .../build.conf.foc_rpi => build.conf/foc_rpi} | 0 .../foc_x86_32} | 0 .../foc_x86_64} | 0 tool/builddir/build.conf/make_j | 3 + tool/builddir/build.conf/qemu_opt_arm | 14 + tool/builddir/build.conf/qemu_opt_x86 | 20 + .../build.conf.optional => build.conf/repos} | 26 +- .../repos_x86} | 2 +- tool/builddir/build.conf/run | 5 + tool/builddir/build.conf/run_boot_dir | 4 + tool/builddir/build.conf/run_kernel_fiasco | 3 + tool/builddir/build.conf/run_kernel_foc | 3 + tool/builddir/build.conf/run_kernel_hw | 3 + tool/builddir/build.conf/run_kernel_hw_foc | 3 + .../run_kernel_linux} | 5 +- tool/builddir/build.conf/run_kernel_nova | 3 + tool/builddir/build.conf/run_kernel_okl4 | 3 + tool/builddir/build.conf/run_kernel_pistachio | 3 + tool/builddir/build.conf/run_kernel_sel4 | 3 + tool/builddir/build.conf/run_kernel_x86_32 | 3 + tool/builddir/build.conf/run_kernel_x86_64 | 3 + tool/builddir/build.conf/run_opt_arm_hw_foc | 4 + tool/builddir/build.conf/run_opt_hw | 3 + .../run_opt_muen} | 8 +- tool/builddir/build.conf/run_opt_spike | 7 + tool/builddir/build.conf/run_opt_x86_32 | 9 + tool/builddir/build.conf/run_opt_x86_64 | 6 + tool/builddir/build.conf/run_qemu | 3 + tool/builddir/build.conf/run_qemu_iso | 3 + tool/builddir/etc/build.conf.drivers_arm | 1 - tool/builddir/etc/build.conf.fiasco_x86 | 7 - tool/builddir/etc/build.conf.generic | 8 - tool/builddir/etc/build.conf.hw_arndale | 7 - tool/builddir/etc/build.conf.hw_imx53_qsb | 7 - tool/builddir/etc/build.conf.hw_imx53_qsb_tz | 7 - tool/builddir/etc/build.conf.hw_odroid_xu | 7 - tool/builddir/etc/build.conf.hw_panda | 7 - tool/builddir/etc/build.conf.hw_pbxa9 | 8 - tool/builddir/etc/build.conf.hw_riscv | 9 - tool/builddir/etc/build.conf.hw_rpi | 7 - tool/builddir/etc/build.conf.hw_usb_armory | 7 - tool/builddir/etc/build.conf.hw_wand_quad | 7 - tool/builddir/etc/build.conf.hw_x86_64 | 9 - tool/builddir/etc/build.conf.hw_zynq | 13 - tool/builddir/etc/build.conf.linux_x86 | 8 - tool/builddir/etc/build.conf.nova_x86_32 | 13 - tool/builddir/etc/build.conf.nova_x86_64 | 13 - tool/builddir/etc/build.conf.okl4_x86 | 8 - tool/builddir/etc/build.conf.pistachio_x86 | 8 - tool/builddir/etc/build.conf.ports-foc | 5 - tool/builddir/etc/build.conf.qemu_no_kvm | 10 - tool/builddir/etc/build.conf.sel4_x86_32 | 7 - tool/create_builddir | 371 +++++++++--------- 71 files changed, 339 insertions(+), 412 deletions(-) create mode 100644 repos/base/mk/spec/x86.mk rename repos/ports/lib/mk/spec/{hw_x86_64_muen => muen}/virtualbox-hwaccl.mk (100%) rename tool/builddir/{etc => build.conf}/README (100%) rename tool/builddir/{etc/build.conf.foc_arndale => build.conf/foc_arndale} (100%) rename tool/builddir/{etc/build.conf.foc_imx53 => build.conf/foc_imx53} (100%) rename tool/builddir/{etc/build.conf.foc_odroid_x2 => build.conf/foc_odroid_x2} (100%) rename tool/builddir/{etc/build.conf.foc_panda => build.conf/foc_panda} (100%) rename tool/builddir/{etc/build.conf.foc_pbxa9 => build.conf/foc_pbxa9} (100%) rename tool/builddir/{etc/build.conf.foc_rpi => build.conf/foc_rpi} (100%) rename tool/builddir/{etc/build.conf.foc_x86_32 => build.conf/foc_x86_32} (100%) rename tool/builddir/{etc/build.conf.foc_x86_64 => build.conf/foc_x86_64} (100%) create mode 100644 tool/builddir/build.conf/make_j create mode 100644 tool/builddir/build.conf/qemu_opt_arm create mode 100644 tool/builddir/build.conf/qemu_opt_x86 rename tool/builddir/{etc/build.conf.optional => build.conf/repos} (66%) rename tool/builddir/{etc/build.conf.drivers_x86 => build.conf/repos_x86} (100%) create mode 100644 tool/builddir/build.conf/run create mode 100644 tool/builddir/build.conf/run_boot_dir create mode 100644 tool/builddir/build.conf/run_kernel_fiasco create mode 100644 tool/builddir/build.conf/run_kernel_foc create mode 100644 tool/builddir/build.conf/run_kernel_hw create mode 100644 tool/builddir/build.conf/run_kernel_hw_foc rename tool/builddir/{etc/build.conf.linux_arm => build.conf/run_kernel_linux} (75%) create mode 100644 tool/builddir/build.conf/run_kernel_nova create mode 100644 tool/builddir/build.conf/run_kernel_okl4 create mode 100644 tool/builddir/build.conf/run_kernel_pistachio create mode 100644 tool/builddir/build.conf/run_kernel_sel4 create mode 100644 tool/builddir/build.conf/run_kernel_x86_32 create mode 100644 tool/builddir/build.conf/run_kernel_x86_64 create mode 100644 tool/builddir/build.conf/run_opt_arm_hw_foc create mode 100644 tool/builddir/build.conf/run_opt_hw rename tool/builddir/{etc/build.conf.hw_x86_64_muen => build.conf/run_opt_muen} (89%) create mode 100644 tool/builddir/build.conf/run_opt_spike create mode 100644 tool/builddir/build.conf/run_opt_x86_32 create mode 100644 tool/builddir/build.conf/run_opt_x86_64 create mode 100644 tool/builddir/build.conf/run_qemu create mode 100644 tool/builddir/build.conf/run_qemu_iso delete mode 100644 tool/builddir/etc/build.conf.drivers_arm delete mode 100644 tool/builddir/etc/build.conf.fiasco_x86 delete mode 100644 tool/builddir/etc/build.conf.generic delete mode 100644 tool/builddir/etc/build.conf.hw_arndale delete mode 100644 tool/builddir/etc/build.conf.hw_imx53_qsb delete mode 100644 tool/builddir/etc/build.conf.hw_imx53_qsb_tz delete mode 100644 tool/builddir/etc/build.conf.hw_odroid_xu delete mode 100644 tool/builddir/etc/build.conf.hw_panda delete mode 100644 tool/builddir/etc/build.conf.hw_pbxa9 delete mode 100644 tool/builddir/etc/build.conf.hw_riscv delete mode 100644 tool/builddir/etc/build.conf.hw_rpi delete mode 100644 tool/builddir/etc/build.conf.hw_usb_armory delete mode 100644 tool/builddir/etc/build.conf.hw_wand_quad delete mode 100644 tool/builddir/etc/build.conf.hw_x86_64 delete mode 100644 tool/builddir/etc/build.conf.hw_zynq delete mode 100644 tool/builddir/etc/build.conf.linux_x86 delete mode 100644 tool/builddir/etc/build.conf.nova_x86_32 delete mode 100644 tool/builddir/etc/build.conf.nova_x86_64 delete mode 100644 tool/builddir/etc/build.conf.okl4_x86 delete mode 100644 tool/builddir/etc/build.conf.pistachio_x86 delete mode 100644 tool/builddir/etc/build.conf.ports-foc delete mode 100644 tool/builddir/etc/build.conf.qemu_no_kvm delete mode 100644 tool/builddir/etc/build.conf.sel4_x86_32 diff --git a/repos/base-fiasco/etc/specs.conf b/repos/base-fiasco/etc/specs.conf index eafd6189f4..0f422868aa 100644 --- a/repos/base-fiasco/etc/specs.conf +++ b/repos/base-fiasco/etc/specs.conf @@ -1 +1 @@ -SPECS += genode fiasco x86_32 vesa pci ps2 framebuffer +SPECS += fiasco x86_32 diff --git a/repos/base-foc/etc/specs.conf b/repos/base-foc/etc/specs.conf index b78640192d..f5ae8ffc52 100644 --- a/repos/base-foc/etc/specs.conf +++ b/repos/base-foc/etc/specs.conf @@ -1 +1 @@ -SPECS += genode foc +SPECS += foc diff --git a/repos/base-foc/lib/mk/kernel-foc.inc b/repos/base-foc/lib/mk/kernel-foc.inc index 420c4186dc..53b2d7bff2 100644 --- a/repos/base-foc/lib/mk/kernel-foc.inc +++ b/repos/base-foc/lib/mk/kernel-foc.inc @@ -4,6 +4,9 @@ FOC_SRC := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco.oc] /" +MAKEOVERRIDES := $(filter-out KERNEL=%,$(MAKEOVERRIDES)) +unexport KERNEL + $(FOC_BUILD_DIR): $(VERBOSE_MK) $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ $(VERBOSE_DIR) -C $(FOC_SRC) BUILDDIR=$@ \ diff --git a/repos/base-linux/etc/specs.conf b/repos/base-linux/etc/specs.conf index e6290e0221..b8df884c85 100644 --- a/repos/base-linux/etc/specs.conf +++ b/repos/base-linux/etc/specs.conf @@ -1,23 +1 @@ - -SPECS += genode linux sdl - -# -# Detect host CPU architecture -# -UNAME_MACHINE := $(shell uname -m) - -ifeq ($(UNAME_MACHINE),i686) -SPECS += x86_32 -endif - -ifeq ($(UNAME_MACHINE),x86_64) -SPECS += x86_64 -endif - -ifeq ($(UNAME_MACHINE),armv6l) -SPECS += arm_v6 -endif - -ifeq ($(UNAME_MACHINE),armv7l) -SPECS += arm_v7a -endif +SPECS += linux sdl diff --git a/repos/base-nova/etc/specs.conf b/repos/base-nova/etc/specs.conf index 07749c890c..cdc01511c3 100644 --- a/repos/base-nova/etc/specs.conf +++ b/repos/base-nova/etc/specs.conf @@ -1 +1 @@ -SPECS += genode nova vesa acpi pci ps2 framebuffer +SPECS += nova acpi diff --git a/repos/base-okl4/etc/specs.conf b/repos/base-okl4/etc/specs.conf index 901c175a41..8da465ec45 100644 --- a/repos/base-okl4/etc/specs.conf +++ b/repos/base-okl4/etc/specs.conf @@ -1 +1 @@ -SPECS += genode okl4 x86_32 vesa pci ps2 framebuffer +SPECS += okl4 x86_32 diff --git a/repos/base-pistachio/etc/specs.conf b/repos/base-pistachio/etc/specs.conf index 9b6966ecc8..e069f3e0fa 100644 --- a/repos/base-pistachio/etc/specs.conf +++ b/repos/base-pistachio/etc/specs.conf @@ -1 +1 @@ -SPECS += genode pistachio x86_32 vesa pci ps2 framebuffer +SPECS += pistachio x86_32 diff --git a/repos/base-sel4/etc/specs.conf b/repos/base-sel4/etc/specs.conf index adfa3ddba5..92a508fb14 100644 --- a/repos/base-sel4/etc/specs.conf +++ b/repos/base-sel4/etc/specs.conf @@ -1 +1 @@ -SPECS += genode sel4 vesa acpi pci ps2 framebuffer +SPECS += sel4 acpi diff --git a/repos/base/mk/spec/x86.mk b/repos/base/mk/spec/x86.mk new file mode 100644 index 0000000000..62bce43960 --- /dev/null +++ b/repos/base/mk/spec/x86.mk @@ -0,0 +1,3 @@ +ifeq ($(filter $(SPECS),linux),) +SPECS += vesa pci ps2 framebuffer usb +endif diff --git a/repos/base/mk/spec/x86_32.mk b/repos/base/mk/spec/x86_32.mk index 5c40d463c7..c35cc0c630 100644 --- a/repos/base/mk/spec/x86_32.mk +++ b/repos/base/mk/spec/x86_32.mk @@ -17,3 +17,4 @@ LD_MARCH ?= -melf_i386 AS_MARCH ?= -march=i686 --32 include $(call select_from_repositories,mk/spec/32bit.mk) +include $(call select_from_repositories,mk/spec/x86.mk) diff --git a/repos/base/mk/spec/x86_64.mk b/repos/base/mk/spec/x86_64.mk index 8e7bfc65b4..dd7507ec0a 100644 --- a/repos/base/mk/spec/x86_64.mk +++ b/repos/base/mk/spec/x86_64.mk @@ -20,5 +20,5 @@ CC_MARCH ?= -m64 # LD_MARCH ?= -melf_x86_64 - include $(call select_from_repositories,mk/spec/64bit.mk) +include $(call select_from_repositories,mk/spec/x86.mk) diff --git a/repos/ports/lib/mk/spec/hw_x86_64_muen/virtualbox-hwaccl.mk b/repos/ports/lib/mk/spec/muen/virtualbox-hwaccl.mk similarity index 100% rename from repos/ports/lib/mk/spec/hw_x86_64_muen/virtualbox-hwaccl.mk rename to repos/ports/lib/mk/spec/muen/virtualbox-hwaccl.mk diff --git a/tool/builddir/etc/README b/tool/builddir/build.conf/README similarity index 100% rename from tool/builddir/etc/README rename to tool/builddir/build.conf/README diff --git a/tool/builddir/etc/build.conf.foc_arndale b/tool/builddir/build.conf/foc_arndale similarity index 100% rename from tool/builddir/etc/build.conf.foc_arndale rename to tool/builddir/build.conf/foc_arndale diff --git a/tool/builddir/etc/build.conf.foc_imx53 b/tool/builddir/build.conf/foc_imx53 similarity index 100% rename from tool/builddir/etc/build.conf.foc_imx53 rename to tool/builddir/build.conf/foc_imx53 diff --git a/tool/builddir/etc/build.conf.foc_odroid_x2 b/tool/builddir/build.conf/foc_odroid_x2 similarity index 100% rename from tool/builddir/etc/build.conf.foc_odroid_x2 rename to tool/builddir/build.conf/foc_odroid_x2 diff --git a/tool/builddir/etc/build.conf.foc_panda b/tool/builddir/build.conf/foc_panda similarity index 100% rename from tool/builddir/etc/build.conf.foc_panda rename to tool/builddir/build.conf/foc_panda diff --git a/tool/builddir/etc/build.conf.foc_pbxa9 b/tool/builddir/build.conf/foc_pbxa9 similarity index 100% rename from tool/builddir/etc/build.conf.foc_pbxa9 rename to tool/builddir/build.conf/foc_pbxa9 diff --git a/tool/builddir/etc/build.conf.foc_rpi b/tool/builddir/build.conf/foc_rpi similarity index 100% rename from tool/builddir/etc/build.conf.foc_rpi rename to tool/builddir/build.conf/foc_rpi diff --git a/tool/builddir/etc/build.conf.foc_x86_32 b/tool/builddir/build.conf/foc_x86_32 similarity index 100% rename from tool/builddir/etc/build.conf.foc_x86_32 rename to tool/builddir/build.conf/foc_x86_32 diff --git a/tool/builddir/etc/build.conf.foc_x86_64 b/tool/builddir/build.conf/foc_x86_64 similarity index 100% rename from tool/builddir/etc/build.conf.foc_x86_64 rename to tool/builddir/build.conf/foc_x86_64 diff --git a/tool/builddir/build.conf/make_j b/tool/builddir/build.conf/make_j new file mode 100644 index 0000000000..3a36a2629f --- /dev/null +++ b/tool/builddir/build.conf/make_j @@ -0,0 +1,3 @@ +# enable parallel build +#MAKE += -j4 + diff --git a/tool/builddir/build.conf/qemu_opt_arm b/tool/builddir/build.conf/qemu_opt_arm new file mode 100644 index 0000000000..f0a44519f6 --- /dev/null +++ b/tool/builddir/build.conf/qemu_opt_arm @@ -0,0 +1,14 @@ + +## +## Qemu arguments, effective when using the run tool's 'power_on/qemu' back end +## + +# enable GDB stub +#QEMU_OPT += -s + +# use time-tested graphics backend +QEMU_OPT += -display sdl + +# add kernel-specific Qemu arguments +QEMU_OPT += $(QEMU_OPT(${KERNEL})} + diff --git a/tool/builddir/build.conf/qemu_opt_x86 b/tool/builddir/build.conf/qemu_opt_x86 new file mode 100644 index 0000000000..e784260d86 --- /dev/null +++ b/tool/builddir/build.conf/qemu_opt_x86 @@ -0,0 +1,20 @@ + +## +## Qemu arguments, effective when using the run tool's 'power_on/qemu' back end +## + +# enable GDB stub +#QEMU_OPT += -s + +# prevent Qemu from using KVM +QEMU_OPT += -no-kvm + +# use time-tested graphics backend +QEMU_OPT += -display sdl + +# use machine model that supports nested virtualization +QEMU_OPT(nova) += -cpu core2duo + +# add kernel-specific Qemu arguments +QEMU_OPT += $(QEMU_OPT(${KERNEL})} + diff --git a/tool/builddir/etc/build.conf.optional b/tool/builddir/build.conf/repos similarity index 66% rename from tool/builddir/etc/build.conf.optional rename to tool/builddir/build.conf/repos index 0d2c551746..10c9ed41f6 100644 --- a/tool/builddir/etc/build.conf.optional +++ b/tool/builddir/build.conf/repos @@ -1,4 +1,22 @@ +## +## Kernel-specific repository +## + +ifdef KERNEL +REPOSITORIES += $(GENODE_DIR)/repos/base-$(KERNEL) +endif + + +## +## Repositories needed for the default demo scenario +## + +REPOSITORIES += $(GENODE_DIR)/repos/base +REPOSITORIES += $(GENODE_DIR)/repos/os +REPOSITORIES += $(GENODE_DIR)/repos/demo + + ## ## Optional repositories ## @@ -36,9 +54,11 @@ #REPOSITORIES += $(GENODE_DIR)/repos/gems # -# Genode world repository +# Collection of community-maintained components # -# Collection of community-maintained components available at -# https://github.com/genodelabs/genode-world.git +# Please follow the instructions provided at: +# +# https://github.com/genodelabs/genode-world # #REPOSITORIES += $(GENODE_DIR)/repos/world + diff --git a/tool/builddir/etc/build.conf.drivers_x86 b/tool/builddir/build.conf/repos_x86 similarity index 100% rename from tool/builddir/etc/build.conf.drivers_x86 rename to tool/builddir/build.conf/repos_x86 index 16e4c0490e..027c92cf80 100644 --- a/tool/builddir/etc/build.conf.drivers_x86 +++ b/tool/builddir/build.conf/repos_x86 @@ -1,4 +1,3 @@ - # # Drivers ported from the OpenBSD # @@ -8,3 +7,4 @@ # Drivers ported from iPXE # #REPOSITORIES += $(GENODE_DIR)/repos/dde_ipxe + diff --git a/tool/builddir/build.conf/run b/tool/builddir/build.conf/run new file mode 100644 index 0000000000..0b49e7324e --- /dev/null +++ b/tool/builddir/build.conf/run @@ -0,0 +1,5 @@ + +## +## Run-tool configuration +## + diff --git a/tool/builddir/build.conf/run_boot_dir b/tool/builddir/build.conf/run_boot_dir new file mode 100644 index 0000000000..41964376f8 --- /dev/null +++ b/tool/builddir/build.conf/run_boot_dir @@ -0,0 +1,4 @@ +ifdef KERNEL +RUN_OPT += ${KERNEL_RUN_OPT(${KERNEL})} --include boot_dir/$(KERNEL) +endif + diff --git a/tool/builddir/build.conf/run_kernel_fiasco b/tool/builddir/build.conf/run_kernel_fiasco new file mode 100644 index 0000000000..2c90892cb8 --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_fiasco @@ -0,0 +1,3 @@ +# kernel to use +KERNEL ?= fiasco + diff --git a/tool/builddir/build.conf/run_kernel_foc b/tool/builddir/build.conf/run_kernel_foc new file mode 100644 index 0000000000..8fb8e38b73 --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_foc @@ -0,0 +1,3 @@ +# kernel to use +KERNEL ?= foc + diff --git a/tool/builddir/build.conf/run_kernel_hw b/tool/builddir/build.conf/run_kernel_hw new file mode 100644 index 0000000000..3c0c84a75a --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_hw @@ -0,0 +1,3 @@ +# kernel to use +KERNEL ?= hw + diff --git a/tool/builddir/build.conf/run_kernel_hw_foc b/tool/builddir/build.conf/run_kernel_hw_foc new file mode 100644 index 0000000000..5b0d5b4740 --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_hw_foc @@ -0,0 +1,3 @@ +# kernel to use (hw or foc) +KERNEL ?= hw + diff --git a/tool/builddir/etc/build.conf.linux_arm b/tool/builddir/build.conf/run_kernel_linux similarity index 75% rename from tool/builddir/etc/build.conf.linux_arm rename to tool/builddir/build.conf/run_kernel_linux index 31f20c5d05..e9e5bd52cf 100644 --- a/tool/builddir/etc/build.conf.linux_arm +++ b/tool/builddir/build.conf/run_kernel_linux @@ -1,4 +1,6 @@ -REPOSITORIES = $(GENODE_DIR)/repos/base-linux +# kernel to use +KERNEL ?= linux + ## ## Kernel-specific run tool configuration @@ -6,3 +8,4 @@ REPOSITORIES = $(GENODE_DIR)/repos/base-linux RUN_OPT = --include boot_dir/linux \ --include power_on/linux --include log/linux + diff --git a/tool/builddir/build.conf/run_kernel_nova b/tool/builddir/build.conf/run_kernel_nova new file mode 100644 index 0000000000..a6f19dda8f --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_nova @@ -0,0 +1,3 @@ +# kernel to use +KERNEL ?= nova + diff --git a/tool/builddir/build.conf/run_kernel_okl4 b/tool/builddir/build.conf/run_kernel_okl4 new file mode 100644 index 0000000000..d4e3bd71aa --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_okl4 @@ -0,0 +1,3 @@ +# kernel to use +KERNEL ?= okl4 + diff --git a/tool/builddir/build.conf/run_kernel_pistachio b/tool/builddir/build.conf/run_kernel_pistachio new file mode 100644 index 0000000000..0cfdb95bc3 --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_pistachio @@ -0,0 +1,3 @@ +# kernel to use +KERNEL ?= pistachio + diff --git a/tool/builddir/build.conf/run_kernel_sel4 b/tool/builddir/build.conf/run_kernel_sel4 new file mode 100644 index 0000000000..cd5b6cb5a8 --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_sel4 @@ -0,0 +1,3 @@ +# kernel to use +KERNEL ?= sel4 + diff --git a/tool/builddir/build.conf/run_kernel_x86_32 b/tool/builddir/build.conf/run_kernel_x86_32 new file mode 100644 index 0000000000..59d9c117d3 --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_x86_32 @@ -0,0 +1,3 @@ +# kernel to use (nova, linux, sel4, foc, okl4, fiasco, or pistachio) +#KERNEL ?= nova + diff --git a/tool/builddir/build.conf/run_kernel_x86_64 b/tool/builddir/build.conf/run_kernel_x86_64 new file mode 100644 index 0000000000..d95dac4419 --- /dev/null +++ b/tool/builddir/build.conf/run_kernel_x86_64 @@ -0,0 +1,3 @@ +# kernel to use (nova, hw, linux, or foc) +#KERNEL ?= nova + diff --git a/tool/builddir/build.conf/run_opt_arm_hw_foc b/tool/builddir/build.conf/run_opt_arm_hw_foc new file mode 100644 index 0000000000..b3e7f55b77 --- /dev/null +++ b/tool/builddir/build.conf/run_opt_arm_hw_foc @@ -0,0 +1,4 @@ +# local varible for run-tool arguments that depend on the used kernel +KERNEL_RUN_OPT(hw) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(foc) := $(QEMU_RUN_OPT) + diff --git a/tool/builddir/build.conf/run_opt_hw b/tool/builddir/build.conf/run_opt_hw new file mode 100644 index 0000000000..3a20d15804 --- /dev/null +++ b/tool/builddir/build.conf/run_opt_hw @@ -0,0 +1,3 @@ +# local varible for run-tool arguments that depend on the used kernel +KERNEL_RUN_OPT(hw) := $(QEMU_RUN_OPT) + diff --git a/tool/builddir/etc/build.conf.hw_x86_64_muen b/tool/builddir/build.conf/run_opt_muen similarity index 89% rename from tool/builddir/etc/build.conf.hw_x86_64_muen rename to tool/builddir/build.conf/run_opt_muen index 6b690bd36c..cd73a48797 100644 --- a/tool/builddir/etc/build.conf.hw_x86_64_muen +++ b/tool/builddir/build.conf/run_opt_muen @@ -1,4 +1,3 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw ## ## Kernel-specific run tool configuration @@ -11,6 +10,7 @@ RUN_OPT = --include boot_dir/hw --include image/muen # # The specified file must be relative to the Muen policy directory or an # absolute path. +# RUN_OPT += --image-muen-hardware platform/lenovo-t430s.xml # @@ -28,13 +28,15 @@ RUN_OPT += --image-muen-spark-path /opt/spark # # The specified file must be relative to the Muen policy directory or an # absolute path. +# RUN_OPT += --image-muen-system xml/genode-base_hw.xml # # Muen system components # # Available components are located in the Muen project directory 'components/'. -RUN_OPT += --image-muen-components 'libdebuglog libmutime dbgserver sm tau0 time' +# +RUN_OPT += --image-muen-components 'dbgserver sm tau0 time' # # External Muen build @@ -42,4 +44,6 @@ RUN_OPT += --image-muen-components 'libdebuglog libmutime dbgserver sm tau0 time # Specifies if the Muen kernel should be built automatically. # If the Muen system is built and integrated externally, i.e. outside # of the Genode build system, set this parameter to 1. +# RUN_OPT += --image-muen-external-build 0 + diff --git a/tool/builddir/build.conf/run_opt_spike b/tool/builddir/build.conf/run_opt_spike new file mode 100644 index 0000000000..6f73bf281d --- /dev/null +++ b/tool/builddir/build.conf/run_opt_spike @@ -0,0 +1,7 @@ + +## +## Run tool configuration +## + +RUN_OPT = --include power_on/spike --include log/spike + diff --git a/tool/builddir/build.conf/run_opt_x86_32 b/tool/builddir/build.conf/run_opt_x86_32 new file mode 100644 index 0000000000..b5a3359198 --- /dev/null +++ b/tool/builddir/build.conf/run_opt_x86_32 @@ -0,0 +1,9 @@ +# local varible for run-tool arguments that depend on the used kernel +KERNEL_RUN_OPT(nova) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(sel4) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(foc) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(okl4) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(fiasco) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(pistachio) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(linux) := --include power_on/linux --include log/linux + diff --git a/tool/builddir/build.conf/run_opt_x86_64 b/tool/builddir/build.conf/run_opt_x86_64 new file mode 100644 index 0000000000..e442a1db85 --- /dev/null +++ b/tool/builddir/build.conf/run_opt_x86_64 @@ -0,0 +1,6 @@ +# local varible for run-tool arguments that depend on the used kernel +KERNEL_RUN_OPT(nova) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(hw) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(foc) := $(QEMU_RUN_OPT) +KERNEL_RUN_OPT(linux) := --include power_on/linux --include log/linux + diff --git a/tool/builddir/build.conf/run_qemu b/tool/builddir/build.conf/run_qemu new file mode 100644 index 0000000000..0289dd9ff6 --- /dev/null +++ b/tool/builddir/build.conf/run_qemu @@ -0,0 +1,3 @@ +# local variable for run-tool arguments used for running scenarios in Qemu +QEMU_RUN_OPT := --include power_on/qemu --include log/qemu + diff --git a/tool/builddir/build.conf/run_qemu_iso b/tool/builddir/build.conf/run_qemu_iso new file mode 100644 index 0000000000..8a83db7bf8 --- /dev/null +++ b/tool/builddir/build.conf/run_qemu_iso @@ -0,0 +1,3 @@ +# local variable for run-tool arguments used for running scenarios in Qemu +QEMU_RUN_OPT := --include power_on/qemu --include log/qemu --include image/iso + diff --git a/tool/builddir/etc/build.conf.drivers_arm b/tool/builddir/etc/build.conf.drivers_arm deleted file mode 100644 index 8b13789179..0000000000 --- a/tool/builddir/etc/build.conf.drivers_arm +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tool/builddir/etc/build.conf.fiasco_x86 b/tool/builddir/etc/build.conf.fiasco_x86 deleted file mode 100644 index 867afd0408..0000000000 --- a/tool/builddir/etc/build.conf.fiasco_x86 +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES = $(GENODE_DIR)/repos/base-fiasco - -## -## Kernel-specific run tool configuration -## -RUN_OPT = --include boot_dir/fiasco \ - --include power_on/qemu --include log/qemu --include image/iso diff --git a/tool/builddir/etc/build.conf.generic b/tool/builddir/etc/build.conf.generic deleted file mode 100644 index cf9b838a72..0000000000 --- a/tool/builddir/etc/build.conf.generic +++ /dev/null @@ -1,8 +0,0 @@ - -## -## Repositories needed for the default demo scenario -## - -REPOSITORIES += $(GENODE_DIR)/repos/base -REPOSITORIES += $(GENODE_DIR)/repos/os -REPOSITORIES += $(GENODE_DIR)/repos/demo diff --git a/tool/builddir/etc/build.conf.hw_arndale b/tool/builddir/etc/build.conf.hw_arndale deleted file mode 100644 index 38fdf9d898..0000000000 --- a/tool/builddir/etc/build.conf.hw_arndale +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw diff --git a/tool/builddir/etc/build.conf.hw_imx53_qsb b/tool/builddir/etc/build.conf.hw_imx53_qsb deleted file mode 100644 index 38fdf9d898..0000000000 --- a/tool/builddir/etc/build.conf.hw_imx53_qsb +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw diff --git a/tool/builddir/etc/build.conf.hw_imx53_qsb_tz b/tool/builddir/etc/build.conf.hw_imx53_qsb_tz deleted file mode 100644 index 38fdf9d898..0000000000 --- a/tool/builddir/etc/build.conf.hw_imx53_qsb_tz +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw diff --git a/tool/builddir/etc/build.conf.hw_odroid_xu b/tool/builddir/etc/build.conf.hw_odroid_xu deleted file mode 100644 index 38fdf9d898..0000000000 --- a/tool/builddir/etc/build.conf.hw_odroid_xu +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw diff --git a/tool/builddir/etc/build.conf.hw_panda b/tool/builddir/etc/build.conf.hw_panda deleted file mode 100644 index 38fdf9d898..0000000000 --- a/tool/builddir/etc/build.conf.hw_panda +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw diff --git a/tool/builddir/etc/build.conf.hw_pbxa9 b/tool/builddir/etc/build.conf.hw_pbxa9 deleted file mode 100644 index 3931f27d73..0000000000 --- a/tool/builddir/etc/build.conf.hw_pbxa9 +++ /dev/null @@ -1,8 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw \ - --include power_on/qemu --include log/qemu diff --git a/tool/builddir/etc/build.conf.hw_riscv b/tool/builddir/etc/build.conf.hw_riscv deleted file mode 100644 index 16061703b3..0000000000 --- a/tool/builddir/etc/build.conf.hw_riscv +++ /dev/null @@ -1,9 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw \ - --include power_on/spike --include log/spike - diff --git a/tool/builddir/etc/build.conf.hw_rpi b/tool/builddir/etc/build.conf.hw_rpi deleted file mode 100644 index 38fdf9d898..0000000000 --- a/tool/builddir/etc/build.conf.hw_rpi +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw diff --git a/tool/builddir/etc/build.conf.hw_usb_armory b/tool/builddir/etc/build.conf.hw_usb_armory deleted file mode 100644 index 38fdf9d898..0000000000 --- a/tool/builddir/etc/build.conf.hw_usb_armory +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw diff --git a/tool/builddir/etc/build.conf.hw_wand_quad b/tool/builddir/etc/build.conf.hw_wand_quad deleted file mode 100644 index 38fdf9d898..0000000000 --- a/tool/builddir/etc/build.conf.hw_wand_quad +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw diff --git a/tool/builddir/etc/build.conf.hw_x86_64 b/tool/builddir/etc/build.conf.hw_x86_64 deleted file mode 100644 index 54a3c309b1..0000000000 --- a/tool/builddir/etc/build.conf.hw_x86_64 +++ /dev/null @@ -1,9 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw \ - --include power_on/qemu --include log/qemu --include image/iso - diff --git a/tool/builddir/etc/build.conf.hw_zynq b/tool/builddir/etc/build.conf.hw_zynq deleted file mode 100644 index ed5c31cf10..0000000000 --- a/tool/builddir/etc/build.conf.hw_zynq +++ /dev/null @@ -1,13 +0,0 @@ -REPOSITORIES += $(GENODE_DIR)/repos/base-hw - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/hw - -## Set RUN_OPT to exectute this on Qemu -RUN_OPT += --include power_on/qemu --include log/qemu - -## Set RUN_OPT to execute this on actual hardware. -#RUN_OPT += --include image/uboot diff --git a/tool/builddir/etc/build.conf.linux_x86 b/tool/builddir/etc/build.conf.linux_x86 deleted file mode 100644 index 31f20c5d05..0000000000 --- a/tool/builddir/etc/build.conf.linux_x86 +++ /dev/null @@ -1,8 +0,0 @@ -REPOSITORIES = $(GENODE_DIR)/repos/base-linux - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/linux \ - --include power_on/linux --include log/linux diff --git a/tool/builddir/etc/build.conf.nova_x86_32 b/tool/builddir/etc/build.conf.nova_x86_32 deleted file mode 100644 index b66c30c943..0000000000 --- a/tool/builddir/etc/build.conf.nova_x86_32 +++ /dev/null @@ -1,13 +0,0 @@ -REPOSITORIES = $(GENODE_DIR)/repos/base-nova - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/nova \ - --include power_on/qemu --include log/qemu --include image/iso - -# -# The current NOVA kernel build is optimized for Intel Core2 Duo. -# -QEMU_OPT += -cpu core2duo diff --git a/tool/builddir/etc/build.conf.nova_x86_64 b/tool/builddir/etc/build.conf.nova_x86_64 deleted file mode 100644 index b66c30c943..0000000000 --- a/tool/builddir/etc/build.conf.nova_x86_64 +++ /dev/null @@ -1,13 +0,0 @@ -REPOSITORIES = $(GENODE_DIR)/repos/base-nova - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/nova \ - --include power_on/qemu --include log/qemu --include image/iso - -# -# The current NOVA kernel build is optimized for Intel Core2 Duo. -# -QEMU_OPT += -cpu core2duo diff --git a/tool/builddir/etc/build.conf.okl4_x86 b/tool/builddir/etc/build.conf.okl4_x86 deleted file mode 100644 index ace567cea6..0000000000 --- a/tool/builddir/etc/build.conf.okl4_x86 +++ /dev/null @@ -1,8 +0,0 @@ -REPOSITORIES = $(GENODE_DIR)/repos/base-okl4 - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/okl4 \ - --include power_on/qemu --include log/qemu --include image/iso diff --git a/tool/builddir/etc/build.conf.pistachio_x86 b/tool/builddir/etc/build.conf.pistachio_x86 deleted file mode 100644 index 0928125d20..0000000000 --- a/tool/builddir/etc/build.conf.pistachio_x86 +++ /dev/null @@ -1,8 +0,0 @@ -REPOSITORIES = $(GENODE_DIR)/repos/base-pistachio - -## -## Kernel-specific run tool configuration -## - -RUN_OPT = --include boot_dir/pistachio \ - --include power_on/qemu --include log/qemu --include image/iso diff --git a/tool/builddir/etc/build.conf.ports-foc b/tool/builddir/etc/build.conf.ports-foc deleted file mode 100644 index 38880fe238..0000000000 --- a/tool/builddir/etc/build.conf.ports-foc +++ /dev/null @@ -1,5 +0,0 @@ - -# -# Software ported specifically for Fiasco.OC, i.e., L4Linux -# -#REPOSITORIES += $(GENODE_DIR)/repos/ports-foc diff --git a/tool/builddir/etc/build.conf.qemu_no_kvm b/tool/builddir/etc/build.conf.qemu_no_kvm deleted file mode 100644 index 1d5eee058d..0000000000 --- a/tool/builddir/etc/build.conf.qemu_no_kvm +++ /dev/null @@ -1,10 +0,0 @@ - -# -# Prevent Qemu from using KVM -# -# Qemu version that come with major Linux distributions (i.e., Ubuntu) enable -# KVM by default. To use Qemu without KVM, Qemu must be started with the -# '-no-kvm' argument. However, if your Qemu version does not support this -# argument, comment-out this line. -# -QEMU_OPT += -no-kvm diff --git a/tool/builddir/etc/build.conf.sel4_x86_32 b/tool/builddir/etc/build.conf.sel4_x86_32 deleted file mode 100644 index 6b0a50512a..0000000000 --- a/tool/builddir/etc/build.conf.sel4_x86_32 +++ /dev/null @@ -1,7 +0,0 @@ -REPOSITORIES = $(GENODE_DIR)/repos/base-sel4 - -## -## Kernel-specific run tool configuration -## -RUN_OPT = --include boot_dir/sel4 \ - --include power_on/qemu --include log/qemu --include image/iso diff --git a/tool/create_builddir b/tool/create_builddir index b8cb23c8ef..4299245028 100755 --- a/tool/create_builddir +++ b/tool/create_builddir @@ -19,35 +19,53 @@ usage: @echo " create_builddir [BUILD_DIR=]" @echo @echo " can be:" - @echo " 'linux_x86'" - @echo " 'linux_arm'" - @echo " 'fiasco_x86'" - @echo " 'pistachio_x86'" - @echo " 'okl4_x86'" - @echo " 'nova_x86_32'" - @echo " 'nova_x86_64'" - @echo " 'hw_panda'" - @echo " 'hw_pbxa9'" - @echo " 'hw_imx53_qsb'" - @echo " 'hw_imx53_qsb_tz'" - @echo " 'hw_usb_armory'" - @echo " 'hw_wand_quad'" - @echo " 'hw_arndale'" - @echo " 'hw_odroid_xu'" - @echo " 'hw_rpi'" - @echo " 'hw_zynq'" - @echo " 'hw_x86_64'" - @echo " 'hw_x86_64_muen'" - @echo " 'hw_riscv'" - @echo " 'foc_x86_32'" - @echo " 'foc_x86_64'" - @echo " 'foc_pbxa9'" - @echo " 'foc_imx53'" - @echo " 'foc_panda'" - @echo " 'foc_arndale'" - @echo " 'foc_rpi'" - @echo " 'foc_odroid_x2'" - @echo " 'sel4_x86_32'" + @echo " 'x86_32'" + @echo " 'x86_64'" + @echo " 'panda'" + @echo " 'pbxa9'" + @echo " 'rpi'" + @echo " 'arndale'" + @echo " 'imx53_qsb'" + @echo " 'imx53_qsb_tz'" + @echo " 'usb_armory'" + @echo " 'wand_quad'" + @echo " 'odroid_xu'" + @echo " 'odroid_x2'" + @echo " 'zynq'" + @echo " 'muen'" + @echo " 'riscv_spike'" + @echo " 'linux'" + @echo + @echo " the following arguments are deprecated:" + @echo " 'linux_x86' (use 'linux')" + @echo " 'linux_arm' (use 'linux')" + @echo " 'fiasco_x86' (use 'x86_32')" + @echo " 'okl4_x86' (use 'x86_32')" + @echo " 'pistachio_x86' (use 'x86_32')" + @echo " 'nova_x86_32' (use 'x86_32')" + @echo " 'nova_x86_64' (use 'x86_64')" + @echo " 'hw_x86_64' (use 'x86_64')" + @echo " 'foc_x86_32' (use 'x86_32')" + @echo " 'foc_x86_64' (use 'x86_64')" + @echo " 'sel4_x86_32' (use 'x86_32')" + @echo " 'hw_panda' (use 'panda')" + @echo " 'foc_panda' (use 'panda')" + @echo " 'hw_pbxa9' (use 'pbxa9')" + @echo " 'foc_pbxa9' (use 'pbxa9')" + @echo " 'hw_rpi' (use 'rpi')" + @echo " 'foc_rpi' (use 'rpi')" + @echo " 'hw_arndale' (use 'arndale')" + @echo " 'foc_arndale' (use 'arndale')" + @echo " 'hw_imx53_qsb' (use 'imx53_qsb')" + @echo " 'foc_imx53' (use 'imx53_qsb')" + @echo " 'hw_imx53_qsb_tz' (use 'imx53_qsb_tz')" + @echo " 'hw_usb_armory' (use 'usb_armory')" + @echo " 'hw_wand_quad' (use 'wand_quad')" + @echo " 'hw_odroid_xu' (use 'odroid_xu')" + @echo " 'hw_zynq' (use 'zynq')" + @echo " 'hw_x86_64_muen' (use 'muen')" + @echo " 'hw_riscv' (use 'riscv_spike')" + @echo " 'foc_odroid_x2' (use 'odroid_x2')" @echo @echo " The definition of BUILD_DIR is optional. If specified," @echo " is the location of the build directory to create." @@ -94,183 +112,152 @@ else CONTRIB_ABS_DIR := $(abspath $(shell echo $(CONTRIB_DIR))) endif -# -# Generic build-directory preparation rules -# -BUILD_CONF = $(GENODE_ABS_DIR)/tool/builddir/etc/build.conf -BUILD_CONF_PLATFORM = $(BUILD_CONF).$(PLATFORM) - $(BUILD_DIR)/etc: @mkdir -p $@ -$(BUILD_DIR)/etc/build.conf:: $(BUILD_CONF_PLATFORM) - @echo "GENODE_DIR = $(GENODE_ABS_DIR)" > $@ - @echo 'BASE_DIR = $$(GENODE_DIR)/repos/base' >> $@ - @echo 'CONTRIB_DIR = $(CONTRIB_ABS_DIR)' >> $@ +BUILD_CONF_X86_32 := run_qemu_iso run_opt_x86_32 run_boot_dir qemu_opt_x86 repos repos_x86 +BUILD_CONF_X86_64 := run_qemu_iso run_opt_x86_64 run_boot_dir qemu_opt_x86 repos repos_x86 +BUILD_CONF_PBXA9 := run_qemu run_opt_arm_hw_foc run_boot_dir qemu_opt_arm repos -# -# Supply -no-kvm argument to Qemu for kernels that are incompatible with KVM -# -ifeq ($(filter-out foc_x86_32 foc_x86_64 okl4_x86 nova_x86_32 nova_x86_64 pistachio_x86,$(PLATFORM)),) -$(BUILD_DIR)/etc/build.conf:: - @cat $(BUILD_CONF).qemu_no_kvm >> $@ -endif +BUILD_CONF(x86_32) := run_kernel_x86_32 $(BUILD_CONF_X86_32) +BUILD_CONF(x86_64) := run_kernel_x86_64 $(BUILD_CONF_X86_64) +BUILD_CONF(pbxa9) := run_kernel_hw_foc $(BUILD_CONF_PBXA9) +BUILD_CONF(panda) := run_kernel_hw_foc run_boot_dir repos +BUILD_CONF(rpi) := run_kernel_hw_foc run_boot_dir repos +BUILD_CONF(arndale) := run_kernel_hw_foc run_boot_dir repos +BUILD_CONF(imx53_qsb) := run_kernel_hw_foc run_boot_dir repos +BUILD_CONF(imx53_qsb_tz) := run_kernel_hw run_boot_dir repos +BUILD_CONF(usb_armory) := run_kernel_hw run_boot_dir repos +BUILD_CONF(wand_quad) := run_kernel_hw run_boot_dir repos +BUILD_CONF(odroid_xu) := run_kernel_hw run_boot_dir repos +BUILD_CONF(odroid_x2) := run_kernel_foc run_boot_dir repos +BUILD_CONF(zynq) := run_kernel_hw run_qemu run_opt_hw run_boot_dir qemu_opt_arm repos +BUILD_CONF(muen) := run_kernel_hw run_opt_muen run_boot_dir repos +BUILD_CONF(riscv_spike) := run_kernel_hw run_opt_spike run_boot_dir repos +BUILD_CONF(linux) := run_kernel_linux repos -# -# Add 'base-' and generic repositories -# -$(BUILD_DIR)/etc/build.conf:: $(BUILD_CONF_PLATFORM) +# deprecated platforms, to be removed +BUILD_CONF(linux_x86) := run_kernel_linux repos +BUILD_CONF(linux_arm) := run_kernel_linux repos +BUILD_CONF(fiasco_x86) := run_kernel_fiasco $(BUILD_CONF_X86_32) +BUILD_CONF(okl4_x86) := run_kernel_okl4 $(BUILD_CONF_X86_32) +BUILD_CONF(pistachio_x86) := run_kernel_pistachio $(BUILD_CONF_X86_32) +BUILD_CONF(nova_x86_32) := run_kernel_nova $(BUILD_CONF_X86_32) +BUILD_CONF(nova_x86_64) := run_kernel_nova $(BUILD_CONF_X86_64) +BUILD_CONF(hw_x86_64) := run_kernel_hw $(BUILD_CONF_X86_64) +BUILD_CONF(foc_x86_32) := run_kernel_foc $(BUILD_CONF_X86_32) +BUILD_CONF(foc_x86_64) := run_kernel_foc $(BUILD_CONF_X86_64) +BUILD_CONF(sel4_x86_32) := run_kernel_sel4 $(BUILD_CONF_X86_32) +BUILD_CONF(hw_panda) := ${BUILD_CONF(panda)} +BUILD_CONF(foc_panda) := run_kernel_foc run_boot_dir repos +BUILD_CONF(hw_pbxa9) := ${BUILD_CONF(pbxa9)} +BUILD_CONF(foc_pbxa9) := run_kernel_foc $(BUILD_CONF_PBXA9) +BUILD_CONF(hw_rpi) := ${BUILD_CONF(rpi)} +BUILD_CONF(foc_rpi) := run_kernel_foc run_boot_dir repos +BUILD_CONF(hw_arndale) := ${BUILD_CONF(arndale)} +BUILD_CONF(foc_arndale) := run_kernel_foc run_boot_dir repos +BUILD_CONF(hw_imx53_qsb) := ${BUILD_CONF(imx53_qsb)} +BUILD_CONF(foc_imx53) := run_kernel_foc run_boot_dir repos +BUILD_CONF(hw_imx53_qsb_tz) := ${BUILD_CONF(imx53_qsb_tz)} +BUILD_CONF(hw_usb_armory) := ${BUILD_CONF(usb_armory)} +BUILD_CONF(hw_wand_quad) := ${BUILD_CONF(wand_quad)} +BUILD_CONF(hw_odroid_xu) := ${BUILD_CONF(odroid_xu)} +BUILD_CONF(hw_zynq) := ${BUILD_CONF(zynq)} +BUILD_CONF(hw_x86_64_muen) := ${BUILD_CONF(muen)} +BUILD_CONF(hw_riscv) := ${BUILD_CONF(riscv_spike)} +BUILD_CONF(foc_odroid_x2) := ${BUILD_CONF(odroid_x2)} + +message: $(BUILD_DIR)/etc/build.conf +$(BUILD_DIR)/etc/build.conf: + @echo "GENODE_DIR := $(GENODE_ABS_DIR)" > $@ + @echo 'BASE_DIR := $$(GENODE_DIR)/repos/base' >> $@ + @echo 'CONTRIB_DIR := $(CONTRIB_ABS_DIR)' >> $@ @echo >> $@ - @echo "##" >> $@ - @echo "## Kernel-specific base repository" >> $@ - @echo "##" >> $@ - @echo >> $@ - @cat $< >> $@ - @cat $(BUILD_CONF).generic >> $@ - -# -# Add optional repositories for all platforms -# -# Those repositories rely on Genode's libc or contain device drivers. -# Both prerequisites are not available for hybrid Linux/Genode programs. -# -$(BUILD_DIR)/etc/build.conf:: - @cat $(BUILD_CONF).optional >> $@ + @for i in make_j run; do \ + cat $(GENODE_DIR)/tool/builddir/build.conf/$$i; done >> $@ + @for i in ${BUILD_CONF(${PLATFORM})}; do \ + cat $(GENODE_DIR)/tool/builddir/build.conf/$$i; done >> $@ +message: $(BUILD_DIR)/Makefile $(BUILD_DIR)/Makefile: @ln -sf $(GENODE_ABS_DIR)/tool/builddir/build.mk $@ +$(BUILD_DIR)/etc/build.conf: $(BUILD_DIR)/etc +$(BUILD_DIR)/etc/specs.conf: $(BUILD_DIR)/etc + # -# Add 'ports-foc' repository to Fiasco.OC build directory +# Detect host CPU architecture (needed for creating Linux build directory that +# matches the host system) # -ifeq ($(filter-out foc_x86_32 foc_imx53 foc_pbxa9 foc_panda foc_arndale foc_rpi foc_odroid_x2,$(PLATFORM)),) -$(BUILD_DIR)/etc/build.conf:: - @cat $(BUILD_CONF).ports-foc >> $@ +UNAME_MACHINE := $(shell uname -m) + +SPEC_ARCH(i686) := x86_32 +SPEC_ARCH(x86_64) := x86_64 +SPEC_ARCH(armv6l) := armv_v6 +SPEC_ARCH(armv7l) := armv_v7 + +HOST_SPEC_ARCH := ${SPEC_ARCH(${UNAME_MACHINE})} + +# +# SPECS definitions +# + +SPECS(x86_32) := x86_32 +SPECS(x86_64) := x86_64 +SPECS(pbxa9) := pbxa9 +SPECS(panda) := panda +SPECS(rpi) := rpi +SPECS(arndale) := arndale +SPECS(imx53_qsb) := imx53_qsb +SPECS(imx53_qsb_tz) := imx53_qsb_tz +SPECS(usb_armory) := hw_usb_armory usb_armory +SPECS(wand_quad) := hw_wand_quad wand_quad +SPECS(odroid_xu) := hw_odroid_xu odroid_xu +SPECS(odroid_x2) := foc_odroid_x2 odroid_x2 +SPECS(zynq_qemu) := hw_zynq zynq_qemu +SPECS(muen) := hw_x86_64_muen muen x86_64 +SPECS(riscv_spike) := hw_riscv riscv +SPECS(linux) := $(HOST_SPEC_ARCH) + +# deprecated platforms +SPECS(linux_x86) := $(HOST_SPEC_ARCH) +SPECS(linux_arm) := $(HOST_SPEC_ARCH) +SPECS(fiasco_x86) := +SPECS(okl4_x86) := +SPECS(pistachio_x86) := +SPECS(nova_x86_32) := nova_x86_32 x86_32 acpi +SPECS(nova_x86_64) := nova_x86_64 x86_64 acpi +SPECS(hw_x86_64) := hw_x86_64 x86_64 acpi +SPECS(foc_x86_32) := foc_x86_32 x86_32 acpi +SPECS(foc_x86_64) := foc_x86_64 x86_64 acpi +SPECS(sel4_x86_32) := sel4_x86_32 x86_32 acpi +SPECS(hw_panda) := hw_panda panda perf_counter +SPECS(foc_panda) := foc_panda panda +SPECS(hw_pbxa9) := hw_pbxa9 pbxa9 perf_counter +SPECS(foc_pbxa9) := foc_pbxa9 pbxa9 +SPECS(hw_rpi) := hw_rpi rpi perf_counter +SPECS(foc_rpi) := foc_rpi rpi +SPECS(hw_arndale) := hw_arndale arndale perf_counter +SPECS(foc_arndale) := foc_arndale arndale +SPECS(hw_imx53_qsb) := hw_imx53_qsb imx53_qsb perf_counter +SPECS(foc_imx53) := foc_imx53 imx53_qsb +SPECS(hw_imx53_qsb_tz) := hw_imx53_qsb_tz imx53_qsb_tz perf_counter +SPECS(hw_usb_armory) := hw_usb_armory usb_armory perf_counter +SPECS(hw_wand_quad) := hw_wand_quad wand_quad perf_counter +SPECS(hw_odroid_xu) := hw_odroid_xu odroid_xu perf_counter +SPECS(hw_zynq) := hw_zynq zynq perf_counter zynq_qemu +SPECS(hw_x86_64_muen) := hw_x86_64_muen x86_64 muen +SPECS(hw_riscv) := hw_riscv riscv +SPECS(foc_odroid_x2) := foc_odroid_x2 odroid_x2 + +ifneq (${SPECS(${PLATFORM})},) +message: $(BUILD_DIR)/etc/specs.conf +$(BUILD_DIR)/etc/specs.conf: + @echo "SPECS += ${SPECS(${PLATFORM})}" > $@ endif -# -# Add x86 drivers repositories to x86 build directories -# -ifeq ($(filter-out foc_x86_32 foc_x86_64 okl4_x86 nova_x86_32 nova_x86_64 pistachio_x86 fiasco_x86 hw_x86_64 hw_x86_64_muen sel4_x86_32,$(PLATFORM)),) -$(BUILD_DIR)/etc/build.conf:: - @cat $(BUILD_CONF).drivers_x86 >> $@ -endif - -# -# Add ARM drivers repositories to ARM build directories -# -ifeq ($(filter-out foc_panda foc_arndale hw_panda hw_arndale hw_odroid_xu foc_imx53 foc_rpi foc_odroid_x2,$(PLATFORM)),) -$(BUILD_DIR)/etc/build.conf:: - @cat $(BUILD_CONF).drivers_arm >> $@ -endif - -# -# Generic platform dependencies -# -$(PLATFORM):: $(BUILD_DIR)/etc -$(PLATFORM):: $(BUILD_DIR)/etc/build.conf -$(PLATFORM):: $(BUILD_DIR)/Makefile - -# -# Platform-specific dependencies -# -foc_x86_32:: - @echo "SPECS = genode foc_x86_32" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf - -foc_x86_64:: - @echo "SPECS = genode foc_x86_64" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf - -nova_x86_32:: - @echo "SPECS = genode nova_x86_32" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf - -nova_x86_64:: - @echo "SPECS = genode nova_x86_64" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf - -sel4_x86_32:: - @echo "SPECS = genode sel4_x86_32" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf - -foc_pbxa9:: - @echo "SPECS = genode foc_pbxa9" > $(BUILD_DIR)/etc/specs.conf - -foc_panda:: - @echo "SPECS = genode foc_panda" > $(BUILD_DIR)/etc/specs.conf - -foc_imx53:: - @echo "SPECS = genode foc_imx53" > $(BUILD_DIR)/etc/specs.conf - -foc_arndale:: - @echo "SPECS = genode foc_arndale" > $(BUILD_DIR)/etc/specs.conf - -foc_rpi:: - @echo "SPECS = genode foc_rpi" > $(BUILD_DIR)/etc/specs.conf - -foc_odroid_x2:: - @echo "SPECS = genode foc_odroid_x2" > $(BUILD_DIR)/etc/specs.conf - -# -# On all other platforms, the performance counter is assumed to be active by -# default. On HW, its activation is done by an optional core lib. To be -# conform to the other platforms, opt it in by default and, e.g. for security -# reasons, allow users to opt it out. -# -hw_pbxa9:: - @echo "SPECS = genode hw_pbxa9" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - -hw_panda:: - @echo "SPECS = genode hw_panda" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - -hw_imx53_qsb:: - @echo "SPECS = genode hw_imx53_qsb" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - -hw_imx53_qsb_tz:: - @echo "SPECS = genode hw_imx53_qsb_tz" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - -hw_usb_armory:: - @echo "SPECS = genode hw_usb_armory" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - -hw_wand_quad:: - @echo "SPECS = genode hw_wand_quad" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - -hw_arndale:: - @echo "SPECS = genode hw_arndale" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - -hw_rpi:: - @echo "SPECS = genode hw_rpi" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - -hw_zynq:: - @echo "SPECS = genode hw_zynq" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - @echo "## By default, hw_zynq is executed on Qemu" >> $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += zynq_qemu" >> $(BUILD_DIR)/etc/specs.conf - -hw_odroid_xu:: - @echo "SPECS = genode hw_odroid_xu" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf - -hw_x86_64:: - @echo "SPECS = genode hw_x86_64" > $(BUILD_DIR)/etc/specs.conf - @echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf - -hw_x86_64_muen:: - @echo "SPECS = genode hw_x86_64_muen" > $(BUILD_DIR)/etc/specs.conf - -hw_riscv:: - @echo "SPECS = genode hw_riscv" > $(BUILD_DIR)/etc/specs.conf - -$(PLATFORM):: +$(PLATFORM): message +message: @echo "Successfully created build directory at $(BUILD_DIR)." @echo "Please adjust $(BUILD_DIR)/etc/build.conf according to your needs."