Introduction#

Libreboot is a user-friendly distribution of coreboot. Coreboot is free and open source firmware for desktop computers.

The Dell Latitude E6400 is a recommended laptop for Librebooting because it can be internally flashed and it doesn’t require vendor file injection.

To change the firmware on a computer, you can flash externally, by opening up your computer and using a flash programmer to overwrite your motherboard’s ROM chip. Alternatively, you can do internal flashing, which means flashing from inside the OS, from within software. This means using the internal programmer on your motherboard, rather than an external one. Only some mainboards support internal flashing of Libreboot.

Most mainboards also need vendor file injection. The Libreboot ROM images distributed by the Libreboot project don’t contain certain vendor files that Libreboot isn’t allowed to distribute, so instead they distribute a script to inject the needed vendor files into the distributed ROM image tarballs.

The Dell Latitude E6400 can be internally flashed, meaning you don’t need to obtain a flash programmer and can flash Libreboot comfortably from inside your OS, and it doesn’t need vendor file injection, meaning that should you somehow fail to insert the vendor files properly, the functioning of your system with Libreboot won’t be impacted.

There are instructions on Libreboot’s website on how to install it, including for the Dell Latitude E6400. I don’t mean to reinvent the wheel, but I personally found the instructions to be rather scattered about several pages, so I’m just writing up my personal notes that can be followed in a linear fashion to install Libreboot on Dell Latitude E6400s specifically.

I’m by no means any authority or expert in this subject, and if my notes say something different to Libreboot’s website, you should do what Libreboot’s website says. This is essentially just a compilation of instructions from different parts of Libreboot’s website.

Note that the E6400 has an integrated Intel GPU variant, and a discrete NVIDIA GPU variant. This guide concerns the Intel variant. The NVIDIA variant will differ in that you need a different ROM image to start with, and vendor file injection is no longer optional for the NVIDIA variant.

It is recommended that you follow these instructions on a Linux distribution. The Libreboot website states:

It is recommended that you build libreboot (all parts of it) in a Linux distribution. For example, the build system (lbmk) is untested on BSD systems.

These instructions were written for Linux, and I don’t know how the different aspects of this guide would differ on BSD systems, or other OSes.

Preparation#

Download#

Firstly, obtain ROM images from one of the mirrors here: https://libreboot.org/download.html

In any of the mirrors, navigate to libreboot/stable/<release>/roms, where <release> is the release you want.

In this directory, download libreboot-<release>_e6400_4mb.tar.xz (if you have the NVIDIA variant, then libreboot-<release>_e6400nvidia_4mb.tar.xz). Also download the SHA sum and signature for the file, and verify the tarball’s integrity using the SHA sum and the signing key from Libreboot’s website.

Then you need to clone the lbmk repo.

$ git clone https://codeberg.org/libreboot/lbmk

cd into the lbmk directory for the following steps.

Install build dependencies#

You will need to compile dell_flash_unlock further down, so install build dependencies for lbmk. The mk script in the lbmk repo should be able to install dependencies with mk dependencies run as root with a given Linux distro, e.g.

# ./mk dependencies ubuntu

I’ve only tried ./mk dependencies arch. The packages from the official Arch repos install fine, but a lot of the AUR packages suggested don’t seem to exist anymore. I installed the packages that were available, and was able to compile dell_flash_unlock just fine.

Set MAC address and inject vendor files#

Use the mk script in the lbmk repo to inject the tarballs and set the MAC address of the ROM images with the following command:

$ ./mk inject path/to/libreboot-<release>_e6400_4mb.tar.xz

Note that we have not extracted the tarball and the injection is done on the tarball, not on the individual ROM image you get from extracting the tarball.

You can also specify the MAC address you want with the format:

$ ./mk inject path/to/libreboot-<release>_e6400_4mb.tar.xz setmac 00:00:00:00:00:00

Now that the tarball has been injected, you can extract it to obtain the ROM image you want from it.

Compile dell_flash_unlock#

You will later need to use dell_flash_unlock, so compile it by going to util/dell-flash-unlock from within the lbmk repo. Then simply

$ make

to obtain the dell_flash_unlock binary.

Install flashprog#

From whatever system you will be using to flash Libreboot, install the flashprog package.

Installation#

On Linux, boot with the iomem=relaxed kernel parameter to disable /dev/mem protections, which should be disabled whilst flashing. Remove the kernel parameter once you’re done with flashing.

Start by backing up the original firmware currently on the chip.

# flashprog -p internal -r factory.rom

Do this multiple times and check that the SHA sums of the images match.

If you get an error related to Intel ME or read-only parts of the chip, add the flags --ifd -i bios.

Run the dell_flash_unlock executable as root and follow the instructions output. Then shut down the system. The system should come back online automatically, but on some systems you may have to manually turn it back on.

Then run dell_flash_unlock (as root) another time.

Finally, flash with flashprog:

# flashprog -p internal:laptop=force_I_want_a_brick,boardmismatch=force -w rom_image.rom

where rom_image.rom is whichever ROM image you’ve selected.

flashprog should say VERIFIED at the end if the flash was successful.

Now run dell_flash_unlock (as root) a final time.

Troubleshooting#

If flashprog complains about multiple flash chips, just pick one of them. The “most correct” would likely be -c MX25L3205D/MX25L3208D for Dell machines.