summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2020-10-13 19:04:52 -0600
committerCommit Bot <commit-bot@chromium.org>2020-10-14 15:44:56 +0000
commit4dacbf92be28c937e07b397ade29e5b8a84cdb7f (patch)
tree81bdd763aa1f62e494880e56b47a4af9cdb5f2ed
parent519c608d2464b5b45b7bfe432a27eae119777971 (diff)
downloadvboot-4dacbf92be28c937e07b397ade29e5b8a84cdb7f.tar.gz
crossystem: remove mosys nvstorage implementation
As promised, it's October 2020, nyan_kitty went AUE with M85, and M86 just got pushed stable. That means we can now delete this code :) BUG=chromium:1090803 BRANCH=none TEST=compiles Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I5a15ef1e1ad02885af135d8e42d02d492bdd6c05 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2469604 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
-rw-r--r--host/arch/arm/lib/crossystem_arch.c4
-rw-r--r--host/include/crossystem_vbnv.h14
-rw-r--r--host/lib/crossystem.c70
3 files changed, 0 insertions, 88 deletions
diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c
index f2e432f9..0223b70c 100644
--- a/host/arch/arm/lib/crossystem_arch.c
+++ b/host/arch/arm/lib/crossystem_arch.c
@@ -433,8 +433,6 @@ int vb2_read_nv_storage(struct vb2_context *ctx)
media = ReadFdtString(FDT_NVSTORAGE_TYPE_PROP);
if (!strcmp(media, "disk"))
return vb2_read_nv_storage_disk(ctx);
- if (!strcmp(media, "cros-ec") || !strcmp(media, "mkbp"))
- return vb2_read_nv_storage_mosys(ctx);
if (!strcmp(media, "flash"))
return vb2_read_nv_storage_flashrom(ctx);
return -1;
@@ -450,8 +448,6 @@ int vb2_write_nv_storage(struct vb2_context *ctx)
media = ReadFdtString(FDT_NVSTORAGE_TYPE_PROP);
if (!strcmp(media, "disk"))
return vb2_write_nv_storage_disk(ctx);
- if (!strcmp(media, "cros-ec") || !strcmp(media, "mkbp"))
- return vb2_write_nv_storage_mosys(ctx);
if (!strcmp(media, "flash"))
return vb2_write_nv_storage_flashrom(ctx);
return -1;
diff --git a/host/include/crossystem_vbnv.h b/host/include/crossystem_vbnv.h
index d61506c2..2f246188 100644
--- a/host/include/crossystem_vbnv.h
+++ b/host/include/crossystem_vbnv.h
@@ -28,20 +28,6 @@ int vb2_read_nv_storage_flashrom(struct vb2_context *ctx);
*/
int vb2_write_nv_storage_flashrom(struct vb2_context* ctx);
-/**
- * Attempt to read non-volatile storage using mosys.
- *
- * Returns 0 if success, non-zero if error.
- */
-int vb2_read_nv_storage_mosys(struct vb2_context *ctx);
-
-/**
- * Attempt to write non-volatile storage using mosys.
- *
- * Returns 0 if success, non-zero if error.
- */
-int vb2_write_nv_storage_mosys(struct vb2_context* ctx);
-
#ifdef __cplusplus
}
#endif
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 59acc0d2..6d72dc07 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -23,8 +23,6 @@
/* Filename for kernel command line */
#define KERNEL_CMDLINE_PATH "/proc/cmdline"
-#define MOSYS_PATH "/usr/sbin/mosys"
-
/* Fields that GetVdatString() can get */
typedef enum VdatStringField {
VDAT_STRING_DEPRECATED_TIMERS = 0, /* Timer values */
@@ -754,71 +752,3 @@ int vb2_write_nv_storage_flashrom(struct vb2_context *ctx)
free(flash_buf);
return rv;
}
-
-/* TODO(crbug.com/1090803): remove these mosys nvdata functions
- (approx. October 2020). */
-int vb2_read_nv_storage_mosys(struct vb2_context *ctx)
-{
- /* Reserve extra 32 bytes */
- char hexstring[VB2_NVDATA_SIZE_V2 * 2 + 32];
- /*
- * TODO(rspangler): mosys doesn't know how to read anything but 16-byte
- * records yet. When it grows a command line option to do that, call
- * it here when needed.
- *
- * It's possible mosys won't need that. For example, if if examines
- * the header byte to determine the records size, or if it calls back
- * to crossystem to read the VBSD flag.
- */
- const char * const argv[] = {
- MOSYS_PATH, "nvram", "vboot", "read", NULL
- };
- char hexdigit[3];
- const int nvsize = vb2_nv_get_size(ctx);
- int i;
-
- struct subprocess_target output = {
- .type = TARGET_BUFFER,
- .buffer = {
- .buf = hexstring,
- .size = sizeof(hexstring),
- },
- };
-
- if (subprocess_run(argv, &subprocess_null, &output, NULL)) {
- fprintf(stderr, "Error running mosys to read nvram data\n");
- return -1;
- }
-
- if (output.buffer.bytes_consumed < 2 * nvsize) {
- fprintf(stderr, "mosys returned hex nvdata size %d"
- " (need %d)\n", (int)strlen(hexstring), 2 * nvsize);
- return -1;
- }
- hexdigit[2] = '\0';
- for (i = 0; i < nvsize; i++) {
- hexdigit[0] = hexstring[i * 2];
- hexdigit[1] = hexstring[i * 2 + 1];
- ctx->nvdata[i] = strtol(hexdigit, NULL, 16);
- }
- return 0;
-}
-
-int vb2_write_nv_storage_mosys(struct vb2_context *ctx)
-{
- char hexstring[VB2_NVDATA_SIZE_V2 * 2 + 1];
- const char * const argv[] = {
- MOSYS_PATH, "nvram", "vboot", "write", hexstring, NULL
- };
- const int nvsize = vb2_nv_get_size(ctx);
- int i;
-
- for (i = 0; i < nvsize; i++)
- snprintf(hexstring + i * 2, 3, "%02x", ctx->nvdata[i]);
- hexstring[sizeof(hexstring) - 1] = '\0';
- if (subprocess_run(argv, &subprocess_null, &subprocess_null, NULL)) {
- fprintf(stderr, "Error running mosys to write nvram data\n");
- return -1;
- }
- return 0;
-}