[coreboot-gerrit] New patch to review for coreboot: Makefile.inc: Document extract_nth and the fields it extracts

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Wed Dec 16 00:49:31 CET 2015


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12713

-gerrit

commit 61b2e235dd6174ba8e705047273078ebac8bab56
Author: Martin Roth <martinroth at google.com>
Date:   Fri Dec 11 11:40:06 2015 -0700

    Makefile.inc: Document extract_nth and the fields it extracts
    
    Change-Id: I0b5cffff95aca0ea0d6302b436797dada1850ba0
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 Makefile.inc | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/Makefile.inc b/Makefile.inc
index 603be00..976280c 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -600,6 +600,33 @@ $(objcbfs)/%.elf: $(objcbfs)/%.debug
 # Build the final rom image
 ###########################################################################
 
+# extract_nth - Return a subsection of the $file string
+#
+# the input string looks like this:
+# ./build/cbfs/fallback/romstage.elf|fallback/romstage|stage|none||64|--xip*-S*.car.data*-P*0x10000
+#
+# Sections:
+# 1 - Path and name of file [FILENAME: Added to cbfs-files-y list variable]
+# 2 - Name of file in cbfs  [$(FILENAME)-file]
+# 3 - File type:            [$(FILENAME)-type]
+#                bootblock, cbfs header, stage, payload, optionrom, bootsplash, raw, vsa,
+#                mbi, microcode, fsp, mrc, cmos_default, cmos_layout, spd, mrc_cache,
+#                mma, efi, deleted, null
+# 4 - Compression type      [$(FILENAME)-compression]
+#                      none, LZMA
+# 5 - Base address          [$(FILANAME)-position]
+# 6 - Alignment             [$(FILENAME)-align]
+# 7 - cbfstool flags        [$(FILENAME)-options]
+#
+# Input:
+#  $(1) = Section to extract
+#  $(2) = Input string
+#
+# Steps:
+# 1) replace all '|' characters with the sequence '- -' within the full string, prepended and appended with the character '-'
+# 2) extract the specified section from the string - this gets us the section surrounded by '-' characters
+# 3) remove the leading and trailing '-' characters
+# 4) replace all '*' characters with spaces
 extract_nth=$(subst *,$(spc),$(patsubst -%-,%,$(word $(1), $(subst |,- -,-$(2)-))))
 
 cbfs-add-cmd = \



More information about the coreboot-gerrit mailing list