diff --git a/Makefile b/Makefile index 65ef45df..1df001b1 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ CROSS_TOOLS := \ ifeq "$(CONFIG_COREBOOT)" "y" -all: $(BOARD).rom +all: $(build)/$(BOARD)/coreboot.rom else ifeq "$(CONFIG_LINUXBOOT)" "y" all: $(build)/$(BOARD)/linuxboot.rom else @@ -416,33 +416,13 @@ $(build)/$(BOARD)/tools.cpio: \ @$(RM) -rf "$(initrd_dir)" -# -# Compress the initrd into a xz file that can be included by coreboot. -# The extra options are necessary to let the Linux kernel decompress it -# and the extra padding is to ensure that it can be concatenated to -# other cpio files. -# -coreboot.intermediate: $(build)/$(BOARD)/initrd.cpio.xz -coreboot.intermediate: $(build)/$(BOARD)/bzImage -#$(build)/$(coreboot_dir)/initrd-$(BOARD).cpio.xz: initrd-$(BOARD).cpio.xz - - - -# Each board output has its own fixup required to turn the coreboot.rom -# into a flashable image. - -# This produces a ROM image suitable for writing into the top chip; -x230.flash.rom: $(build)/$(coreboot_dir)/x230.flash/coreboot.rom - "$(build)/$(coreboot_dir)/$(BOARD)/cbfstool" "$<" print - $(call do,EXTRACT,$@,dd if="$<" of="$@" bs=1M skip=8) - @-$(RM) $< - @sha256sum "$@" # This produces a ROM image that is written with the flashrom program -%.rom: $(build)/$(coreboot_dir)/%/coreboot.rom +$(build)/$(BOARD)/coreboot.rom: $(build)/$(coreboot_dir)/$(BOARD)/coreboot.rom "$(build)/$(coreboot_dir)/$(BOARD)/cbfstool" "$<" print $(call do,EXTRACT,$@,mv "$<" "$@") - @sha256sum "$@" + @sha256sum "$(@:$(pwd)/%=%)" + module_dirs := \ $(busybox_dir) \ diff --git a/boards/x230-generic.config b/boards/x230-generic.config index 6fad4b2f..7d0d651c 100644 --- a/boards/x230-generic.config +++ b/boards/x230-generic.config @@ -2,6 +2,8 @@ BOARD=x230 CONFIG_COREBOOT=y +CONFIG_COREBOOT_CONFIG:=config/coreboot-x230.config + CONFIG_CRYPTSETUP=y CONFIG_FLASHROM=y CONFIG_GPG=y diff --git a/config/coreboot-x230.config b/config/coreboot-x230.config index 9d61ad8e..7230e330 100644 --- a/config/coreboot-x230.config +++ b/config/coreboot-x230.config @@ -601,11 +601,11 @@ CONFIG_GENERATE_SMBIOS_TABLES=y # CONFIG_PAYLOAD_UBOOT is not set CONFIG_PAYLOAD_LINUX=y # CONFIG_PAYLOAD_TIANOCORE is not set -CONFIG_PAYLOAD_FILE="./bzImage" +CONFIG_PAYLOAD_FILE="../../build/x230-generic/bzImage" CONFIG_PAYLOAD_OPTIONS="" # CONFIG_PXE is not set CONFIG_LINUX_COMMAND_LINE="quiet" -CONFIG_LINUX_INITRD="./initrd.cpio.xz" +CONFIG_LINUX_INITRD="../../build/x230-generic/initrd.cpio.xz" # CONFIG_PAYLOAD_IS_FLAT_BINARY is not set # diff --git a/modules/coreboot b/modules/coreboot index e9aaef56..f8571314 100644 --- a/modules/coreboot +++ b/modules/coreboot @@ -8,10 +8,9 @@ coreboot_tar := coreboot-$(coreboot_version).tar.xz coreboot_url := https://www.coreboot.org/releases/$(coreboot_tar) coreboot_hash := ecfc57f3e16543fe38f83171eaa3a7933098387d0cf597933b7e89a0c95ef531 - # Coreboot builds are specialized on a per-target basis. # The builds are done in a per-target subdirectory -#coreboot_config := coreboot-$(TARGET).config +CONFIG_COREBOOT_CONFIG ?= config/coreboot-$(BOARD).config EXTRA_FLAGS := -fdebug-prefix-map=$(pwd)=heads -gno-record-gcc-switches @@ -19,14 +18,14 @@ coreboot_configure := \ $(MAKE) \ oldconfig \ obj=./$(BOARD) \ - DOTCONFIG=../../config/coreboot-$(BOARD).config \ + DOTCONFIG=../../$(CONFIG_COREBOOT_CONFIG) \ BUILD_TIMELESS=1 \ CFLAGS_x86_32="$(EXTRA_FLAGS)" \ CFLAGS_x86_64="$(EXTRA_FLAGS)" \ coreboot_target := \ obj=./$(BOARD) \ - DOTCONFIG=../../config/coreboot-$(BOARD).config \ + DOTCONFIG=../../$(CONFIG_COREBOOT_CONFIG) \ BUILD_TIMELESS=1 \ CFLAGS_x86_32="$(EXTRA_FLAGS)" \ CFLAGS_x86_64="$(EXTRA_FLAGS)" \ @@ -34,7 +33,6 @@ coreboot_target := \ coreboot_output := $(BOARD)/coreboot.rom - # hack to force a build dependency on the cross compiler $(build)/$(coreboot_dir)/.configured: $(build)/$(coreboot_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc $(build)/$(coreboot_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc: $(build)/$(coreboot_dir)/.canary @@ -45,12 +43,20 @@ $(build)/$(coreboot_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc: $(build)/$(coreboo # The coreboot-blobs must be unpacked before we can build coreboot # if we are using a tar file; git checkout will clone the submodule. +# The Linux kernel and Heads initrd must be built before linuxboot +# unless the user has specified "FAST=1" on the make command line, +# which will assume that the kernel and initrd are fresh +ifneq "$(FAST)" "1" coreboot_depends := linux initrd +coreboot.intermediate: $(build)/$(BOARD)/bzImage +coreboot.intermediate: $(build)/$(BOARD)/initrd.cpio.xz +endif -ifneq "$(coreboot_version)" "git" # if we are not building from a git checkout, # we must also download the coreboot-blobs tree +ifneq "$(coreboot_version)" "git" + coreboot_depends += coreboot-blobs modules-y += coreboot-blobs diff --git a/modules/linuxboot b/modules/linuxboot index 85f2046c..314ff7a8 100644 --- a/modules/linuxboot +++ b/modules/linuxboot @@ -53,11 +53,6 @@ $(build)/$(BOARD)/linuxboot.rom: $(linuxboot_output) # which will assume that the kernel and initrd are fresh ifneq "$(FAST)" "1" linuxboot_depends := linux initrd +linuxboot.intermediate: $(build)/$(BOARD)/bzImage +linuxboot.intermediate: $(build)/$(BOARD)/initrd.cpio.xz endif - -# The bzImage and initrd must be built, but the dependency -# might not be there if FAST is defined. -linuxboot.intermediate: \ - $(build)/$(BOARD)/bzImage \ - $(build)/$(BOARD)/initrd.cpio.xz \ -