Patchwork Sanitize cbfs-files-y

login
register
about
Submitter Patrick Georgi
Date 2011-01-28 14:32:25
Message ID <1296225145.4045.79.camel@linux-0a8x.site>
Download mbox | patch
Permalink /patch/2575/
State Accepted
Commit r6319
Headers show

Comments

Patrick Georgi - 2011-01-28 14:32:25
Hi,

attached patch inverses two arguments of cbfs-files-y and adapts its
users (one of which already used the new order). This is in reponse to
feedback that the original setup was too complicated.

New cbfs-files-y:

cbfs-files-y contains the names of files as they appear in CBFS. The
arguments describe the on-filesystem name, the type and (optionally) the
position. Example:

cbfs-files-y += foo
foo-file := bar
foo-type := splashscreen
foo-position := 0xffff8000

This configures a CBFS file called "foo" that is marked "splashscreen",
located at 0xffff8000 in flash and contains the data of the file "bar"
in the filesystem (either in the current directory, ie. where the
corresponding Makefile.inc resides, or if that doesn't exist, relative
to the toplevel directory).


Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Stefan Reinauer - 2011-01-28 20:57:29
* Georgi, Patrick <Patrick.Georgi@secunet.com> [110128 15:32]:
> Hi,
> 
> attached patch inverses two arguments of cbfs-files-y and adapts its
> users (one of which already used the new order). This is in reponse to
> feedback that the original setup was too complicated.
> 
> New cbfs-files-y:
> 
> cbfs-files-y contains the names of files as they appear in CBFS. The
> arguments describe the on-filesystem name, the type and (optionally) the
> position. Example:
> 
> cbfs-files-y += foo
> foo-file := bar
> foo-type := splashscreen
> foo-position := 0xffff8000
> 
> This configures a CBFS file called "foo" that is marked "splashscreen",
> located at 0xffff8000 in flash and contains the data of the file "bar"
> in the filesystem (either in the current directory, ie. where the
> corresponding Makefile.inc resides, or if that doesn't exist, relative
> to the toplevel directory).
> 
> 
> Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>

nice!

Acked-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Stefan Reinauer - 2011-01-28 21:02:50
* Georgi, Patrick <Patrick.Georgi@secunet.com> [110128 15:32]:
> Hi,
> 
> attached patch inverses two arguments of cbfs-files-y and adapts its
> users (one of which already used the new order). This is in reponse to
> feedback that the original setup was too complicated.
> 
> New cbfs-files-y:
> 
> cbfs-files-y contains the names of files as they appear in CBFS. The
> arguments describe the on-filesystem name, the type and (optionally) the
> position. Example:
> 
> cbfs-files-y += foo
> foo-file := bar
> foo-type := splashscreen
> foo-position := 0xffff8000

Two questions:

Stuff like cmos.layout could arguably go into fallback/ or normal/. 

What's the right way to solve this with cbfs-files-y?

If it stays in /, what happens if an image is updated with a newer
version of cmos.layout (say, no old options move/remove so it's safe in
that regard). Will the file be ignored? Or Overwritten? Do we produce a
proper warning for that? 

Stefan
Patrick Georgi - 2011-01-30 16:27:15
Am 28.01.2011 22:02, schrieb Stefan Reinauer:
> Stuff like cmos.layout could arguably go into fallback/ or normal/.
> What's the right way to solve this with cbfs-files-y?
Use CONFIG_CBFS_PREFIX? Like:
cbfs-files-y += $(CONFIG_CBFS_PREFIX)/cmos.layout
$(CONFIG_CBFS_PREFIX)/cmos.layout-file := #and so on

> If it stays in /, what happens if an image is updated with a newer
> version of cmos.layout (say, no old options move/remove so it's safe in
> that regard). Will the file be ignored? Or Overwritten? Do we produce a
> proper warning for that? 
good question, but probably not.
updating things is still a "you better know what you're doing" operation


Patrick

Patch

Index: src/southbridge/intel/sch/Makefile.inc

===================================================================
--- src/southbridge/intel/sch/Makefile.inc	(Revision 6315)

+++ src/southbridge/intel/sch/Makefile.inc	(Arbeitskopie)

@@ -37,6 +37,6 @@ 

 
 # We don't ship that, but booting without it is bound to fail
 cbfs-files-$(CONFIG_HAVE_CMC) += cmc.bin
-cmc.bin-name := $(CONFIG_CMC_FILE)

+cmc.bin-file := $(CONFIG_CMC_FILE)

 cmc.bin-type := 0xaa
 cmc.bin-position := 0xfffd0000
Index: src/pc80/Makefile.inc

===================================================================
--- src/pc80/Makefile.inc	(Revision 6315)

+++ src/pc80/Makefile.inc	(Arbeitskopie)

@@ -10,7 +10,7 @@ 

 $(obj)/pc80/mc146818rtc.ramstage.o : $(OPTION_TABLE_H)
 $(obj)/pc80/mc146818rtc_early.romstage.o : $(OPTION_TABLE_H)
 
-cbfs-files-$(CONFIG_HAVE_CMOS_DEFAULT) += $(CONFIG_CMOS_DEFAULT_FILE)

-$(CONFIG_CMOS_DEFAULT_FILE)-name := cmos.default

-$(CONFIG_CMOS_DEFAULT_FILE)-type := 0xaa

+cbfs-files-$(CONFIG_HAVE_CMOS_DEFAULT) += cmos.default

+cmos.default-file = $(CONFIG_CMOS_DEFAULT_FILE)

+cmos.default-type = 0xaa

 
Index: src/arch/x86/Makefile.inc

===================================================================
--- src/arch/x86/Makefile.inc	(Revision 6315)

+++ src/arch/x86/Makefile.inc	(Arbeitskopie)

@@ -27,9 +27,9 @@ 

 
 OPTION_TABLE_H:=
 ifeq ($(CONFIG_HAVE_OPTION_TABLE),y)
-cbfs-files-y += $(obj)/cmos_layout.bin

-$(obj)/cmos_layout.bin-name = cmos_layout.bin

-$(obj)/cmos_layout.bin-type = 0x01aa

+cbfs-files-y += cmos_layout.bin

+cmos_layout.bin-file = $(obj)/cmos_layout.bin

+cmos_layout.bin-type = 0x01aa

 
 OPTION_TABLE_H:=$(obj)/option_table.h
 endif
Index: Makefile

===================================================================
--- Makefile	(Revision 6315)

+++ Makefile	(Arbeitskopie)

@@ -205,10 +205,10 @@ 

 			$$(subst $(top)/,, \
 			$$(abspath $$(addprefix $(dir $(1)),$$($(type)-y)))))) \
 	$(foreach file,$(cbfs-files-y), \
-		$(if $(wildcard $(dir $(1))$(file)), \

-			$(eval tmp-cbfs-file:= $(wildcard $(dir $(1))$(file))), \

-			$(eval tmp-cbfs-file:= $(file))) \

-		$(eval cbfs-files += $(tmp-cbfs-file)|$$($(file)-name)|$$($(file)-type)|$$($(file)-position)) \

+		$(if $(wildcard $(dir $(1))$$($(file)-file)), \

+			$(eval tmp-cbfs-file:= $(wildcard $(dir $(1))$$($(file)-file))), \

+			$(eval tmp-cbfs-file:= $$($(file)-file))) \

+		$(eval cbfs-files += $(tmp-cbfs-file)|$(file)|$$($(file)-type)|$$($(file)-position)) \

 		$(eval $(file)-name:=) \
 		$(eval $(file)-type:=) \
 		$(eval $(file)-position:=)) \