We have had a configuration problem smoldering for some time in buildrom. Basically, the problem is that we sometimes want buildrom to have some sort of control over the configuration of coreboot v2 and v3. The classic example is compression - buildrom allows the user to choose if they want to compress with LZMA or not - the problem is that this then needs to be communicated to coreboot v2 or v3, which is difficult to do with static configuration files. So we need a way to massage the v2 and v3 configuration files based on information from buildrom.
Attached is a quick script that I wrote this morning that starts to go down that path for v3. Given a trigger item in the buildrom config (in this case CONFIG_USE_LZMA), it adds the appropriate config options to the v3 config which is piped in through stdin. The result is a fully operational config file that can be run through oldconfig in the v3 build.
I'm sending this out for comments - clearly this is an early hack, and there will be refinements made. And v3 is the easy case - v2 is going to be a bear, and unfortunately v2 is the system that needs this the most.
So comments welcome, and please excuse my lack of perl fu.
Jordan
-----Original Message----- From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of Jordan Crouse Sent: Tuesday, December 02, 2008 12:00 PM To: coreboot@coreboot.org Subject: [coreboot] Request for comments: v3 config script
We have had a configuration problem smoldering for some time in buildrom. Basically, the problem is that we sometimes want buildrom to have some sort of control over the configuration of coreboot v2 and v3. The classic example is compression - buildrom allows the user to choose if they want to compress with LZMA or not - the problem is that this then needs to be communicated to coreboot v2 or v3, which is difficult to do with static configuration files. So we need a way to massage the v2 and v3 configuration files based on information from buildrom.
The last time we looked at this, I thought we decided that we would just have a "reasonable" default for v3, and not let the user configure it any more than that. So in defconfig we always enable LZMA. This allows the user to compress the payload or not. The other thing we allowed the user to change was ROM size. Anything else they need to do a make coreboot-v3-config.
I think that's still reasonable for v3. What other things do we want configurable directly from buildrom?
Attached is a quick script that I wrote this morning that starts to go down that path for v3. Given a trigger item in the buildrom config (in this case CONFIG_USE_LZMA), it adds the appropriate config options to the v3 config which is piped in through stdin. The result is a fully operational config file that can be run through oldconfig in the v3 build.
I'm sending this out for comments - clearly this is an early hack, and there will be refinements made. And v3 is the easy case - v2 is going to be a bear, and unfortunately v2 is the system that needs this the most.
I agree that v2 is the real needy one here. I think this might be overkill for v3.
Thanks, Myles
Myles Watson wrote:
Anything else they need to do a make coreboot-v3-config.
Could a submenu in buildrom menuconfig bring up the v3 menuconfig? Maybe with some Kconfig glue?
For v2, well, we're stuck using homemade config things but maybe a very simple sh script is enough?
//Peter
Peter Stuge wrote:
Myles Watson wrote:
Anything else they need to do a make coreboot-v3-config.
Could a submenu in buildrom menuconfig bring up the v3 menuconfig? Maybe with some Kconfig glue?
Possibly - the interesting thing would be "sharing" config options between buildrom and coreboot-v3.
For v2, well, we're stuck using homemade config things but maybe a very simple sh script is enough?
I think simple is a bit optimistic - here is the diff between the standard Config.lb and the LZMA enabled one for one of the tyan boards. If you think we could recreate this magic in a shell script, then lets go for it.
--- Config.lb 2008-11-06 11:47:54.000000000 -0700 +++ Config-lab.lb 2008-11-06 11:47:54.000000000 -0700 @@ -5,59 +5,19 @@ target s2891 mainboard tyan/s2891
-# Tyan s2891 -romimage "normal" -# 36K for ATI ROM in 1M - option ROM_SIZE = 1024*1024-36*1024 -# 48K for SCSI FW -# option ROM_SIZE = 512*1024-48*1024 -# 48K for SCSI FW and 36K for ATI ROM -# option ROM_SIZE = 512*1024-48*1024-36*1024 -# 64K for Etherboot -# option ROM_SIZE = 512*1024-64*1024 - option USE_FALLBACK_IMAGE=0 -# option ROM_IMAGE_SIZE=0x11800 -# option ROM_IMAGE_SIZE=0x13000 -# option ROM_IMAGE_SIZE=0x16000 - option ROM_IMAGE_SIZE=0x20000 - option XIP_ROM_SIZE=0x20000 - option COREBOOT_EXTRA_VERSION="$(shell cat ../../VERSION)_Normal" -# payload ../../../payloads/tg3--ide_disk.zelf -# payload ../../../payloads/filo.elf -# payload ../../../payloads/filo_mem.elf -# payload ../../../payloads/filo.zelf -# payload ../../../payloads/tg3--filo.zelf -# payload ../../../../payloads/tg3--filo_hda2_vga.zelf -# payload ../../../payloads/tg3--filo_hda2_vga_com2.zelf -# payload ../../../payloads/tg3--filo_hda2_vga_5_3.zelf -# payload ../../../payloads/tg3--filo_btext_hda2.zelf -# payload ../../../payloads/e1000--filo.zelf -# payload ../../../payloads/tg3--e1000--filo.zelf -# payload ../../../payloads/tg3--eepro100--e1000--filo_hda2.zelf - payload ../payload.elf -end +option ROM_SIZE=0x100000 +# 36K for ATI ROM in 1M +option FALLBACK_SIZE=(ROM_SIZE-0x9000)
+# Tyan s2891 romimage "fallback" option USE_FALLBACK_IMAGE=1 -# option ROM_IMAGE_SIZE=0x11800 -# option ROM_IMAGE_SIZE=0x13000 -# option ROM_IMAGE_SIZE=0x16000 - option ROM_IMAGE_SIZE=0x20000 - option XIP_ROM_SIZE=0x20000 + option CONFIG_COMPRESSED_PAYLOAD_LZMA=1 + option CONFIG_PRECOMPRESSED_PAYLOAD=1 + option ROM_IMAGE_SIZE=0x17000 + option XIP_ROM_SIZE=0x40000 option COREBOOT_EXTRA_VERSION="$(shell cat ../../VERSION)_Fallback" -# payload ../../../payloads/tg3--ide_disk.zelf -# payload ../../../payloads/filo.elf -# payload ../../../payloads/filo_mem.elf -# payload ../../../payloads/filo.zelf -# payload ../../../payloads/tg3--filo.zelf -# payload ../../../../payloads/tg3--filo_hda2_vga.zelf -# payload ../../../payloads/tg3--filo_hda2_vga_com2.zelf -# payload ../../../payloads/tg3--filo_hda2_vga_5_3.zelf -# payload ../../../payloads/e1000--filo.zelf -# payload ../../../payloads/tg3--filo_btext_hda2.zelf -# payload ../../../payloads/tg3--e1000--filo.zelf -# payload ../../../payloads/tg3--eepro100--e1000--filo_hda2.zelf - payload ../payload.elf + payload ../payload.elf.lzma end
-buildrom ./coreboot.rom ROM_SIZE "normal" "fallback" +buildrom ./coreboot.rom ROM_SIZE "fallback"
//Peter
-- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
On Tue, Dec 02, 2008 at 08:51:50PM -0700, Jordan Crouse wrote:
I think simple is a bit optimistic - here is the diff between the standard Config.lb and the LZMA enabled one for one of the tyan boards. If you think we could recreate this magic in a shell script, then lets go for it.
Let's start by simplyfying that diff by throwing out all the cruft from the Config.lb file:
--- Config-lab.lb 2008-11-26 14:29:06.000000000 -0500 +++ Config.lb 2008-12-02 23:18:42.000000000 -0500 @@ -5,19 +5,23 @@ target s2891 mainboard tyan/s2891
-option ROM_SIZE=0x100000 -# 36K for ATI ROM in 1M -option FALLBACK_SIZE=(ROM_SIZE-0x9000) - # Tyan s2891 +romimage "normal" +# 36K for ATI ROM in 1M + option ROM_SIZE = 1024*1024-36*1024 + option USE_FALLBACK_IMAGE=0 + option ROM_IMAGE_SIZE=0x20000 + option XIP_ROM_SIZE=0x20000 + option COREBOOT_EXTRA_VERSION="$(shell cat ../../VERSION)_Normal" + payload ../payload.elf +end + romimage "fallback" option USE_FALLBACK_IMAGE=1 - option CONFIG_COMPRESSED_PAYLOAD_LZMA=1 - option CONFIG_PRECOMPRESSED_PAYLOAD=1 - option ROM_IMAGE_SIZE=0x17000 - option XIP_ROM_SIZE=0x40000 + option ROM_IMAGE_SIZE=0x20000 + option XIP_ROM_SIZE=0x20000 option COREBOOT_EXTRA_VERSION="$(shell cat ../../VERSION)_Fallback" - payload ../payload.elf.lzma + payload ../payload.elf end
-buildrom ./coreboot.rom ROM_SIZE "fallback" +buildrom ./coreboot.rom ROM_SIZE "normal" "fallback"
So basically these are the differences:
1) no normal image in the lzma case, only fallback 2) some size parameter differences 3) payload filename is different
Thanks, Ward.