Hi,
I've a question. I'm writing a software that installs a specific Linux
distro on the target computer automatically. It also should flash
coreboot as part of the install process, and that's where I'm stuck.
From what I've gathered, for that I would need a stripped down version
of libflashrom that only has the internal SPI driver, nothing else
(without laptop-checks, Paralell, LPC, NICs, external USB programmers
etc.) What is the best way to achieve this?
I've already set up my test environment: I've configured and compiled
qemu with "-enable-m25p80", which emulates lots of flash chips, among
others the one that my target machine has. Then I can run qemu with
"-device m25p80" and start a minimal Linux VM with the flashrom
utility that I've compiled from source.
I've also cleaned up flashrom.c to only list the chips with the
BUS_SPI interface (I need to support one specific chip only, but my
understanding is, all of these use the same driver so it shouldn't be
a problem having all these chips in this list). Now I need to remove
files and functions that are not related to internal SPI, and I'm not
sure how to proceed. Which would be the easiest and suggested way to
have a stripped down libflashrom with just the internal SPI driver?
ps: unfortunately using flashrom as-is is out of question because it
has way too many dependencies that the installer image simply does not
have. For example, there's no libpci, libusb and no /dev/spidev device
either, so I must restrict libflashrom to use its own driver, and also
my installer can't call system(), so I must link it with libflashrom.
Can somebody help me with this?