UPSTREAM: rules.h: change verstage name if it starts before bootblock

VBOOT_STARTS_VEFORE_BOOTBLOCK indicates that verstage starts before
bootblock. However "cbmem -1" will first try to match "bootblock
starting" to find out the beginning of console for current boot.

Change ENV_STRING for verstage to "verstage-before-bootblock" in the
case and add regex in cbmem utility to grab it.

BUG=b:159220781
TEST=flash and boot, check `cbmem -1`
BRANCH=zork

Signed-off-by: Martin Roth <gaumless@gmail.com>
Original-Commit-Id: 4b5c8b554154f290d509b6db3c44f850134581b7
Original-Signed-off-by: Kangheui Won <khwon@chromium.org>
Original-Change-Id: Ica38f6bfeb05605caadac208e790fd072b352732
Original-Reviewed-on: https://review.coreboot.org/c/coreboot/+/46060
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Change-Id: I6c28089acf025fc4c6420a0f5d72e1900752d3fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/+/2458818
Reviewed-by: Martin Roth <martinroth@google.com>
Commit-Queue: Martin Roth <martinroth@google.com>
Tested-by: Martin Roth <martinroth@google.com>
(cherry picked from commit eb9a894107a39bfb0b3b5692b5cd36e6731800d7)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/+/2490419
Auto-Submit: Martin Roth <martinroth@google.com>
diff --git a/src/include/rules.h b/src/include/rules.h
index 39836b1..d30b2b8 100644
--- a/src/include/rules.h
+++ b/src/include/rules.h
@@ -78,7 +78,11 @@
 #define ENV_RMODULE 0
 #define ENV_POSTCAR 0
 #define ENV_LIBAGESA 0
+#if CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)
+#define ENV_STRING "verstage-before-bootblock"
+#else
 #define ENV_STRING "verstage"
+#endif
 
 #elif defined(__RAMSTAGE__)
 #define ENV_DECOMPRESSOR 0
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c
index 34e79d3..3a94f3e 100644
--- a/util/cbmem/cbmem.c
+++ b/util/cbmem/cbmem.c
@@ -782,7 +782,8 @@
 #define BANNER_REGEX(stage) \
 		"\n\ncoreboot-[^\n]* " stage " starting.*\\.\\.\\.\n"
 #define OVERFLOW_REGEX(stage) "\n\\*\\*\\* Pre-CBMEM " stage " console overflow"
-		const char *regex[] = { BANNER_REGEX("bootblock"),
+		const char *regex[] = { BANNER_REGEX("verstage-before-bootblock"),
+					BANNER_REGEX("bootblock"),
 					BANNER_REGEX("verstage"),
 					OVERFLOW_REGEX("romstage"),
 					BANNER_REGEX("romstage"),