Author: myles
Date: 2008-02-15 20:16:50 +0100 (Fri, 15 Feb 2008)
New Revision: 118

Modified:
   buildrom-devel/Config.in
   buildrom-devel/Makefile
   buildrom-devel/config/payloads/payloads.conf
Log:
This patch uses lar to compress a payload, instead of pre-compressing
it.  Since we are already using lar to add the payload, this
simplifies the build process.  It also allows us to compress filo,
which didn't work with v2.

Thanks,
Myles

Signed-off-by: Myles Watson <myles at pel.cs.byu.edu>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>



Modified: buildrom-devel/Config.in
===================================================================
--- buildrom-devel/Config.in    2008-02-13 21:33:04 UTC (rev 117)
+++ buildrom-devel/Config.in    2008-02-15 19:16:50 UTC (rev 118)
@@ -78,14 +78,17 @@
 
 config USE_LZMA
        bool "Enable LZMA compression"
-       depends !PAYLOAD_OFW
-       depends !PAYLOAD_FILO
-       depends !PAYLOAD_ETHERBOOT
+       depends !(PAYLOAD_OFW && COREBOOT_V2)
+       depends !(PAYLOAD_FILO && COREBOOT_V2)
+       depends !(PAYLOAD_ETHERBOOT && COREBOOT_V2)
        default y
        help
-         Precompress the payload with LZMA. This doesn't work
-         for FILO, OFW, or ETHERBOOT.
+         Precompress the payload with LZMA when using coreboot v2. This doesn't
+         work for FILO, OFW, or ETHERBOOT.
 
+         When using COREBOOT_V3, parse the elf and have lar compress the files.
+         This works with all ELF payloads.
+
 config CB_USE_BUILD
        bool "Specify a coreboot build dir"
        depends ADVANCED

Modified: buildrom-devel/Makefile
===================================================================
--- buildrom-devel/Makefile     2008-02-13 21:33:04 UTC (rev 117)
+++ buildrom-devel/Makefile     2008-02-15 19:16:50 UTC (rev 118)
@@ -69,9 +69,17 @@
 rom: $(HOSTTOOLS-y) payload $(COREBOOT-y)
 else
 
+# If compressing the payload in v3, parse the elf and tell lar to compress it.
+# Parsing the elf without compression bloats the ROM with bss zeroes.
+ifeq ($(CONFIG_USE_LZMA),y)
+LAR_PAYLOAD_FLAGS=-a -e -C lzma
+else
+LAR_PAYLOAD_FLAGS=-a
+endif
+
 rom: $(HOSTTOOLS-y) payload $(COREBOOT-y)
        @ cp $(CBV3_OUTPUT) $(TARGET_ROM_FILE)
-       @ $(STAGING_DIR)/bin/lar -a $(TARGET_ROM_FILE) 
$(PAYLOAD_TARGET):normal/payload
+       @ $(STAGING_DIR)/bin/lar $(LAR_PAYLOAD_FLAGS) $(TARGET_ROM_FILE) 
$(PAYLOAD_TARGET):normal/payload
        @ for file in `ls $(ROM_DIR)`; do \
                $(STAGING_DIR)/bin/lar -a $(TARGET_ROM_FILE) 
$(ROM_DIR)/$$file:$$file; \
        done

Modified: buildrom-devel/config/payloads/payloads.conf
===================================================================
--- buildrom-devel/config/payloads/payloads.conf        2008-02-13 21:33:04 UTC 
(rev 117)
+++ buildrom-devel/config/payloads/payloads.conf        2008-02-15 19:16:50 UTC 
(rev 118)
@@ -27,8 +27,11 @@
 
 include $(CONFIG_DIR)/payloads/$(PCONF-y)
 
-# Add LZMA if it is enabled
+# Add LZMA if it is enabled and we are using v2
+ifeq ($(CONFIG_COREBOOT_V2),y)
 HOSTTOOLS-$(CONFIG_USE_LZMA) += lzma
+endif
+
 HOSTTOOLS-$(CONFIG_BUILD_QEMU) += qemu
 
 # Sanity check
@@ -38,19 +41,25 @@
 endif
 
 ifeq ($(CONFIG_USE_LZMA),y)
+ifeq ($(CONFIG_COREBOOT_V2),y)
 ifeq ($(PAYLOAD_COMPRESSED),)
 $(error You must specify a compressed target)
 endif
 endif
+endif
 
 # Set the payload target (if it wasn't set by the config - warning
 # there be dragons here if everything isn't aligned)
 
 ifeq ($(PAYLOAD_TARGET),)
-ifeq ($(CONFIG_USE_LZMA),y)
-PAYLOAD_TARGET=$(PAYLOAD_COMPRESSED)
-else
-PAYLOAD_TARGET=$(PAYLOAD_ELF)
+       ifeq ($(CONFIG_COREBOOT_V2),y)
+               ifeq ($(CONFIG_USE_LZMA),y)
+                               PAYLOAD_TARGET=$(PAYLOAD_COMPRESSED)
+               else
+                               PAYLOAD_TARGET=$(PAYLOAD_ELF)
+               endif
+       else
+               PAYLOAD_TARGET=$(PAYLOAD_ELF)
+       endif
 endif
-endif
 


-- 
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to