1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

8 Commits

Author SHA1 Message Date
Edward O'Callaghan
00635b0da2 Revert "libflashrom: Return progress state to the library user"
This reverts commit 40892b0c08fbc8029921e91511dd3f91fc956f90.

The feature of returning progress for libflashrom users was
introduced in original commit, however later a bug was found and
reported as https://ticket.coreboot.org/issues/390.

Reverting in a release branch to unblock release candidate, since
it is unknown how much time needed to fix the bug. Meanwhile the
feature remains in a master branch and will be fixed under
ticket 390.

TEST=scenarios below run successfully
1) flashrom -h does not show --progress
2) flashrom -p dummy:emulate=W25Q128FV -r /tmp/dump.bin
3) flashrom -p dummy:emulate=W25Q128FV -v /tmp/dump.bin
4) flashrom -p dummy:emulate=W25Q128FV -E
5) head -c 16777216 </dev/urandom >/tmp/image.bin
flashrom -p dummy:image=/tmp/image.bin,emulate=W25Q128FV \
	 -w /tmp/dump.bin

Change-Id: Id3d7ffcaf266a60a44eb453fd09b7c63c05349c2
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69283
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-11-10 17:23:07 +00:00
Evan Benn
5b78c08156 libflashrom.map: Add missing functions from libflashrom.h
Some functions were not being defined, namely flashrom_wp_*. Thus, add
all missing functions from libflashrom.h header file.

Change-Id: Ic90b3c20780d3a07b00bfca82d23d44c4fa6f22f
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/64851
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
2022-06-15 05:42:50 +00:00
Richard Hughes
40892b0c08 libflashrom: Return progress state to the library user
Projects using libflashrom like fwupd expect the user to wait for the
operation to complete. To avoid the user thinking the process has
"hung" or "got stuck" report back the progress complete of the erase,
write and read operations.

Add a new --progress flag to the CLI to report progress of operations.

Include a test for the dummy spi25 device.

TEST=./test_build.sh; ./flashrom -p lspcon_i2c_spi:bus=7 -r /dev/null --progress

Change-Id: I7197572bb7f19e3bdb2bde855d70a0f50fd3854c
Signed-off-by: Richard Hughes <richard@hughsie.com>
Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/49643
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-05-25 08:08:13 +00:00
Edward O'Callaghan
f31bb81de1 layout: Hoist get_region_range() into libflashrom API
While using the libflashrom API to read specific regions
there is no currently no general way to find the offset
into the read buffer of the expected region.

flashrom_layout_include_region() probably should have
returned the region offset and size if it was included.
However to avoid a change in API signature we can instead
hoist up get_region_range() into the API to be called after.

BUG=b:207808292
TEST=`make` && tested in porting cbfstool use-case.

Change-Id: I8cf95b5eaec943a51d0ea668f26a56bf6d6b4446
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/60881
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sam McNally <sammc@google.com>
2022-01-11 22:53:44 +00:00
Thomas Heijligen
72fd4f194e libflashrom: remove flashrom_system_info
void flashrom_system_info(void) has no implementation nor any relation
to existing code.

Change-Id: Iad805322aeead149a8d51ad8bf0babde2a12f01f
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/55351
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2021-06-20 09:10:28 +00:00
Thomas Heijligen
6aaa51f19a libflashrom: remove flashrom_supported_programmers
const char **flashrom_supported_programmers(void) returns an array of
strings without returning the array size or making a NULL
termination. This can lead to undefined behavior when iterating over the
array.

Change-Id: I0157926a654e337c14d840dd398e5576471c304f
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/55350
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-06-20 09:10:15 +00:00
Artur Raglis
71b706f544 libflashrom: add querying functions with meson integration
Work based on lukasz.dmitrowski@gmail.com code

Change-Id: I49041b8fa5700dabe59fef0d2337339d34cd6c6f
Signed-off-by: Artur Raglis <artur.raglis@3mdeb.com>
Signed-off-by: Lukasz Dmitrowski <lukasz.dmitrowski@gmail.com>
Signed-off-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/34363
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2019-09-17 00:34:37 +00:00
Richard Hughes
cb97368328 Add support for the meson build system
The fwupd project has to build in all kinds of crazy targets, e.g. for odd
endians, odd instruction sets, and in odd ways, e.g. installing with a prefix
of /app for projects like flatpak. We also have other "robustness" guarantees
and therefore have a comprehensive set of CI tests which enable a lot of
warning flags and run linting and static analysis code like Coverity.

Rather than hack the Makefile I ported the codebase to use Meson.
Meson is a(nother) next-generation build system used by a lot of open source
projects ranging from low level libraries to desktop software. As part of the
port, I also copied the CONFIG_ logic from the makefile, e.g.

  Option                  Current Value Possible Values Description
  ------                  ------------- --------------- -----------
  config_atahpt           false         [true, false]   Highpoint (HPT) ATA/RAID controllers
  config_atapromise       false         [true, false]   Promise ATA controller
  config_atavia           true          [true, false]   VIA VT6421A LPC memory
...

At the moment I'm using the meson port so I can include flashrom as a subproject
to fwupd as distros are not yet shipping libflashrom as a shared library.

Change-Id: I3d950ece2a0568c09985eab47ddab9df1d0c43a2
Signed-off-by: Richard Hughes <richard@hughsie.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/31248
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2019-04-02 17:33:27 +00:00