summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2021-04-09 11:45:39 +0800
committerCommit Bot <commit-bot@chromium.org>2021-04-09 13:59:41 +0000
commit57c0c5be50767c3f86c648bf33e15955cc349f25 (patch)
treec8c95f1444f0c47c829a9913d73225bbe68bb593 /Makefile
parent70838cc1a1294f1f53d00c08d3ee7616db073e8e (diff)
downloadvboot-57c0c5be50767c3f86c648bf33e15955cc349f25.tar.gz
cgpt: Move all GPT on SPI-NOR infra behind a flag
This piece of code caused serious issues in b/184559695, and it seems like we have no active users at the moment. We can punt the decision to remove the code entirely, but for now, let's stop building and executing it, leaving it to potential users to fix it up, and refactor/cleanup/test the code. BRANCH=none BUG=b:184812319 TEST=`make` does not build `cgpt_wrapper` or any SPI-NOR code. TEST=`make GPT_SPI_NOR=1` does build it. TEST=`emerge-$BOARD -v vboot_reference && \ cros deploy $IP vboot_reference` `cgpt find -t kernel` does not print any RW_GPT-related errors anymore. Change-Id: Ie081f372964807caa1b121059288ae761f2f8e43 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2814132 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 15 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 5f5132c7..c4ebbddc 100644
--- a/Makefile
+++ b/Makefile
@@ -187,6 +187,12 @@ ifneq (${TPM2_MODE},)
CFLAGS += -DTPM2_MODE
endif
+# Support devices with GPT in SPI-NOR (for nand device)
+# TODO(b:184812319): Consider removing this code if nobody uses it.
+ifneq (${GPT_SPI_NOR},)
+CFLAGS += -DGPT_SPI_NOR
+endif
+
# Enable boot from external disk when switching to dev mode
ifneq ($(filter-out 0,${BOOT_EXTERNAL_ON_DEV}),)
CFLAGS += -DBOOT_EXTERNAL_ON_DEV=1
@@ -498,7 +504,6 @@ HOSTLIB_SRCS = \
cgpt/cgpt_create.c \
cgpt/cgpt_edit.c \
cgpt/cgpt_find.c \
- cgpt/cgpt_nor.c \
cgpt/cgpt_prioritize.c \
cgpt/cgpt_show.c \
firmware/2lib/2common.c \
@@ -535,6 +540,10 @@ HOSTLIB_SRCS = \
host/lib21/host_misc.c \
${TLCL_SRCS}
+ifneq (${GPT_SPI_NOR},)
+HOSTLIB_SRCS += cgpt/cgpt_nor.c
+endif
+
HOSTLIB_OBJS = ${HOSTLIB_SRCS:%.c=${BUILD}/%.o}
ALL_OBJS += ${HOSTLIB_OBJS}
@@ -552,7 +561,6 @@ CGPT_SRCS = \
cgpt/cgpt_edit.c \
cgpt/cgpt_find.c \
cgpt/cgpt_legacy.c \
- cgpt/cgpt_nor.c \
cgpt/cgpt_prioritize.c \
cgpt/cgpt_repair.c \
cgpt/cgpt_show.c \
@@ -566,6 +574,10 @@ CGPT_SRCS = \
cgpt/cmd_repair.c \
cgpt/cmd_show.c
+ifneq (${GPT_SPI_NOR},)
+CGPT_SRCS += cgpt/cgpt_nor.c
+endif
+
CGPT_OBJS = ${CGPT_SRCS:%.c=${BUILD}/%.o}
ALL_OBJS += ${CGPT_OBJS}
@@ -948,7 +960,7 @@ ${CGPT_WRAPPER}: ${CGPT_WRAPPER_OBJS} ${UTILLIB}
${Q}${LD} -o ${CGPT_WRAPPER} ${LDFLAGS} $^ ${LDLIBS}
.PHONY: cgpt
-cgpt: ${CGPT} ${CGPT_WRAPPER}
+cgpt: ${CGPT} $(if ${GPT_SPI_NOR},cgpt_wrapper)
# on FreeBSD: install misc/e2fsprogs-libuuid from ports,
# or e2fsprogs-libuuid from its binary package system.