Skip to content

Commit

Permalink
Use $(BOARD)-$(HEADS_GIT_VERSION) as basis for output filename
Browse files Browse the repository at this point in the history
makes builds uniquely identifiable based on board and version.

Signed-off-by: Matt DeVillier <[email protected]>
  • Loading branch information
MrChromebox committed Oct 20, 2020
1 parent b2e1a58 commit 9fb1649
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,13 @@ CROSS_TOOLS := \



ifeq "$(CONFIG_COREBOOT)" "y"
all: $(build)/$(BOARD)/coreboot.rom
else ifeq "$(CONFIG_LINUXBOOT)" "y"
all: $(build)/$(BOARD)/linuxboot.rom
all:
ifeq ($(CONFIG_COREBOOT), y)
CB_OUTPUT_FILE := heads-$(BOARD)-$(HEADS_GIT_VERSION).rom
all: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
else ifeq ($(CONFIG_LINUXBOOT), y)
LB_OUTPUT_FILE := linuxboot-$(BOARD)-$(HEADS_GIT_VERSION).rom
all: $(build)/$(BOARD)/$(LB_OUTPUT_FILE)
else
$(error "$(BOARD): neither CONFIG_COREBOOT nor CONFIG_LINUXBOOT is set?")
endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export CONFIG_BOOT_DEV="/dev/sda1"
run:
qemu-system-x86_64 \
--machine q35 \
--bios $(build)/$(BOARD)/coreboot.rom \
--bios $(build)/$(BOARD)/$(CB_OUTPUT_FILE) \
-object rng-random,filename=/dev/urandom,id=rng0 \
-device virtio-rng-pci,rng=rng0 \
-netdev user,id=u1 -device e1000,netdev=u1 \
Expand Down
2 changes: 1 addition & 1 deletion boards/qemu-coreboot/qemu-coreboot.config
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ run:
qemu-system-x86_64 \
--machine q35 \
--serial /dev/tty \
--bios $(build)/$(BOARD)/coreboot.rom \
--bios $(build)/$(BOARD)/$(CB_OUTPUT_FILE) \
-object rng-random,filename=/dev/urandom,id=rng0 \
-device virtio-rng-pci,rng=rng0 \
-netdev user,id=u1 -device e1000,netdev=u1 \
Expand Down
2 changes: 1 addition & 1 deletion boards/t430-flash/t430-flash.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export CONFIG_FLASHROM_OPTIONS="--force --noverify-all -p internal --ifd --image
# allow the board to boot into a minimal Heads and read the full
# ROM from an external USB media.
all: $(build)/$(BOARD)/$(BOARD).rom
$(build)/$(BOARD)/$(BOARD).rom: $(build)/$(BOARD)/coreboot.rom
$(build)/$(BOARD)/$(BOARD).rom: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
dd of=$@ if=$< bs=65536 count=64 skip=128
sha256sum $@
2 changes: 1 addition & 1 deletion boards/x230-flash/x230-flash.config
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export CONFIG_FLASHROM_OPTIONS="--force --noverify-all -p internal --ifd --image
# allow the board to boot into a minimal Heads and read the full
# ROM from an external USB media.
all: $(build)/$(BOARD)/$(BOARD).rom
$(build)/$(BOARD)/$(BOARD).rom: $(build)/$(BOARD)/coreboot.rom
$(build)/$(BOARD)/$(BOARD).rom: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
dd of=$@ if=$< bs=65536 count=64 skip=128
sha256sum $@
4 changes: 3 additions & 1 deletion modules/coreboot
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ $(build)/$(coreboot_dir)/.build: \
$(build)/$(BOARD)/initrd.cpio.xz \

# This produces a ROM image that is written with the flashrom program
$(build)/$(BOARD)/coreboot.rom: $(build)/$(coreboot_dir)/.build
ifneq ($(CONFIG_COREBOOT),)
$(build)/$(BOARD)/$(CB_OUTPUT_FILE): $(build)/$(coreboot_dir)/.build
"$(build)/$(coreboot_dir)/cbfstool" "$(dir $<)coreboot.rom" print
$(call do-copy,$(dir $<)coreboot.rom,$@)
@touch $@ # update the time stamp
endif

#
# Helpful target for reconfiguring the coreboot target
Expand Down
6 changes: 4 additions & 2 deletions modules/linuxboot
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ endif
linuxboot_output := build/$(linuxboot_board)/linuxboot.rom
linuxboot_rom := $(build)/$(linuxboot_dir)/$(linuxboot_output)

$(build)/$(BOARD)/linuxboot.rom: $(build)/$(linuxboot_dir)/.build
ifneq ($(CONFIG_LINUXBOOT),)
$(build)/$(BOARD)/$(LB_OUTPUT_FILE): $(build)/$(linuxboot_dir)/.build
$(call do-copy,$(dir $<)linuxboot.rom,$@)
@touch $@
endif

# Also force a rebuild if any of the input files are updated
$(build)/$(linuxboot_dir)/.build: \
Expand All @@ -70,7 +72,7 @@ $(build)/$(linuxboot_dir)/.build: \
$(build)/$(BOARD)/initrd.cpio.xz \


linuxboot.run: $(build)/$(BOARD)/linuxboot.rom
linuxboot.run: $(build)/$(BOARD)/$(LB_OUTPUT_FILE)
$(MAKE) -C $(build)/$(linuxboot_base_dir) \
BOARD:=$(linuxboot_board) \
KERNEL=$(build)/$(BOARD)/bzImage \
Expand Down

0 comments on commit 9fb1649

Please sign in to comment.