# Libreboot documentation: Main

It is assumed that you are running GNU/Linux. No other operating system is known to be compatible (with libreboot) for this release.

The information here is user documentation mainly. For development notes and TODO's, see release.html and future/index.html

## GNU/Linux distributions

- How to install a GNU/Linux distribution
- How to change your default GRUB menu

## Working with source code

- Install build dependencies
- Get the full source code from metadata (git clone)
- How to build "bucts" (for LenovoBIOS X60/X60S/X60T/T60)
- How to build "flashrom"
- Configuring libreboot
  - dmidecode
  - ThinkPad X60
  - ThinkPad X60 Tablet
  - ThinkPad T60
  - MacBook2,1
- How to build your ROM's

## Supported hardware

- List of supported hardware
- Recommended wifi chipsets
- List of supported ThinkPad X60/X60s
- List of supported ThinkPad X60 Tablets
- List of supported ThinkPad T60's
- ThinkPad T60 (ATI GPU) and ThinkPad T60 (Intel GPU) differences.
- Information about the Macbook1,1
- Information about the Macbook2,1

## Installing libreboot (software: using internal programmer)

- Recommended ROM's to flash
- X60/X60S/X60T/T60: How to flash your ROM (if running Lenovo BIOS firmware)
- macbook21: How to flash your ROM (if running Apple EFI firmware)
- X60/X60S/X60T/T60/macbook21: How to flash your ROM (if running libreboot or coreboot already)

## Installing libreboot (hardware: using external programmer)

- ThinkPad X60/X60S: How to unbrick
- ThinkPad X60 Tablet: How to unbrick
- ThinkPad T60: How to unbrick

## Security topics

- ThinkPad X60/X60S: hardware security
- ThinkPad T60: hardware security
- Installing Trisquel GNU/Linux with full disk encryption (including /boot)

## Hardware maintenance

- ThinkPad X60/X60S: change the fan/heatsink
- ThinkPad X60/X60s: How to change the LCD panel (incomplete. pics only for now)
- ThinkPad T60 15.1" changing LCD panel
- ThinkPad T60: change the fan/heatsink

## GRUB2 payload

- Setting font in GRUB
- GRUB keyboard layouts
  - Custom keyboard layout in GRUB
  - UK Dvorak keyboard layout in GRUB

## Miscallaneous

- ThinkPad X60: Enable or disable wifi
- ThinkPad X60: Enable or disable bluetooth
- ThinkPad X60: Enable or disable trackpoint
- High Pitched Whining Noise on Idle (how to remove in Trisquel)
  - Powertop - how to use
  - Powertop - Start automatically at boot time
- High Pitched Whining Noise on Idle (how to remove in Parabola)
- X60/T60: Serial port - how to use (for dock owners)
- Using diff and patch
- Get EDID: Find out the name (model) of your LCD panel

# What is libreboot, really?

## Project goals (and differences versus coreboot):

- Coreboot contains blobs (proprietary data/code) and libreboot does not (it intentionally removes them).
- Coreboot is hacker-friendly and focusses on software developers, libreboot is user-focussed and attempts to turn coreboot into a distribution, sort of like a GNU/Linux distribution (same concept, different software): for example, libreboot distributes GRUB/memtest86+/bucts (and more) and comes with user-focussed documentation and build scripts; libreboot is therefore made more 'user-friendly'.

Libreboot is not a fork of coreboot, despite misconceptions of this fact. Libreboot (downstream supplier) is a parallel effort which works closely with and re-bases on the latest coreboot (upstream supplier) every so often.

As such, all new coreboot development should be done in coreboot, not libreboot! Libreboot is about deblobbing, and packaging coreboot in a user-friendly way, where most work is already done for the user! If, for example you wanted to attempt porting a new motherboard then you should do that in coreboot. Libreboot will (as a downstream) receive your change at some point in the future, in a future release.

## A 'stable' coreboot:

- Coreboot uses the rolling release model (and it is therefore quite volatile; one day when you build coreboot, it may or may not work correctly on your machine).
- Libreboot changes less often (as far as the release model is concerned), focussing instead of 'tested' releases for specific machines (at any given time, it may be possible to build and use libreboot ROM's for systems other than those officially supported; if you manage to get another board working in a given release (without violating the 'coreboot development goes in coreboot' rule), other users might also benefit from your work).

On the other hand, coreboot is also strict about what it accepts (merges) into the main git repository: most of the time, a lot of changes are under review at review.coreboot.org (as a way of encouraging as much further development as possible before accepting the patch).

Meanwhile, libreboot is a lot less strict in this area and freely merges specific patches that are desirable, sometimes before they are merged into coreboot's main repository.

Back to top of page.

# Install build dependencies

Before doing anything, you need the dependencies first.

- deps-trisquel script installs dependencies for Trisquel 6 (also tested in Trisquel 7).
- deps-parabola script installs dependencies for Parabola

For all other GNU/Linux distributions, you may have to adapt these scripts. By all means send patches!

Back to top of page

# Get the full source code from metadata (git clone)

If you downloaded libreboot from git, then there are some steps to download and patch the source code for all relevant dependencies. The archive in the git repository used to be available as a tarball called 'libreboot_meta.tar.gz'. It contains 'metadata' (scripts) which define how the source was created (where it came from).

You can use the scripts included to dwnload everything.

First, install the build dependencies.

After that, run the get script:
$ ./getall

What this did was download everything (grub, coreboot, memtest86+, bucts, flashrom) at the versions last tested for this release, and patch them. Read the script in a text editor to learn more.

To build the ROM's, see #build.

Back to top of page.

# How to build "bucts" (for LenovoBIOS X60/X60S/X60T/T60)

This is for Lenovo BIOS users on the ThinkPad X60/X60S, X60 Tablet and T60. If you have coreboot or libreboot running already, ignore this.

Bucts is needed when flashing in software the X60/X60S/X60T/T60 ROM while Lenovo BIOS is running; external flashing will be safe regardless. Each ROM contains identical data inside the two final 64K region in the file. This corresponds to the final two 64K regions in the flash chip. Lenovo BIOS will prevent you from writing the final one, so running "bucts 1" will set the machine to boot from the other block instead (which is writeable along with everything beneath it when using a patched flashrom. see #build_flashrom). After shutting down and booting up after the first flash, the final 64K block is writeable so you flash the ROM again with an unpatched flashrom and run "bucts 0" to make the machine boot from the normal (highest) block again.

BUC.TS utility is included in libreboot_src.tar.gz and libreboot_bin.tar.gz.
If you downloaded from git, follow #build_meta before you proceed.

"BUC" means "Backup Control" (it's a register) and "TS" means "Top Swap" (it's a status bit). Hence "bucts" (BUC.TS). TS 1 and TS 0 corresponds to bucts 1 and bucts 0.

First, install the build dependencies.

To build bucts, do that in the main directory:
$ ./builddeps-bucts

The "builddeps" script in libreboot_src also makes use of builddeps-bucts.

Back to top of page.

# How to build "flashrom"

Flashrom is the utility for flashing/dumping ROM's. This is what you will use to install libreboot.

Flashrom source code is included in libreboot_src.tar.gz and libreboot_bin.tar.gz.
If you downloaded from git, follow #build_meta before you proceed.

First, install the build dependencies.

To build it, do that in the main directory:
$ ./builddeps-flashrom

After you've done that, under ./flashrom/ you will find the following executables:

- flashrom
  - For flashing while coreboot or libreboot is running.
- flashrom_lenovobios_sst
  - This is patched for flashing while Lenovo BIOS is running on an X60 or T60 with the SST25VF016B (SST) flash chip.
- flashrom_lenovobios_macronix
  - This is patched for flashing while Lenovo BIOS is running on an X60 or T60 with the MX25L1605D (Macronix) flash chip.

The "builddeps" script in libreboot_src also makes use of builddeps-flashrom.

Back to top of page.

# Configuring libreboot

Before building a ROM in libreboot (or coreboot, for that matter), you need to configure it. This is done using the following inside the source tree:
$ make menuconfig

If you've already built a kernel before, you know how to use this interface.

Configurations are saved then as files called ".config". Copies of each configuration used for each machine type by the libreboot build scripts are stored in resources/libreboot/config/

## dmidecode

There is certain information that can be useful to enter in particular:

- Local version string
- SMBIOS Serial Number
- SMBIOS Manufacturer
- SMBIOS Version
- SMBIOS Product name

This information can be obtained using:
$ sudo dmidecode
# dmidecode

Specifically, it's good practise to enter the same information for libreboot that you found when running this with the original BIOS or firmware. libreboot has already done this for you. This information is for reference, in the hope that it will be useful.

## ThinkPad X60 configuration (file: resources/libreboot/config/x60/config)

- General setup / Expert mode = enable
- General setup / Local version string = 7BETC7WW (2.08 )
- Mainboard / Mainboard vendor = Lenovo
- Mainboard / Mainboard model = ThinkPad X60 / X60s / X60t
- Mainboard / ROM chip size = 2048 KB (2 MB)
- Mainboard / SMBIOS Serial Number = L3BH242
- Mainboard / SMBIOS Version Number = ThinkPad X60s
- Mainboard / SMBIOS Manufacturer = LENOVO
- Mainboard / SMBIOS Product name = 1702L8G
- Chipset / Include CPU microcode in CBFS = Do not include microcode updates
- Devices / Use native graphics initialization = enable
- Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  - Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at boot time to enable coreboot framebuffer for a separate set of ROM images, in each machine.
- Generic Drivers / Digitizer = Autodetect
- Console / Send console output to a CBMEM buffer = enable
- Payload / Add a payload = An ELF executable payload
- Payload / Payload path and filename = grub.elf

Now go back into Devices:

- Devices / Run VGA Option ROMs = disable
- Devices / Run Option ROMs on PCI devices = disable

The resulting .config file was saved as resources/libreboot/config/x60/config and is used by the build scripts for this machine.

This is based on an X60S with the Core 2 Duo L7400 processor.

SMBIOS Version Number is ThinkPad X60 on the X60, but it is believed that X60 and X60s both have identical motherboards where the only difference is the CPU. This same configuration is used on the X60 and X60s.

## ThinkPad X60 Tablet configuration (file: resources/libreboot/config/x60t/config)

- General setup / Expert mode = enable
- General setup / Local version string = 7JET23WW (1.08 )
- Mainboard / Mainboard vendor = Lenovo
- Mainboard / Mainboard model = ThinkPad X60 / X60s / X60t
- Mainboard / ROM chip size = 2048 KB (2 MB)
- Mainboard / SMBIOS Serial Number = L3B8281
- Mainboard / SMBIOS Version Number = ThinkPad X60 Tablet
- Mainboard / SMBIOS Manufacturer = LENOVO
- Mainboard / SMBIOS Product name = 6364WJ1
- Chipset / Include CPU microcode in CBFS = Do not include microcode updates
- Devices / Use native graphics initialization = enable
- Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  - Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at boot time to enable coreboot framebuffer for a separate set of ROM images, in each machine.
- Generic Drivers / Digitizer = Present
- Console / Send console output to a CBMEM buffer = enable
- Payload / Add a payload = An ELF executable payload
- Payload / Payload path and filename = grub.elf

Now go back into Devices:

- Devices / Run VGA Option ROMs = disable
- Devices / Run Option ROMs on PCI devices = disable

The resulting .config file was saved as resources/libreboot/config/x60t/config and is used by the build scripts for this machine.

This is based on an X60T with the Core 2 Duo L7400 processor.

## ThinkPad T60 configuration (file: resources/libreboot/config/t60/config)

- General setup / Expert mode = enable
- General setup / Local version string = 79ETE7WW (2.27 )
- Mainboard / Mainboard vendor = Lenovo
- Mainboard / Mainboard model = ThinkPad T60 / T60p
- Mainboard / ROM chip size = 2048 KB (2 MB)
- Mainboard / SMBIOS Serial Number = L3DKE06
- Mainboard / SMBIOS Version Number = ThinkPad T60
- Mainboard / SMBIOS Manufacturer = LENOVO
- Mainboard / SMBIOS Product name = 1951FEG
- Chipset / Include CPU microcode in CBFS = Do not include microcode updates
- Devices / Use native graphics initialization = enable
- Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  - Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at boot time to enable coreboot framebuffer for a separate set of ROM images, in each machine.
- Console / Send console output to a CBMEM buffer = enable
- Payload / Add a payload = An ELF executable payload
- Payload / Payload path and filename = grub.elf

Go back into Devices:

- Devices / Run VGA Option ROMs = disable
- Devices / Run Option ROMs on PCI devices = disable

The resulting .config file was saved as resources/libreboot/config/t60/config and is used by the build scripts for this machine.

It is believed that the motherboards on 14.1" and 15.1" T60's are the same, so the same configuration is used on both the 14.1" and 15.1" T60's.

## MacBook2,1 configuration (file: resources/libreboot/config/macbook21/config)

- General / Expert mode = enable
- General / Local version string = " MB21.88Z.00A5.B07.0706270922" (without the quotes)
- Mainboard / Mainboard vendor = Apple
- Mainboard / Mainboard model = Macbook2,1 ICH7 TESTING
- Mainboard / ROM chip size = 2048 KB (2 MB)
- Mainboard / SMBIOS Serial Number = W8724XXXXXX
- Mainboard / SMBIOS Version Number = 1.0
- Mainboard / SMBIOS Manufacturer = Apple Inc.
- Mainboard / SMBIOS Product Name = MacBook2,1
- Chipset / Include CPU microcode in CBFS = Do not include microcode updates
- Devices / Use native graphics initialization = enable
- Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  - Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at boot time to enable coreboot framebuffer for a separate set of ROM images, in each machine.
- Console / Send console output to a CBMEM buffer = enable
- Payload / Add a payload = An ELF executable payload
- Payload / Payload path and filename = grub.elf

Go back and disable option ROM's:

- Devices / Run VGA Option ROMs = disable
- Devices / Run Option ROMs on PCI devices = disable

The resulting .config file was saved as resources/libreboot/config/macbook21/config and is used by the build scripts for this machine. This config is also used for the MacBook1,1.

Back to top of page.

# How to build the ROM's!

You don't need to do much: there are scripts already written for you that can build everything automatically.

First, install the build dependencies.

If running for the first time, run this:
$ ./buildall (also performs the "./build" step below)
Or if you only want to build dependencies (crossgcc, grub and so on):
$ ./builddeps

If you've already run ./builddeps and/or ./buildall before, you don't need to run them again. Just run that from now on to build your ROM's:
$ ./build

To un-build (clean) the build dependencies that you built before, do that:
This also deletes the ROM images under ./bin/:
$ ./cleandeps

Note: after running 'cleandeps', you will need to run 'builddeps' or 'buildall' again before you can use 'build'.

After 'build' or 'buildall' has finished, you'll find the ROM images for each machine under ./bin/

## Preparing release archives (optional)

Run that script:
$ ./build-release

You'll find that the files libreboot_bin.tar.xz and libreboot_src.tar.xz have been created.

Back to top of page

# List of supported hardware

Libreboot supports the following machines in this release:

- Lenovo ThinkPad X60/X60s
- Lenovo ThinkPad X60 Tablet
- Lenovo ThinkPad T60 (there are exceptions. see link)
- Apple MacBook1,1
- Apple MacBook2,1

'Supported' means that the build scripts know how to build ROM's for these machines, and that the machines have been tested (confirmed working). There may be exceptions; in other words, this is a list of 'officially' supported machines.

It is possible to build ROM images (from source) for other machines aswell (and virtual machines, e.g. QEMU).

Back to top of page

# Recommended wifi chipsets

The following are known to work well:

- Atheros AR5B95 (chipset: Atheros AR9285); mini PCI-E. Most of these are half-height, so you will need a half>full height mini PCI express adapter/bracket.
- Unex DNUA-93F (chipset: Atheros AR9271); USB.
- Any of the chipsets sold at https://fsf.org/ryf

Back to top of page

# List of supported ThinkPad X60's

Native gpu initialization ('native graphics') which replaces the proprietary VGA Option ROM ('Video BIOS' or 'VBIOS'), all known LCD panels are currently compatible:

To find what LCD panel you have, see: #get_edid_panelname.

- TMD-Toshiba LTD121ECHB: #
- CMO N121X5-L06: #
- Samsung LTN121XJ-L07: #
- BOE-Hydis HT121X01-101: #

You can remove an X61/X61s motherboard from the chassis and install an X60/X60s motherboard in it's place (for flashing libreboot). The chassis is mostly identical and the motherboards are the same shape/size.

The X60 typically comes with an Intel wifi chipset which does not work at all without proprietary firmware, and while Lenovo BIOS is running the machine will refuse to boot if you replace the card. Fortunately it is very easily replaced; just remove the card and install another one after libreboot is installed. See #recommended_wifi for replacements.

Back to top of page.

# List of supported ThinkPad X60 Tablets

Native gpu initialization ('native graphics') which replaces the proprietary VGA Option ROM ('Video BIOS' or 'VBIOS').

To find what LCD panel you have, see: #get_edid_panelname.

The following LCD panels are known to work:

- X60T XGA (1024x768):
  - BOE-Hydis HV121X03-100: #
  - Samsung LTN121XP01
- X60T SXGA+ (1400x1050):
  - BOE-Hydis HV121P01-100: #
  - BOE-Hydis HV121P01-101: #

Most X60T's only have digitizer (pen), but some have finger (touch) aswell as pen; finger/multitouch doesn't work, only digitizer (pen) does.

You can remove an X61/X61s motherboard from the chassis and install an X60/X60s motherboard in it's place (for flashing libreboot). The chassis is mostly identical and the motherboards are the same shape/size. It is unknown if the same applies between the X60 Tablet and the X61 Tablet.

The X60 Tablet typically comes with an Intel wifi chipset which does not work at all without proprietary firmware, and while Lenovo BIOS is running the machine will refuse to boot if you replace the card. Fortunately it is very easily replaced; just remove the card and install another one after libreboot is installed. See #recommended_wifi for replacements.

Back to top of page.

# Supported T60 list

Native gpu initialization ('native graphics') which replaces the proprietary VGA Option ROM ('Video BIOS' or 'VBIOS').

To find what LCD panel you have, see: #get_edid_panelname.

Some T60's have ATI GPU's, and all T60p's have ATI GPU's These are incompatible! See #t60_ati_intel for how to remedy this.

Tested LCD panels: working(compatible)

- TMD-Toshiba LTD141EN9B (14.1" 1400x1050) (FRU P/N 41W1478 recommended for the inverter board)
- Samsung LTN141P4-L02 (14.1" 1400x1050) (FRU P/N 41W1478 recommended for the inverter board)
- LG-Philips LP150E05-A2K1 (15.1" 1400x1050) (P/N 42T0078 FRU 42T0079 or P/N 41W1338 recommended for the inverter board)
- Samsung LTN150P4-L01 (15.1" 1400x1050) (P/N 42T0078 FRU 42T0079 or P/N 41W1338 recommended for the inverter board) (not a T60 screen afaik, but it works)
- BOE-Hydis HV150UX1-100 (15.1" 1600x1200) (P/N 42T0078 FRU 42T0079 or P/N 41W1338 recommended for the inverter board)
- IDtech IAQX10N (15.1" 2048x1536) (GRUB doesn't display at the moment, but GNU/Linux works) (P/N 42T0078 FRU 42T0079 or P/N 41W1338 recommended for the inverter board)

Tested LCD panels: not working yet (incompatible; see future/index.html#lcd_i945_incompatibility)

- Samsung LTN141XA-L01 (14.1" 1024x768)
- LG-Philips LP150X09 (15.1" 1024x768)
- LG-Philips LP150E06-A5K4 (15.1" 1400x1050) (also, not an official T60 screen)
- Samsung LTN154X3-L0A (15.4" 1280x800)

The following LCD panels are UNTESTED. If you have one of these panels then please submit a report!:

- CMO(IDtech?) N141XC (14.1" 1024x768)
- BOE-Hydis HT14X14 (14.1" 1024x768)
- TMD-Toshiba LTD141ECMB (14.1" 1024x768)
- Boe-Hydis HT14P12 (14.1" 1400x1050) (FRU P/N 41W1478 recommended for the inverter board)
- Samsung LTN150XG (15.1" 1024x768)
- CMO (IDtech?) 13N7068 (15.1" 1024x768)
- CMO (IDtech?) 13N7069 (15.1" 1024x768)
- BOE-Hydis HV150P01-100 (15.1" 1400x1050) (P/N 42T0078 FRU 42T0079 or P/N 41W1338 recommended for the inverter board)
- IDtech N150U3-L01 (15.1" 1600x1200) (P/N 42T0078 FRU 42T0079 or P/N 41W1338 recommended for the inverter board)
- BOE-Hydis HV150UX1-102 (15.1" 1600x1200) (P/N 42T0078 FRU 42T0079 or P/N 41W1338 recommended for the inverter board)
- IDtech IAQX10S (15.1" 2048x1536) (P/N 42T0078 FRU 42T0079 or P/N 41W1338 recommended for the inverter board)
- Samsung LTN154P2-L05 (42X4641 42T0329) (15.4" 1680x1050)
- LG-Philips LP154W02-TL10 (13N7020 42T0423) (15.4" 1680x1050)
- LG-Philips LP154WU1-TLB1 (42T0361) (15.4" 1920x1200) (for T61p but it might work in T60. Unknown!)
- Samsung LTN154U2-L05 (42T0408 42T0574) (15.4" 1920x1200) (for T61p but it might work in T60. Unknown!)

It is unknown whether the 1680x1050 (15.4") and 1920x1200 (15.4") panels use a different inverter board than the 1280x800 panels.

The T60 typically comes with an Intel wifi chipset which does not work at all without proprietary firmware, and while Lenovo BIOS is running the machine will refuse to boot if you replace the card. Fortunately it is very easily replaced; just remove the card and install another one after libreboot is installed. See #recommended_wifi for replacements.

Back to top of page.

# ThinkPad T60 (ATI GPU) and ThinkPad T60 (Intel GPU) differences.

If your T60 is a 14.1" or 15.1" model with an ATI GPU, it won't work with libreboot by default but you can replace the motherboard with another T60 motherboard that has an Intel GPU, and then libreboot should work.

As far as I know, 14.1" (Intel GPU) and 15.1" (Intel GPU) T60 motherboards are the same, where 'spacers' are used on the 15.1" T60. In any case, it makes sense to find one that is guaranteed to fit in your chassis.

There is also a 15.4" T60 with Intel GPU.

Note: the T60p laptops all have ATI graphics. The T60p laptops cannot be used with libreboot under any circumstances.

The following T60 motherboard (see area highlighted in white) shows an empty space where the ATI GPU would be (this particular motherboard has an Intel GPU):

The reason that the ATI GPU on T60 is unsupported is due to the VBIOS (Video BIOS) which is non-free. The VBIOS for the Intel GPU on X60/T60 has been reverse engineered, and replaced with Free Software and so will work in libreboot.

The 'Video BIOS' is what initializes graphics.

See: https://en.wikipedia.org/wiki/Video_BIOS.
In fact, lack of free VBIOS in general is a big problem in coreboot, and is one reason (among others) why many ports for coreboot are unsuitable for libreboot's purpose.

Theoretically, the ThinkPad T60 with ATI GPU can work with libreboot and have ROM's compiled for it, however in practise it would not be usable as a laptop because there would be no visual display at all. That being said, such a configuration is acceptable for use in a 'headless' server setup (with serial and/or ssh console as the display).

Back to top of page.

# Information about the macbook1,1

There is an Apple laptop called the macbook1,1 from 2006 which uses the same i945 chipset as the ThinkPad X60/T60. A developer ported the MacBook2,1 to coreboot, the ROM images also work on the macbook1,1.

You can refer to #macbook21 for most of this. Macbook2,1 laptops come with Core 2 Duo processors which support 64-bit operating systems (and 32-bit). The MacBook1,1 uses Core Duo processors (supports 32-bit OS but not 64-bit), and it is believed that this is the only difference.

It is believed that all models are compatible, listed here:

- http://www.everymac.com/ultimate-mac-lookup/?search_keywords=MacBook1,1

## Compatible models

Specifically (Order No. / Model No. / CPU):

- MA255LL/A / A1181 (EMC 2092) / Core Duo T2500 (tested - working)
- MA254LL/A / A1181 (EMC 2092) / Core Duo T2400 (untested)
- MA472LL/A / A1181 (EMC 2092) / Core Duo T2500 (untested)

Also of interest: #config_macbook21.

Unbricking: this page shows disassembly guides and mono's page (see #macbook21) shows the location of the SPI flash chip on the motherboard. How to remove the motherboard.

No method is yet known for flashing in GNU/Linux while the Apple firmware is running. You will need to disassemble the machine and flash externally. Reading from flash seems to work. Bus Pirate recommended for external flashing (there are others) and needed tools: clip (eg Pomona 5250), mini usb cable, bus pirate cable (for connecting Pomona to the bus pirate).

Back to top of page.

# Information about the macbook2,1

There is an Apple laptop called the macbook2,1 from late 2006 or early 2007 that uses the same i945 chipset as the ThinkPad X60 and ThinkPad T60. A developer ported coreboot to his macbook2,1, and now libreboot can run on it.

Mono Moosbart is the person who wrote the port for macbook2,1. Referenced below are copies (up to date at the time of writing, 20140630) of the pages he wrote when porting coreboot to the macbook2,1. They are included here in case the main site goes down for whatever reason, since they include a lot of useful information.

Backups created using wget:
$ wget -m -p -E -k -K -np http://macbook.donderklumpen.de/
$ wget -m -p -E -k -K -np http://macbook.donderklumpen.de/coreboot/
Use -e robots=off if using this trick for other sites and the site restricts using robots.txt

Links to wget backups (and the backups themselves) of Mono's pages (see above) removed temporarily. Mono has given me permission to distribute them, but I need to ask him to tell me what license these works fall under first. Otherwise, the above URL's should be fine. NOTE TO SELF: REMOVE THIS WHEN DONE

## Installing GNU/Linux distributions (on Apple EFI firmware)

- Parabola GNU/Linux installation on a macbook2,1 with Apple EFI firmware (this is a copy of Mono's page, see above)

How to boot an ISO: burn it to a CD (like you would normally) and hold down the Alt/Control key while booting. The bootloader will detect the GNU/Linux CD as 'Windows' (because Apple doesn't think GNU/Linux exists). Install it like you normally would. When you boot up again, hold Alt/Control once more. The installation (on the HDD) will once again be seen as 'Windows'. (it's not actually Windows, but Apple likes to think that Apple and Microsoft are all that exist.) Now to install libreboot, follow #flashrom_macbook21.

## Information about coreboot

- Coreboot on the macbook2,1 (this is a copy of Mono's page, see above)

## coreboot wiki page

- http://www.coreboot.org/Board:apple/macbook21

## Compatible models

It is believed that all models are compatible, listed here:

- http://www.everymac.com/ultimate-mac-lookup/?search_keywords=MacBook2,1

Specifically (Order No. / Model No. / CPU):

- MA699LL/A / A1181 (EMC 2121) / Intel Core 2 Duo T5600 (tested - working)
- MA701LL/A / A1181 (EMC 2121) / Intel Core 2 Duo T7200 (tested - working)
- MB061LL/A / A1181 (EMC 2139) / Intel Core 2 Duo T7200 (untested)
- MA700LL/A / A1181 (EMC 2121) / Intel Core 2 Duo T7200 (untested)
- MB063LL/A / A1181 (EMC 2139) / Intel Core 2 Duo T7400 (untested)
- MB062LL/A / A1181 (EMC 2139) / Intel Core 2 Duo T7400 (tested - working)

Also of interest: #config_macbook21.

Unbricking: this page shows disassembly guides and mono's page (see above) shows the location of the SPI flash chip on the motherboard. How to remove the motherboard.

Bus Pirate recommended for external flashing (there are others) and needed tools: clip (eg Pomona 5250), mini usb cable, bus pirate cable (for connecting Pomona to the bus pirate).

You need to replace OS X with GNU/Linux before flashing libreboot. (OSX won't run at all in libreboot).

There are some issues with this machine (compared to other computers that libreboot supports):

This is an apple laptop, so it comes with OS X: it has an Apple keyboard, which means that certain keys you expect are missing: insert, del, home, end, pgup, pgdown. There is also one mouse button only. Battery life is poor compared to X60/T60 (for now). It also has other issues: for example, the Apple logo on the back is a hole, exposing the backlight, which means that it glows. You should cover it up.

The macbook21 gets extremely hot under GNU/Linux and libreboot; Macfanctld (mac fan control daemon) I'm told is a programme (GPLv3 license) that can help with this.

Debugging the heating issues (initial work):
Distro: Trisquel 7. kernel(linux-libre): 3.13.0-32
CPU temperatures:
52C(idle)/81C(stress) on factory.bin
70C(idle)/80C(stress) on coreboot(with microcode updates). libreboot results (without microcode updates) were the same.
(libreboot and coreboot rom's were both built from the same code, just with or without microcode included in the rom)
battery life was higher on original firmware, lower on coreboot/libreboot.
microcode patches included [y/n] makes no difference.
libreboot: 1hr18min left on idle (99% battery), 42mins left on stress (82% battery)
factory.bin: 2 hours left on idle (99% battery), 48mins left on stress (82% battery)

mtjm: see what Macbook's vendor boot firmware has in its ACPI tables?
fchmmr: if this works, I'll add the patch to libreboot proper, and udpate the build scripts to use it (also, I should submit the change upstream)
fchmmr: mtjm, how do I do that?
mtjm: (I don't know if these values are generic or specific to something)
mtjm: fchmmr: get them, decompile, read, use the spec to understand what _CST does; acpidump and iasl help
so, acpidump and then iasl -d ?
http://smackerelofopinion.blogspot.co.uk/2009/10/dumping-acpi-tables-using-acpidump-and.html cstate entries should be is SSDT.dat. so use iasl -d on it

The following patch was made (copied from x60 mainboard.c): do not use this
(resulted in bricked macbook21: grub booted, but kernel would get stuck while booting (flashing text). wasn't sure how to debug)

The MacBook2,1 comes with a webcam, which does not work without proprietary software. Also, webcams are a security risk; cover it up! Or remove it.

Back to top of page.

# Recommended ROM's to flash

List of directories corresponding to each board:

- ThinkPad X60, X60s: bin/x60/
- ThinkPad X60 Tablet: bin/x60t/
- ThinkPad T60: bin/t60/ (note, see #supported_t60_list)
- Apple MacBook2,1: bin/macbook21/
- Apple MacBook1,1: bin/macbook21/ (it's not a typo; the same ROM's work)

These images use coreboot text-mode graphics:

- US Qwerty keyboard: libreboot_usqwerty_txtmode.rom
- UK Qwerty keyboard: libreboot_ukqwerty_txtmode.rom
- US Dvorak keyboard: libreboot_usdvorak_txtmode.rom
- UK Dvorak keyboard: libreboot_ukdvorak.rom
- French Azerty keyboard: libreboot_frazerty_txtmode.rom
- Italian Qwerty keyboard: libreboot_itqwerty_txtmode.rom
- Swedish Qwerty keyboard: libreboot_svenska_txtmode.rom

These images use coreboot framebuffer graphics:

- US Qwerty keyboard: libreboot_usqwerty_vesafb.rom
- UK Qwerty keyboard: libreboot_ukqwerty_vesafb.rom
- US Dvorak keyboard: libreboot_usdvorak_vesafb.rom
- UK Dvorak keyboard: libreboot_ukdvorak_vesafb.rom
- French Azerty keyboard: libreboot_frazerty_vesafb.rom
- Italian Qwerty keyboard: libreboot_itqwerty_vesafb.rom
- Swedish Qwerty keyboard: libreboot_svenska_vesafb.rom

_txtmode images come with a working MemTest86+ and GRUB Invaders, both of which require text-mode. _vesafb images are recommended in most cases.

This will give you your native keyboard layout inside GRUB. The preferences in your OS are not affected, it just makes using the GRUB command line easier (if you ever need to do that). #grub_keyboardshows you how this was done. If your native keyboard layout differs, you can adapt those notes and hack the 'build' script for your needs.

Back to top of page.

# X60/X60S/X60T/T60: How to flash the ROM's onto your machine (if running Lenovo BIOS firmware).

Hover over the next paragraph to make it black.

Following this guide means simply flashing a libreboot ROM. This guide will not (directly) teach you how to make a backup (dump) of the original Lenovo BIOS because to do so would be to explicitly endorse proprietary software. However, for the purposes of reverse engineering it can be useful to have a backup. Each copy of the original Lenovo BIOS is tied to the specific machine that it came from; it will not run on any other machine, even if it's the same type of machine as yours. What this means is that, effectively, you can back it up now (so that you can re-flash it later if you want to run the original Lenovo BIOS again) or lose it forever. The X60/T60 installation guide on the coreboot wiki will show you how to do this: http://www.coreboot.org/Board:lenovo/x60/Installation.
Do not make this decision lightly! This is your last and only chance.

The following is for the libreboot image and *not* the factory bios dump:

Check the last two 64K regions in your ROM file (libreboot.rom in this example):
$ dd if=libreboot.rom of=top64k.bin bs=1 skip=$[$(stat -c %s libreboot.rom) - 0x10000] count=64k
$ dd if=libreboot.rom of=lower64k.bin bs=1 skip=$[$(stat -c %s libreboot.rom) - 0x20000] count=64k
$ sha512sum lower64k.bin top64k.bin
Make *sure* that they match before you continue. The ROM's included pre-compiled in libreboot should already match. If they don't match, then do this (based on those instructions from coreboot wiki):
$ dd if=top64k.bin of=libreboot.rom bs=1 seek=$[$(stat -c %s libreboot.rom) - 0x20000] count=64k conv=notrunc
After this, the ROM will be safe to flash. Explanation is provided in #build_bucts.

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 #supported_t60_list

First, install the build dependencies.

Before you proceed, make *sure* to build flashrom and bucts from source. Both are provided. This is very important!

- How to build flashrom from source
- How to build bucts from source

"YOURBOARD/YOURROM" should be replaced with what is correct as per #rom. Alternatively you may be using your own custom ROM. Adapt.

Run the script:
$ sudo ./lenovobios_firstflash bin/YOURBOARD/YOURROM.

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

If you boot and you see nothing, try turning up the backlight (Fn+Home).

After the 2nd flash, if this is a ThinkPad X60 then you can look at #x60_wifi for how to enable/disable wifi. You can also look at #x60_trackpoint for how to enable/disable the trackpoint (red mouse on keyboard). You might want to do the 2nd flash first (see below) before doing that.

When you have booted up again:
$ sudo ./lenovobios_secondflash bin/YOURBOARD/YOURROM

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."

Shut down again, wait a few seconds, and then boot.

Back to top of page.

# macbook21: How to flash your ROM (if running Apple EFI firmware)

Hover over the next paragraph to make it black.

Following this guide means simply flashing a libreboot ROM. This guide will not (directly) teach you how to make a backup (dump) of the original Apple EFI firmware because to do so would be to explicitly endorse proprietary software. However, for the purposes of reverse engineering it can be useful to have a backup. Each copy of the original Apple EFI is (believed, but unproven to be) tied to the specific machine that it came from; it will not (as is believed) run on any other machine, even if it's the same type of machine as yours. What this means is that, effectively, you can back it up now (so that you can re-flash it later if you want to run the original Apple EFI firmware again) or lose it forever. The macbook21 installation guide on the coreboot wiki will show you how to do this: http://www.coreboot.org/Board:apple/macbook21.
Do not make this decision lightly! This is (very likely) your last and only chance.

(this theory is untested at the time of writing)

Note: If you have a MacBook1,1 then these instructions will not work. See #macbook11 for MacBook1,1 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 #macbook21.

First, install the build dependencies.

Before you proceed, make *sure* to build flashrom from source. This is very important!

- How to build flashrom from source

Look at #rom to see which ROM is suitable for your machine. Alternatively you may be using your own custom ROM. Adapt.

Flashing is actually easy (compared to X60/T60).
$ sudo flashrom -p internal:laptop=force_I_want_a_brick -w bin/YOURBOARD/YOURROM

Alternatively, a script is provided which does the same thing:
$ sudo ./macbook21_firstflash bin/YOURBOARD/YOURROM

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

If you see that, great! Shut down now (power off). Wait a few seconds and then boot!

If you boot and you see nothing, try turning up the backlight (F2 for macbook21).

Back to top of page.

# X60/X60S/X60T/T60/macbook21: How to flash the ROM's onto your machine (if running libreboot or coreboot already)

These instructions work for the Lenovo ThinkPad X60/X60S/X60T/T60 and Apple MacBook2,1.

This assumes that you already have coreboot or libreboot running.

If you have Lenovo BIOS running (X60/X60S/X60T/T60), go to #flashrom_lenovobios instead.

If you have Apple EFI firmware running (macbook21), go to #flashrom_macbook21 instead.

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

If you are flashing an Apple MacBook2,1, be sure to read the information in #macbook21.

First, install the build dependencies.

Before you proceed, make *sure* to build flashrom from source. This is very important!

- How to build flashrom from source

Look at #rom to see which ROM is suitable for your machine. Alternative you may be using your own custom ROM. Adapt.

Flash the ROM:
$ sudo ./flash bin/YOURBOARD/YOURROM

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.

If you boot and you see nothing, try turning up the backlight (Fn+Home for X60/X60S/X60T/T60, F2 for macbook21).

If this is a ThinkPad X60 then you can look at #x60_wifi for how to enable/disable wifi. You can also look at #x60_trackpoint for how to enable/disable the trackpoint (red mouse on keyboard).

Back to top of page

# Setting font in GRUB (for reference)

You don't need to do this unless you would like to change the default font yourself. (this is just for reference. It has already been done for you)

The old font used was Unifont, and this had some missing characters: for instance, the border showed ??? characters instead of lines.

I tried DeJavu Sans Mono from this website: dejavu-fonts.org

Specifically, the version that I chose was the latest at the time of writing (Saturday 21 June 2014): this one

This is a free font that is also contained in GNU/Linux distributions like Trisquel or Parabola.

$ cd libreboot_src/grub
compile grub ('build' script has the info on how to do this)
come back out into libreboot_src/resources/grub:
$ cd ../libreboot_src/resources/grub/font

I took Dejavu Sans Mono from dejavu (included in this version of libreboot) and did:
$ ../../../grub/grub-mkfont -o dejavusansmono.pf2 ../../../dejavu-fonts-ttf-2.34/ttf/DejaVuSansMono.ttf

I then added the instructions to 'build' script to include resources/grub/dejavusansmono.pf2 in all of the ROM's in root of cbfs.
I then added that instructions to the grub.cfg files (to load the font):
loadfont (cbfsdisk)/dejavusansmono.pf2

Back to top of page

# GRUB keyboard layouts (for reference)

## Custom keyboard layout in GRUB (for reference)

Keymaps are stored in resources/utilities/grub-assemble/keymap/.

Example (French Azerty):
$ ckbcomp fr > frazerty
Go in grub directory:
cat frazerty | ./grub/grub-mklayout -o frazerty.gkb

You must make sure that the files are named keymap and keymap.gkb (where 'keymap' can be whatever you want).

Then from the above example, you would put frazerty in resources/utilities/grub-assemble/keymap/original/ and the frazerty.gkb file goes under resources/utilities/grub-assemble/keymap/

The scripts build and buildrom-withgrub will automatically see this, and automatically build ROM's with your custom layout (given the name) and include them under bin. Example: libreboot_frazerty.rom.

Back to top of page

## UK Dvorak keyboard layout in GRUB (for reference)

ukdvorak had to be created manually, based on usdvorak. diff them (under resources/utilities/grub-assemble/keymap/original) to see how ukdvorak file was created

$ cat ukdvorak | ./grub/grub-mklayout -o ukdvorak.gkb

Back to top of page

# ThinkPad X60: Enable or disable wifi

Install the build dependencies and then build nvramtool.
nvramtool is in coreboot or libreboot source tree under util/:
$ cd libreboot_src/coreboot/util/nvramtool
(nvramtool is also in libreboot_bin/nvramtool)
$ make
Enable wifi:
$ sudo ./nvramtool -w wlan=Enable
Disable wifi:
$ sudo ./nvramtool -w wlan=Disable
If that doesn't work, try one of these instead:
$ sudo ./nvramtool -y ../../src/mainboard/lenovo/x60/cmos.layout -w wlan=Enable
$ sudo ./nvramtool -y ../../src/mainboard/lenovo/x60/cmos.layout -w wlan=Disable
If you are using libreboot_bin, do that instead:
$ sudo ./nvramtool -y ../x60cmos.layout -w wlan=Enable
$ sudo ./nvramtool -y ../x60cmos.layout -w wlan=Disable

The next time you boot, wifi will be enabled.

Back to top of page

# ThinkPad X60: Enable or disable bluetooth

Install the build dependencies and then build nvramtool.
nvramtool is in coreboot or libreboot source tree under util/:
$ cd libreboot_src/coreboot/util/nvramtool
(nvramtool is also in libreboot_bin/nvramtool)
$ make
Enable wifi:
$ sudo ./nvramtool -w bluetooth=Enable
Disable wifi:
$ sudo ./nvramtool -w bluetooth=Disable
If that doesn't work, try one of these instead:
$ sudo ./nvramtool -y ../../src/mainboard/lenovo/x60/cmos.layout -w bluetooth=Enable
$ sudo ./nvramtool -y ../../src/mainboard/lenovo/x60/cmos.layout -w bluetooth=Disable
If you are using libreboot_bin, do that instead:
$ sudo ./nvramtool -y ../x60cmos.layout -w bluetooth=Enable
$ sudo ./nvramtool -y ../x60cmos.layout -w bluetooth=Disable

The next time you boot, wifi will be enabled.

Back to top of page

# ThinkPad X60: Enable or disable trackpoint

Install the build dependencies and then build nvramtool.
nvramtool is in coreboot or libreboot source tree under util/:
$ cd libreboot_src/coreboot/util/nvramtool
(nvramtool is also in libreboot_bin/nvramtool)
$ make
Enable wifi:
$ sudo ./nvramtool -w trackpoint=Enable
Disable wifi:
$ sudo ./nvramtool -w trackpoint=Disable
If that doesn't work, try one of these instead:
$ sudo ./nvramtool -y ../../src/mainboard/lenovo/x60/cmos.layout -w trackpoint=Enable
$ sudo ./nvramtool -y ../../src/mainboard/lenovo/x60/cmos.layout -w trackpoint=Disable
If you are using libreboot_bin, do that instead:
$ sudo ./nvramtool -y ../x60cmos.layout -w wlan=Enable
$ sudo ./nvramtool -y ../x60cmos.layout -w wlan=Disable

The next time you boot, trackpoint will be enabled.

Back to top of page

# High Pitched Whining Noise on Idle (how to remove in Trisquel)

Tested in Trisquel 6.

Note: untested in Trisquel 7. Remove this note when it is.

## Powertop - how to use

Now you can use this command to kill that noise:
$ sudo powertop --auto-tune

You can also run it without parameters and then go into 'Tunables' and set everything to 'Good'

Note: On Trisquel 6, you will need to use a later powertop version from git. The one in the repositories is too old. See below:

## Powertop - Start automatically at boot time (Trisquel 6)

Included with libreboot is a script called 'powertop.trisquel6'. Run this and it will setup powertop to run with --auto-tune at boot time. Load the file in your text editor to see how it does that.

$ ./powertop.trisquel6

This has been tested on Trisquel 6.

Back to top of page

# High Pitched Whining Noise on Idle (how to remove in Parabola)

The following removes most of the noise. It reduces what is a high frequency whine (that not everyone can hear) to a slight buzz (which most people can't hear or doesn't bother most people).

This is not perfect! The full solution is still not discovered but this is a step towards that. Also, in some instances you will need to run 'sudo powertop --auto-tune' again. This needs to be implemented properly in coreboot itself!

On the X60 with coreboot or libreboot, there is a high pitched sound when idle. So far we have use processor.max_cstate=2 or idle=halt in GRUB. These consume power. Stop using them!

Be root
$ su -

Installed powertop:
# pacman -S powertop

and added the following to /etc/systemd/system/powertop.service :

    [Unit]
    Description=Powertop tunings

    [Service]
    Type=oneshot
    RemainAfterExit=no
    ExecStart=/usr/bin/powertop --auto-tune
    # "powertop --auto-tune" still needs a terminal for some reason. Possibly a bug?
    Environment="TERM=xterm"

    [Install]
    WantedBy=multi-user.target

Finally, as root do that:
# systemctl enable powertop
# systemctl start powertop

The next time you boot the machine, the buzz will be gone.

Back to top of page

# X60/T60: Serial port - how to use (for dock owners)

For the Thinkpad X60 you can use the "UltraBase X6" dock (for the X60 Tablet it is called X6 Tablet UltraBase). For the ThinkPad T60, you can use the "Advanced Mini Dock".

If you are using one of the ROM's with 'serial' in the name, then you have serial port enabled in libreboot and you have memtest86+ included inside the ROM. Connect your null modem cable to the serial port on the dock and connect the other end to a 2nd machine using your USB Serial adapter.

On the 2nd machine, you can try this (using GNU Screen):
$ sudo screen /dev/ttyUSB0 115200

How to quit GNU Screen: Ctrl+A then release and press K, and then press Y.

There are also others like Minicom but I like GNU Screen

By doing this before booting the X60/T60, you will see console output from libreboot. You will also see GRUB displaying on the serial output, and you will be able to see MemTest86+ on the serial output aswell. You can also configure your distro so that a terminal (TTY) is accessible from the serial console.

The following guide is for Ubuntu, and can be followed for Trisquel 6.0 which is based on Ubuntu 12.04 (should also work in Trisquel 7, based on Ubuntu 14.04) to enable a serial console using GeTTY:
https://help.ubuntu.com/community/SerialConsoleHowto

Note: part of the tutorial above requires changing your grub.cfg. Just change the linux line to add instructions for enabling getty. See howtos/grub_cbfs.html.

Back to top of page

# Get EDID: Find out the name (model) of your LCD panel

Get the panel name with sudo get-edid | strings
Or look in /sys/class/drm/card0-LVDS-1/edid

If neither of these options work (or they are unavailable), physically removing the LCD panel is an option. Usually, there will be information printed on the back.

Back to top of page.

    	Unlisted note: http://inertiawar.com/microcode/
    	Read that thread: http://www.coreboot.org/pipermail/coreboot/2014-July/078261.html
    	(link published to coreboot mailing list on July 8, 2014)
    	Document everything listed in this discussion (and the link)

    	SeaVGABIOS+SeaBIOS support for X60/T60 (VBT is missing, see docs/future/index.html):
    	Read that: http://www.coreboot.org/pipermail/coreboot/2014-July/078342.html

    	This page talks about 'calibration' in powertop:
    	https://docs.fedoraproject.org/en-US/Fedora/15/html/Power_Management_Guide/PowerTOP.html
    	I should think about adapting information here based on that page.

    	Look into 'git archive' instead of deleting .git
    	eg (coreboot directory):
    	git archive --format=tar --prefix=libreboot/ -o ../libreboot_release.tar HEAD

    	Very useful(!!):
    	http://git-scm.com/book/en/Git-Tools-Stashing

Copyright © 2014 Francis Rowe <info@gluglug.org.uk>
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 license.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 license.txt for more information.