Skip to content

T60p Build Coreboot

matthias-t edited this page Mar 6, 2021 · 30 revisions

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

  1. Install all the packages required to build Coreboot:

     sudo apt-get install libncurses-dev iasl libc6-dev bison flex git zlib1g-dev gnat
    
  2. 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.

  1. Download and extract the Libreboot source code.

  2. Obtain the T60 Coreboot config file, found under the libreboot_src/resources/libreboot/config/t60 folder.

  3. Copy that config file to the coreboot/ source code folder.

  4. Rename config to .config , with a dot at the beginning. .config will become a hidden file.

  5. 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)

  1. Edit the .config file with a text editor. (you may need to use the command line and nano to do so, since it is a hidden file)

  2. 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
  1. From the coreboot folder, use this command to visually configure the .config file.

     make menuconfig
    
  2. 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

  1. Copy over the vgabios.bin file (from wherever it was saved) to the coreboot/ folder.

  2. From the coreboot/ folder, use this command to visually configure the .config file.

     make menuconfig
    
  3. 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|T60p Extract VGABIOS]]), each one is unique.

Build Coreboot

  1. 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
    
  2. Run make to build coreboot.

     make
    
  3. Finally, we need to patch the compiled coreboot.rom so that it does not overwrite the Lenovo BIOS (protected by bucts 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
    
  4. Flash that Coreboot ROM by following these instructions.

BA Logo

Bibliotheca Anonoma

Coreboot Laptops

Coreboot is an open source, user configurable BIOS. However, it does use a few proprietary blobs here and there.

ThinkPads

These require hardware flashing. Due to Intel Management Firmware, proprietary blobs are required for newer Intel motherboards to even power up.

Chromebooks

Most Intel Chromebooks come with Coreboot preinstalled. SeaBIOS can optionally be installed to add Windows support.

Just use John Lewis's Installation Script for All Models to autoinstall.

Build Notes

NOTE: The Libreboot components of this wiki was divested into the Official Libreboot Documentation here. Please use that from now on.

Libreboot laptops are certified by the FSF to protect your freedom.

They contain no proprietary blobs of any kind, and have the best support for FSF certified GNU/LInux.

ThinkPads

Macbooks

Other Tutorials

Clone this wiki locally