Libreboot/ThinkPad X60

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Note: This guide will be merged with the official Libreboot documentation. Please update your links.
ThinkPad X60 Series.
The ThinkPad X60, X60T, and X60s.

The ThinkPad X60 is the first Libreboot laptop, and the only laptop series where every motherboard is guaranteed to work with Libreboot (no ATI GPUs, all LCDs work out of the box, etc.).

Briefing[edit]

  • All ThinkPad X60/X60s/X60 Tablet motherboards support Libreboot, since none of them have an ATI GPU.
  • The ThinkPad X60 series supports software BIOS flashing.
    • No hardware flashing is necessary, unless you accidentally brick the BIOS.
  • You must install GNU/Linux before installing Libreboot. Here's a list of FSF-approved distros.
  • In order to use an FSF-approved GNU/Linux distro, you must replace the Intel 3945abg Wifi Card; since it uses proprietary drivers.
    • We recommend an Atheros ath9k Wireless-N miniPCI card. Other wifi cards with open source drivers are listed at h-node.
    • You will need to remove the keyboard and palmrest in order to replace the miniPCI card. If you're not brave enough to do this, just buy a USB dongle.
    • Don't plug in the new miniPCI card until Libreboot is installed, or your laptop will not boot (due to pesky miniPCI whitelisting).
    • Until Libreboot is installed, you must use an Ethernet cable to connect to the internet, or transfer data via a USB drive.

Download Libreboot[edit]

  1. Download the latest Libreboot Binaries.
  2. Open a Terminal and navigate to the Downloads folder (or wherever else)
  3. Extract the Libreboot folder:
    tar -xvf libreboot_bin.tar.gz 
  4. Navigate to the libreboot_bin folder:
    cd libreboot_bin 

Install and Make Dependencies[edit]

The flashrom and bucts programs require a few dependencies. Install them automatically with the Libreboot builddeb scripts.

  • For DEB-based distros (Trisquel, Ubuntu, Debian, etc):
  • sudo ./deps-trisquel
  • For Arch-based distros (Parabola, Arch Linux, etc):
  • sudo ./deps-parabola
  • Other Linux distros will need to find the corresponding dependencies on their own.

Next, we actually have to build flashrom and bucts from source code. The Libreboot developers have made a nice build script that does this automatically:

sudo ./builddeps-flashrom
sudo ./builddeps-bucts

Find the Right ROM[edit]

Under the bin/ folder in libreboot_bin/, there are a multitude of Libreboot ROMs sorted by motherboard.

Choose the ROM with your laptop's keyboard layout (US or UK, QWERTY or DVORAK). For ThinkPads, choose a serial ROM if dock and serial port support is needed.

  • bin/x60/ - ThinkPad X60/X60s
  • bin/x60t/ - ThinkPad X60 Tablet

Once you know which ROM to use, remember it's directory path for the next step (ex. bin/x60/libreboot_serial_usqwerty.rom )

Check the ROMs section from the official Libreboot Documentation for the latest list.

Back up Original BIOS[edit]

If you choose to make a backup, click [Expand] on the right and follow the directions.

  1. From the libreboot_bin/ folder, enter the flashrom/ folder.
    cd flashrom 
  2. Run both of these commands to backup the BIOS to factory.bin (don't panic, nothing is being installed):
    sudo ./flashrom_lenovobios_sst -p internal -r factory.bin
sudo ./flashrom_lenovobios_macronix -p internal -r factory.bin 
  1. If a factory.bin file was created in the flashrom/ folder, the Lenovo BIOS has been backed up successfully. If not, try the commands again. Copy this dump to a safe place.
  2. Return to the libreboot_bin/ folder.
    cd .. 

Libreboot First Flash[edit]

If you are flashing Libreboot for the first time, on an unmodified ThinkPad running Lenovo's BIOS, you will need to follow this special process.

  1. Run the first flash script for Lenovo BIOSes:
    sudo ./lenovobios_firstflash bin/YOURBOARD/YOURROM
  2. Wait for the process to finish. Expect to see "critical errors" during flashing, but don't panic; proceed to the next step to check if the flash ran correctly.
  3. The line below is displayed if bucts 1 was enabled successfully.
    Updated BUC.TS=1 - 64kb address ranges at 0xFFFE0000 and 0xFFFF0000 are swapped.
  1. The following "errors" are displayed if flashrom installed Libreboot correctly. The output must be very similar (later versions of flashrom may have minor differences).
    Reading old flash chip contents... done.
    Erasing and writing flash chip... spi_block_erase_20 failed during command execution at address 0x0
    Reading current flash chip contents... done. spi_block_erase_52 failed during command execution at address 0x0
    Reading current flash chip contents... done. Transaction error!
    spi_block_erase_d8 failed during command execution at address 0x1f0000
    Reading current flash chip contents... done. spi_chip_erase_60 failed during command execution
    Reading current flash chip contents... done. spi_chip_erase_c7 failed during command execution
    FAILED!
    Uh oh. Erase/write failed. Checking if anything changed.
    Your flash chip is in an unknown state.
  1. If the "errors" closely match the lines above, shut down the laptop (don't restart).
  2. Wait a few seconds, and then boot. Libreboot will start up.
  3. Use the Search for GRUB configuration on local storage option if the normal menu options don't work.
  4. After booting into Linux, proceed to Libreboot Second Flash.

Enable Trackpoint[edit]

On a few rare X60 variants, the Trackpoint mouse might not work out of the box. Not to worry though, just use nvramtool with the Libreboot package to enable it.

  1. Boot and log into Linux. (you may need to use text mode, find keyboard shortcuts)
  2. Open a Terminal (somehow... without the mouse. Hopefully you have Yakuake installed!)
  3. Navigate to the libreboot_bin/nvramtool folder.
  4. Build nvramtool with make .
    make 
  5. Use nvramtool to enable the TrackPoint mouse.
    sudo ./nvramtool -w trackpoint=Enable 
  6. Reboot the laptop (using sudo reboot), and the TrackPoint will be enabled. If it still doesn't work, try this command instead:
    sudo ./nvramtool -y ../../src/mainboard/lenovo/x60/cmos.layout -w trackpoint=Enable 

Libreboot Second Flash[edit]

Now that Libreboot has been installed and is up and running, it must be flashed a second time to fully remove the Lenovo BIOS.

  1. Open a Terminal and navigate to the libreboot_bin directory.
  2. Run the following command to flash Libreboot a second time.
    sudo ./lenovobios_secondflash /path/to/libreboot.rom
  1. The following line will be displayed if bucts was set back to 0 again. If it was not set to 0, run the script again.
    Updated BUC.TS=0 - 128kb address range 0xFFFE0000-0xFFFFFFFF is untranslated 
  2. The following should also be displayed, without any errors:
    Verifying flash... VERIFIED. 
  3. Shut down again, wait a few seconds, and then boot. Libreboot has been successfully installed.

Replace the WiFi Card[edit]

If you are planning on using Trisquel or some other FSF-approved GNU/Linux distro, you must replace the Intel mPCI wifi card with an Atheros Wireless-N mPCI card ($10-15).

The Intel card requires proprietary blobs, makes the palmrest extremely hot, and only supports the slower Wireless-G anyway; so it's well worth the upgrade.

  1. Follow this guide for the X60/X60s or the HMM for the X60 tablet to remove the palmrest.
  2. Remove the Intel 3945bgn WiFi Card.
  3. Replace it with an Atheros Wireless-N MiniPCI card.

(needs more info and photos)

Updating Libreboot or Installing Custom ROMs[edit]

In the future, if you ever want to update Libreboot on the X60 (or restore the factory BIOS), follow this process.

  1. Download and extract the latest Libreboot binary release.
  2. Open a Terminal, and navigate to the libreboot_bin directory.
  3. Run the following command to flash your chosen rom:
    sudo ./flash /path/to/libreboot.rom
  1. The following should be displayed, without any errors:
    Verifying flash... VERIFIED. 
  2. Shut down again, wait a few seconds, and then boot. Libreboot has been successfully updated.

Remove High Pitched Whining Noise[edit]

There might be a high pitched whining noise coming from the CPU at times, so if it bothers you, follow this procedure to get rid of it:

Installing PowerTop[edit]

^

First, install powertop from the repositories:

sudo apt-get install powertop

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'

Powertop - Start automatically at boot time (Trisquel 6)[edit]

^

Included with the libreboot release 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

Powertop for Arch Linux/Parabola[edit]

  1. Become root:
    su - 
  2. Install powertop:
    pacman -S powertop 
  3. Add 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, enable powertop in systemd:

    systemctl enable powertop
    systemctl start powertop

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

Powertop Cannot Load from File[edit]

Powertop will not work immediately, it has to collect measurement data before implementing it's features, which will be stored in /var/cache/powertop/saved_parameters.powertop Leave the laptop running on battery for a while, and Powertop will figure something out sooner or later.

Sources[edit]