From bfbb55ed6430f6b4d9bb49d4f2592ef9a5713e75 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 29 Dec 2014 03:08:09 -0500 Subject: refactor (again): new download script, separate architectures, modules --- Makefile.d/buildrom-withgrub.mk | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Makefile.d/buildrom-withgrub.mk (limited to 'Makefile.d/buildrom-withgrub.mk') diff --git a/Makefile.d/buildrom-withgrub.mk b/Makefile.d/buildrom-withgrub.mk new file mode 100644 index 0000000..11b223e --- /dev/null +++ b/Makefile.d/buildrom-withgrub.mk @@ -0,0 +1,38 @@ +# % = $(board) +resources/libreboot/config/%_vesafb_config: resources/libreboot/config/%_txtmode_config + sed 's/# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set/CONFIG_FRAMEBUFFER_KEEP_VESA_MODE=y/' < $< > $@ + +# Unfortunately, this rule requires exclusive use of the src/coreboot directory +.NOTPARALLEL: +define rule_rom_nokeyboard +tmp/%(board)_nokeyboard_%(romtype).rom: tmp/builddeps-stamps/$(host_arch)/coreboot \ + tmp/grub_%(romtype).elf \ + resources/libreboot/config/%(board)_%(romtype)_config + rm -f src/$(host_arch)/coreboot/.config src/$(host_arch)/coreboot/grub.elf + $(MAKE) -C src/$(host_arch)/coreboot clean + ln resources/libreboot/config/%(board)_%(romtype)_config src/$(host_arch)/coreboot/.config + ln tmp/grub_%(romtype).elf src/$(host_arch)/coreboot/grub.elf + $(MAKE) -C src/$(host_arch)/coreboot + rm -f src/$(host_arch)/coreboot/.config src/$(host_arch)/coreboot/grub.elf + mv src/$(host_arch)/coreboot/build/coreboot.rom $@ +endef +$(eval $(call multiglob,rom_nokeyboard,board romtype)) + +define rule_rom +roms/%(board)_%(keymap)_%(romtype).rom: \ + tmp/%(board)_nokeyboard_%(romtype).rom \ + tmp/grub_%(keymap)_%(romtype).cfg \ + tmp/grub_%(keymap)_%(romtype)_test.cfg \ + $(firstword $(CBFSTOOL)) + cp $< $@.tmp + $(CBFSTOOL) $@.tmp add -f tmp/grub_%(keymap)_%(romtype).cfg -n grub.cfg -t raw + $(CBFSTOOL) $@.tmp add -f tmp/grub_%(keymap)_%(romtype)_test.cfg -n grubtest.cfg -t raw + $(if $(filter %(board),$(i945boards)),\ + # Needed on i945 systems for the bucts/dd trick (documented) + # This enables the ROM to be flashed over the lenovo bios firmware + dd if='$@.tmp' of='$@.tmp.top64k' bs=1 skip=$$[$$(stat -c %s '$@.tmp') - 0x10000] count=64k && \ + dd if='$@.tmp.top64k' of='$@.tmp' bs=1 seek=$$[$$(stat -c %s '$@.tmp') - 0x20000] count=64k conv=notrunc && \ + rm -f '$@.tmp.top64k') + mv $@.tmp $@ +endef +$(eval $(call multiglob,rom,board keymap romtype)) -- cgit v1.2.3