switch-coreboot/src/arch/i386/Config.lb
Patrick Georgi aed1f925a6 the attached patch is the last infrastructure change necessary for
romfs.
Everything else to make a target romfs aware happens in the targets.

What the patch does:
1. missing romfs.h include
2. special handling while creating coreboot.rom
While the romfs code path in the makefile doesn't actually use the file,
it's possible that the build of coreboot.rom fails in a romfs setup,
because the individual buildrom image is too small to host both coreboot
and payloads (as the payloads aren't supposed to be there). Thus, a
special case to replace the payload with /dev/null in case of a romfs
build.
There would be cleaner ways, but they're not easily encoded in the
Config.lb format.
3. config.g is changed to create rules for a romfs build

Targets should still build (they do for me)

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4049 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-04-03 12:52:43 +00:00

113 lines
2.9 KiB
Text

uses CONFIG_SMP
uses CONFIG_PRECOMPRESSED_PAYLOAD
uses CONFIG_USE_INIT
uses HAVE_FAILOVER_BOOT
uses USE_FAILOVER_IMAGE
uses USE_FALLBACK_IMAGE
init init/crt0.S.lb
if HAVE_FAILOVER_BOOT
if USE_FAILOVER_IMAGE
ldscript init/ldscript_failover.lb
else
ldscript init/ldscript.lb
end
else
if USE_FALLBACK_IMAGE
ldscript init/ldscript_fallback.lb
else
ldscript init/ldscript.lb
end
end
makerule all
depends "coreboot.rom"
end
makerule floppy
depends "all"
action "mcopy -o coreboot.rom a:"
end
makerule nrv2b
depends "$(TOP)/util/nrv2b/nrv2b.c"
action "$(HOSTCC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG -DBITSIZE=32 -DENDIAN=0 $< -o $@"
end
makerule payload
depends "$(PAYLOAD)"
action "cp $< $@"
end
makerule payload.nrv2b
depends "$(PAYLOAD) nrv2b"
action "./nrv2b e $(PAYLOAD) $@"
end
# unlike nrv2b, lzma is a huge build mess. If they want lzma, they have to have built it
makerule payload.lzma
depends "$(PAYLOAD) "
action "lzma e $(PAYLOAD) $@"
end
# this one example shows the mess that has occurred. People are now mixing
# conditional if in the make style with if in the config language style.
# The -1 is linux standard.
# I don't much like it but it is the mode nowadays. So coreboot will change
# what a mess. -- RGM
# catch the case where there is no compression
makedefine PAYLOAD-1:=payload
# match the case where a compression type is specified.
makedefine PAYLOAD-$(CONFIG_COMPRESSED_PAYLOAD_NRV2B):=payload.nrv2b
makedefine PAYLOAD-$(CONFIG_COMPRESSED_PAYLOAD_LZMA):=payload.lzma
# catch the case where there is precompression. Yes, this bites.
if CONFIG_PRECOMPRESSED_PAYLOAD
makedefine PAYLOAD-1:=payload
end
if USE_FAILOVER_IMAGE
makedefine COREBOOT_APC:=
makedefine COREBOOT_RAM_ROM:=
makerule coreboot.rom
depends "coreboot.strip"
action "cp $< $@"
end
else
makerule coreboot.rom
depends "coreboot.strip buildrom $(PAYLOAD-1)"
action "PAYLOAD=$(PAYLOAD-1); if [ $(CONFIG_ROMFS) -eq 1 ]; then PAYLOAD=/dev/null; fi; ./buildrom $< $@ $$PAYLOAD $(ROM_IMAGE_SIZE) $(ROM_SECTION_SIZE)"
end
end
makerule crt0.S
depends "$(CRT0)"
action "cp $< $@"
end
addaction clean "rm -f romimage payload.*"
if CONFIG_USE_INIT
makerule init.o
depends "$(INIT-OBJECTS)"
action "$(LD) -melf_i386 -r -o init.pre.o $(INIT-OBJECTS)"
action "$(OBJCOPY) --rename-section .text=.init.text --rename-section .data=.init.data --rename-section .rodata=.init.rodata --rename-section .rodata.str1.1=.init.rodata.str1.1 init.pre.o init.o"
end
makerule coreboot
depends "crt0.o init.o $(COREBOOT_APC) $(COREBOOT_RAM_ROM) ldscript.ld"
action "$(CC) -nostdlib -nostartfiles -static -o $@ -T ldscript.ld crt0.o init.o"
action "$(CROSS_COMPILE)nm -n coreboot | sort > coreboot.map"
end
end
dir lib
dir boot
if CONFIG_SMP
dir smp
end