From 9a321884379a71b5f0986fdfb97a2b6c5bdccd8a Mon Sep 17 00:00:00 2001
From: Francis Rowe
- If you downloaded libreboot_meta.tar.gz, then you can use the scripts included
- which download all of the extra dependencies and (basically) generates libreboot_src.
+ Before doing anything, you need the dependencies first.
+
+ For all other GNU/Linux distributions, you may have to adapt these scripts. By all means send patches!
+
+ 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 need to install the build dependencies first.
+ You can use the scripts included to dwnload everything.
- The following scripts installs them for apt-get distros.
@@ -234,7 +245,6 @@
- After that, you will have the full source. Rename libreboot_meta to libreboot_src.
To build the ROM's, see #build.
BUC.TS utility is included in libreboot_src.tar.gz and libreboot_bin.tar.gz.
@@ -271,8 +281,7 @@
- You need to install GCC. The following will work on apt-get distros (adapt that script if your distro doesn't use apt-get):
@@ -281,7 +290,7 @@
- The "builddeps" script in libreboot_src and libreboot_meta also makes use of builddeps-bucts.
+ The "builddeps" script in libreboot_src also makes use of builddeps-bucts.
Flashrom source code is included in libreboot_src.tar.gz and libreboot_bin.tar.gz.
- You need the build dependencies for flashrom.
- The following script works in apt-get distros (tested in Trisquel 6):
@@ -335,7 +342,7 @@
- The "builddeps" script in libreboot_src and libreboot_meta also makes use of builddeps-flashrom.
+ The "builddeps" script in libreboot_src also makes use of builddeps-flashrom.
The resulting .config file was saved as resources/libreboot/config/macbook21/config and is used by the build
- scripts for this machine.
+ scripts for this machine. This config is also used for the MacBook1,1.
If you have anything special in a directory called libreboot_bin, just outside of libreboot_src,
- then back it up first. You don't need to do much: there are scripts already written for you that can build everything automatically. Install all dependencies (works on apt-get distros, tested in Trisquel 6) If your distro uses a different package manager or package names, then you'll need to adapt what you see in
- 'builddeb' and install it yourself - maybe you could share the script for your distro! Also, make sure that you have the sha512sum utility installed.
+ First, install the build dependencies.
+ If running for the first time, run this: To un-build (clean) the build dependencies that you built before, do that: Note: after running 'cleandeps', you will need to run 'builddeps' or 'buildall' again before you can use 'build'. After 'build' or 'buildall' has finished, an ../libreboot_bin directory will exist outside of libreboot_src containing the ROM's and other files. In libreboot_src will also be
- a directory called 'bin' which contains all of the ROM's that you compiled. After 'build' or 'buildall' has finished, you'll find the ROM images for each machine under ./bin/ The script also generates a 'libreboot_meta' directory outside of libreboot_src, which contains everything in src except for grub, coreboot, memtest,
- flashrom and bucts. There is a script called 'getall' from src included in meta, which downloads and patches everything needed to create src.
+ Run that script: Reading all of those scripts will teach you how everything is built. It should also be simple to modify it to your needs.
+ You'll find that the files libreboot_bin.tar.xz and libreboot_src.tar.xz have been created.
+
+ The following are known to work well:
+
@@ -617,6 +666,12 @@
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.
+ Working with source code
-
- Hardware maintenance
+ Supported hardware
-
- Macbook2,1
-
@@ -98,38 +92,37 @@
Security topics
+
+
+
+ Hardware maintenance
+
+
GRUB2 payload
Miscallaneous
-
@@ -156,7 +149,7 @@
- How to build libreboot_src from libreboot_meta
+ Install build dependencies
+
+
+
+
+ Get the full source code from metadata (git clone)
+
+
- Adapt what's in this script if you don't use an apt-get distro:
- $ sudo ./builddeb
+ First, install the build dependencies.
- If you downloaded libreboot_meta.tar.gz, follow #build_meta before you proceed.
+ If you downloaded from git, follow #build_meta before you proceed.
- $ sudo ./builddeb-bucts
+ First, install the build dependencies.
- If you downloaded libreboot_meta.tar.gz, follow #build_meta before you proceed.
+ If you downloaded from git, follow #build_meta before you proceed.
- $ sudo ./builddeb-flashrom
+ First, install the build dependencies.
+
+
+
+
+
+
+
+ How to build the ROM's!
-
- $ sudo ./builddeb
$ ./buildall (also performs the "./build" step below)
@@ -551,17 +579,23 @@
$ ./build
+ This also deletes the ROM images under ./bin/:
$ ./cleandepsPreparing release archives (optional)
+
+
+ $ ./build-release
+
@@ -593,6 +628,20 @@
+ Recommended wifi chipsets
+
+
+
+
+
+
+
List of supported ThinkPad X60's
@@ -661,6 +716,12 @@
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. +
++ 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. +
+ @@ -760,13 +827,8 @@
- The following T60 motherboard shows an ATI GPU (do not buy this) (highlighted in red, or on the right next to the white CPU socket), which is unsupported by libreboot:
-
-
- The following T60 motherboard shows an Intel GPU (buy this!) (highlighted in red or on the right next to the white CPU socket, you can see that the space for ATI GPU is empty):
-
+ 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):
+
@@ -795,6 +857,57 @@
+ 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: +
+ + ++ Specifically (Order No. / Model No. / CPU): +
++ 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). +
+ + + +@@ -859,8 +972,8 @@ Specifically (Order No. / Model No. / CPU):
+ 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).
@@ -881,13 +1004,42 @@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. Cooling (ventilation) - is also poor. The speaker might aswell not be there, quality is really bad. Not only that, these machines are expensive and usually easier to find in North America, so if you live outside - of NA then you will most likely have to import it. It's the opinion of this libreboot developer that the MacBook2,1 is not a very good machine. + 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. @@ -899,81 +1051,49 @@
Recommended ROM's to flash:
-+ List of directories corresponding to each board: +
+These images use coreboot text-mode graphics:
+These images use coreboot framebuffer graphics:
++ _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.
-- For pictures of what these keyboard layouts look like (so you can compare with yours), see #keyboards. -
@@ -998,6 +1118,9 @@+ 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
@@ -1016,15 +1139,23 @@
If you are flashing a Lenovo ThinkPad T60, be sure to read #supported_t60_list
- If you are using Trisquel 6 (32-bit) then the bucts/flashrom binaries are tested. If not (or if you want), recompile them:
- See: #build_flashrom
- See: #build_bucts
- In any case, you will want the dependencies to run them aswell:
- $ sudo ./builddeb-flashrom
- $ sudo ./builddeb-bucts
- (^ works on Trisquel 6, maybe other apt-get distros. Adapt for all other distros.)
+ First, install the build dependencies.
+ + Before you proceed, make *sure* to build flashrom and bucts from source. Both are provided. This is very important! + +
+ + +"YOURBOARD/YOURROM" should be replaced with what is correct as per #rom. Alternatively you may be using your own custom ROM. Adapt.
@@ -1060,7 +1191,6 @@If you boot and you see nothing, try turning up the backlight (Fn+Home). - If this is a ThinkPad X60 and backlight resets to zero when turning it up while at max, look at #tft_brightness.
@@ -1119,6 +1249,10 @@ (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. +
+@@ -1133,13 +1267,22 @@
- If you need to recompile flashrom:
- See: #build_flashrom
-
- You also need the run-time dependencies. This script works on apt-get distros:
- $ sudo ./builddeb-flashrom
+ First, install the build dependencies.
+ + Before you proceed, make *sure* to build flashrom from source. This is very important! + +
+ + +Look at #rom to see which ROM is suitable for your machine. Alternatively you may be using your own custom ROM. Adapt. @@ -1212,13 +1355,20 @@
- If you need to recompile flashrom:
- See: #build_flashrom
-
- You also need the run-time dependencies. This script works on apt-get distros:
- $ sudo ./builddeb-flashrom
+ First, install the build dependencies.
+ + Before you proceed, make *sure* to build flashrom from source. This is very important! + +
+ + +Look at #rom to see which ROM is suitable for your machine. Alternative you may be using your own custom ROM. Adapt. @@ -1238,7 +1388,6 @@
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 and backlight resets to zero when turning it up while at max, look at #tft_brightness.
@@ -1288,50 +1437,10 @@- Taken from WikiPedia. - See https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard, - https://en.wikipedia.org/wiki/QWERTY - and https://en.wikipedia.org/wiki/AZERTY. -
- -- https://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/KB_France.svg/800px-KB_France.svg.png -
-- Keymaps are stored in resources/grub/keymap/original (original files) and resources/grub/keymap (.gkb files). + Keymaps are stored in resources/utilities/grub-assemble/keymap/.
@@ -1346,8 +1455,8 @@
- Then from the above example, you would put frazerty in resources/grub/keymap/original/ and - the frazerty.gkb file goes under resources/grub/keymap/ + 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/
@@ -1357,90 +1466,23 @@
-Generate the layout file:
- $ ckbcomp us > usqwerty
- $ cat usqwerty | ./grub/grub-mklayout -o usqwerty.gkb
Generate the layout file:
- $ ckbcomp gb > ukqwerty
- $ cat ukqwerty | ./grub/grub-mklayout -o ukqwerty.gkb
Generate the layout file:
- $ ckbcomp dvorak > usdvorak
- $ cat usdvorak | ./grub/grub-mklayout -o usdvorak.gkb
- ukdvorak had to be created manually, based on usdvorak. diff them (under resources/grub/keymap/original) + 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 -Generate the layout file:
- $ ckbcomp fr > frazerty
- $ cat frazerty | ./grub/grub-mklayout -o frazerty.gkb
Generate the layout file:
- $ ckbcomp it > itqwerty
- $ cat itqwerty | ./grub/grub-mklayout -o itqwerty.gkb
- Sometimes, on some setups, when turning up the brightness while at max, it will loop back to minimum. - Also, the minimum will turn the backlight off completely. -
-
- Install build dependencies (for Trisquel 6. Adapt if your distro is different):
- $ sudo apt-get install build-essential
-
- Go into the libreboot_src directory. Under coreboot/util/nvramtool/ do that to compile it:
- $ make
- (nvramtool is also in libreboot_bin/nvramtool)
-
- Now do that:
- $ sudo ./nvramtool -w tft_brightness=0xff
- Alternatively if there are errors, try:
- $ sudo ./nvramtool -y ../../src/mainboard/lenovo/x60/cmos.layout -w tft_brightness=0xff
- If you are using libreboot_bin, do that:
- $ sudo ../x60cmos.layout -w tft_brightness=0xff
-
- The next time you boot, the looping issue should be gone. -
- - - -
- Install build dependencies in Trisquel 6 (adapt for other distro):
- $ sudo apt-get install build-essential
- nvramtool is in coreboot or libreboot source tree until util/:
+ 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
@@ -1460,11 +1502,33 @@
+ 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.
+ + +
- Install build dependencies in Trisquel 6 (adapt for other distro):
- $ sudo apt-get install build-essential
- nvramtool is in coreboot or libreboot source tree until util/:
+ 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
@@ -1486,6 +1550,13 @@
+ Tested in Trisquel 6. +
++ Note: untested in Trisquel 7. Remove this note when it is. +
+Now you can use this command to kill that noise:
@@ -1594,7 +1665,7 @@ WantedBy=multi-user.target
- Get the panel name with sudo get-edit | strings
+ Get the panel name with sudo get-edid | strings
Or look in /sys/class/drm/card0-LVDS-1/edid
@@ -1630,8 +1701,15 @@ WantedBy=multi-user.target
- Copyright © 2014 Francis Rowe, All Rights Reserved.
- See license.html for license conditions.
+ 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.