Attention is currently required from: Martin L Roth.
Jérémy Compostella has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/77230?usp=email )
Change subject: Makefile.inc: Support FILENAME-REGION-compression CBFS flag ......................................................................
Makefile.inc: Support FILENAME-REGION-compression CBFS flag
The `FILENAME-REGION-compression' CBFS flag allows to specify a compression algorithm per REGION. Similarily, to `-align' or `-position', it overrides the `FILENAME-compression' flag for a particular `REGION'.
It can be use to set the compression to `none' for a particular region in which the file is going to be use in pre-memory stages and therefore cannot be uncompressed without alterating the more desired compressed version for other regions.
BUG=b:279173035 TEST=Verified that with `vtb.bin-COREBOOT-compression := none' the vbt.bin in the COREBOOT region is not compressed.
Change-Id: I4e3b827407aeca60f27270ee5d3fa606047a80d5 Signed-off-by: Jeremy Compostella jeremy.compostella@intel.com --- M Documentation/getting_started/build_system.md M Makefile.inc 2 files changed, 17 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/77230/1
diff --git a/Documentation/getting_started/build_system.md b/Documentation/getting_started/build_system.md index 787c833..7f19bbe 100644 --- a/Documentation/getting_started/build_system.md +++ b/Documentation/getting_started/build_system.md @@ -71,8 +71,9 @@ Since FMAP policies depend on features using FMAP, that's kept separate from the cbfs-files class.
-The `position` and `align` options for file `foo` can be overwritten for a -region `REGION` using `foo-REGION-position` and `foo-REGION-align`. +The `position`, `align` and `compression` options for file `foo` can be +overwritten for a region `REGION` using `foo-REGION-position`, +`foo-REGION-align` and `foo-REGION-compression`.
The regions that each file should end in can be defined by overriding a function called `regions-for-file` that's called as diff --git a/Makefile.inc b/Makefile.inc index b5665a7..f3371c1 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -957,17 +957,23 @@ update-file-for-region = \ $(subst $(spc),*,$(call extract_nth,1,$(1))|$(call extract_nth,2,$(1))|$(call extract_nth,3,$(1))|$(call extract_nth,4,$(1))|$($(call extract_nth,2,$(1))-$(2)-position)|$($(call extract_nth,2,$(1))-$(2)-align)|$(call extract_nth,7,$(1)))
+# $(call update-file-compression-for-region,file string from $(cbfs-files),region name) +# Update compression according to overrides for region if available +# Returns the updated file string +update-file-compression-for-region = $(subst $(spc),*,$(call extract_nth,1,$(1))|$(call extract_nth,2,$(1))|$(call extract_nth,3,$(1))|$(if $($(call extract_nth,2,$(1))-$(2)-compression),$($(call extract_nth,2,$(1))-$(2)-compression),$(call extract_nth,4,$(1)))|$(call extract_nth,5,$(1))|$(call extract_nth,6,$(1))|$(call extract_nth,7,$(1))) + # $(call placed-files-in-region,region name) # like all-files-in-region, but updates the files to contain region overrides -# to position or alignment. -placed-files-in-region = $(foreach file,$(call all-files-in-region,$(1)), \ - $(if $($(call extract_nth,2,$(file))-$(1)-position), \ - $(if $($(call extract_nth,2,$(file))-$(1)-align), \ - $(error It is not allowed to specify both alignment and position for $(call extract_nth,2,$(file))-$(1))) \ - $(call update-file-for-region,$(file),$(1)), \ - $(if $($(call extract_nth,2,$(file))-$(1)-align), \ +# to position, alignment or compression. +placed-files-in-region = $(foreach file,$(call all-files-in-region,$(1)),\ + $(call update-file-compression-for-region,$(strip \ + $(if $($(call extract_nth,2,$(file))-$(1)-position), \ + $(if $($(call extract_nth,2,$(file))-$(1)-align), \ + $(error It is not allowed to specify both alignment and position for $(call extract_nth,2,$(file))-$(1))) \ $(call update-file-for-region,$(file),$(1)), \ - $(file)))) + $(if $($(call extract_nth,2,$(file))-$(1)-align), \ + $(call update-file-for-region,$(file),$(1)), \ + $(file)))),$(1)))
# $(call sort-files,subset of $(cbfs-files)) # reorders the files in the given set to list files at fixed positions first,