Patchwork Fixed the LZMA compression flag in Kbuild

login
register
about
Submitter Cristi Magherusan
Date 2009-08-22 18:21:35
Message ID <1250965295.12773.29.camel@ufo>
Download mbox | patch
Permalink /patch/169/
State Accepted
Headers show

Comments

Cristi Magherusan - 2009-08-22 18:21:35
Please check the attached trivial patch.

It properly checks for the LZMA compression variable, and fixes a print
message for the VGA ROM that would print a useless NULL string.

Thanks,
Cristi

The patch is 
Signed-off by: Cristi Magherusan <cristi.magherusan@net.utcluj.ro>
ron minnich - 2009-08-22 21:19:45
This is not quite complete.

For example,
src/boot/selfboot.c:#if CONFIG_COMPRESSED_PAYLOAD_LZMA==1


We're going to need to rationalize the uses of this variable across
old and new config tools and code.

I'll try to look more later or you can look too. This is not the only
problem of this type we can expect to have.

ron
ron minnich - 2009-08-22 21:25:15
Here are all uses I could fine.
Defaults to 0 in old config tool.
Set to 1 if used in new config tool.

If src/Kconfig it is:
config COMPRESSED_PAYLOAD_LZMA
        bool
        default y

So we have a problem. Here are the usages I could find.

src/mainboard/intel/eagleheights/Options.lb:default
CONFIG_COMPRESSED_PAYLOAD_LZMA=1
src/lib/Config.lb:if CONFIG_COMPRESSED_PAYLOAD_LZMA
src/lib/Makefile.inc:obj-$(CONFIG_COMPRESSED_PAYLOAD_LZMA)  +=  lzma.o
src/arch/i386/Config.lb:makedefine
PAYLOAD-$(CONFIG_COMPRESSED_PAYLOAD_LZMA):=payload.lzma
src/arch/i386/Config.lb:		action "if [
$(CONFIG_COMPRESSED_PAYLOAD_LZMA) -eq 1 -a $(CONFIG_CBFS) -eq 1 ];
then echo l > cbfs-support; fi"
src/stream/rom_stream.c:#if CONFIG_PRECOMPRESSED_PAYLOAD &&
((!CONFIG_COMPRESSED_PAYLOAD_NRV2B) &&
(!CONFIG_COMPRESSED_PAYLOAD_LZMA))
src/stream/rom_stream.c:#error "You set CONFIG_PRECOMPRESSED_PAYLOAD
but need to set CONFIG_COMPRESSED_PAYLOAD_NRV2B or
CONFIG_COMPRESSED_PAYLOAD_LZMA"
src/stream/rom_stream.c:#if ((CONFIG_COMPRESSED_PAYLOAD_NRV2B) ||
(CONFIG_COMPRESSED_PAYLOAD_LZMA))
src/stream/rom_stream.c:#if (CONFIG_COMPRESSED_PAYLOAD_LZMA)
src/stream/rom_stream.c:#if (CONFIG_COMPRESSED_PAYLOAD_LZMA)
src/stream/serial_stream.c:#if CONFIG_PRECOMPRESSED_PAYLOAD &&
((!CONFIG_COMPRESSED_PAYLOAD_NRV2B) &&
(!CONFIG_COMPRESSED_PAYLOAD_LZMA))
src/stream/serial_stream.c:#error "You set
CONFIG_PRECOMPRESSED_PAYLOAD but need to set
CONFIG_COMPRESSED_PAYLOAD_NRV2B or CONFIG_COMPRESSED_PAYLOAD_LZMA"
src/stream/serial_stream.c:#if (CONFIG_COMPRESSED_PAYLOAD_LZMA)
src/stream/serial_stream.c:#if (CONFIG_COMPRESSED_PAYLOAD_LZMA)
src/boot/selfboot.c:#if CONFIG_COMPRESSED_PAYLOAD_LZMA==1

It needs to be 'y' for Kconfig but it will have to be fixed in all the
old usages. This is not a big deal to fix. We should change it
so old config tool uses 'y', since old config tool is on its way out anyway.

But the patch is not complete. If it were committed it would break all
the old config builds.

ron
Patrick Georgi - 2009-08-22 21:41:46
Am 22.08.2009 23:25, schrieb ron minnich:
> It needs to be 'y' for Kconfig but it will have to be fixed in all the
> old usages. This is not a big deal to fix. We should change it
>    
See build/config.h: "y" is "1" there.


Patrick
ron minnich - 2009-08-23 03:28:15
On Sat, Aug 22, 2009 at 2:41 PM, Patrick Georgi<patrick@georgi-clan.de> wrote:
> Am 22.08.2009 23:25, schrieb ron minnich:
>>
>> It needs to be 'y' for Kconfig but it will have to be fixed in all the
>> old usages. This is not a big deal to fix. We should change it
>>

sounds good, sorry for my confusion ... forgot about that.

OK, so, is Cristi's fix solid? If you and cristi agree, maybe you can
ack and commit.

ron

Patch

From f97e9d74d938a2503103407a0cba8899956ffe91 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Cristi=20M=C4=83gheru=C8=99an?= <cristi.magherusan@net.utcluj.ro>
Date: Sat, 22 Aug 2009 21:14:43 +0300
Subject: [PATCH] fixed the LZMA compression

---

 Makefile                   |    2 +-
 src/arch/i386/Makefile.inc |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile

index ef20d1a..e937e7c 100644

--- a/Makefile

+++ b/Makefile

@@ -232,7 +232,7 @@  CFLAGS += -Werror-implicit-function-declaration -Wstrict-aliasing -Wshadow

 CFLAGS += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
 
 CBFS_COMPRESS_FLAG:=
-ifeq "$(CONFIG_COMPRESSED_PAYLOAD_LZMA)" "1"

+ifeq ($(CONFIG_COMPRESSED_PAYLOAD_LZMA),y)

 CBFS_COMPRESS_FLAG:=l
 endif
 
diff --git a/src/arch/i386/Makefile.inc b/src/arch/i386/Makefile.inc

index 7fed6f5..304ab03 100644

--- a/src/arch/i386/Makefile.inc

+++ b/src/arch/i386/Makefile.inc

@@ -27,7 +27,7 @@  else

 	$(Q) printf "    PAYLOAD    $(CONFIG_FALLBACK_PAYLOAD_FILE) $(COMPRESSFLAG)\n"
 	$(Q)$(CBFSTOOL) ./build/coreboot.rom add-payload $(CONFIG_FALLBACK_PAYLOAD_FILE)  fallback/payload $(CBFS_COMPRESS_FLAG)
 ifeq ($(CONFIG_VGA_BIOS),y)
-	$(Q) printf "    VGABIOS    $(CONFIG_FALLBACK_VGA_BIOS_FILE) $(CONFIG_FALLBACK_VGA_BIOS_ID) $(COMPRESSFLAG)\n"

+	$(Q) printf "    VGABIOS    $(CONFIG_FALLBACK_VGA_BIOS_FILE) $(CONFIG_FALLBACK_VGA_BIOS_ID)\n"

 	$(Q) $(CBFSTOOL) ./build/coreboot.rom add $(CONFIG_FALLBACK_VGA_BIOS_FILE) "pci$(CONFIG_FALLBACK_VGA_BIOS_ID).rom" optionrom 
 endif
 	$(Q) printf "    CBFSPRINT  ./build/coreboot.rom\n\n"
-- 

1.6.0.4