# Installing libreboot

This section relates to installing libreboot on supported targets.

Back to previous index

## Software methods

- List of ROM images in libreboot
- How to update libreboot (if you are already running libreboot or coreboot)
- ThinkPad X60/T60: Initial installation guide (if running the proprietary firmware)
- MacBook2,1: Initial installation guide (if running the proprietary firmware)

## Hardware methods

- How to programme an SPI flash chip with the BeagleBone Black
- ThinkPad X60: Recovery guide
- ThinkPad X60 Tablet: Recovery guide
- ThinkPad T60: Recovery guide
- ThinkPad X200/X200S/X200T (needed if running the proprietary firmware, or to unbrick)
- ThinkPad R400 (needed if running the proprietary firmware, or to unbrick)
- ThinkPad T400 (needed if running the proprietary firmware, or to unbrick)
- ThinkPad T500 (needed if running the proprietary firmware, or to unbrick)

# List of ROM images in libreboot

Libreboot supports the following (refer to the release page):

- Apple MacBook1,1 and MacBook2,1: download libreboot_macbook21.tar.xz
- ThinkPad X60, X60s and X60 Tablet: download libreboot_x60.tar.xz
- ThinkPad T60: download libreboot_t60.tar.xz (see ../hcl/index.html#supported_t60_list)
- ThinkPad X200: download libreboot_x200_8mb.tar.xz (8MiB flash chip) or libreboot_x200_4mb.tar.xz (4MiB flash chip) (see ../hcl/x200.html)
- ThinkPad R400: download libreboot_r400_8mb.tar.xz (8MiB flash chip) or libreboot_r400_4mb.tar.xz (4MiB flash chip) (see ../hcl/r400.html)
- ThinkPad T400: download libreboot_t400_8mb.tar.xz (8MiB flash chip) or libreboot_t400_4mb.tar.xz (4MiB flash chip) (see ../hcl/t400.html)
- ThinkPad T500: download libreboot_t500_8mb.tar.xz (8MiB flash chip) or libreboot_t500_4mb.tar.xz (4MiB flash chip) (see ../hcl/t500.html)

The ROM images in each archive use the following naming convention: boardname_keymap_mode.rom

Available modes: vesafb or txtmode. The vesafb ROM images are recommended, in most cases; txtmode ROM images come with MemTest86+, which requires text-mode instead of the usual framebuffer used by coreboot native graphics initialization.

Keymaps are named appropriate/y according to each keyboard layout support in GRUB. To learn how these keymaps are created, see ../grub/index.html#grub_keyboard

## QEMU

Libreboot comes with ROM images built for QEMU, by default:

- libreboot_qemu_q35_ich9.tar.xz
- libreboot_qemu_i440fx_piix4.tar.xz

Examples of how to use libreboot in QEMU:

- $ qemu-system-i386 -M q35 -m 512 -bios qemu_q35_ich9_keymap_mode.rom
- $ qemu-system-i386 -M pc -m 512 -bios qemu_i440fx_piix4_keymap_mode.rom

You can optionally specify the -serial stdio argument, so that QEMU will emulate a serial terminal on the standard input/output (most likely your terminal emulator or TTY).

Other arguments are available for QEMU. The manual will contain more information.

On GM45 hardware (with libreboot), make sure that the kvm and kvm_intel kernel modules are not loaded, when using QEMU.

Back to top of page.

# How to update libreboot (if you are already running libreboot or coreboot)

On all current targets, updating libreboot can be accomplished without disassembly and, therefore, without having to externally re-flash using any dedicated hardware. In other words, you can do everything entirely in software, directly from the OS that is running on your libreboot system.

If you are using libreboot_src or git, then make sure that you built the sources first (see ../git/index.html#build).

Look at the list of ROM images to see which image is compatible with your device.

## Are you currently running the original, proprietary firmware?

If you are currently running the proprietary firmware (not libreboot or coreboot), then the flashing instructions for your system are going to be different.

X60/T60 users running the proprietary firmware should refer to #flashrom_lenovobios. MacBook2,1 users running Apple EFI should refer to #flashrom_macbook21

X200 users, refer to x200_external.html, R400 users refer to r400_external.html, T400 users refer to t400_external.html, T500 users refer to t500_external.html

## Are you currently running libreboot (or coreboot)?

X60/T60 users should be fine with this guide. If you write-protected the flash chip, please refer to x60_unbrick.html, x60tablet_unbrick.html or t60_unbrick.html. This probably does not apply to you. Most people do not write-protect the flash chip, so you probably didn't either.

Similarly, it is possible to write-protect the flash chip in coreboot or libreboot on GM45 laptops (X200/R400/T400/T500). If you did this, then you will need to use the links above for flashing, treating your laptop as though it currently has the proprietary firmware (because write-protected SPI flash requires external re-flashing, as is also the case when running the proprietary firmware).

If you did not write-protect the flash chip, or it came to you without any write-protection (libreboot does not write-protect the flash chip by default, so this probably applies to you), read on!

## MAC address on GM45 (X200/R400/T400/T500)

Users of the X200/R400/T400/T500 take note: The MAC address for the onboard ethernet chipset is located inside the flash chip. Libreboot ROM images for these laptops contain a generic MAC address by default (00:F5:F0:40:71:FE), but this is not what you want. Make sure to change the MAC address inside the ROM image, before flashing it. The instructions on ../hcl/gm45_remove_me.html#ich9gen show how to do this.

It is important that you change the default MAC address, before flashing. It will be printed on a sticker at the bottom of the laptop, or it will be printed on a sticker next to or underneath the RAM. Alternatively, and assuming that your current firmware has the correct MAC address in it, you can get it from your OS.

## Flash chip size on GM45 (X200/R400/T400/T500)

Users of the X200/R400/T400/T500 take note: There are two different sized capacities that your flash chip could have: 4MiB or 8MiB. There are archives for each capacity, for each of these laptops, and you will need to select the correct size.

To easily identify which size chip is present:
# dmidecode | grep ROM\ Size
or (on some distributions):
$ sudo dmidecode | grep ROM\ Size
Example output:

    # ROM Size: 8192 kB

## All good?

Excellent! Moving on...

Download the libreboot_util.tar.xz archive, and extract it. Inside, you will find a directory called flashrom. This contains statically compiled executable files of the flashrom utility, which you will use to re-flash your libreboot system.

Simply use cd on your terminal, to switch to the libreboot_util directory. Inside, there is a script called flash, which will detect what CPU architecture you have (e.g. i686, x86_64) and use the appropriate executable. It is also possible for you to build these executables from the libreboot source code archives.

How to update the flash chip contents:
$ sudo ./flash update yourrom.rom

Ocassionally, coreboot changes the name of a given board. If flashrom complains about a board mismatch, but you are sure that you chose the correct ROM image, then run this alternative command:
$ sudo ./flash forceupdate yourrom.rom

You should see "Verifying flash... VERIFIED." written at the end of the flashrom output. Shut down after you see this, and then boot up again after a few seconds.

Back to top of page

# ThinkPad X60/T60: Initial installation guide (if running the proprietary firmware)

This is for the ThinkPad X60 and T60 while running Lenovo BIOS. If you already have coreboot or libreboot running, then go to #flashrom instead!

If you are flashing a Lenovo ThinkPad T60, be sure to read ../hcl/index.html#supported_t60_list

If you are using libreboot_src or git, then make sure that you built the sources first (see ../git/index.html#build).

Warning: this guide will not instruct the user how to backup the original Lenovo BIOS firmware. These backups are tied to each machine, and will not work on any other. For that, please refer to http://www.coreboot.org/Board:lenovo/x60/Installation.

If you're using libreboot 20150518, note that there is a mistake in the flashing script. Apply this patch to the BASH script named flash (this is the script for flashing libreboot into your X60): x60flashscript.patch. This patch is merged in the main git repository, and in all releases after 20150518.

The first half of the procedure is as follows:
$ sudo ./flash i945lenovo_firstflash yourrom.rom.

You should see within the output the following:
"Updated BUC.TS=1 - 64kb address ranges at 0xFFFE0000 and 0xFFFF0000 are swapped".

You should also see within the output the following:
"Flash chip is in an unknown state", "FAILED" and "DO NOT SHUTDOWN OR REBOOT"
Seeing this means that the operation was a resounding success! DON'T PANIC.

See this link for more details: http://thread.gmane.org/gmane.linux.bios.flashrom/575.

If the above is what you see, then SHUT DOWN. Wait a few seconds, and then boot; libreboot is running, but there is a 2nd procedure *needed* (see below).

When you have booted up again, you must also do this:
$ sudo ./flash i945lenovo_secondflash yourrom.rom

You should see within the output the following:
"Updated BUC.TS=0 - 128kb address range 0xFFFE0000-0xFFFFFFFF is untranslated"

You should also see within the output the following:
"Verifying flash... VERIFIED."

Back to top of page.

# MacBook2,1: Initial installation guide (if running the proprietary firmware)

If you have a MacBook1,1, refer to ../hcl/index.html#macbook11 for flashing instructions.

This is for the MacBook2,1 while running Apple EFI firmware. If you already have coreboot or libreboot running, then go to #flashrom instead!

Be sure to read the information in ../hcl/index.html#macbook21.

Warning: this guide will not instruct the user how to backup the original Apple EFI firmware. For that, please refer to http://www.coreboot.org/Board:apple/macbook21.

If you are using libreboot_src or git, then make sure that you built the sources first (see ../git/index.html#build).

Look at the list of ROM images to see which image is compatible with your device.

Use this flashing script, to install libreboot:
$ sudo ./flash i945apple_firstflash yourrom.rom

You should also see within the output the following:
"Verifying flash... VERIFIED."

Shut down.

Back to top of page.

Copyright © 2014, 2015 Francis Rowe <info@gluglug.org.uk>
Copyright © 2015 Chris Ryder <cdkr00@gmail.com>
This document is released under the Creative Commons Attribution-ShareAlike 4.0 International Public License and all future versions. A copy of the license can be found at ../cc-by-sa-4.txt.

This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ../cc-by-sa-4.txt for more information.