diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2021-04-09 11:45:39 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-09 13:59:41 +0000 |
commit | 57c0c5be50767c3f86c648bf33e15955cc349f25 (patch) | |
tree | c8c95f1444f0c47c829a9913d73225bbe68bb593 /cgpt/cgpt_nor.c | |
parent | 70838cc1a1294f1f53d00c08d3ee7616db073e8e (diff) | |
download | vboot-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 'cgpt/cgpt_nor.c')
-rw-r--r-- | cgpt/cgpt_nor.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/cgpt/cgpt_nor.c b/cgpt/cgpt_nor.c index 40306676..f7e65e87 100644 --- a/cgpt/cgpt_nor.c +++ b/cgpt/cgpt_nor.c @@ -49,7 +49,7 @@ int GetMtdSize(const char *mtd_device, uint64_t *size) { return ret; } -// TODO(b:184559695): Remove these functions and use subprocess_run everywhere. +// TODO(b:184812319): Remove these functions and use subprocess_run everywhere. int ForkExecV(const char *cwd, const char *const argv[]) { pid_t pid = fork(); if (pid == -1) { @@ -202,6 +202,7 @@ int RemoveDir(const char *dir) { // Read RW_GPT from NOR flash to "rw_gpt" in a temp dir |temp_dir_template|. // |temp_dir_template| is passed to mkdtemp() so it must satisfy all // requirements by mkdtemp. +// TODO(b:184812319): Replace this function with flashrom_read. int ReadNorFlash(char *temp_dir_template) { int ret = 0; @@ -215,9 +216,6 @@ int ReadNorFlash(char *temp_dir_template) { // Read RW_GPT section from NOR flash to "rw_gpt". ret++; - // TODO(b:184559695): Add parameter to subprocess_run to change directory - // before exec. Also, NULL parameter is a glibc extension that _might_ - // break FreeBSD. char *cwd = getcwd(NULL, 0); if (!cwd) { Error("Cannot get current directory.\n"); @@ -247,6 +245,7 @@ out_free: } // Write "rw_gpt" back to NOR flash. We write the file in two parts for safety. +// TODO(b:184812319): Replace this function with flashrom_write. int WriteNorFlash(const char *dir) { int ret = 0; @@ -258,9 +257,6 @@ int WriteNorFlash(const char *dir) { ret++; int nr_fails = 0; - // TODO(b:184559695): Add parameter to subprocess_run to change directory - // before exec. Also, NULL parameter is a glibc extension that _might_ - // break FreeBSD. char *cwd = getcwd(NULL, 0); if (!cwd) { Error("Cannot get current directory.\n"); |