Continuing from the last post on Buildroot, I wanted to see if I can have it on my ROM.
The idea is to hav a tiny, self-contained Linux system that can be booted without any drives.
I am yet satisfied with the BIOS. I wanted to see how far I can take this by adding a bootable Linux system onto the ROM.
For that, I simply have my trusty X230 system, and the coreboot.rom
Integrating it with the coreboot image
The bzImage
can then be added to the coreboot.rom
with cbfstool
. Adding linux command line can be done by adding -C
option.
$ cbfstool coreboot.rom add-payload -f /boot/bzImage -n img/linux-acrost -C quiet
E: Could not add [/boot/bzImage, 8922703 bytes (8713 KB)@0x0]; too big?
E: Failed to add '/boot/bzImage' into ROM image.
E: Failed while operating on 'COREBOOT' region!
E: The image will be left unmodified.
Whoops... I guess the image's too big...
...or maybe the coreboot region's too small!
Getting rid of ME firmware to free up some space
The me_cleaner program is included in the coreboot package, but I'd have to build it myself.
To install the me_cleaner.py
program:
$ sudo cp util/me_cleaner/me_cleaner.py /usr/local/bin/
$ sudo mkdir /usr/local/share/man/man1
$ sudo cp util/me_cleaner/man/me_cleaner.1 /usr/local/share/man/man1/
Verify that the image is operable
$ me_cleaner.py -c x230-bios-orig.img
Full image detected
The ME/TXE region goes from 0x3000 to 0x500000
Found FPT header at 0x3010
Found 23 partition(s)
Found FTPR header: FTPR partition spans from 0x180000 to 0x24a000
ME/TXE firmware version 8.1.0.1265
Public key match: Intel ME, firmware versions 7.x.x.x, 8.x.x.x
The AltMeDisable bit is NOT SET
Checking the FTPR RSA signature... VALID
Operate with:
$ me_cleaner.py -S -r -t -d \
-D flashregion_0_flashdescriptor.bin \
-M flashregion_2_intel_me.bin \
-O modified_firmware.bin \
x230-bios-orig.img
After putting it on the custom
directory, the CBFS size can now be increased to 0xBE5000
(in decimals, that would be 12472320 bytes, or about 11.89 MiB). I found this thru trial and error.
Wrapping up
Without forgetting to run make clean
, I rebuilt the coreboot image with make -j8
again.
I then ran:
$ cbfstool coreboot.rom add-payload -f /boot/bzImage -n img/linux-acrost
No error this time!
Of course, I did not forget about the customizations done in the prior posts.