T60p Build Coreboot - bibanon/Coreboot-ThinkPads GitHub Wiki
This method embeds a proprietary VGABIOS into Coreboot. Coreboot can also be built with SeaBIOS or a GRUB2 payload (used in Libreboot).
We recommend using the GRUB2 Payload; Libreboot has already integrated SeaBIOS into it.
Build Coreboot with SeaBIOS and VGABIOS
In this method, SeaBIOS will be used. SeaBIOS will display perfectly unlike on Libreboot, since it is able to use the proprietary VGABIOS.
Preparation
-
Install all the packages required to build Coreboot:
sudo apt-get install libncurses-dev iasl libc6-dev bison flex git zlib1g-dev gnat
-
Then, clone the Coreboot source code with Git:
git clone https://review.coreboot.org/coreboot.git cd coreboot git submodule update --init --checkout
Configuration
Note: We will borrow Libreboot's T60 config file, which has all the options set up for us.
-
Download and extract the Libreboot source code.
-
Obtain the T60 Coreboot
config
file, found under thelibreboot_src/resources/libreboot/config/t60
folder. -
Copy that
config
file to thecoreboot/
source code folder. -
Rename
config
to.config
, with a dot at the beginning..config
will become a hidden file. -
Choose between the two payloads below: Coreboot's default SeaBIOS, or Libreboot's GRUB2.
SeaBIOS Payload
This section will use SeaBIOS as the payload, which can run MBR bootloaders. (If you want to use GRUB2 as the payload instead, check this section)
-
Edit the
.config
file with a text editor. (you may need to use the command line andnano
to do so, since it is a hidden file) -
Find the
Payload
section (use Ctrl-F), and replace the entire section with the following:
#
# Payload
#
CONFIG_PAYLOAD_SEABIOS=y
CONFIG_SEABIOS_STABLE=y
CONFIG_PAYLOAD_FILE="payloads/external/SeaBIOS/seabios/out/bios.bin.elf"
CONFIG_COMPRESSED_PAYLOAD_LZMA=y
-
From the
coreboot
folder, use this command to visually configure the.config
file.make menuconfig
-
SeaBIOS automatically detects and runs VGABIOS binaries on it's own. Please make sure Devices -> Run VGA Option ROMs is disabled.
Embedding the VGABIOS in Coreboot
-
Copy over the
vgabios.bin
file (from wherever it was saved) to thecoreboot/
folder. -
From the
coreboot/
folder, use this command to visually configure the.config
file.make menuconfig
-
Enter the VGABIOS menu, and enable the following settings, as shown in the following example.
VGA BIOS ---> [*] Add a VGA BIOS image (vgabios.bin) VGA BIOS path and filename (1002,7145) VGA device PCI IDs
Warning: Make sure to use the VGA PCI IDs found from extracting the
vgabios.bin
), each one is unique.
Build Coreboot
-
Now exit configuration, and run
make crossgcc
to build the Coreboot toolchain. (The Coreboot toolchain is used since many distro toolchains have been modified and are incompatible with Coreboot)make crossgcc
-
Run
make
to build coreboot.make
-
Finally, we need to patch the compiled
coreboot.rom
so that it does not overwrite the Lenovo BIOS (protected bybucts 1
). This step is very important! It provides a safety net in case Coreboot does not run the first time.cd build dd if=coreboot.rom of=top64k.bin bs=1 skip=$[$(stat -c %s coreboot.rom) - 0x10000] count=64k dd if=coreboot.rom bs=1 skip=$[$(stat -c %s coreboot.rom) - 0x20000] count=64k | hexdump dd if=top64k.bin of=coreboot.rom bs=1 seek=$[$(stat -c %s coreboot.rom) - 0x20000] count=64k conv=notrunc
-
Flash that Coreboot ROM by following these instructions.
- Source: Coreboot Wiki - VGA Support