774dcffc36
Currently elogtool sub-proccesses flashrom as calling libflashrom requires a missing function from the previous flashrom release. Pending a new release of flashrom we must continue to use subprocess. However the current subprocess wrapper implementation lives in vboot_reference which is a git sub-module of coreboot. This causes all sorts of grief keeping a subprocess ABI stable from vboot_reference when the rest of vboot_reference builds of HEAD of the flashrom tree (i.e., using unreleased libflashrom functions). In order to not keep finding ourseleves in a bind between the two separately moving trees with different build environments, decouple elogtool with its own mini copy of flashrom subprocess wrapping logic. Squash in, util/cbfstool/elogtool.c: Convert args into struct in flashrom helper vboot signatures for flashrom r/w helpers changed in the upstream commit bd2971326ee94fc5. Reflect the change here to allow vboot ref and coreboot to realign. BUG=b:207808292,b:231152447 TEST=builds with vboot_ref uprev. Change-Id: I04925e4d9a44b52e4a6fb6f9cec332cab2c7c725 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65055 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
33 lines
1,018 B
C
33 lines
1,018 B
C
/* Copyright 2020 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*
|
|
* Host utilities to execute flashrom command.
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include "common.h" /* from cbfstool for buffer API. */
|
|
|
|
/**
|
|
* Read using flashrom into an allocated buffer.
|
|
*
|
|
* @param buffer The parameter that contains the buffer to use
|
|
* in the read operation.
|
|
* @param region The name of the fmap region to read, or NULL to
|
|
* read the entire flash chip.
|
|
*
|
|
* @return 0 on success, or < 0 on error.
|
|
*/
|
|
int flashrom_host_read(struct buffer *buffer, const char *region);
|
|
|
|
/**
|
|
* Write using flashrom from a buffer.
|
|
*
|
|
* @param buffer The parameter that contains the buffer to use
|
|
* in the write operation.
|
|
* @param regions The name of the fmap region to write, or NULL to
|
|
* write the entire flash chip.
|
|
*
|
|
* @return 0 on success, or < 0 on error.
|
|
*/
|
|
int flashrom_host_write(struct buffer *buffer, const char *region);
|