aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/bsd/freebsd.md21
-rw-r--r--docs/bsd/index.md6
-rw-r--r--docs/bsd/netbsd.md34
-rw-r--r--docs/bsd/openbsd.md33
-rw-r--r--docs/depthcharge/index.md228
-rw-r--r--docs/fdl-1.3.md1
-rw-r--r--docs/git/index.md105
-rw-r--r--docs/gnulinux/configuring_parabola.md137
-rw-r--r--docs/gnulinux/encrypted_debian.md91
-rw-r--r--docs/gnulinux/encrypted_parabola.md213
-rw-r--r--docs/gnulinux/grub_boot_installer.md112
-rw-r--r--docs/gnulinux/grub_cbfs.md103
-rw-r--r--docs/gnulinux/grub_hardening.md35
-rw-r--r--docs/gnulinux/index.md6
-rw-r--r--docs/grub/grubeditor.md121
-rw-r--r--docs/grub/index.md52
-rw-r--r--docs/hardware/c201.md43
-rw-r--r--docs/hardware/d510mo.md2
-rw-r--r--docs/hardware/d945gclf.md2
-rw-r--r--docs/hardware/ga-g41m-es2l.md2
-rw-r--r--docs/hardware/gm45_remove_me.md60
-rw-r--r--docs/hardware/imac52.md2
-rw-r--r--docs/hardware/index.md170
-rw-r--r--docs/hardware/kcma-d8.md16
-rw-r--r--docs/hardware/kfsn4-dre.md6
-rw-r--r--docs/hardware/kgpe-d16.md60
-rw-r--r--docs/hardware/r400.md6
-rw-r--r--docs/hardware/t400.md8
-rw-r--r--docs/hardware/t500.md9
-rw-r--r--docs/hardware/x200.md68
-rw-r--r--docs/index.md34
-rw-r--r--docs/install/bbb_setup.md92
-rw-r--r--docs/install/c201.md107
-rw-r--r--docs/install/d510mo.md3
-rw-r--r--docs/install/d945gclf.md2
-rw-r--r--docs/install/ga-g41m-es2l.md17
-rw-r--r--docs/install/images/x200/disassembly/0006.1.jpgbin0 -> 32364 bytes
-rw-r--r--docs/install/index.md163
-rw-r--r--docs/install/kcma-d8.md14
-rw-r--r--docs/install/kgpe-d16.md16
-rw-r--r--docs/install/r400_external.md58
-rw-r--r--docs/install/rpi_setup.md130
-rw-r--r--docs/install/t400_external.md55
-rw-r--r--docs/install/t500_external.md49
-rw-r--r--docs/install/t60_unbrick.md39
-rw-r--r--docs/install/x200_external.md138
-rw-r--r--docs/install/x60_unbrick.md29
-rw-r--r--docs/install/x60tablet_unbrick.md29
-rw-r--r--docs/misc/bbb_ehci.md24
-rw-r--r--docs/misc/index.md51
-rw-r--r--docs/release.md11
-rwxr-xr-xlibreboot183
-rwxr-xr-xlibs/common17
-rwxr-xr-xlibs/git36
-rwxr-xr-xlibs/project18
-rwxr-xr-xlibs/tool9
-rw-r--r--projects/bucts/bucts110
-rw-r--r--projects/bucts/configs/install1
-rw-r--r--projects/bucts/configs/revision1
-rw-r--r--projects/bucts/configs/targets2
-rw-r--r--projects/bucts/patches/0001-Makefile-don-t-use-git.patch24
-rw-r--r--projects/bucts/patches/staticlink.diff13
-rwxr-xr-xprojects/cros-scripts/install/cros-boot-keys2
-rwxr-xr-xprojects/cros-scripts/install/cros-firmware-prepare2
-rwxr-xr-xprojects/cros-scripts/install/cros-kernel-install2
-rwxr-xr-xprojects/cros-scripts/install/cros-kernel-prepare2
-rwxr-xr-xprojects/cros-scripts/install/cros-medium-setup2
-rw-r--r--projects/libreboot-release/install/libreboot-release2
-rwxr-xr-xprojects/libreboot-sources/install/libreboot-sources2
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch212
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch379
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch31
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/reused.list1
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch212
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch379
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch31
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/reused.list1
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch212
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch379
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch31
-rw-r--r--resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/reused.list1
-rw-r--r--resources/scripts/misc/grubeditor.sh451
-rw-r--r--www/contrib.md8
-rw-r--r--www/download.md16
-rw-r--r--www/footer.md8
-rw-r--r--www/git.md22
-rw-r--r--www/global.css15
-rw-r--r--www/headercenter.css3
-rw-r--r--www/headerleft.css3
-rw-r--r--www/index.md17
-rw-r--r--www/management.md2
-rw-r--r--www/news/fsf-domain-offer.md15
-rw-r--r--www/news/sfc-domain-offer.md36
-rwxr-xr-xwww/publish.sh35
-rw-r--r--www/suppliers.md122
95 files changed, 2211 insertions, 3652 deletions
diff --git a/docs/bsd/freebsd.md b/docs/bsd/freebsd.md
index f66ca88b..35277053 100644
--- a/docs/bsd/freebsd.md
+++ b/docs/bsd/freebsd.md
@@ -1,5 +1,6 @@
---
title: How to install FreeBSD on a libreboot system
+x-toc-enable: true
...
This section relates to preparing, booting and installing FreeBSD on
@@ -7,8 +8,8 @@ your libreboot system, using nothing more than a USB flash drive (and
*dd*). They've only been tested on a Lenovo ThinkPad x200.
It is expected that you use text mode in libreboot (txtmode images), for
-the early boot process in FreeBSD. **Booting the installer results in a
-red flickering text display, and doesn't boot.**
+the early boot process in FreeBSD. *Booting the installer results in a
+red flickering text display, and doesn't boot.*
Thanks go to ioxcide in [this Reddit
post](https://www.reddit.com/r/BSD/comments/53jt70/libreboot_and_bsds/)
@@ -19,16 +20,9 @@ if it does not). Instructions are provided here, to boot and install
FreeBSD but we're not sure whether it is currently fully compatible
with libreboot.
-- [Prepare the USB drive (in FreeBSD)](#prepare)
-- [Installing FreeBSD without full disk encryption](#noencryption)
-- [Installing FreeBSD with full disk encryption](#encryption)
-- [Booting](#booting)
-- [Configuring Grub](#configuring_grub)
-- [Troubleshooting](#troubleshooting)
-
-**This section is only for the GRUB payload. For depthcharge (used on
+*This section is only for the GRUB payload. For depthcharge (used on
CrOS devices in libreboot), instructions have yet to be written in the
-libreboot documentation.**
+libreboot documentation.*
freebsd.img is the installation image for FreeBSD. Adapt the filename
accordingly, for whatever FreeBSD version you use.
@@ -85,6 +79,7 @@ the bootable FreeBSD USB drive:
Connect the USB drive. Check dmesg:
$ dmesg
+
Check lsblk to confirm which drive it is:
$ lsblk
@@ -143,7 +138,7 @@ because it doesn't exist.
In most cases, you should use the vesafb ROM images. Example filename:
libreboot\_ukdvorak\_vesafb.rom.
-won't boot\...something about file not found
+won't boot...something about file not found
---------------------------------------------
Your device names (i.e. usb0, usb1, sd0, sd1, wd0, ahci0, hd0, etc) and
@@ -152,8 +147,6 @@ numbers may differ. Use TAB completion.
Copyright © 2016 Leah Rowe <info@minifree.org>\
Copyright © 2016 Scott Bonds <scott@ggr.com>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/bsd/index.md b/docs/bsd/index.md
index 8237f884..2f7d83e6 100644
--- a/docs/bsd/index.md
+++ b/docs/bsd/index.md
@@ -5,8 +5,8 @@ title: BSD projects
This section relates to dealing with BSD projects: preparing bootable
USB drives, changing the default GRUB menu and so on.
-**This section is only for the \*GRUB\* payload. For depthcharge,
-instructions have yet to be written.**
+*This section is only for the GRUB payload. For depthcharge,
+instructions have yet to be written.*
- [How to install NetBSD on a libreboot system](netbsd.md)
- [How to install LibertyBSD or OpenBSD on a libreboot
@@ -16,8 +16,6 @@ instructions have yet to be written.**
Copyright © 2016 Scott Bonds <scott@ggr.com>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/bsd/netbsd.md b/docs/bsd/netbsd.md
index 39157ef6..c3ed6970 100644
--- a/docs/bsd/netbsd.md
+++ b/docs/bsd/netbsd.md
@@ -1,5 +1,6 @@
---
title: How to install NetBSD on a libreboot system
+x-toc-enable: true
...
This section relates to preparing, booting and installing NetBSD on your
@@ -7,23 +8,16 @@ libreboot system, using nothing more than a USB flash drive (and *dd*).
They've only been tested on a librebooted ThinkPad X60.
It is expected that you use text mode in libreboot (txtmode images), for
-the early boot process in NetBSD. **Suspend/hibernate is broken,
-according to at least 1 user.**
+the early boot process in NetBSD. *Suspend/hibernate is broken,
+according to at least 1 user.*
Thanks go to ioxcide in [this Reddit
post](https://www.reddit.com/r/BSD/comments/53jt70/libreboot_and_bsds/)
for the initial instructions.
-- [Prepare the USB drive (in NetBSD)](#prepare)
-- [Installing NetBSD without full disk encryption](#noencryption)
-- [Installing NetBSD with full disk encryption](#encryption)
-- [Booting](#booting)
-- [Configuring Grub](#configuring_grub)
-- [Troubleshooting](#troubleshooting)
-
-**This section is only for the GRUB payload. For depthcharge (used on
+*This section is only for the GRUB payload. For depthcharge (used on
CrOS devices in libreboot), instructions have yet to be written in the
-libreboot documentation.**
+libreboot documentation.*
netbsd.iso is the installation image for NetBSD. Adapt the filename
accordingly, for your version of NetBSD.
@@ -81,6 +75,7 @@ the bootable NetBSD USB drive:
Connect the USB drive. Check dmesg:
$ dmesg
+
Check lsblk to confirm which drive it is:
$ lsblk
@@ -135,14 +130,13 @@ command to boot NetBSD every time, you can create a GRUB configuration
that's aware of your NetBSD installation and that will automatically be
used by libreboot.
-On your NetBSD root partition, create the **/grub** directory and add
-the file **libreboot\_grub.cfg** to it. Inside the
-**libreboot\_grub.cfg** add these lines:
+On your NetBSD root partition, create the `/grub` directory and add
+the file `libreboot_grub.cfg` to it. Inside the
+`libreboot_grub.cfg` add these lines:
-**default=0 timeout=3 menuentry "NetBSD" {\
-    knetbsd -r wd0a (ahci0,netbsd1)/netbsd\
-}\
-**
+ default=0 timeout=3 menuentry "NetBSD" {
+     knetbsd -r wd0a (ahci0,netbsd1)/netbsd
+ }
The next time you boot, you'll see the old Grub menu for a few seconds,
then you'll see the a new menu with only NetBSD on the list. After 3
@@ -160,7 +154,7 @@ because it doesn't exist.
In most cases, you should use the vesafb ROM images. Example filename:
libreboot\_ukdvorak\_vesafb.rom.
-won't boot\...something about file not found
+won't boot...something about file not found
---------------------------------------------
Your device names (i.e. usb0, usb1, sd0, sd1, wd0, ahci0, hd0, etc) and
@@ -169,8 +163,6 @@ numbers may differ. Use TAB completion.
Copyright © 2016 Leah Rowe <info@minifree.org>\
Copyright © 2016 Scott Bonds <scott@ggr.com>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/bsd/openbsd.md b/docs/bsd/openbsd.md
index 0124356e..ca9ac387 100644
--- a/docs/bsd/openbsd.md
+++ b/docs/bsd/openbsd.md
@@ -1,5 +1,6 @@
---
title: How to install LibertyBSD or OpenBSD on a libreboot system
+x-toc-enable: true
...
NOTE: This guide was written for OpenBSD by the person who contributed
@@ -13,16 +14,9 @@ This section relates to preparing, booting and installing OpenBSD on
your libreboot system, using nothing more than a USB flash drive (and
*dd*). They've only been tested on a Lenovo ThinkPad x200.
-- [Prepare the USB drive (in OpenBSD)](#prepare)
-- [Installing OpenBSD without full disk encryption](#noencryption)
-- [Installing OpenBSD with full disk encryption](#encryption)
-- [Booting](#booting)
-- [Configuring Grub](#configuring_grub)
-- [Troubleshooting](#troubleshooting)
-
-**This section is only for the GRUB payload. For depthcharge (used on
+*This section is only for the GRUB payload. For depthcharge (used on
CrOS devices in libreboot), instructions have yet to be written in the
-libreboot documentation.**
+libreboot documentation.*
install60.fs is the installation image for OpenBSD 6.0. Adapt the
filename accordingly, for a different OpenBSD version or LibertyBSD.
@@ -80,6 +74,7 @@ the bootable OpenBSD USB drive:
Connect the USB drive. Check dmesg:
$ dmesg
+
Check lsblk to confirm which drive it is:
$ lsblk
@@ -129,9 +124,9 @@ working this way.
Alternatively, it would be good to port OpenBSD either natively as a
coreboot payload, or port it to libpayload (payload library in coreboot;
it has a basic C library and a few functions for certain operations e.g.
-text/bitmap). **This would be ideal, because then it would be possible
+text/bitmap). *This would be ideal, because then it would be possible
to boot a truly fully encrypted OpenBSD or LibertyBSD installation, by
-putting everything in the flash chip.**
+putting everything in the flash chip.*
Alternatively, modifying GRUB to support booting fully encrypted OpenBSD
installations would be possible, but probably not feasible; it's an
@@ -156,14 +151,12 @@ command to boot OpenBSD every time, you can create a GRUB configuration
that's aware of your OpenBSD installation and that will automatically
be used by libreboot.
-On your OpenBSD root partition, create the **/grub** directory and add
-the file **libreboot\_grub.cfg** to it. Inside the
-**libreboot\_grub.cfg** add these lines:
+On your OpenBSD root partition, create the `/grub` directory and add the file
+`libreboot_grub.cfg` to it. Inside the `libreboot_grub.cfg` add these lines:
-**default=0 timeout=3 menuentry "OpenBSD" {\
-    kopenbsd -r sd0a (ahci0,openbsd1)/bsd\
-}\
-**
+ default=0 timeout=3 menuentry "OpenBSD" {
+     kopenbsd -r sd0a (ahci0,openbsd1)/bsd
+ }
The next time you boot, you'll see the old Grub menu for a few seconds,
then you'll see the a new menu with only OpenBSD on the list. After 3
@@ -181,7 +174,7 @@ because it doesn't exist.
In most cases, you should use the vesafb ROM images. Example filename:
libreboot\_ukdvorak\_vesafb.rom.
-won't boot\...something about file not found
+Won't boot...something about file not found
---------------------------------------------
Your device names (i.e. usb0, usb1, sd0, sd1, wd0, ahci0, hd0, etc) and
@@ -190,8 +183,6 @@ numbers may differ. Use TAB completion.
Copyright © 2016 Scott Bonds <scott@ggr.com>\
Copyright © 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/depthcharge/index.md b/docs/depthcharge/index.md
index 1c361a7d..ffb525f5 100644
--- a/docs/depthcharge/index.md
+++ b/docs/depthcharge/index.md
@@ -1,86 +1,70 @@
---
title: Depthcharge payload
+x-toc-enable: true
...
This section relates to the depthcharge payload used in libreboot.
-- [CrOS security model](#cros_security_model)
-- [Developer mode screen](#developer_mode_screen)
- - Holding the developer mode screen
- - Booting normally
- - Booting from different mediums
- - Showing device information
- - Warnings
-
-- [Recovery mode screen](#recovery_mode_screen)
- - [Recovering from a bad state](#recovering_bad_state)
- - [Enabling developer mode](#enabling_developer_mode)
-- [Configuring verified boot
- parameters](#configuring_verified_boot_parameters)
-
-CrOS security model {#cros_security_model}
+CrOS security model
===================
-CrOS (Chromium OS/Chrome OS) devices such as Chromebooks implement a
-strict security model to ensure that these devices do not become
-compromised, that is implemented as the verified boot (vboot) reference,
-most of which is executed within depthcharge. A detailed overview of the
-CrOS security model is available on the dedicated page.
+CrOS (Chromium OS/Chrome OS) devices such as Chromebooks implement a strict
+security model to ensure that these devices do not become compromised, that is
+implemented as the verified boot (vboot) reference, most of which is executed
+within depthcharge. A detailed overview of the CrOS security model is available
+on the dedicated page.
-In spite of the CrOS security model, depthcharge won't allow booting
-kernels without verifying their signature and booting from external
-media or legacy payload unless explicitly allowed: see [configuring
-verified boot parameters](#configuring_verified_boot_parameters).
+In spite of the CrOS security model, depthcharge won't allow booting kernels
+without verifying their signature and booting from external media or legacy
+payload unless explicitly allowed: see [configuring verified boot
+parameters](#configuring_verified_boot_parameters).
-Developer mode screen {#developer_mode_screen}
+Developer mode screen
=====================
-The developer mode screen can be accessed in depthcharge when developer
-mode is enabled.\
-Developer mode can be enabled from the [recovery mode
-screen](#recovery_mode_screen).
+The developer mode screen can be accessed in depthcharge when developer mode is
+enabled. Developer mode can be enabled from the recovery mode screen.
It allows booting normally, booting from internal storage, booting from
-external media (when enabled), booting from legacy payload (when
-enabled), showing information about the device and disabling developer
-mode.
+external media (when enabled), booting from legacy payload (when enabled),
+showing information about the device and disabling developer mode.
-Holding the developer mode screen {#holding_developer_mode_screen}
+Holding the developer mode screen
---------------------------------
-As instructed on the developer mode screen, the screen can be held by
-pressing **Ctrl + H** in the first 3 seconds after the screen is shown.
-After that delay, depthcharge will resume booting normally.
+As instructed on the developer mode screen, the screen can be held by pressing
+*Ctrl + H* in the first 3 seconds after the screen is shown. After that delay,
+depthcharge will resume booting normally.
-Booting normally {#booting_normally}
+Booting normally
----------------
-As instructed on the developer mode screen, a regular boot will happen
-after **3 seconds** (if developer mode screen is not held).\
-The default boot medium (internal storage, external media, legacy
-payload) is shown on screen.
+As instructed on the developer mode screen, a regular boot will happen after *3
+seconds* (if developer mode screen is not held).
-Booting from different mediums {#booting_different_mediums}
+The default boot medium (internal storage, external media, legacy payload) is
+shown on screen.
+
+Booting from different mediums
------------------------------
-Depthcharge allows booting from different mediums, when they are allowed
-(see [configuring verified boot
-parameters](#configuring_verified_boot_parameters) to enable or disable
-boot mediums).\
-As instructed on the developer mode screen, booting from various mediums
-can be triggered by pressing various key combinations:
+Depthcharge allows booting from different mediums, when they are allowed (see
+[configuring verified boot parameters](#configuring_verified_boot_parameters)
+to enable or disable boot mediums).
+
+As instructed on the developer mode screen, booting from various mediums can be
+triggered by pressing various key combinations:
-- Internal storage: **Ctrl + D**
-- External media: **Ctrl + U** (when enabled)
-- Legacy payload: **Ctrl + L** (when enabled)
+- Internal storage: *Ctrl + D*
+- External media: *Ctrl + U* (when enabled)
+- Legacy payload: *Ctrl + L* (when enabled)
-Showing device information {#showing_device_information}
+Showing device information
--------------------------
-As instructed on the developer mode screen, showing device information
-can be triggered by pressing **Ctrl + I** or **Tab**.\
-Various information is shown, including vboot non-volatile data, TPM
-status, GBB flags and key hashes.\
+As instructed on the developer mode screen, showing device information can be
+triggered by pressing *Ctrl + I* or *Tab*. Various information is shown,
+including vboot non-volatile data, TPM status, GBB flags and key hashes.
Warnings
--------
@@ -91,111 +75,99 @@ The developer mode screen will show warnings when:
- Booting from external media is enabled
- Booting legacy payloads is enabled
-Recovery mode screen {#recovery_mode_screen}
+Recovery mode screen
====================
-The recovery mode screen can be accessed in depthcharge, by pressing
-**Escape + Refresh + Power** when the device is off.
+The recovery mode screen can be accessed in depthcharge, by pressing *Escape +
+Refresh + Power* when the device is off.
-It allows recovering the device from a bad state by booting from a
-trusted recovery media. When accessed with the device in a good state,
-it also allows enabling developer mode.
+It allows recovering the device from a bad state by booting from a trusted
+recovery media. When accessed with the device in a good state, it also allows
+enabling developer mode.
-Recovering from a bad state {#recovering_bad_state}
+Recovering from a bad state
---------------------------
-When the device fails to verify the signature of a piece of the boot
-software or when an error occurs, it is considered to be in a bad state
-and will instruct the user to reboot to recovery mode.\
-Recovery mode boots using only software located in write-protected
-memory, that is considered to be trusted and safe.
+When the device fails to verify the signature of a piece of the boot software
+or when an error occurs, it is considered to be in a bad state and will
+instruct the user to reboot to recovery mode.
+
+Recovery mode boots using only software located in write-protected memory, that
+is considered to be trusted and safe.
-Recovery mode then allows recovering the device by booting from a
-trusted recovery media, that is automatically detected when recovery
-mode starts. When no external media is found or when the recovery media
-is invalid, instructions are shown on screen.\
-Trusted recovery media are external media (USB drives, SD cards, etc)
-that hold a kernel signed with the recovery key.
+Recovery mode then allows recovering the device by booting from a trusted
+recovery media, that is automatically detected when recovery mode starts. When
+no external media is found or when the recovery media is invalid, instructions
+are shown on screen.
-Google provides images of such recovery media for Chrome OS (which are
-not advised to users as they contain proprietary software).\
-They are signed with Google's recovery keys, that are pre-installed on
-the device when it ships.
+Trusted recovery media are external media (USB drives, SD cards, etc) that hold
+a kernel signed with the recovery key.
+
+Google provides images of such recovery media for Chrome OS (which are not
+advised to users as they contain proprietary software).
+
+They are signed with Google's recovery keys, that are pre-installed on the
+device when it ships.
When replacing the full flash of the device, the pre-installed keys are
replaced. When the recovery private key is available (e.g. when using
-self-generated keys), it can be used to sign a kernel for recovery
-purposes.
+self-generated keys), it can be used to sign a kernel for recovery purposes.
-Enabling developer mode {#enabling_developer_mode}
+Enabling developer mode
-----------------------
-As instructed on the recovery mode screen, developer mode can be enabled
-by pressing **Ctrl + D**.\
-Instructions to confirm enabling developer mode are then shown on
-screen.
+As instructed on the recovery mode screen, developer mode can be enabled by
+pressing *Ctrl + D*. Instructions to confirm enabling developer mode are then
+shown on screen.
-Configuring verified boot parameters {#configuring_verified_boot_parameters}
+Configuring verified boot parameters
====================================
Depthcharge's behavior relies on the verified boot (vboot) reference
-implementation, that can be configured with parameters stored in the
-verified boot non-volatile storage.\
-These parameters can be modified with the **crossystem** tool, that
-requires sufficient privileges to access the verified boot non-volatile
-storage.
-
-**crossystem** relies on **mosys**, that is used to access the verified
-boot non-volatile storage on some devices. **crossystem** and **mosys**
-are both free software and their source code is made available by
-Google:
-[crossystem](https://chromium.googlesource.com/chromiumos/platform/vboot_reference/).
-[mosys](https://chromium.googlesource.com/chromiumos/platform/mosys/).\
-These tools are not distributed along with Libreboot yet. However, they
-are preinstalled on the device, with ChromeOS.
+implementation, that can be configured with parameters stored in the verified
+boot non-volatile storage.
-Some of these parameters have the potential of **weakening the security
-of the device**. In particular, disabling kernels signature
-verification, external media boot and legacy payload boot can weaken the
-security of the device.
+These parameters can be modified with the `crossystem` tool, that requires
+sufficient privileges to access the verified boot non-volatile storage.
-The following parameters can be configured:
+`crossystem` relies on `mosys`, that is used to access the verified boot
+non-volatile storage on some devices. `crossystem` and `mosys` are both free
+software and their source code is made available by Google:
+[crossystem](https://chromium.googlesource.com/chromiumos/platform/vboot_reference/).
+[mosys](https://chromium.googlesource.com/chromiumos/platform/mosys/).
-- Kernels signature verification:
- - Enabled with:
+These tools are not distributed along with Libreboot yet. However, they are
+preinstalled on the device, with ChromeOS.
- \# **crossystem dev\_boot\_signed\_only=1**
- - Disabled with:
+Some of these parameters have the potential of *weakening the security of the
+device*. In particular, disabling kernels signature verification, external
+media boot and legacy payload boot can weaken the security of the device.
- \# **crossystem dev\_boot\_signed\_only=0**
-- External media boot:
- - Enabled with:
+The following parameters can be configured:
- \# **crossystem dev\_boot\_usb=1**
- - Disabled with:
+Kernels signature verification:
- \# **crossystem dev\_boot\_usb=0**
-- Legacy payload boot:
- - Enabled with:
+ # crossystem dev_boot_signed_only=1 # enable
+ # crossystem dev_boot_signed_only=0 # disable
- \# **crossystem dev\_boot\_legacy=1**
- - Disabled with:
+External media boot:
- \# **crossystem dev\_boot\_legacy=0**
-- Default boot medium:
- - Internal storage:
+ # crossystem dev_boot_usb=1 # enable
+ # crossystem dev_boot_usb=0 # disable
- \# **crossystem dev\_default\_boot=disk**
- - External media:
+Legacy payload boot:
- \# **crossystem dev\_default\_boot=usb**
- - Legacy payload:
+ # crossystem dev_boot_legacy=1 # enable
+ # crossystem dev_boot_legacy=0 # disable
- \# **crossystem dev\_default\_boot=legacy**
+Default boot medium:
-Copyright © 2015 Paul Kocialkowski <contact@paulk.fr>\
+ # crossystem dev_default_boot=disk # internal storage
+ # crossystem dev_default_boot=usb # external media
+ # crossystem dev_default_boot=legacy # legacy payload
+Copyright © 2015 Paul Kocialkowski <contact@paulk.fr>\
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
diff --git a/docs/fdl-1.3.md b/docs/fdl-1.3.md
index 13e2839b..0f883f0c 100644
--- a/docs/fdl-1.3.md
+++ b/docs/fdl-1.3.md
@@ -426,7 +426,6 @@ license notices just after the title page:
Copyright (C) YEAR YOUR NAME.
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
diff --git a/docs/git/index.md b/docs/git/index.md
index d8ed35a2..5b74d51a 100644
--- a/docs/git/index.md
+++ b/docs/git/index.md
@@ -1,5 +1,6 @@
---
title: Instructions for compiling from the source code
+x-toc-enable: true
...
Depthcharge is currently not documented, since it is in the new build
@@ -9,36 +10,33 @@ included in the BUILD\_HOWTO file in libreboot.git or \_src.
This section relates to building libreboot from source, and working with
the git repository.
-- [Install build dependencies](#build_dependencies)
-- [Get the full source code from metadata (git clone)](#build_meta)
-- [How to build "bucts" (for LenovoBIOS
- X60/X60S/X60T/T60)](#build_bucts)
-
-- [How to build "flashrom"](#build_flashrom)
-- [How to build the ROM images](#build)
-
-Install build dependencies {#build_dependencies}
+Install build dependencies
==========================
Before doing anything, you need the dependencies first. This is true if
you want to build libreboot from source, with either
-libreboot\_src.tar.xz or git. **If you are using libreboot\_util.tar.xz
+libreboot\_src.tar.xz or git. *If you are using libreboot\_util.tar.xz
(binary archive) then you can ignore this, because ROM images and
-statically compiled executables for the utilities are included.**
+statically compiled executables for the utilities are included.*
For Debian Stretch (may also work on Debian Jessie), you can run the
following command:
+
$ sudo ./oldbuild dependencies debian
+
(this will also work in Devuan)
For Parabola, you can run the following command:
+
$ sudo ./oldbuild dependencies parabola\
+
or:
+
# ./oldbuild dependencies parabola
For other GNU+Linux distributions, you can adapt the existing scripts.
-Get the full source code from metadata (git clone) {#build_meta}
+Get the full source code from metadata (git clone)
==================================================
If you downloaded libreboot from git, then there are some steps to
@@ -57,6 +55,7 @@ requirement is:
$ git config --global user.name "Your Name"
$ git config --global user.email your@emailaddress.com
+
This is what will also appear in git logs if you ever commit your own
changes to a given repository. For more information, see
<http://git-scm.com/doc>.
@@ -79,11 +78,11 @@ them. Read the script in a text editor to learn more.
To build the ROM images, see [\#build](#build).
-How to build "bucts" (for LenovoBIOS X60/X60S/X60T/T60) {#build_bucts}
+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.**
+*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.*
BUC.TS isn't really specific to these laptops, but is a bit inside the
a register in the chipset on some Intel systems.
@@ -93,12 +92,12 @@ 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 system to boot from the other block instead
+`bucts 1` will set the system to boot from the other block instead
(which is writeable along with everything beneath it when using a
patched flashrom. see [\#build\_flashrom](#build_flashrom)). After
shutting down and booting up after the first flash of libreboot, the
final 64K block is writeable so you flash the ROM again with an
-unpatched flashrom and run "**bucts 0**" to make the system boot from
+unpatched flashrom and run `bucts 0` to make the system boot from
the normal (highest) block again.
\*Libreboot ROM images have identical data in those two 64KiB regions
@@ -112,12 +111,13 @@ the mainboard. Removing that battery removes power to BUC.TS, resetting
the bit back to 0 (if you previously set it to 1).
BUC.TS utility is included in libreboot\_src.tar.xz and
-libreboot\_util.tar.xz.\
-**If you downloaded from git, follow [\#build\_meta](#build_meta) before
-you proceed.**
+libreboot\_util.tar.xz.
-"BUC" means "**B**ack**u**p **C**ontrol" (it's a register) and
-"TS" means "**T**op **S**wap" (it's a status bit). Hence "bucts"
+If you downloaded from git, follow [\#build\_meta](#build_meta) before
+you proceed.
+
+"BUC" means "*B*ack*u*p *C*ontrol" (it's a register) and
+"TS" means "*T*op *S*wap" (it's a status bit). Hence "bucts"
(BUC.TS). TS 1 and TS 0 corresponds to bucts 1 and bucts 0.
If you have the binary release archive, you'll find executables under
@@ -136,16 +136,17 @@ To statically compile it, do this:
The "builddeps" script in libreboot\_src also makes use of
builddeps-bucts.
-How to build "flashrom" {#build_flashrom}
+How to build "flashrom"
=========================
Flashrom is the utility for flashing/dumping ROM images. This is what
you will use to install libreboot.
Flashrom source code is included in libreboot\_src.tar.xz and
-libreboot\_util.tar.xz.\
-**If you downloaded from git, follow [\#build\_meta](#build_meta) before
-you proceed.**
+libreboot\_util.tar.xz.
+
+*If you downloaded from git, follow [\#build\_meta](#build_meta) before
+you proceed.*
If you are using the binary release archive, then there are already
binaries included under ./flashrom/. The flashing scripts will try to
@@ -165,19 +166,19 @@ To statically compile it, do the following in the main directory:
After you've done that, under ./flashrom/ you will find the following
executables:
-- **flashrom**
+- `flashrom`
- For flashing while coreboot or libreboot is running.
-- **flashrom\_lenovobios\_sst**
+- `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**
+- `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.
-How to build the ROM images {#build}
+How to build the ROM images
===========================
You don't need to do much, as there are scripts already written for you
@@ -211,29 +212,31 @@ modulename*. To see the possible values for *modulename*, use:
After that, build the ROM images (for all boards):
$ ./oldbuild roms withgrub
+
Alternatively, you can build for a specific board or set of boards. For
example:
$ ./oldbuild roms withgrub x60
- $ ./oldbuild roms withgrub x200\_8mb
- $ ./oldbuild roms withgrub x60 x200\_8mb
+ $ ./oldbuild roms withgrub x200_8mb
+ $ ./oldbuild roms withgrub x60 x200_8mb
+
The list of board options can be found by looking at the directory names
-in **resources/libreboot/config/grub/**.
+in `resources/libreboot/config/grub/`.
To clean (reverse) everything, do the following:
$ ./oldbuild clean all
-The ROM images will be stored under **bin/*payload*/**, where *payload*
-could be *grub*, *seabios*, or whatever other payload those images were
+The ROM images will be stored under `bin/payload/`, where `payload`
+could be `grub`, `seabios`, or whatever other payload those images were
built for.
Preparing release archives (optional)
-------------------------------------
-**This is only confirmed to work (tested) in Debian Stretch. Parabola
-\*fails\* at this stage (for now). For all other distros, YMMV. This
-will also work in Devuan.**
+*This is only confirmed to work (tested) in Debian Stretch. Parabola fails at
+this stage (for now). For all other distros, YMMV. This will also work in
+Devuan.*
This is mainly intended for use with the git repository. These commands
will work in the release archive (\_src), unless otherwise noted below.
@@ -256,8 +259,8 @@ Archive containing flashrom and bucts source code:
$ ./oldbuild release tobuild
-Documentation archive (**does not work on \_src release archive, only
-git**):
+Documentation archive (*does not work on \_src release archive, only
+git*):
$ ./oldbuild release docs
@@ -275,17 +278,18 @@ SHA512 sums of all other release archives that have been generated:
If you are building on an i686 host, this will build statically linked
32-bit binaries in the binary release archive that you created, for:
-**nvramtool, cbfstool, ich9deblob, cbmem**.
+
+ nvramtool, cbfstool, ich9deblob, cbmem
If you are building on an x86\_64 host, this will build statically
-linked 32- \*and\* 64-bit binaries for **cbmem**, **ich9deblob**,
-**cbfstool** and **nvramtool**.
+linked 32- \*and\* 64-bit binaries for `cbmem`, `ich9deblob`,
+`cbfstool` and `nvramtool`.
-**To include statically linked i686 and x86\_64 binaries for bucts and
+*To include statically linked i686 and x86\_64 binaries for bucts and
flashrom, you will need to build them on a chroot, a virtual system or a
real system where the host uses each given architecture. These packages
are difficult to cross-compile, and the libreboot project is still
-figuring out how to deal with them.**
+figuring out how to deal with them.*
The same applies if you want to include statically linked flashrom
binaries for ARM.
@@ -314,21 +318,20 @@ The command that you used for generating the release archives will also
run the following command:
$ ./oldbuild release tobuild
-The archive **tobuild.tar.xz** will have been created under
-**release/oldbuildsystem/**, containing bucts, flashrom and all other
+
+The archive `tobuild.tar.xz` will have been created under
+`release/oldbuildsystem/`, containing bucts, flashrom and all other
required resources for building them.
You'll find that the files libreboot\_util.tar.xz and
libreboot\_src.tar.xz have been created, under
-**release/oldbuildsystem/**.
+`release/oldbuildsystem/`.
The ROM images will be stored in separate archives for each system,
-under **release/oldbuildsystem/rom/**.
+under `release/oldbuildsystem/rom/`.
Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/gnulinux/configuring_parabola.md b/docs/gnulinux/configuring_parabola.md
index 29dc0243..af6e18d3 100644
--- a/docs/gnulinux/configuring_parabola.md
+++ b/docs/gnulinux/configuring_parabola.md
@@ -1,5 +1,6 @@
---
title: Configuring Parabola (post-install)
+x-toc-enable: true
...
Post-installation configuration steps for Parabola GNU+Linux-libre.
@@ -7,38 +8,6 @@ Parabola is extremely flexible; this is just an example. This example
uses LXDE because it's lightweight, but we recommend the *MATE* desktop
(which is actually about as lightweight as LXDE).
-Table of Contents
-=================
-
-- [Configuring pacman](#pacman_configure)
- - [Updating Parabola](#pacman_update)
- - [Maintaining Parabola during system updates](#pacman_maintain)
- - [Clearing package cache after updating](#pacman_cacheclean)
- - [Pacman command equivalents (compared to other package
- managers)](#pacman_commandequiv)
- - [your-freedom](#yourfreedom)
-
-- [Add a user account](#useradd)
-- [System D](#systemd)
-- [Interesting repositories](#interesting_repos)
-- [Setup a network connection in Parabola](#network)
- - [Setting hostname](#network_hostname)
- - [Network status](#network_status)
- - [Network interface names](#network_devicenames)
- - [Network setup](#network_setup)
-- [System maintenance](#system_maintain) - important!
-- [Configuring the desktop](#desktop)
- - [Install Xorg](#desktop_xorg)
- - [Xorg keyboard layout](#desktop_kblayout)
- - [Install LXDE](#desktop_lxde)
- - [LXDE - clock](#lxde_clock)
- - [LXDE - font](#lxde_font)
- - [LXDE - screenlock](#lxde_screenlock)
- - [LXDE - automounting](#lxde_automount)
- - [LXDE - disable suspend](#lxde_suspend)
- - [LXDE - battery monitor](#lxde_battery)
- - [LXDE - network manager](#lxde_network)
-
While not strictly related to the libreboot project, this guide is
intended to be useful for those interested in installing Parabola on
their libreboot system.
@@ -50,9 +19,9 @@ likely to become obsolete at a later date (due to the volatile
'rolling-release' model that Arch/Parabola both use), but attempts
will be made to maintain it.
-**This guide was valid on 2014-09-21. If you see any changes that should
+*This guide was valid on 2014-09-21. If you see any changes that should
to be made at the present date, please get in touch with the libreboot
-project!**
+project!*
You do not necessarily have to follow this guide word-for-word;
*parabola* is extremely flexible. The aim here is to provide a common
@@ -66,18 +35,18 @@ Paradoxically, as you get more advanced Parabola can actually become
compared to what most distributions provide. You will find over time
that other distributions tend to *get in your way*.
-**This guide assumes that you already have Parabola installed. If you
+*This guide assumes that you already have Parabola installed. If you
have not yet installed Parabola, then [this
-guide](encrypted_parabola.md) is highly recommended!**
+guide](encrypted_parabola.md) is highly recommended!*
A lot of the steps in this guide will refer to the Arch wiki. Arch is
the upstream distribution that Parabola uses. Most of this guide will
also tell you to read wiki articles, other pages, manuals, and so on. In
general it tries to cherry pick the most useful information but
-nonetheless you are encouraged to learn as much as possible. **It might
+nonetheless you are encouraged to learn as much as possible. *It might
take you a few days to fully install your system how you like, depending
on how much you need to read. Patience is key, especially for new
-users**.
+users*.
The Arch wiki will sometimes use bad language, such as calling the whole
system Linux, using the term open-source (or closed-source), and it will
@@ -86,9 +55,13 @@ careful about this when reading anything on the Arch wiki.
Some of these steps require internet access. I'll go into networking
later but for now, I just connected my system to a switch and did:
+
# systemctl start dhcpcd.service
+
You can stop it later by running:
+
# systemctl stop dhcpcd.service\
+
For most people this should be enough, but if you don't have DHCP on
your network then you should setup your network connection first:\
[Setup network connection in Parabola](#network)
@@ -96,7 +69,7 @@ your network then you should setup your network connection first:\
Configure pacman {#pacman_configure}
----------------
-pacman (**pac**kage **man**ager) is the name of the package management
+pacman (*pac*kage *man*ager) is the name of the package management
system in Arch, which Parabola (as a deblobbed parallel effort) also
uses. Like with 'apt-get' on Debian or Devuan, this can be used to
add/remove and update the software on your computer.
@@ -114,6 +87,7 @@ In the end, I didn't change my configuration for pacman. When you are
updating, resync with the latest package names/versions:
# pacman -Syy
+
(according to the wiki, -Syy is better than Sy because it refreshes the
package list even if it appears to be up to date, which can be useful
when switching to another mirror).\
@@ -121,8 +95,8 @@ Then, update the system:
# pacman -Syu
-**Before installing packages with 'pacman -S', always update first,
-using the notes above.**
+*Before installing packages with 'pacman -S', always update first,
+using the notes above.*
Keep an eye out on the output, or read it in /var/log/pacman.log.
Sometimes, pacman will show messages about maintenance steps that you
@@ -169,13 +143,13 @@ re-install it or install the distro on another computer, for example).
### Cleaning the package cache {#pacman_cacheclean}
-**The following is very important as you continue to use, update and
+*The following is very important as you continue to use, update and
maintain your Parabola system:\
<https://wiki.archlinux.org/index.php/Pacman#Cleaning_the_package_cache>.
Essentially, this guide talks about a directory that has to be cleaned
once in a while, to prevent it from growing too big (it's a cache of
old package information, updated automatically when you do anything in
-pacman).**
+pacman).*
To clean out all old packages that are cached:
@@ -190,6 +164,7 @@ The wiki also mentions this method for removing everything from the
cache, including currently installed packages that are cached:
# pacman -Scc
+
This is inadvisable, since it means re-downloading the package again if
you wanted to quickly re-install it. This should only be used when disk
space is at a premium.
@@ -227,6 +202,7 @@ Read the entire document linked to above, and then continue.
Add your user:
# useradd -m -G wheel -s /bin/bash *yourusername*
+
Set a password:
# passwd *yourusername*
@@ -241,8 +217,8 @@ This is the name of the system used for managing services in Parabola.
It is a good idea to become familiar with it. Read
<https://wiki.archlinux.org/index.php/systemd> and
<https://wiki.archlinux.org/index.php/systemd#Basic_systemctl_usage> to
-gain a full understanding. **This is very important! Make sure to read
-them.**
+gain a full understanding. *This is very important! Make sure to read
+them.*
An example of a 'service' could be a webserver (such as lighttpd), or
sshd (openssh), dhcp, etc. There are countless others.
@@ -254,6 +230,7 @@ supplier) to use systemd.
The manpage should also help:
# man systemd
+
The section on 'unit types' is especially useful.
According to the wiki, systemd 'journal' keeps logs of a size up to
@@ -287,9 +264,11 @@ Finally, the wiki mentions 'temporary' files and the utility for
managing them.
# man systemd-tmpfiles
+
The command for 'clean' is:
# systemd-tmpfiles --clean
+
According to the manpage, this *"cleans all files and directories with
an age parameter"*. According to the Arch wiki, this reads information
in /etc/tmpfiles.d/ and /usr/lib/tmpfiles.d/ to know what actions to
@@ -301,6 +280,7 @@ However, /usr/lib/tmpfiles.d/ contained some files. The first one was
etc.conf, containing information and a reference to this manpage:
# man tmpfiles.d
+
Read that manpage, and then continue studying all the files.
The systemd developers tell me that it isn't usually necessary to touch
@@ -343,6 +323,7 @@ when installing Parabola. You can also do it with systemd (do so now, if
you like):
# hostnamectl set-hostname *yourhostname*
+
This writes the specified hostname to /etc/hostname. More information
can be found in these manpages:
@@ -422,14 +403,15 @@ System Maintenance {#system_maintain}
Read <https://wiki.archlinux.org/index.php/System_maintenance> before
continuing. Also read
-<https://wiki.archlinux.org/index.php/Enhance_system_stability>. **This
-is important, so make sure to read them!**
+<https://wiki.archlinux.org/index.php/Enhance_system_stability>. *This
+is important, so make sure to read them!*
Install smartmontools (it can be used to check smart data. HDDs use
non-free firmware inside, but it's transparent to you but the smart
data comes from it. Therefore, don't rely on it too much):
# pacman -S smartmontools
+
Read <https://wiki.archlinux.org/index.php/S.M.A.R.T.> to learn how to
use it.
@@ -449,6 +431,7 @@ Based on <https://wiki.archlinux.org/index.php/Xorg>.
Firstly, install it!
# pacman -S xorg-server
+
I also recommend installing this (contains lots of useful tools,
including *xrandr*):
@@ -458,33 +441,38 @@ Install the driver. For me this was *xf86-video-intel* on the ThinkPad
X60. T60 and macbook11/21 should be the same.
# pacman -S xf86-video-intel
+
For other systems you can try:
# pacman -Ss xf86-video- | less
+
Combined with looking at your *lspci* output, you can determine which
driver is needed. By default, Xorg will revert to xf86-video-vesa which
is a generic driver and doesn't provide true hardware acceleration.
Other drivers (not just video) can be found by looking at the
-*xorg-drivers* group:
+`xorg-drivers` group:
# pacman -Sg xorg-drivers
-Mostly you will rely on a display manager, but in case you ever want to
-start X without one:
+Mostly you will rely on a display manager, but in case you ever want to start X
+without one:
# pacman -S xorg-xinit
-<optional>\
-   Arch wiki recommends installing these, for testing that X works:\
-   \# **pacman -S xorg-twm xorg-xclock xterm**\
-   Refer to <https://wiki.archlinux.org/index.php/Xinitrc>. and test X:\
-   \# **startx**\
-   When you are satisfied, type ***exit*** in xterm, inside the X
-session.\
-   Uninstall them (clutter. eww): \# **pacman -S xorg-xinit xorg-twm
-xorg-xclock xterm**\
-</optional>
+Optionally, to test X, install these:
+
+   # pacman -S xorg-twm xorg-xclock xterm
+
+Refer to <https://wiki.archlinux.org/index.php/Xinitrc>. and test X:
+
+   # startx
+
+When you are satisfied, type `exit` in xterm, inside the X session.
+
+Uninstall them (clutter. eww):
+
+ # pacman -S xorg-xinit xorg-twm xorg-xclock xterm
### Xorg keyboard layout {#desktop_kblayout}
@@ -566,6 +554,7 @@ I also like to install these:
Enable LXDM (the default display manager, providing a graphical login):
# systemctl enable lxdm.service
+
It will start when you boot up the system. To start it now, do:
# systemctl start lxdm.service
@@ -576,23 +565,26 @@ start lxde without lxdm. Read
<https://wiki.archlinux.org/index.php/Xinitrc>.
Open LXterminal:
+
$ cp /etc/skel/.xinitrc \~
+
Open .xinitrc and add the following plus a line break at the bottom of
-the file.\
-*\# Probably not needed. The same locale info that we set before\
-\# Based on advice from the LXDE wiki export LC\_ALL=en\_GB.UTF-8\
-export LANGUAGE=en\_GB.UTF-8\
-export LANG=en\_GB.UTF-8\
-\
-\# Start lxde desktop\
-exec startlxde\
+the file.
+
+ export LC_ALL=en_GB.UTF-8
+ export LANGUAGE=en_GB.UTF-8
+ export LANG=en_GB.UTF-8
+
+ exec startlxde
+
* Now make sure that it is executable:
+
$ chmod +x .xinitrc
### LXDE - clock {#lxde_clock}
-In **Digital Clock Settings** (right click the clock) I set the Clock
-Format to *%Y/%m/%d %H:%M:%S*
+In *Digital Clock Settings* (right click the clock) I set the Clock
+Format to `%Y/%m/%d %H:%M:%S`
### LXDE - font {#lxde_font}
@@ -643,6 +635,7 @@ Install Network Manager:
You will also want the graphical applet:
# pacman -S network-manager-applet
+
Arch wiki says that an autostart rule will be written at
*/etc/xdg/autostart/nm-applet.desktop*
@@ -657,6 +650,7 @@ LXDE uses openbox, so I refer to:\
It tells me for the applet I need:
# pacman -S xfce4-notifyd gnome-icon-theme
+
Also, for storing authentication details (wifi) I need:
# pacman -S gnome-keyring
@@ -665,6 +659,7 @@ I wanted to quickly enable networkmanager:
# systemctl stop dhcpcd
# systemctl start NetworkManager
+
Enable NetworkManager at boot time:
# systemctl enable NetworkManager
@@ -677,8 +672,6 @@ theme, in *lxappearance*.
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/gnulinux/encrypted_debian.md b/docs/gnulinux/encrypted_debian.md
index 27e5be35..71129950 100644
--- a/docs/gnulinux/encrypted_debian.md
+++ b/docs/gnulinux/encrypted_debian.md
@@ -22,42 +22,43 @@ tampering by someone with physical access to the system.
This guide is written for Debian net installer. You can download the ISO
from the homepage on [debian.org](https://www.debian.org/). Use this on
-the GRUB terminal to boot it from USB (for 64-bit Intel or AMD):\
-**set root='usb0'\
-linux /install.amd/vmlinuz\
-initrd /install.amd/initrd.gz\
-boot\
-** If you are on a 32-bit system (e.g. X60):\
-**set root='usb0'\
-linux /install.386/vmlinuz\
-initrd /install.386/initrd.gz\
-boot**
-
+the GRUB terminal to boot it from USB (for 64-bit Intel or AMD):
+
+ set root='usb0'
+ linux /install.amd/vmlinuz
+ initrd /install.amd/initrd.gz
+ boot
+
+If you are on a 32-bit system (e.g. X60):
+
+ set root='usb0'
+ linux /install.386/vmlinuz
+ initrd /install.386/initrd.gz
+ boot
+
[This guide](grub_boot_installer.md) shows how to create a boot USB
drive with the Debian ISO image.
-**This guide is \*only\* for the GRUB payload. If you use the
-depthcharge payload, ignore this section entirely.**
+*This guide is only for the GRUB payload. If you use the depthcharge payload,
+ignore this section entirely.*
-Note: on some thinkpads, a faulty DVD drive can cause the cryptomount -a
-step during boot to fail. If this happens to you, try removing the
-drive.
+Note: on some thinkpads, a faulty DVD drive can cause the cryptomount -a step
+during boot to fail. If this happens to you, try removing the drive.
-Set a strong user password (lots of lowercase/uppercase, numbers and
-symbols).
+Set a strong user password (lots of lowercase/uppercase, numbers and symbols).
-Use of the *diceware method* is recommended, for generating secure
-passphrases (instead of passwords).
+Use of the *diceware method* is recommended, for generating secure passphrases
+(instead of passwords).
-when the installer asks you to set up encryption (ecryptfs) for your
-home directory, select 'Yes' if you want to: **LUKS is already secure
-and performs well. Having ecryptfs on top of it will add noticeable
-performance penalty, for little security gain in most use cases. This is
-therefore optional, and not recommended. Choose 'no'.**
+When the installer asks you to set up encryption (ecryptfs) for your home
+directory, select 'Yes' if you want to: *LUKS is already secure and performs
+well. Having ecryptfs on top of it will add noticeable performance penalty, for
+little security gain in most use cases. This is therefore optional, and not
+recommended. Choose 'no'.*
-**Your user password should be different from the LUKS password which
+*Your user password should be different from the LUKS password which
you will set later on. Your LUKS password should, like the user
-password, be secure.**
+password, be secure.*
Partitioning
============
@@ -88,15 +89,15 @@ Choose 'Manual' partitioning:
- Configure the logical volume manager:
- Keep settings: Yes
- Create volume group:
- - Name: **matrix** (use this exact name)
+ - Name: `matrix` (use this exact name)
- Select crypto partition
- Create logical volume
- - select **matrix** (use this exact name)
- - name: **rootvol** (use this exact name)
+ - select `matrix` (use this exact name)
+ - name: `rootvol` (use this exact name)
- size: default, minus 2048 MB
- Create logical volume
- - select **matrix** (use this exact name)
- - name: **swap** (user this exact name)
+ - select `matrix` (use this exact name)
+ - name: `swap` (user this exact name)
- size: press enter
Further partitioning
@@ -129,8 +130,8 @@ something else.
If you want debian-testing, then you should only select barebones
options here and change the entries in /etc/apt/sources.list after
-install to point to the new distro, and then run **apt-get update** and
-**apt-get dist-upgrade** as root, then reboot and run **tasksel** as
+install to point to the new distro, and then run `apt-get update` and
+`apt-get dist-upgrade` as root, then reboot and run `tasksel` as
root. This is to avoid downloading large packages twice.
NOTE: If you want the latest up to date version of the Linux kernel,
@@ -165,13 +166,11 @@ Booting your system
===================
At this point, you will have finished the installation. At your GRUB
-payload, press C to get to the command line.
+payload, press C to get to the command line, and enter:
-Do that:\
grub> cryptomount -a
- grub> set root='lvm/matrix-rootvol'\
-grub> **linux /vmlinuz root=/dev/mapper/matrix-rootvol
-cryptdevice=/dev/mapper/matrix-rootvol:root**\
+ grub> set root='lvm/matrix-rootvol'
+ grub> linux /vmlinuz root=/dev/mapper/matrix-rootvolcryptdevice=/dev/mapper/matrix-rootvol:root
grub> initrd /initrd.img
grub> boot
@@ -182,6 +181,7 @@ If you didn't encrypt your home directory, then you can safely ignore
this section.
Immediately after logging in, do that:
+
$ sudo ecryptfs-unwrap-passphrase
This will be needed in the future if you ever need to recover your home
@@ -199,12 +199,11 @@ Modify your grub.cfg (in the firmware) [using this
tutorial](grub_cbfs.md); just change the default menu entry 'Load
Operating System' to say this inside:
-**cryptomount -a**\
-**set root='lvm/matrix-rootvol'**\
-**linux /vmlinuz root=/dev/mapper/matrix-rootvol
-cryptdevice=/dev/mapper/matrix-rootvol:root**\
-**initrd /initrd.img**
-
+ cryptomount -a
+ set root='lvm/matrix-rootvol'
+ linux /vmlinuz root=/dev/mapper/matrix-rootvolcryptdevice=/dev/mapper/matrix-rootvol:root
+ initrd /initrd.img
+
Without specifying a device, the *-a* parameter tries to unlock all
detected LUKS volumes. You can also specify -u UUID or -a (device).
@@ -302,8 +301,6 @@ problems. Removing that worked around the issue.
Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/gnulinux/encrypted_parabola.md b/docs/gnulinux/encrypted_parabola.md
index 25c4e5c6..d2f77482 100644
--- a/docs/gnulinux/encrypted_parabola.md
+++ b/docs/gnulinux/encrypted_parabola.md
@@ -17,8 +17,8 @@ volume. Not so with libreboot! Since GRUB is already included directly
as a payload, even /boot can be encrypted. This protects /boot from
tampering by someone with physical access to the system.
-**This guide is \*only\* for the GRUB payload. If you use the
-depthcharge payload, ignore this section entirely.**
+*This guide is \*only\* for the GRUB payload. If you use the
+depthcharge payload, ignore this section entirely.*
This guide is intended for the Parabola distribution, but it should also
work (with some adaptation) for *Arch*. We recomend using Parabola,
@@ -65,12 +65,14 @@ article](https://wiki.archlinux.org/index.php/Solid_State_Drives). Edit
whole article and keep all points in mind, adapting them for this guide.
Securely wipe the drive:
+
# dd if=/dev/urandom of=/dev/sda; sync
NOTE: If you have an SSD, only do this the first time. If it was already
LUKS-encrypted before, use the info below to wipe the LUKS header. Also,
check online for your SSD what the recommended erase block size is. For
example if it was 2MiB:
+
# dd if=/dev/urandom of=/dev/sda bs=2M; sync
If your drive was already LUKS encrypted (maybe you are re-installing
@@ -82,6 +84,7 @@ guide is recommending putting zero there. I'm going to use urandom. Do
this:
# head -c 3145728 /dev/urandom > /dev/sda; sync
+
(Wiping the LUKS header is important, since it has hashed passphrases
and so on. It's 'secure', but 'potentially' a risk).
@@ -93,6 +96,7 @@ list the available keymaps and use yours:
# localectl list-keymaps
# loadkeys LAYOUT
+
For me, LAYOUT would have been dvorak-uk.
Establish an internet connection
@@ -142,13 +146,14 @@ I am then directed to
Parabola forces you to RTFM. Do that.
-It tells me to run:
+To populate the list below, it tells me to run:
+
+ # cryptsetup benchmark
- # cryptsetup benchmark (for making sure the list below is
-populated)\
Then:
# cat /proc/crypto
+
This gives me crypto options that I can use. It also provides a
representation of the best way to set up LUKS (in this case, security is
a priority; speed, a distant second). To gain a better understanding, I
@@ -162,10 +167,14 @@ on
Reading through, it seems like Serpent (encryption) and Whirlpool (hash)
is the best option.
-I am initializing LUKS with the following:\
-\# **cryptsetup -v --cipher serpent-xts-plain64 --key-size 512 --hash
+I am initializing LUKS with the following:
+
+ # cryptsetup -v --cipher serpent-xts-plain64 --key-size 512 --hash
+
whirlpool --iter-time 500 --use-random --verify-passphrase luksFormat
-/dev/sda1** Choose a **secure** passphrase here. Ideally lots of
+/dev/sda1
+
+ Choose a *secure* passphrase here. Ideally lots of
lowercase/uppercase numbers, letters, symbols etc all in a random
pattern. The password length should be as long as you are able to handle
without writing it down or storing it anywhere.
@@ -178,14 +187,14 @@ Create LVM
Now I refer to <https://wiki.archlinux.org/index.php/LVM>.
-Open the LUKS partition:
+Open the LUKS partition at /dev/mapper/lvm:
# cryptsetup luksOpen /dev/sda1 lvm
-(it will be available at /dev/mapper/lvm)
Create LVM partition:
# pvcreate /dev/mapper/lvm
+
Show that you just created it:
# pvdisplay
@@ -194,22 +203,24 @@ Now I create the volume group, inside of which the logical volumes will
be created:
# vgcreate matrix /dev/mapper/lvm
+
(volume group name is 'matrix' - choose your own name, if you like)
Show that you created it:
# vgdisplay
-Now create the logical volumes:
+Now create the logical volumes (2G swap parittion named swapvol):
+
+ # lvcreate -L 2G matrix -n swapvol
- # lvcreate -L 2G matrix -n swapvol (2G swap partition, named
-swapvol)\
-Again, choose your own name if you like. Also, make sure to choose a
-swap size of your own needs. It basically depends on how much RAM you
-have installed. I refer to
+Again, choose your own name if you like. Also, make sure to choose a swap size
+of your own needs. It basically depends on how much RAM you have installed. I
+refer to
<http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space>.
+This creates a single large partition in the rest of the space, named root:
+
+ # lvcreate -l +100%FREE matrix -n root
- # lvcreate -l +100%FREE matrix -n root (single large partition in
-the rest of the space, named root)\
You can also be flexible here, for example you can specify a /boot, a /,
a /home, a /var, a /usr, etc. For example, if you will be running a
web/mail server then you want /var in its own partition (so that if it
@@ -227,6 +238,7 @@ Create / and swap partitions, and mount
For the swapvol LV I use:
# mkswap /dev/mapper/matrix-swapvol
+
Activate swap:
# swapon /dev/matrix/swapvol
@@ -257,55 +269,76 @@ Create /home and /boot on root mountpoint:
Once all the remaining partitions, if any, have been mounted, the
devices are ready to install Parabola.
-In **/etc/pacman.d/mirrorlist**, comment out all lines except the Server
+In `/etc/pacman.d/mirrorlist`, comment out all lines except the Server
line closest to where you are (I chose the UK Parabola server (main
server)) and then did:
# pacman -Syy
# pacman -Syu
- # pacman -Sy pacman (and then I did the other 2 steps above,
-again)\
+ # pacman -Sy pacman
+
In my case I did the steps in the next paragraph, and followed the steps
in this paragraph again.
-<troubleshooting>\
-   The following is based on 'Verification of package signatures' in
-the Parabola install guide.\
-   Check there first to see if steps differ by now.\
-   Now you have to update the default Parabola keyring. This is used for
-signing and verifying packages:\
-   \# **pacman -Sy parabola-keyring**\
-   It says that if you get GPG errors, then it's probably an expired
-key and, therefore, you should do:\
-   \# **pacman-key --populate parabola**\
-   \# **pacman-key --refresh-keys**\
-   \# **pacman -Sy parabola-keyring**\
-   To be honest, you should do the above anyway. Parabola has a lot of
-maintainers, and a lot of keys. Really!\
-   If you get an error mentioning dirmngr, do:\
-   \# **dirmngr </dev/null**\
-   Also, it says that if the clock is set incorrectly then you have to
-manually set the correct time\
-   (if keys are listed as expired because of it):\
-   \# **date MMDDhhmm\[\[CC\]YY\]\[.ss\]**\
-   I also had to install:\
-   \# **pacman -S archlinux-keyring**\
-   \# **pacman-key --populate archlinux**\
-   In my case I saw some conflicting files reported in pacman, stopping
-me from using it.\
-   I deleted the files that it mentioned and then it worked.
-Specifically, I had this error:\
-   *licenses: /usr/share/licenses/common/MPS exists in filesystem*\
-   I rm -Rf'd the file and then pacman worked. I'm told that the
-following would have also made it work:\
-   \# **pacman -Sf licenses**\
-</troubleshooting>\
+Troubleshooting
+---------------
+
+The following is based on 'Verification of package signatures' in
+the Parabola install guide.
+
+Check there first to see if steps differ by now.
+
+Now you have to update the default Parabola keyring. This is used for
+signing and verifying packages:
+
+   # pacman -Sy parabola-keyring
+
+It says that if you get GPG errors, then it's probably an expired
+key and, therefore, you should do:
+
+   # pacman-key --populate parabola
+   # pacman-key --refresh-keys
+   # pacman -Sy parabola-keyring
+
+To be honest, you should do the above anyway. Parabola has a lot of
+maintainers, and a lot of keys. Really!
+
+If you get an error mentioning dirmngr, do:
+
+   # dirmngr < /dev/null
+
+Also, it says that if the clock is set incorrectly then you have to manually
+set the correct time
+
+   # date MMDDhhmm\[\[CC\]YY\]\[.ss\]
+
+I also had to install:
+
+   # pacman -S archlinux-keyring
+   # pacman-key --populate archlinux
+
+In my case I saw some conflicting files reported in pacman, stopping
+me from using it.
+I deleted the files that it mentioned and then it worked.
+Specifically, I had this error:
+
+   licenses: /usr/share/licenses/common/MPS exists in filesystem
+
+I rm -Rf'd the file and then pacman worked. I'm told that the
+following would have also made it work:
+
+ # pacman -Sf licenses
+
+More packages
+--------------
I also like to install other packages (base-devel, compilers and so on)
and wpa\_supplicant/dialog/iw/wpa\_actiond are needed for wireless after
-the install:\
-\# **pacstrap /mnt base base-devel wpa\_supplicant dialog iw
-wpa\_actiond**
+the install:
+
+ # pacstrap /mnt base base-devel wpa_supplicant dialog iw
+
+wpa\_actiond
Configure the system
--------------------
@@ -315,10 +348,12 @@ Generate an fstab - UUIDs are used because they have certain advantages
prefer labels instead, replace the -U option with -L):
# genfstab -U -p /mnt >> /mnt/etc/fstab
+
Check the created file:
# cat /mnt/etc/fstab
-(If there are any errors, edit the file. Do **NOT** run the genfstab
+
+(If there are any errors, edit the file. Do *NOT* run the genfstab
command again!)
Chroot into new system:
@@ -346,16 +381,18 @@ Parabola does not have wget. This is sinister. Install it:
Locale:
# vi /etc/locale.gen
+
Uncomment your needed localisations. For example en\_GB.UTF-8 (UTF-8 is
highly recommended over other options).
# locale-gen
- # echo LANG=en\_GB.UTF-8 > /etc/locale.conf
- # export LANG=en\_GB.UTF-8
+ # echo LANG=en_GB.UTF-8 > /etc/locale.conf
+ # export LANG=en_GB.UTF-8
Console font and keymap:
# vi /etc/vconsole.conf
+
In my case:
KEYMAP=dvorak-uk
@@ -364,6 +401,7 @@ In my case:
Time zone:
# ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
+
(Replace Zone and Subzone to your liking. See /usr/share/zoneinfo)
Hardware clock:
@@ -374,6 +412,7 @@ Hostname: Write your hostname to /etc/hostname. For example, if your
hostname is parabola:
# echo parabola > /etc/hostname
+
Add the same hostname to /etc/hosts:
# vi /etc/hosts
@@ -392,6 +431,7 @@ Mkinitcpio: Configure /etc/mkinitcpio.conf as needed (see
information about each hook.) Specifically, for this use case:
# vi /etc/mkinitcpio.conf
+
Then modify the file like so:
- MODULES="i915"
@@ -418,9 +458,11 @@ with (this is different from Arch, specifying linux-libre instead of
linux):
# mkinitcpio -p linux-libre
+
Also do it for linux-libre-lts:
# mkinitcpio -p linux-libre-lts
+
Also do it for linux-libre-grsec:
# mkinitcpio -p linux-libre-grsec
@@ -430,9 +472,11 @@ default for its password hashing. I referred to
<https://wiki.archlinux.org/index.php/SHA_password_hashes>.
# vi /etc/pam.d/passwd
+
Add rounds=65536 at the end of the uncommented 'password' line.
# passwd root
+
Make sure to set a secure password! Also, it must never be the same as
your LUKS password.
@@ -457,7 +501,8 @@ file=/var/log/faillog*\
To unlock a user manually (if a password attempt is failed 3 times),
do:
- # pam\_tally --user *theusername* --reset What the above
+ # pam_tally --user *theusername* --reset What the above
+
configuration does is lock the user out for 10 minutes, if they make 3
failed login attempts.
@@ -487,6 +532,7 @@ Lock the encrypted partition (close it):
# cryptsetup luksClose lvm
# shutdown -h now
+
Remove the installation media, then boot up again.
Booting from GRUB
@@ -538,13 +584,18 @@ current firmware - where *libreboot.rom* is an example: make sure to
adapt:
# flashrom -p internal -r libreboot.rom
+
If flashrom complains about multiple flash chips detected, add a *-c*
option at the end, with the name of your chosen chip is quotes.\
You can check if everything is in there (*grub.cfg* and *grubtest.cfg*
would be really nice):
+
$ ./cbfstool libreboot.rom print
+
Extract grubtest.cfg:
+
$ ./cbfstool libreboot.rom extract -n grubtest.cfg -f grubtest.cfg\
+
And modify:
$ vi grubtest.cfg
@@ -578,20 +629,25 @@ Save your changes in grubtest.cfg, then delete the unmodified config
from the ROM image:
$ ./cbfstool libreboot.rom remove -n grubtest.cfg
-and insert the modified grubtest.cfg:\
-\$ **./cbfstool libreboot.rom add -n grubtest.cfg -f grubtest.cfg -t
-raw**\
+
+and insert the modified grubtest.cfg:
+
+ # ./cbfstool libreboot.rom add -n grubtest.cfg -f grubtest.cfg -t
+
+raw
Now refer to [../install/#flashrom](../install/#flashrom). Cd (up) to
the libreboot\_util directory and update the flash chip contents:
# ./flash update libreboot.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:
# ./flash forceupdate libreboot.rom
-You should see "Verifying flash\... VERIFIED." written at the end of
+
+You should see "Verifying flash... VERIFIED." written at the end of
the flashrom output.
With this new configuration, Parabola can boot automatically and you
@@ -616,13 +672,17 @@ the main config still links (in the menu) to grubtest.cfg, so that you
don't have to manually switch to it, in case you ever want to follow
this guide again in the future (modifying the already modified config).
Inside libreboot\_util/cbfstool/{armv7l i686 x86\_64}, we can do this
-with the following command:\
-\$ **sed -e 's:(cbfsdisk)/grub.cfg:(cbfsdisk)/grubtest.cfg:g' -e
+with the following command:
+
+ # sed -e 's:(cbfsdisk)/grub.cfg:(cbfsdisk)/grubtest.cfg:g' -e
+
's:Switch to grub.cfg:Switch to grubtest.cfg:g' < grubtest.cfg >
-grub.cfg**\
+grub.cfg
+
Delete the grub.cfg that remained inside the ROM:
$ ./cbfstool libreboot.rom remove -n grub.cfg
+
Add the modified version that you just made:
$ ./cbfstool libreboot.rom add -n grub.cfg -f grub.cfg -t raw
@@ -632,7 +692,8 @@ Now you have a modified ROM. Once more, refer to
directory and update the flash chip contents:
# ./flash update libreboot.rom
-And wait for the "Verifying flash\... VERIFIED." Once you have done
+
+And wait for the "Verifying flash... VERIFIED." Once you have done
that, shut down and then boot up with your new configuration.
When done, delete GRUB (remember, we only needed it for the
@@ -656,26 +717,32 @@ will be asked to enter your passphrase a second time. A workaround is to
put a keyfile inside initramfs, with instructions for the kernel to use
it when booting. This is safe, because /boot/ is encrypted (otherwise,
putting a keyfile inside initramfs would be a bad idea).\
-Boot up and login as root or your user. Then generate the key file:\
-\# **dd bs=512 count=4 if=/dev/urandom of=/etc/mykeyfile
-iflag=fullblock**\
+Boot up and login as root or your user. Then generate the key file:
+
+ # dd bs=512 count=4 if=/dev/urandom of=/etc/mykeyfile
+
+iflag=fullblock
+
Insert it into the luks volume:
# cryptsetup luksAddKey /dev/sdX /etc/mykeyfile
+
and enter your LUKS passphrase when prompted. Add the keyfile to the
initramfs by adding it to FILES in /etc/mkinitcpio.conf. For example:
# FILES="/etc/mykeyfile"
+
Create the initramfs image from scratch:
# mkinitcpio -p linux-libre
# mkinitcpio -p linux-libre-lts
# mkinitcpio -p linux-libre-grsec
+
Add the following to your grub.cfg - you are now able to do that, see
above! -, or add it in the kernel command line for GRUB:
# cryptkey=rootfs:/etc/mykeyfile
-\
+
You can also place this inside the grub.cfg that exists in CBFS:
[grub\_cbfs.md](grub_cbfs.md).
@@ -775,8 +842,6 @@ problems. Removing that worked around the issue.
Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\
Copyright © 2015 Jeroen Quint <jezza@diplomail.ch>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/gnulinux/grub_boot_installer.md b/docs/gnulinux/grub_boot_installer.md
index 228dadff..10158619 100644
--- a/docs/gnulinux/grub_boot_installer.md
+++ b/docs/gnulinux/grub_boot_installer.md
@@ -1,21 +1,15 @@
---
title: How to install GNU+Linux on a libreboot system
+x-toc-enable: true
...
This section relates to preparing, booting and installing a GNU+Linux
distribution on your libreboot system, using nothing more than a USB
-flash drive (and *dd*).
+flash drive (and `dd`).
-- [Prepare the USB drive (in GNU+Linux)](#prepare)
-- [Installing GNU+Linux with full disk encryption](#encryption)
-- [Debian or Devuan net install?](#debian_netinstall)
-- [Booting ISOLINUX images (automatic method)](#parse_isolinux)
-- [Booting ISOLINUX images (manual method)](#manual_isolinux)
-- [Troubleshooting](#troubleshooting)
-
-**This section is only for the GRUB payload. For depthcharge (used on
+*This section is only for the GRUB payload. For depthcharge (used on
CrOS devices in libreboot), instructions have yet to be written in the
-libreboot documentation.**
+libreboot documentation.*
Prepare the USB drive (in GNU+Linux)
------------------------------------
@@ -72,6 +66,7 @@ how to create the bootable GNU+Linux USB drive:
Connect the USB drive. Check dmesg:
$ dmesg | tail
+
Check to confirm which drive it is, for example, if you think its sd3:
$ disklabel sd3
@@ -92,10 +87,8 @@ Continue reading, for information about how to do that.
Installing GNU+Linux with full disk encryption
----------------------------------------------
-- [Installing Debian or Devuan GNU+Linux with full disk encryption
- (including /boot)](encrypted_debian.md)
-- [Installing Parabola GNU+Linux with full disk encryption (including
- /boot)](encrypted_parabola.md)
+- [Debian or Devuan GNU+Linux with full disk encryption](encrypted_debian.md)
+- [Parabola GNU+Linux with full disk encryption](encrypted_parabola.md)
Debian or Devuan net install?
-----------------------------
@@ -103,16 +96,21 @@ Debian or Devuan net install?
Download the Debian or Devuan net installer. You can download the ISO
from the homepage on [debian.org](https://www.debian.org/), or [the
Devuan homepage](https://www.devuan.org/) for Devuan. Use this on the
-GRUB terminal to boot it from USB (for 64-bit Intel or AMD):\
-**set root='usb0'\
-linux /install.amd/vmlinuz\
-initrd /install.amd/initrd.gz\
-boot\
-** If you are on a 32-bit system (e.g. X60):\
-**set root='usb0'\
-linux /install.386/vmlinuz\
-initrd /install.386/initrd.gz\
-boot**\
+GRUB terminal to boot it from USB (for 64-bit Intel or AMD):
+
+
+ set root='usb0'
+ linux /install.amd/vmlinuz
+ initrd /install.amd/initrd.gz
+ boot
+
+If you are on a 32-bit system (e.g. X60):
+
+ set root='usb0'
+ linux /install.386/vmlinuz
+ initrd /install.386/initrd.gz
+ boot
+
We recommend using the *MATE* desktop.
Booting ISOLINUX images (automatic method)
@@ -131,38 +129,45 @@ distribution. You must adapt them appropriately, for whatever GNU+Linux
distribution it is that you are trying to install.*
If the ISOLINUX parser or *Search for GRUB configuration* options won't
-work, then press C in GRUB to access the command line.\
+work, then press C in GRUB to access the command line.
+
grub> ls
-Get the device from above output, eg (usb0). Example:\
- grub> cat (usb0)/isolinux/isolinux.cfg\
+
+Get the device from above output, eg (usb0). Example:
+
+ grub> cat (usb0)/isolinux/isolinux.cfg
+
Either this will show the ISOLINUX menuentries for that ISO, or link to
-other .cfg files, for example /isolinux/foo.cfg.\
-If it did that, then you do:\
+other .cfg files, for example /isolinux/foo.cfg.
+
+If it did that, then you do:
+
grub> cat (usb0)/isolinux/foo.cfg
-And so on, until you find the correct menuentries for ISOLINUX. **The
-file */isolinux/foo.cfg* is a fictional example. Do not actually use
-this example, unless you actually have that file, if it is
-appropriate.**
-
-For Debian or Devuan (and other debian-based distros), there are
-typically menuentries listed in */isolinux/txt.cfg* or
-*/isolinux/gtk.cfg*. For dual-architecture ISO images (i686 and
-x86\_64), there may be separate files/directories for each architecture.
-Just keep searching through the image, until you find the correct
-ISOLINUX configuration file. NOTE: Debian 8.6 ISO only lists 32-bit boot
-options in txt.cfg. This is important if you want 64-bit booting on your
-system. Devuan versions based on Debian 8.x may also have the same
-issue.
-
-Now look at the ISOLINUX menuentry. It'll look like:\
-**kernel /path/to/kernel\
-append PARAMETERS initrd=/path/to/initrd MAYBE\_MORE\_PARAMETERS\
-** GRUB works the same way, but in it's own way. Example GRUB
-commands:\
- grub> set root='usb0'\
+
+And so on, until you find the correct menuentries for ISOLINUX. *The file
+`/isolinux/foo.cfg` is a fictional example. Do not actually use this example,
+unless you actually have that file, if it is appropriate.*
+
+For Debian or Devuan (and other debian-based distros), there are typically
+menuentries listed in */isolinux/txt.cfg* or */isolinux/gtk.cfg*. For
+dual-architecture ISO images (i686 and x86\_64), there may be separate
+files/directories for each architecture. Just keep searching through the
+image, until you find the correct ISOLINUX configuration file. NOTE: Debian 8.6
+ISO only lists 32-bit boot options in txt.cfg. This is important if you want
+64-bit booting on your system. Devuan versions based on Debian 8.x may also
+have the same issue.
+
+Now look at the ISOLINUX menuentry. It'll look like:
+
+ kernel /path/to/kernel append PARAMETERS initrd=/path/to/initrd ...
+
+GRUB works similarly. Example GRUB commands:
+
+ grub> set root='usb0'
grub> linux /path/to/kernel PARAMETERS MAYBE\_MORE\_PARAMETERS
grub> initrd /path/to/initrd
grub> boot
+
Note: *usb0* may be incorrect. Check the output of the *ls* command in
GRUB, to see a list of USB devices/partitions. Of course this will vary
from distro to distro. If you did all of that correctly, then it should
@@ -193,8 +198,9 @@ When using the ROM images that use coreboot's "text mode" instead of
the coreboot framebuffer, booting the Debian or Devuan net installer
results in graphical corruption because it is trying to switch to a
framebuffer which doesn't exist. Use that kernel parameter on the
-'linux' line when booting it:\
-**vga=normal fb=false**
+'linux' line when booting it:
+
+ vga=normal fb=false
This forces debian-installer to start in text-mode, instead of trying to
switch to a framebuffer.
@@ -211,8 +217,6 @@ debian-installer (text mode) net install method.
Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\
Copyright © 2016 Scott Bonds <scott@ggr.com>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/gnulinux/grub_cbfs.md b/docs/gnulinux/grub_cbfs.md
index 4b58d3e5..d1c5428a 100644
--- a/docs/gnulinux/grub_cbfs.md
+++ b/docs/gnulinux/grub_cbfs.md
@@ -1,5 +1,6 @@
---
title: How to replace the default GRUB configuration file
+x-toc-enable: true
...
Libreboot on x86 uses the GRUB
@@ -24,29 +25,15 @@ the libreboot GRUB payload will automatically search for.
Here is an excellent writeup about CBFS (coreboot filesystem):
<http://lennartb.home.xs4all.nl/coreboot/col5.html>.
-**This guide is \*only\* for the GRUB payload. If you use the
-depthcharge payload, ignore this section entirely.**
-
-Table of Contents
-=================
-
-- [Introduction](#introduction)
-- [1st option: don't re-flash](#option1_dont_reflash)
-- [2nd option: re-flash](#option2_reflash)
- - [Acquire the necessary utilities](#tools)
- - [Acquiring the correct ROM image](#rom)
- - [Extract grubtest from the ROM image](#extract_testconfig)
- - [Re-insert the modified grubtest.cfg into the ROM
- image](#reinsert_modified_testconfig)
- - [Testing](#testing)
- - [Final steps](#final_steps)
+*This guide is only for the GRUB payload. If you use the depthcharge payload,
+ignore this section entirely.*
Introduction
------------
Download the latest release from [libreboot.org](/)\
-**If you downloaded from git, refer to
-[../git/\#build\_meta](../git/#build_meta) before continuing.**
+*If you downloaded from git, refer to
+[../git/\#build\_meta](../git/#build_meta) before continuing.*
There are several advantages to modifying the GRUB configuration stored
in CBFS, but this also means that you have to flash a new libreboot ROM
@@ -58,7 +45,7 @@ If you aren't up to that then don't worry; it is possible to use a
custom GRUB menu without flashing a new image, by loading a GRUB
configuration from a partition on the main storage instead.
-1st option: don't re-flash {#option1_dont_reflash}
+1st option: don't re-flash
---------------------------
By default, GRUB in libreboot is configured to scan all partitions on
@@ -67,10 +54,10 @@ the main storage for /boot/grub/libreboot\_grub.cfg or
partition), and then use it automatically.
Simply create your custom GRUB configuration and save it to
-**/boot/grub/libreboot\_grub.cfg** on the running system. The next time
+`/boot/grub/libreboot_grub.cfg` on the running system. The next time
you boot, GRUB (in libreboot) will automatically switch to this
-configuration file. **This means that you do not have to re-flash,
-recompile or otherwise modify libreboot at all!**
+configuration file. *This means that you do not have to re-flash,
+recompile or otherwise modify libreboot at all!*
Ideally, your distribution should automatically generate a
libreboot\_grub.cfg file that is written specifically under the
@@ -86,30 +73,31 @@ If you want to adapt a copy of the existing *libreboot* GRUB
configuration and use that for the libreboot\_grub.cfg file, then follow
[\#tools](#tools), [\#rom](#rom) and
[\#extract\_testconfig](#extract_testconfig) to get the
-***grubtest.cfg***. Rename ***grubtest.cfg*** to
-***libreboot\_grub.cfg*** and save it to ***/boot/grub/*** on the
+`grubtest.cfg`. Rename `grubtest.cfg` to
+`libreboot_grub.cfg` and save it to `/boot/grub/` on the
running system where it is intended to be used. Modify the file at that
location however you see fit, and then stop reading this guide (the rest
-of this page is irrelevant to you); **in libreboot\_grub.cfg on disk, if
+of this page is irrelevant to you); in `libreboot_grub.cfg` on disk, if
you are adapting it based on grub.cfg from CBFS then remove the check
-for libreboot\_grub.cfg otherwise it will loop.**.
+for `libreboot_grub.cfg` otherwise it will loop.
-2nd option: re-flash {#option2_reflash}
+2nd option: re-flash
--------------------
You can modify what is stored inside the flash chip quite easily. Read
on to find out how.
-Acquire the necessary utilities {#tools}
+Acquire the necessary utilities
-------------------------------
-Use ***cbfstool*** and ***flashrom***. There are available in the
+Use `cbfstool` and `flashrom`. There are available in the
*libreboot\_util* release archive, or they can be compiled (see
[../git/\#build\_flashrom](../git/#build_flashrom)). Flashrom is also
available from the repositories:
+
# pacman -S flashrom
-Acquiring the correct ROM image {#rom}
+Acquiring the correct ROM image
-------------------------------
You can either work directly with one of the ROM images already included
@@ -119,20 +107,22 @@ image file is named *libreboot.rom*, so please make sure to adapt.
ROM images are included pre-compiled in libreboot. You can also dump
your current firmware, using flashrom:
+
$ sudo flashrom -p internal -r libreboot.rom
# flashrom -p internal -r libreboot.rom
-If you are told to specify the chip, add the option **-c {your chip}**
-to the command, for example:
+
+If you are told to specify the chip, add the option `-c {your chip}` to the
+command, for example:
# flashrom -c MX25L6405 -p internal -r libreboot.rom
-Extract grubtest.cfg from the ROM image {#extract_testconfig}
+Extract grubtest.cfg from the ROM image
---------------------------------------
You can check the contents of the ROM image, inside CBFS:
- $ cd \.../libreboot\_util/cbfstool** $ ./cbfstool libreboot.rom
-print**
+ $ cd .../libreboot\_util/cbfstool
+ $ ./cbfstool libreboot.rom
The files *grub.cfg* and *grubtest.cfg* should be present. grub.cfg is
loaded by default, with a menuentry for switching to grubtest.cfg. In
@@ -145,7 +135,7 @@ Extract grubtest.cfg from the ROM image:
Modify the grubtest.cfg accordingly.
-Re-insert the modified grubtest.cfg into the ROM image {#reinsert_modified_testconfig}
+Re-insert the modified grubtest.cfg into the ROM image
------------------------------------------------------
Once your grubtest.cfg is modified and saved, delete the unmodified
@@ -153,34 +143,39 @@ config from the ROM image:
$ ./cbfstool libreboot.rom remove -n grubtest.cfg
-Next, insert the modified version:\
-**\$ ./cbfstool libreboot.rom add -n grubtest.cfg -f grubtest.cfg -t
-raw**
+Next, insert the modified version:
+
+ $ ./cbfstool libreboot.rom add -n grubtest.cfg -f grubtest.cfg -t raw
Testing
-------
-**Now you have a modified ROM. Refer back to
+Now you have a modified ROM. Refer back to
[../install/\#flashrom](../install/#flashrom) for information on how to
flash it.
- $ cd /libreboot\_util** \# **./flash update libreboot.rom\
+
+ $ cd /libreboot\_util
+ # ./flash update libreboot.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:
+
# ./flash forceupdate libreboot.rom
-You should see **"Verifying flash\... VERIFIED."** written at the end
+
+You should see `Verifying flash... VERIFIED.` written at the end
of the flashrom output. Once you have done that, shut down and then boot
-up with your new test configuration.**
+up with your new test configuration.
Choose (in GRUB) the menu entry that switches to grubtest.cfg. If it
works, then your config is safe and you can continue below.
-**If it does not work like you want it to, if you are unsure or
+*If it does not work like you want it to, if you are unsure or
sceptical in any way, then re-do the steps above until you get it right!
-Do \*not\* proceed past this point unless you are 100% sure that your
-new configuration is safe (or desirable) to use.**
+Do not proceed past this point unless you are 100% sure that your
+new configuration is safe (or desirable) to use.*
-Final steps {#final_steps}
+Final steps
-----------
When you are satisfied booting from grubtest.cfg, you can create a copy
@@ -190,10 +185,12 @@ difference: the menuentry 'Switch to grub.cfg' will be changed to
grubtest.cfg. This is so that the main config still links (in the menu)
to grubtest.cfg, so that you don't have to manually switch to it, in
case you ever want to follow this guide again in the future (modifying
-the already modified config). From /libreboot\_util/cbfstool, do:\
-\$ **sed -e 's:(cbfsdisk)/grub.cfg:(cbfsdisk)/grubtest.cfg:g' -e
+the already modified config). From /libreboot\_util/cbfstool, do:
+
+ # sed -e 's:(cbfsdisk)/grub.cfg:(cbfsdisk)/grubtest.cfg:g' -e
+
's:Switch to grub.cfg:Switch to grubtest.cfg:g' < grubtest.cfg >
-grub.cfg**\
+grub.cfg
Delete the grub.cfg that remained inside the ROM:
@@ -203,16 +200,14 @@ Add the modified version that you just made:
$ ./cbfstool libreboot.rom add -n grub.cfg -f grub.cfg -t raw
-**Now you have a modified ROM. Again, refer back to
+*Now you have a modified ROM. Again, refer back to
[../install/\#flashrom](../install/#flashrom) for information on how to
flash it. It's the same method as you used before. Shut down and then
-boot up with your new configuration.**
+boot up with your new configuration.*
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
Copyright © 2015 Jeroen Quint <jezza@diplomail.ch>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/gnulinux/grub_hardening.md b/docs/gnulinux/grub_hardening.md
index 12485949..c32a0534 100644
--- a/docs/gnulinux/grub_hardening.md
+++ b/docs/gnulinux/grub_hardening.md
@@ -31,14 +31,10 @@ image:
Helpful links:
-- [GRUB manual
- \#security](https://www.gnu.org/software/grub/manual/html_node/Security.html#Security)
-- [GRUB info
- pages](http://git.savannah.gnu.org/cgit/grub.git/tree/docs/grub.texi)
-- [SATA connected storage considered dangerous until proven
- otherwise.](../../faq.md#firmware-hddssd)
-- [Coreboot GRUB security
- howto](https://www.coreboot.org/GRUB2#Security)
+- [GRUB manual](https://www.gnu.org/software/grub/manual/html_node/Security.html#Security)
+- [GRUB info pages](http://git.savannah.gnu.org/cgit/grub.git/tree/docs/grub.texi)
+- [SATA connected storage considered dangerous.](../../faq.md#firmware-hddssd)
+- [Coreboot GRUB security howto](https://www.coreboot.org/GRUB2#Security)
GRUB Password
=============
@@ -58,8 +54,8 @@ location.
Note that this is not your LUKS password, but it's a password that you
have to enter in order to use "restricted" functionality (such as
console). This protects your system from an attacker simply booting a
-live USB and re-flashing your firmware. **This should be different than
-your LUKS passphrase and user password.**
+live USB and re-flashing your firmware. *This should be different than
+your LUKS passphrase and user password.*
Use of the *diceware method* is recommended, for generating secure
passphrases (as opposed to passwords). Diceware method involves using
@@ -80,7 +76,7 @@ The GRUB password can be entered in two ways:
- protected with [PBKDF2](https://en.wikipedia.org/wiki/Pbkdf2)
We will (obviously) use the later. Generating the PBKDF2 derived key is
-done using the **grub-mkpasswd-pbkdf2** utility. You can get it by
+done using the `grub-mkpasswd-pbkdf2` utility. You can get it by
installing GRUB version 2. Generate a key by giving it a password:
grub-mkpasswd-pbkdf2
@@ -101,13 +97,13 @@ As enabling password protection as above means that you have to input it
on every single boot, we will make one menu entry work without it.
Remember that we will have GPG signing active, thus a potential attacker
will not be able to boot an arbitrary operating system. We do this by
-adding option **--unrestricted** to a menuentry definition:
+adding option `--unrestricted` to a menuentry definition:
menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o' --unrestricted {
...
Another good thing to do, if we chose to load signed on-disk GRUB
-configurations, is to remove (or comment out) **unset superusers** in
+configurations, is to remove (or comment out) `unset superusers` in
function try\_user\_config:
function try_user_config {
@@ -137,8 +133,8 @@ GPG keys
First generate a GPG keypair to use for signing. Option RSA (sign only)
is ok.
-**Warning:** GRUB does not read ASCII armored keys. When attempting to
-trust \... a key filename it will print error: bad signature
+Warning: GRUB does not read ASCII armored keys. When attempting to
+trust ... a key filename it will print error: bad signature
mkdir --mode 0700 keys
gpg --homedir keys --gen-key
@@ -155,9 +151,10 @@ Now that we have a key, we can sign some files with it. We have to sign:
by pressing ESC, but afterwards grubtest.cfg is not signed and it
will not load.
-Suppose that we have a pair of **my.kernel** and **my.initramfs** and an
-on-disk **libreboot\_grub.cfg**. We sign them by issuing the following
+Suppose that we have a pair of `my.kernel` and `my.initramfs` and an
+on-disk `libreboot_grub.cfg`. We sign them by issuing the following
commands:
+
gpg --homedir keys --detach-sign my.initramfs
gpg --homedir keys --detach-sign my.kernel
gpg --homedir keys --detach-sign libreboot_grub.cfg
@@ -176,12 +173,10 @@ What remains now is to include the modifications into the image (rom):
cbfstool my.rom add -n grubtest.cfg -f my.grubtest.cfg -t raw
cbfstool my.rom add -n grubtest.cfg.sig -f my.grubtest.cfg.sig -t raw
-\... and flashing it.
+... and flashing it.
Copyright © 2017 Fedja Beader <fedja@protonmail.ch>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/gnulinux/index.md b/docs/gnulinux/index.md
index 3814b75f..85777b95 100644
--- a/docs/gnulinux/index.md
+++ b/docs/gnulinux/index.md
@@ -5,8 +5,8 @@ title: GNU+Linux installation instructions
This section relates to dealing with GNU+Linux distributions: preparing
bootable USB drives, changing the default GRUB menu and so on.
-**This section is only for the \*GRUB\* payload. For depthcharge,
-instructions have yet to be written.**
+*This section is only for the GRUB payload. For depthcharge,
+instructions have yet to be written.*
- [How to install GNU+Linux on a libreboot
system](grub_boot_installer.md)
@@ -24,8 +24,6 @@ instructions have yet to be written.**
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/grub/grubeditor.md b/docs/grub/grubeditor.md
new file mode 100644
index 00000000..628d184f
--- /dev/null
+++ b/docs/grub/grubeditor.md
@@ -0,0 +1,121 @@
+# GRUB EDITOR
+
+Libreboot ROM images now support fluid _grub.cfg_ and _grubtest.cfg_
+configuration editing with the grubeditor.sh script! Instead of manually running
+cbfstool to manipulate these configuration files, this script will handle the
+work for you so you can focus on actually modifying your GRUB configuration
+files to your setup's needs.
+
+At the time of this writing, grubeditor.sh supports extracting and editing
+either the grub.cfg or grubtest.cfg file in any cbfstool-compatible Libreboot
+ROM image that contains these files, even ones that have been previously
+modified. It can also swap these configuration files in an existing ROM image,
+handy if you have a working grubtest.cfg and want to make it the default or if
+you broke the main grub.cfg and know that your grubtest.cfg still works. Lastly,
+it can also run diff on these two configuration files to show you how they
+differ.
+
+## Requirements
+
+grubeditor.sh requires an x86, x86\_64, or armv7l environment, since these are
+the environments for which cbfstools binaries are provided. Additionally,
+grubeditor.sh needs a Bash environment with extended getopt functionality that
+can run the **diff** command and write to /tmp. Lastly, the script expects to
+live in the top directory of the Libreboot utilities package so it can properly
+call cbfstool.
+
+Chances are that you already meet these requirements if you are on a Linux
+environment of the listed architectures and downloaded the Libreboot utilities
+package from an official source. If not, it shouldn't be too hard to use a
+Linux LiveCD of your choice which provides these essentials.
+
+Optionally, you should make sure your EDITOR variable is set. Otherwise,
+grubeditor.sh will default to using vi, which may not exist on your system. You
+can override this default or the contents of your EDITOR variable using the
+**-e** or **--editor** command.
+
+## Usage help
+
+grubeditor.sh takes a number of options, the only one which is required being a
+valid Libreboot ROM image that uses the GRUB2 payload and contains both
+_grub.cfg_ and _grubtest.cfg_ files. Additional options should come _before_ the
+ROM image file on the command line.
+
+grubeditor.sh supports combining several short options with a single hyphen
+like **-ris**, but you can also list them separately like **-r -i -s**. Long
+options must always be written as standalone arguments.
+
+You can use the **-h** or **--help** option to view a brief summary of the
+options available. Consider this guide a more extensive version of this screen.
+
+Lastly, you can check which version of grubeditor.sh you are using with the
+**-v** or **--version** option.
+
+## Editing configuration files
+
+Invoked without any arguments except for the ROM image, grubeditor.sh will
+attempt to extract the _grubtest.cfg_ file from the provided ROM image and
+launch it in your editor of choice. If you make changes to the file,
+grubeditor.sh will incorporate your changes into a new ROM image with the same
+name in the same directory, except that the new ROM file will end with
+".modified". You can then flash this ROM image to your platform's BIOS chip.
+
+If you would prefer to edit the actual _grub.cfg_ configuration file, use the
+**-r** or the **--realcfg** option. Everything else will work the same except
+that your editor will open the _grub.cfg_ instead.
+
+If you would prefer to overwrite your existing ROM image instead of creating a
+new one ending in ".modified" use the **-i** or **--inplace** option.
+Naturally, you can combine this option with the **-r/--realcfg** option
+described above.
+
+## Swapping grub.cfg and grubtest.cfg
+
+grubeditor.sh supports swapping the _grub.cfg_ and _grubtest.cfg_ configuration
+files with the **-s** or **--swap** option. This will create a new ROM image
+alongside the existing ROM image ending with ".modified" which has these files
+swapped. Naturally, you can request this operation overwrite the existing file
+instead using the **-i/--inplace** option.
+
+Note that the script will automatically modify the "Load test configuration
+(grubtest.cfg)" menu entry in both configuration files during this operation.
+If this was not done, these entries would end up being self-referential after
+the rename, breaking their intended functionality of changing between the
+configuration files.
+
+For best results, please do not modify this section without studying the source
+code of _grubeditor.sh_ and making sure your edits do not impact the script's
+ability to perform this modification
+
+## Swapping grub.cfg and grubtest.cfg
+
+grubeditor.sh supports comparing _grub.cfg_ and _grubtest.cfg_ files for
+differences with the **-d** or **--diffcfg** option. This uses the diff command
+by default, but if you want to use another program (e.g. vimdiff), you can
+specify it with the **-D** or **--differ** option. Note that this mode is only
+intended to show differences in the files and does not support updating the
+configs themselves, so any changes you make in an interactive differ will be
+ignored.
+
+## Extracting a configuration file
+
+You can simply extract a configuration file using the **-x** or **--extract**
+option. This option is responsive to the **-r/--realcfg** option for choosing
+between grubtest.cfg and grub.cfg.
+
+## Pending development
+
+TODO:
+- allow injecting configuration files to complement the extractor.
+- detect potentially devastating corner cases, however rare they may actually be
+- i can't specify a quoted command line with arguments to -e or -D, why?
+- support editing both config files if using an interactive differ
+- work with other types of files besides the grub configuration files.
+
+## Conclusion
+
+I hope that grubeditor.sh will significantly ease modifying your configuration
+files in your Libreboot ROM files.
+
+Should you find any bugs or want any feature requests, please don't hesitate to
+email me or bug me on IRC.
diff --git a/docs/grub/index.md b/docs/grub/index.md
index f148cc0f..65d4863f 100644
--- a/docs/grub/index.md
+++ b/docs/grub/index.md
@@ -1,28 +1,23 @@
---
title: GRUB payload
+x-toc-enable: true
...
This section relates to the GRUB payload used in libreboot.
-- [Changing the background image in GRUB](#grub_background)
-- [Setting font in GRUB](#grub_font)
-- [GRUB keyboard layouts](#grub_keyboard)
- - [Custom keyboard layout in GRUB](#grub_custom_keyboard)
- - [UK Dvorak keyboard layout in GRUB](#grub_ukdvorak_keyboard)
-
-Changing the background image in GRUB {#grub_background}
+Changing the background image in GRUB
=====================================
Use cbfstool from libreboot\_util, or
libreboot\_src/coreboot/util/cbfstool/ if you want to build from source.
-./cbfstool yourrom.rom remove background.png -n background.png\
-./cbfstool yourrom.rom add -f background.png -n background.png -t raw
+ $ ./cbfstool yourrom.rom remove background.png -n background.png
+ $ ./cbfstool yourrom.rom add -f background.png -n background.png -t raw
When you've done this, re-flash your ROM and you should have a new
background at boot time.
-Setting font in GRUB (for reference) {#grub_font}
+Setting font in GRUB (for reference)
====================================
You don't need to do this unless you would like to change the default
@@ -43,27 +38,29 @@ This is a free font that is also contained in GNU+Linux distributions
like Debian, Devuan or Parabola.
$ cd libreboot\_src/grub
+
compile grub (the build scripts 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**
+libreboot) and did:
+
+ $ ../../../grub/grub-mkfont -o dejavusansmono.pf2 dejavu-fonts-ttf-2.34/ttf/DejaVuSansMono.ttf
I then added the instructions to 'gen.sh' script in grub-assemble to
include resources/grub/dejavusansmono.pf2 in all of the ROM images, at
the root of the GRUB memdisk.\
I then added that instructions to the grub.cfg files (to load the
-font):\
-**loadfont (memdisk)/dejavusansmono.pf2**
+font):
+
+ loadfont (memdisk)/dejavusansmono.pf2
-GRUB keyboard layouts (for reference) {#grub_keyboard}
+GRUB keyboard layouts (for reference)
=====================================
-Custom keyboard layout in GRUB (for reference) {#grub_custom_keyboard}
+Custom keyboard layout in GRUB (for reference)
----------------------------------------------
Keymaps are stored in resources/utilities/grub-assemble/keymap/.
@@ -71,23 +68,24 @@ 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**
+
+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/**
+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 build scripts will automatically see this, and automatically build
ROM images with your custom layout (given the name) and include them
-under bin. Example: **libreboot\_frazerty.rom**.
+under bin. Example: `libreboot_frazerty.rom`.
-UK Dvorak keyboard layout in GRUB (for reference) {#grub_ukdvorak_keyboard}
+UK Dvorak keyboard layout in GRUB (for reference)
-------------------------------------------------
ukdvorak had to be created manually, based on usdvorak. diff them (under
@@ -98,8 +96,6 @@ file was created
Copyright © 2014 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/c201.md b/docs/hardware/c201.md
index 82b68fc9..98699bd1 100644
--- a/docs/hardware/c201.md
+++ b/docs/hardware/c201.md
@@ -1,33 +1,16 @@
---
title: ASUS Chromebook C201
+x-toc-enable: true
...
This is a Chromebook, using the Rockchip RK3288 SoC. It uses an ARM CPU,
and has free EC firmware (unlike some other laptops). More RK3288-based
laptops will be added to libreboot at a later date.
-Paul Kocialkowski, a [Replicant](http://www.replicant.us/) developer,
-ported this laptop to libreboot. Thank you, Paul!
-
-**More info will be added later, including build/installation
-instructions. The board is supported in libreboot, however, and has been
-confirmed to work.**
-
Flashing instructions can be found at
[../install/\#flashrom](../install/#flashrom)
-- [Google's intent with CrOS devices](#googlesintent)
-- [Considerations about ChromeOS and free operating systems](#os)
-- [Caution: Video acceleration requires a non-free blob, software
- rendering can be used instead.](#videoblobs)
-- [Caution: WiFi requires a non-free blob, a USB dongle can be used
- instead.](#wifiblobs)
-- [EC firmware is free software!](#ec)
-- [No microcode!](#microcode)
-- [Depthcharge payload](#depthcharge)
-- [Flash chip write protection: the screw](#thescrew)
-
-Google's intent with CrOS devices {#googlesintent}
+Google's intent with CrOS devices
==================================
CrOS (Chromium OS/Chrome OS) devices, such as Chromebooks, were not
@@ -56,7 +39,7 @@ are supported in libreboot. Those laptops are supported, in spite of
Apple and Lenovo, companies which are actually *hostile* to the free
software movement.
-Considerations about ChromeOS and free operating systems {#os}
+Considerations about ChromeOS and free operating systems
========================================================
This laptop comes preinstalled (from the factory) with Google ChromeOS.
@@ -71,9 +54,13 @@ Debian GNU+Linux
<https://wiki.debian.org/InstallingDebianOn/Asus/C201> shows how to
install Debian.
-TODO: instructions for Devuan
+Devuan GNU+Linux
+----------------
+
+<https://notabug.org/dimkr/devsus> produces bootable and installable
+Devuan images.
-Caution: Video acceleration requires a non-free blob, software rendering can be used instead. {#videoblobs}
+Caution: Video acceleration requires a non-free blob, software rendering can be used instead.
=============================================================================================
The Tamil driver source code for the onboard Mali T GPU is not released.
@@ -92,7 +79,7 @@ The Tamil developer wrote this blog post, which sheds light on the
story:
[http://libv.livejournal.com/27461.html,http://libv.livejournal.com/27461.html](http://libv.livejournal.com/27461.html).
-Caution: WiFi requires a non-free blob, a USB dongle can be used instead. {#wifiblobs}
+Caution: WiFi requires a non-free blob, a USB dongle can be used instead.
=========================================================================
These laptops have non-removeable (soldered on) WiFi chips, which
@@ -117,7 +104,7 @@ These wifi dongles use the AR9271 (atheros) chipset, supported by the
free *ath9k\_htc* driver in the Linux kernel. They work in *linux-libre*
too.
-EC firmware is free software! {#ec}
+EC firmware is free software!
=============================
It's free software. Google provides the source. Build scripts will be
@@ -132,7 +119,7 @@ when using one of these laptops.
The libreboot FAQ briefly describes what an *EC* is:
[../../faq.md#firmware-ec](../../faq.md#firmware-ec)
-No microcode! {#microcode}
+No microcode!
=============
Unlike x86 (e.g. Intel/AMD) CPUs, ARM CPUs do not use microcode, not
@@ -146,14 +133,14 @@ present), which are proprietary software.
On ARM CPUs, the instruction set is implemented in circuitry, without
microcode.
-Depthcharge payload {#depthcharge}
+Depthcharge payload
===================
These systems do not use the GRUB payload. Instead, they use a payload
called depthcharge, which is common on CrOS devices. This is free
software, maintained by Google.
-Flash chip write protection: the screw {#thescrew}
+Flash chip write protection: the screw
======================================
It's next to the flash chip. Unscrew it, and the flash chip is
@@ -178,8 +165,6 @@ is such a stupidly simple idea, which all designs should implement.
Copyright © 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/d510mo.md b/docs/hardware/d510mo.md
index 9d4350b1..b2e85b0a 100644
--- a/docs/hardware/d510mo.md
+++ b/docs/hardware/d510mo.md
@@ -15,8 +15,6 @@ Flashing instructions can be found at
Copyright © 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/d945gclf.md b/docs/hardware/d945gclf.md
index aeb85706..c3f4754a 100644
--- a/docs/hardware/d945gclf.md
+++ b/docs/hardware/d945gclf.md
@@ -76,8 +76,6 @@ fan connector back, and you are done.
Copyright © 2016 Arthur Heymans <arthur@aheymans.xyz>\
Copyright © 2016 Vitaly Castaño Solana <vita\_cell@hotmail.com>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/ga-g41m-es2l.md b/docs/hardware/ga-g41m-es2l.md
index 143c2f85..fbcf2132 100644
--- a/docs/hardware/ga-g41m-es2l.md
+++ b/docs/hardware/ga-g41m-es2l.md
@@ -19,8 +19,6 @@ Flashing instructions can be found at
Copyright © 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/gm45_remove_me.md b/docs/hardware/gm45_remove_me.md
index a5343ac9..ad969919 100644
--- a/docs/hardware/gm45_remove_me.md
+++ b/docs/hardware/gm45_remove_me.md
@@ -3,7 +3,7 @@ title: "GM45 chipsets: remove the ME (manageability engine)"
...
This sections relates to disabling and removing the ME (Intel
-**M**anagement **E**ngine) on GM45. This was originally done on the
+*M*anagement *E*ngine) on GM45. This was originally done on the
ThinkPad X200, and later adapted for the ThinkPad R400/T400/T500. It can
in principle be done on any GM45 or GS45 system.
@@ -37,11 +37,13 @@ factory.bin dump.
ich9gen executables can be found under ./ich9deblob/ statically compiled
in libreboot\_util. If you are using src or git, build ich9gen from
source with:
+
$ ./oldbuild module ich9deblob
The executable will appear under resources/utilities/ich9deblob/
Run:
+
$ ./ich9gen
Running ich9gen this way (without any arguments) generates a default
@@ -52,7 +54,7 @@ mitigate the risk of bricking your laptop, but with the generic MAC
address (the libreboot project does not know what your real MAC address
is).
-You can find out your MAC address from **ip addr** or **ifconfig** in
+You can find out your MAC address from `ip addr` or `ifconfig` in
GNU+Linux. Alternatively, if you are running libreboot already (with the
correct MAC address in your ROM), dump it (flashrom -r) and read the
first 6 bytes from position 0x1000 (or 0x2000) in a hex editor (or,
@@ -70,30 +72,39 @@ generate a descriptor+gbe image with your own MAC address inside (with
the Gbe checksum updated to match). Run:
$ ./ich9gen --macaddress XX:XX:XX:XX:XX:XX
+
(replace the XX chars with the hexadecimal chars in the MAC address that
you want)
Two new files will be created:
-- **ich9fdgbe\_4m.bin**: this is for GM45 laptops with the 4MB flash
+- `ich9fdgbe_4m.bin`: this is for GM45 laptops with the 4MB flash
chip.
-- **ich9fdgbe\_8m.bin**: this is for GM45 laptops with the 8MB flash
+- `ich9fdgbe_8m.bin`: this is for GM45 laptops with the 8MB flash
chip.
-- **ich9fdgbe\_16m.bin**: this is for GM45 laptops with the 16MB flash
+- `ich9fdgbe_16m.bin`: this is for GM45 laptops with the 16MB flash
chip.
Assuming that your libreboot image is named **libreboot.rom**, copy the
file to where **libreboot.rom** is located and then insert the
descriptor+gbe file into the ROM image.\
-For 16MiB flash chips:\
-\$ **dd if=ich9fdgbe\_16m.bin of=libreboot.rom bs=1 count=12k
-conv=notrunc**\
-For 8MiB flash chips:\
-\$ **dd if=ich9fdgbe\_8m.bin of=libreboot.rom bs=1 count=12k
-conv=notrunc**\
-For 4MiB flash chips:\
-\$ **dd if=ich9fdgbe\_4m.bin of=libreboot.rom bs=1 count=12k
-conv=notrunc**\
+For 16MiB flash chips:
+
+ # dd if=ich9fdgbe_16m.bin of=libreboot.rom bs=1 count=12k
+
+conv=notrunc
+
+For 8MiB flash chips:
+
+ # dd if=ich9fdgbe_8m.bin of=libreboot.rom bs=1 count=12k
+
+conv=notrunc
+
+For 4MiB flash chips:
+
+ # dd if=ich9fdgbe_4m.bin of=libreboot.rom bs=1 count=12k
+
+conv=notrunc
Your libreboot.rom image is now ready to be flashed on the system. Refer
back to [../install/\#flashrom](../install/#flashrom) for how to flash
@@ -164,6 +175,7 @@ you ran **./oldbuild module all** or **./oldbuild module ich9deblob**
from the main directory (./), otherwise you can build it like so:
$ ./oldbuild module ich9deblob
+
An executable file named **ich9deblob** will now appear under
resources/utilities/ich9deblob/
@@ -192,9 +204,11 @@ Intel. Only the Intel NICs need a GbE region in the flash chip.
Assuming that your libreboot image is named **libreboot.rom**, copy the
**deblobbed\_descriptor.bin** file to where **libreboot.rom** is located
-and then run:\
-\$ **dd if=deblobbed\_descriptor.bin of=libreboot.rom bs=1 count=12k
-conv=notrunc**
+and then run:
+
+ # dd if=deblobbed_descriptor.bin of=libreboot.rom bs=1 count=12k
+
+conv=notrunc
Alternatively, if you got a the **deblobbed\_4kdescriptor.bin** file (no
GbE defined), do this: \$ **dd if=deblobbed\_4kdescriptor.bin
@@ -235,9 +249,11 @@ Simply run (with factory.rom in the same directory):
It will generate a 4KiB descriptor file (only the descriptor, no GbE).
Insert that into a factory.rom image (NOTE: do this on a copy of it.
-Keep the original factory.rom stored safely somewhere):\
-\$ **dd if=demefactory\_4kdescriptor.bin of=factory\_nome.rom bs=1
-count=4k conv=notrunc**
+Keep the original factory.rom stored safely somewhere):
+
+ # dd if=demefactory_4kdescriptor.bin of=factory_nome.rom bs=1
+
+count=4k conv=notrunc
TODO: test this.\
TODO: lenovobios (GM45 thinkpads) still write-protects parts of the
@@ -423,7 +439,7 @@ actually be others on the X200.
0xBABA"*
In honour of the song *Baba O'Reilly* by *The Who* apparently. We're
-not making this stuff up\...
+not making this stuff up...
0x3ABA, 0x34BA, 0x40BA and more have been observed in the main Gbe
regions on the X200 factory.rom dumps. The checksums of the backup
@@ -518,8 +534,6 @@ It has only a 448 byte fragment different from 0x00 or 0xFF.
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/imac52.md b/docs/hardware/imac52.md
index 54efd3e6..99db1977 100644
--- a/docs/hardware/imac52.md
+++ b/docs/hardware/imac52.md
@@ -6,8 +6,6 @@ Information to be written soon, but this board is merged in libreboot.
Copyright © 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/index.md b/docs/hardware/index.md
index 2e20b680..58161090 100644
--- a/docs/hardware/index.md
+++ b/docs/hardware/index.md
@@ -1,29 +1,18 @@
---
title: Hardware compatibility list
+x-toc-enable: true
...
This sections relates to known hardware compatibility in libreboot.
For installatation instructions, refer to [../install/](../install/).
-- [List of supported hardware](#supported_list)
- - [Desktops (x86, AMD and Intel)](#supported_desktops_x86amdintel)
- - [Servers/workstations](#supported_workstations_x86amd)
- - [Laptops (ARM)](#supported_laptops_arm)
- - [Laptops (Intel, x86)](#supported_laptops_x86intel)
-
-- NOTES:
- - [Updating the EC firmware on i945 and GM45
- (recommended)](#ecupdate)
- - [How to find what EC version you have (i945/GM45)](#ecversion)
-- [Recommended wifi chipsets](#recommended_wifi)
-
-List of supported hardware {#supported_list}
+List of supported hardware
--------------------------
Libreboot supports the following systems in this release:
-### Desktops (AMD, Intel, x86) {#supported_desktops_x86amdintel}
+### Desktops (AMD, Intel, x86)
- [Gigabyte GA-G41M-ES2L motherboard](ga-g41m-es2l.md)
- [Intel D510MO motherboard](d510mo.md)
@@ -31,28 +20,27 @@ Libreboot supports the following systems in this release:
- [Intel D945GCLF](d945gclf.md)
- [Apple iMac 5,2](imac52.md)
-### Servers/workstations (AMD, x86) {#supported_workstations_x86amd}
+### Servers/workstations (AMD, x86)
- [ASUS KFSN4-DRE motherboard](kfsn4-dre.md)
- [ASUS KGPE-D16 motherboard](kgpe-d16.md)
-### Laptops (ARM) {#supported_laptops_arm}
+### Laptops (ARM)
- [ASUS Chromebook C201](c201.md)
-### Laptops (Intel, x86) {#supported_laptops_x86intel}
+### Laptops (Intel, x86)
-- [Lenovo ThinkPad X60/X60s](#supported_x60_list)
-- [Lenovo ThinkPad X60 Tablet](#supported_x60t_list)
-- [Lenovo ThinkPad T60](#supported_t60_list) (there are exceptions.
- see link)
+- [Lenovo ThinkPad X60/X60s](#list-of-supported-x60s)
+- [Lenovo ThinkPad X60 Tablet](#list-of-supported-x60-tablets)
+- [Lenovo ThinkPad T60](#supported-t60-list) (some exceptions)
- [Lenovo ThinkPad X200](x200.md)
- [Lenovo ThinkPad R400](r400.md)
- [Lenovo ThinkPad T400](t400.md)
- [Lenovo ThinkPad T500](t500.md)
- [Lenovo ThinkPad W500](t500.md)
-- [Apple MacBook1,1](#macbook11)
-- [Apple MacBook2,1](#macbook21)
+- [Apple MacBook1,1](#information-about-the-macbook11)
+- [Apple MacBook2,1](#information-about-the-macbook21)
'Supported' means that the build scripts know how to build ROM images
for these systems, and that the systems have been tested (confirmed
@@ -62,7 +50,7 @@ working). There may be exceptions; in other words, this is a list of
It is also possible to build ROM images (from source) for other systems
(and virtual systems, e.g. QEMU).
-EC update on i945 (X60, T60) and GM45 (X200, T400, T500, R400, W500) {#ecupdate}
+EC update on i945 (X60, T60) and GM45 (X200, T400, T500, R400, W500)
==============================================================
It is recommended that you update to the latest EC firmware version. The
@@ -81,19 +69,21 @@ only replaces the BIOS firmware, not EC.
Updated EC firmware has several advantages e.g. bettery battery
handling.
-How to find what EC version you have (i945/GM45) {#ecversion}
+How to find what EC version you have (i945/GM45)
================================================
-In GNU+Linux, you can try this:\
-**grep 'at EC' /proc/asound/cards**
+In GNU+Linux, you can try this:
+
+ $ grep 'at EC' /proc/asound/cards
+
+Sample output:
-Sample output:\
-**ThinkPad Console Audio Control at EC reg 0x30, fw 7WHT19WW-3.6**
+ ThinkPad Console Audio Control at EC reg 0x30, fw 7WHT19WW-3.6
7WHT19WW is the version in different notation, use search engine to find
out regular version - in this case it's a 1.06 for x200 tablet
-Recommended wifi chipsets {#recommended_wifi}
+Recommended wifi chipsets
-------------------------
The following are known to work well:
@@ -111,7 +101,7 @@ project if these work with linux-libre kernel (TODO: test):
- \[0200\]: Qualcomm Atheros AR242x / AR542x Wireless Network Adapter
(PCI-Express) \[168c:001c\]
-List of supported ThinkPad X60s {#supported_x60_list}
+List of supported ThinkPad X60s
-------------------------------
Native gpu initialization ('native graphics') which replaces the
@@ -136,10 +126,10 @@ 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 system 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
+*after* libreboot is installed. See
[\#recommended\_wifi](#recommended_wifi) for replacements.
-List of supported ThinkPad X60 Tablets {#supported_x60t_list}
+List of supported ThinkPad X60 Tablets
--------------------------------------
Native gpu initialization ('native graphics') which replaces the
@@ -151,11 +141,11 @@ To find what LCD panel you have, see:
There are 5 known LCD panels for the X60 Tablet:
-- **X60T XGA (1024x768):**
+- *X60T XGA (1024x768):*
- BOE-Hydis HV121X03-100 (works)
- Samsung LTN121XP01 (does not work. blank screen)
- BOE-Hydis HT12X21-351 (does not work. blank screen)
-- **X60T SXGA+ (1400x1050):**
+- *X60T SXGA+ (1400x1050):*
- BOE-Hydis HV121P01-100 (works)
- BOE-Hydis HV121P01-101 (works)
@@ -165,15 +155,15 @@ does.
You can remove an X61/X61s motherboard from the chassis and install an
X60/X60s motherboard in its place (for flashing libreboot). The chassis
-is mostly identical and the motherboards are the same shape/size. **It
+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**.
+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 system 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
+another one *after* libreboot is installed. See
[\#recommended\_wifi](#recommended_wifi) for replacements.
A user with a X60T that has digitizer+finger support, reported that they
@@ -223,7 +213,7 @@ could get finger input working. They used linuxwacom at git tag
InputDevice "WTouch" "SendCoreEvents"
EndSection
-Supported T60 list {#supported_t60_list}
+Supported T60 list
------------------
Native gpu initialization ('native graphics') which replaces the
@@ -233,26 +223,26 @@ BIOS](https://en.wikipedia.org/wiki/Video_BIOS)' or 'VBIOS').
To find what LCD panel you have, see:
[../misc/\#get\_edid\_panelname](../misc/#get_edid_panelname).
-**Some T60s have ATI GPUs, and all T60P laptops have ATI GPUs These are
+*Some T60s have ATI GPUs, and all T60P laptops have ATI GPUs These are
incompatible! See [\#t60\_ati\_intel](#t60_ati_intel) for how to remedy
-this.**
+this.*
-Tested LCD panels: **working(compatible)**
+Tested LCD panels: (working)
-- 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)
+- 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)
-Tested LCD panels: **not working yet (incompatible; see
-[../future/\#lcd\_i945\_incompatibility](../future/#lcd_i945_incompatibility))**
+Tested LCD panels: *not working yet (incompatible; see
+[../future/\#lcd\_i945\_incompatibility](../future/#lcd_i945_incompatibility))*
- Samsung LTN141XA-L01 (14.1" 1024x768)
- LG-Philips LP150X09 (15.1" 1024x768)
@@ -267,8 +257,8 @@ Tested LCD panels: **not working yet (incompatible; see
GNU+Linux works) (P/N 42T0078 FRU 42T0079 or P/N 41W1338 recommended
for the inverter board)
-*The following LCD panels are **UNTESTED**. If you have one of these
-panels then please submit a report!*:
+*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)
@@ -285,10 +275,10 @@ panels then please submit a report!*:
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!)**
+- 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.
@@ -297,10 +287,10 @@ 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 system 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
+*after* libreboot is installed. See
[\#recommended\_wifi](#recommended_wifi) for replacements.
-ThinkPad T60 (ATI GPU) and ThinkPad T60 (Intel GPU) differences. {#t60_ati_intel}
+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
@@ -315,13 +305,13 @@ your chassis.
There is also a 15.4" T60 with Intel GPU.
-Note: the T60**p** laptops all have ATI graphics. The T60p laptops
+Note: the T60*p* 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):\
-\
+
![](../images/t60_dev/t60_unbrick.jpg)
The reason that the ATI GPU on T60 is unsupported is due to the VBIOS
@@ -342,7 +332,7 @@ 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).
-Information about the macbook1,1 {#macbook11}
+Information about the macbook1,1
--------------------------------
There is an Apple laptop called the macbook1,1 from 2006 which uses the
@@ -364,8 +354,8 @@ It is believed that all models are compatible, listed here:
Specifically (Order No. / Model No. / CPU):
-- MA255LL/A / A1181 (EMC 2092) / Core Duo T2500 **(tested - working)**
-- MA254LL/A / A1181 (EMC 2092) / Core Duo T2400 **(tested - working)**
+- MA255LL/A / A1181 (EMC 2092) / Core Duo T2500 *(tested - working)*
+- MA254LL/A / A1181 (EMC 2092) / Core Duo T2400 *(tested - working)*
- MA472LL/A / A1181 (EMC 2092) / Core Duo T2500 (untested)
Also of interest:
@@ -382,7 +372,7 @@ firmware is running. You will need to disassemble the system and flash
externally. Reading from flash seems to work. For external flashing,
refer to [../install/bbb\_setup.md](../install/bbb_setup.md).
-Information about the macbook2,1 {#macbook21}
+Information about the macbook2,1
--------------------------------
There is an Apple laptop called the macbook2,1 from late 2006 or early
@@ -399,22 +389,13 @@ 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
+ $ wget -m -p -E -k -K -np http://macbook.donderklumpen.de/coreboot/
-**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 this person to tell me what license
-these works fall under first. Otherwise, the above URLs should be fine.
-NOTE TO SELF: REMOVE THIS WHEN DONE**
+Use `-e robots=off` if using this trick for other sites and the site restricts
+using robots.txt
### 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
@@ -425,11 +406,6 @@ likes to think that Apple and Microsoft are all that exist.) Now to
install libreboot, follow
[../install/\#flashrom\_macbook21](../install/#flashrom_macbook21).
-### Information about coreboot
-
-- [Coreboot on the macbook2,1](#) (this is a copy of Mono's page, see
- above)
-
### coreboot wiki page
- <https://www.coreboot.org/Board:apple/macbook21>
@@ -442,16 +418,16 @@ It is believed that all models are compatible, listed here:
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)**
+- 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 **(tested -
- working)**
+- MA700LL/A / A1181 (EMC 2121) / Intel Core 2 Duo T7200 *(tested -
+ working)*
- MB063LL/A / A1181 (EMC 2139) / Intel Core 2 Duo T7400 (works)
-- MB062LL/A / A1181 (EMC 2139) / Intel Core 2 Duo T7400 **(tested -
- working)**
+- MB062LL/A / A1181 (EMC 2139) / Intel Core 2 Duo T7400 *(tested -
+ working)*
Also of interest:
[../git/\#config\_macbook21](../git/#config_macbook21).
@@ -483,9 +459,9 @@ firmware. It is certainly hotter than an X60/T60. The heat issues have
been partially fixed by the following patch (now merged in libreboot):
<https://review.coreboot.org/#/c/7923/>.
-**The MacBook2,1 comes with a webcam, which does not work without
+*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.**
+remove it.*
A user reported that they could get better response from the touchpad
with the following in their xorg.conf:
@@ -541,8 +517,6 @@ libreboot git repository.
Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/kcma-d8.md b/docs/hardware/kcma-d8.md
index fa5a2615..f6c6fad7 100644
--- a/docs/hardware/kcma-d8.md
+++ b/docs/hardware/kcma-d8.md
@@ -2,13 +2,13 @@
title: ASUS KCMA-D8 desktop/workstation board
...
-This is a desktop board using AMD hardware (Fam10h **and Fam15h** CPUs
+This is a desktop board using AMD hardware (Fam10h *and Fam15h* CPUs
available). It can also be used for building a high-powered workstation.
Powered by libreboot. The coreboot port was done by Timothy Pearson of
Raptor Engineering Inc. and, working with them, merged into libreboot.
-**Memory initialization is still problematic, for some modules. We
-recommend avoiding Kingston modules.**
+*Memory initialization is still problematic, for some modules. We
+recommend avoiding Kingston modules.*
Flashing instructions can be found at
[../install/\#flashrom](../install/#flashrom) - note that external
@@ -20,8 +20,8 @@ without using external hardware.
CPU compatibility
=================
-**Use Opteron 4200 series (works without microcode updates, including hw
-virt).** 4300 series needs microcode updates, so avoid those CPUs. 4100
+*Use Opteron 4200 series (works without microcode updates, including hw
+virt).* 4300 series needs microcode updates, so avoid those CPUs. 4100
series is too old, and mostly untested.
Board status (compatibility) {#boardstatus}
@@ -58,9 +58,9 @@ boot that, loading it into memory.
Libreboot has configs for 2, 4, 8 and 16 MiB flash chip sizes (default
flash chip is 2MiB).
-**DO NOT hot-swap the chip with your bare hands. Use a P-DIP 8 chip
+*DO NOT hot-swap the chip with your bare hands. Use a P-DIP 8 chip
extractor. These can be found online. See
-<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>**
+<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>*
Native graphics initialization {#graphics}
==============================
@@ -97,8 +97,6 @@ Check the ASUS website.
Copyright © 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/kfsn4-dre.md b/docs/hardware/kfsn4-dre.md
index da3a75bb..944098e0 100644
--- a/docs/hardware/kfsn4-dre.md
+++ b/docs/hardware/kfsn4-dre.md
@@ -24,9 +24,9 @@ SST49LF080A is the default that the board uses. SST49LF016C is an
example of a 2MiB (16Mbits) chip, which might work. It is believed that
2MiB (16Mbits) is the maximum size available for the flash chip.
-**DO NOT hot-swap the chip with your bare hands. Use a PLCC chip
+*DO NOT hot-swap the chip with your bare hands. Use a PLCC chip
extractor. These can be found online. See
-<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>**
+<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>*
Native graphics initialization {#graphics}
==============================
@@ -70,8 +70,6 @@ Other information
Copyright © 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/kgpe-d16.md b/docs/hardware/kgpe-d16.md
index 87868249..e14c447d 100644
--- a/docs/hardware/kgpe-d16.md
+++ b/docs/hardware/kgpe-d16.md
@@ -2,14 +2,14 @@
title: ASUS KGPE-D16 server/workstation board
...
-This is a server board using AMD hardware (Fam10h **and Fam15h** CPUs
+This is a server board using AMD hardware (Fam10h *and Fam15h* CPUs
available). It can also be used for building a high-powered workstation.
Powered by libreboot. The coreboot port was done by Timothy Pearson of
Raptor Engineering Inc. and, working with them (and sponsoring the
work), merged into libreboot.
-**Memory initialization is still problematic, for some modules. We
-recommend avoiding Kingston modules.**
+*Memory initialization is still problematic, for some modules. We
+recommend avoiding Kingston modules.*
Flashing instructions can be found at
[../install/\#flashrom](../install/#flashrom) - note that external
@@ -21,8 +21,8 @@ KGPE-D16, without using external hardware.
CPU compatibility
=================
-**Use Opteron 6200 series (works without microcode updates, including hw
-virt).** 6300 series needs microcode updates, so avoid those CPUs. 6100
+*Use Opteron 6200 series (works without microcode updates, including hw
+virt).* 6300 series needs microcode updates, so avoid those CPUs. 6100
series is too old, and mostly untested.
Board status (compatibility) {#boardstatus}
@@ -59,9 +59,9 @@ boot that, loading it into memory.
Libreboot has configs for 2, 4, 8 and 16 MiB flash chip sizes (default
flash chip is 2MiB).
-**DO NOT hot-swap the chip with your bare hands. Use a P-DIP 8 chip
+*DO NOT hot-swap the chip with your bare hands. Use a P-DIP 8 chip
extractor. These can be found online. See
-<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>**
+<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>*
Native graphics initialization {#graphics}
==============================
@@ -101,15 +101,15 @@ The information here is adapted, from the ASUS website.
- 2 CPU sockets (G34 compatible)
- HyperTransport™ Technology 3.0
- CPUs supported:
- - AMD Opteron 6100 series (Fam10h. No IOMMU support. **Not**
+ - AMD Opteron 6100 series (Fam10h. No IOMMU support. *Not*
recommended - old. View errata datasheet here:
<http://support.amd.com/TechDocs/41322_10h_Rev_Gd.pdf>)
- AMD Opteron 6200 series (Fam15h, with full IOMMU support in
- libreboot - **highly recommended - fast, and works well without
- microcode updates, including virtualization**)
+ libreboot - *highly recommended - fast, and works well without
+ microcode updates, including virtualization*)
- AMD Opteron 6300 series (Fam15h, with full IOMMU support in
- libreboot. **AVOID LIKE THE PLAGUE - virtualization is broken
- without microcode updates.**
+ libreboot. *AVOID LIKE THE PLAGUE - virtualization is broken
+ without microcode updates.*
- NOTE: 6300 series CPUs have buggy microcode built-in, and
libreboot recommends avoiding the updates. The 6200 series CPUs
have more reliable microcode. Look at this errata datasheet:
@@ -124,27 +124,27 @@ The information here is adapted, from the ASUS website.
### Memory compatibility (with libreboot)
-- **Total Slots:** 16 (4-channel per CPU, 8 DIMM per CPU), ECC
-- **Capacity:** Maximum up to 256GB RDIMM
-- **Memory Type that is compatible:**
+- *Total Slots:* 16 (4-channel per CPU, 8 DIMM per CPU), ECC
+- *Capacity:* Maximum up to 256GB RDIMM
+- *Memory Type that is compatible:*
- DDR3 1600/1333/1066/800 UDIMM\*
- DDR3 1600/1333/1066/800 RDIMM\*
-- **Compatible sizes per memory module:**
+- *Compatible sizes per memory module:*
- 16GB, 8GB, 4GB, 3GB, 2GB, 1GB RDIMM
- 8GB, 4GB, 2GB, 1GB UDIMM
### Expansion slots
-- **Total slot:** 6
-- **Slot Location 1:** PCI 32bit/33MHz
-- **Slot Location 2:** PCI-E x16 (Gen2 X8 Link)
-- **Slot Location 3:** PCI-E x16 (Gen2 X16 Link), Auto switch to x8
+- *Total slot:* 6
+- *Slot Location 1:* PCI 32bit/33MHz
+- *Slot Location 2:* PCI-E x16 (Gen2 X8 Link)
+- *Slot Location 3:* PCI-E x16 (Gen2 X16 Link), Auto switch to x8
link if slot 2 is occupied
-- **Slot Location 4:** PCI-E x8 (Gen2 X4 Link)
-- **Slot Location 5:** PCI-E x16 (Gen2 X16 Link)
-- **Slot Location 6:** PCI-E x16 (Gen2 X16 Link), Auto turn off if
+- *Slot Location 4:* PCI-E x8 (Gen2 X4 Link)
+- *Slot Location 5:* PCI-E x16 (Gen2 X16 Link)
+- *Slot Location 6:* PCI-E x16 (Gen2 X16 Link), Auto turn off if
slot 5 is occupied, For 1U FH/FL Card, MIO supported
-- **Additional Slot 1:** PIKE slot (for SAS drives. See notes above)
+- *Additional Slot 1:* PIKE slot (for SAS drives. See notes above)
- Follow SSI Location\#
### Form factor {#form-factor}
@@ -158,10 +158,10 @@ The information here is adapted, from the ASUS website.
### Storage
-- **SATA controller:**
+- *SATA controller:*
- AMD SP5100
- 6 x SATA2 300MB/s
-- **SAS/SATA Controller:**
+- *SAS/SATA Controller:*
- ASUS PIKE2008 3Gbps 8-port SAS card included
### Networking
@@ -195,9 +195,9 @@ The information here is adapted, from the ASUS website.
### Environment
-- **Operation temperature:** 10C \~ 35C
-- **Non operation temperature:** -40C \~ 70C
-- **Non operation humidity:** 20% \~ 90% ( Non condensing)
+- *Operation temperature:* 10C \~ 35C
+- *Non operation temperature:* -40C \~ 70C
+- *Non operation humidity:* 20% \~ 90% ( Non condensing)
### Monitoring
@@ -211,8 +211,6 @@ The information here is adapted, from the ASUS website.
Copyright © 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/r400.md b/docs/hardware/r400.md
index f8c1f213..4e0a0b19 100644
--- a/docs/hardware/r400.md
+++ b/docs/hardware/r400.md
@@ -11,9 +11,9 @@ There are two possible flash chip sizes for the R400: 4MiB (32Mbit) or
8MiB (64Mbit). This can be identified by the type of flash chip below
the palmrest: 4MiB is SOIC-8, 8MiB is SOIC-16.
-**The R400 laptops come with the ME (and sometimes AMT in addition)
+*The R400 laptops come with the ME (and sometimes AMT in addition)
before flashing libreboot. Libreboot disables and removes it by using a
-modified descriptor: see [gm45\_remove\_me.md](gm45_remove_me.md)**
+modified descriptor: see [gm45\_remove\_me.md](gm45_remove_me.md)*
(contains notes, plus instructions)
Flashing instructions can be found at
@@ -63,8 +63,6 @@ TODO: put hardware register logs here like on the [X200](x200.md) and
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/t400.md b/docs/hardware/t400.md
index b30c436b..7464f682 100644
--- a/docs/hardware/t400.md
+++ b/docs/hardware/t400.md
@@ -11,9 +11,9 @@ There are two possible flash chip sizes for the T400: 4MiB (32Mbit) or
8MiB (64Mbit). This can be identified by the type of flash chip below
the palmrest: 4MiB is SOIC-8, 8MiB is SOIC-16.
-**The T400 laptops come with the ME (and sometimes AMT in addition)
+*The T400 laptops come with the ME (and sometimes AMT in addition)
before flashing libreboot. Libreboot disables and removes it by using a
-modified descriptor: see [gm45\_remove\_me.md](gm45_remove_me.md)**
+modified descriptor: see [gm45\_remove\_me.md](gm45_remove_me.md)*
(contains notes, plus instructions)
Flashing instructions can be found at
@@ -66,7 +66,7 @@ The coreboot wiki
collect various logs useful in porting to new boards. Following are
outputs from the T400:
-- T400 with **Winbond W25X64** flash chip (8MiB, SOIC-16) and Lenovo
+- T400 with *Winbond W25X64* flash chip (8MiB, SOIC-16) and Lenovo
BIOS 2.02 (EC firmware 1.01):
- [../future/dumps/logs-t400-bios2.02-ec1.01/](../future/dumps/logs-t400-bios2.02-ec1.01/)
@@ -75,8 +75,6 @@ outputs from the T400:
Copyright © 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/t500.md b/docs/hardware/t500.md
index 66d6a37d..fdbca0d1 100644
--- a/docs/hardware/t500.md
+++ b/docs/hardware/t500.md
@@ -13,9 +13,9 @@ There are two possible flash chip sizes for the T500: 4MiB (32Mbit) or
8MiB (64Mbit). This can be identified by the type of flash chip below
the palmrest: 4MiB is SOIC-8, 8MiB is SOIC-16.
-**The T500 laptops come with the ME (and sometimes AMT in addition)
+*The T500 laptops come with the ME (and sometimes AMT in addition)
before flashing libreboot. Libreboot disables and removes it by using a
-modified descriptor: see [gm45\_remove\_me.md](gm45_remove_me.md)**
+modified descriptor: see [gm45\_remove\_me.md](gm45_remove_me.md)*
(contains notes, plus instructions)
Flashing instructions can be found at
@@ -72,6 +72,7 @@ The patches above are based on the output from ich9deblob on a
factory.rom image dumped from the T500 with a SOIC-8 4MiB flash chip.
The patch re-creates the X200 descriptor/gbe source, so the commands
were something like:
+
$ diff -u t500gbe x200gbe
$ diff -u t500descriptor x200descriptor
@@ -90,14 +91,12 @@ The coreboot wiki
collect various logs useful in porting to new boards. Following are
outputs from the T500:
-- T500 with **Macronix MX25L3205D** flash chip (4MiB, SOIC-8) and
+- T500 with *Macronix MX25L3205D* flash chip (4MiB, SOIC-8) and
Lenovo BIOS 3.13 7VET83WW (EC firmware 1.06):
- [../future/dumps/t500log/](../future/dumps/t500log/)
Copyright © 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/hardware/x200.md b/docs/hardware/x200.md
index 30cc05a0..be4c2a38 100644
--- a/docs/hardware/x200.md
+++ b/docs/hardware/x200.md
@@ -5,18 +5,17 @@ title: ThinkPad X200
It is believed that all X200 laptops are compatible. X200S and X200
Tablet will also work, [depending on the configuration](#x200s).
-It \*might\* be possible to put an X200 motherboard in an X201 chassis,
-though this is currently untested by the libreboot project. The same may
-also apply between X200S and X201S; again, this is untested. **It's
-most likely true.**
+It may be possible to put an X200 motherboard in an X201 chassis, though this
+is currently untested by the libreboot project. The same may also apply between
+X200S and X201S; again, this is untested. *It's most likely true.*
There are two possible flash chip sizes for the X200: 4MiB (32Mbit) or
8MiB (64Mbit). This can be identified by the type of flash chip below
the palmrest: 4MiB is SOIC-8, 8MiB is SOIC-16.
-**The X200 laptops come with the ME (and sometimes AMT in addition)
+*The X200 laptops come with the ME (and sometimes AMT in addition)
before flashing libreboot. Libreboot disables and removes it by using a
-modified descriptor: see [gm45\_remove\_me.md](gm45_remove_me.md)**
+modified descriptor: see [gm45\_remove\_me.md](gm45_remove_me.md)*
(contains notes, plus instructions)
Flashing instructions can be found at
@@ -33,6 +32,8 @@ will update both the BIOS and EC version. See:
- [../install/#flashrom](../install/#flashrom)
- <http://www.thinkwiki.org/wiki/BIOS_update_without_optical_disk>
+- [X200, X200s, X200si BIOS Update](http://pcsupport.lenovo.com/au/en/products/laptops-and-netbooks/thinkpad-x-series-laptops/thinkpad-x200/downloads/ds015007)
+- [X200t BIOS Update](http://pcsupport.lenovo.com/au/en/products/laptops-and-netbooks/thinkpad-x-series-tablet-laptops/thinkpad-x200-tablet/downloads/ds018814)
NOTE: this can only be done when you are using Lenovo BIOS. How to
update the EC firmware while running libreboot is unknown. Libreboot
@@ -93,10 +94,10 @@ and work.
This suspicion was confirmed with the following log:
[text/x200s/cblog01.txt](text/x200s/cblog01.txt). The memory modules in
-this case are 2x4GB. ~~**However, not all configurations work:
+this case are 2x4GB. ~~*However, not all configurations work:
[text/x200s/cblog02.txt](text/x200s/cblog02.txt) (2x2GB) and
[text/x200s/cblog03.txt](text/x200s/cblog03.txt) (1x2GB) show a failed
-bootup.**~~ *False alarm. The modules were mixed (non-matching). X200S
+bootup.*~~ *False alarm. The modules were mixed (non-matching). X200S
with high-performance mode CPU will work so long as you use matching
memory modules (doesn't matter what size).*
@@ -157,12 +158,12 @@ just simply remove the digitizer).
- Samsung LTN121AP02-001 - common to find, cheap
-**If your X200 has an LED backlit panel in it, then you also need to get
+*If your X200 has an LED backlit panel in it, then you also need to get
an inverter and harness cable that is compatible with the CCFL panels.
To see which panel type you have, see
[\#led\_howtotell](#led_howtotell). If you need the inverter/cable, here
are part numbers: 44C9909 for CCFL LVDS cable with bluetooth and camera
-connections, and 42W8009 or 42W8010 for the inverter.**
+connections, and 42W8009 or 42W8010 for the inverter.*
There are glossy and matte versions of these. Matte means anti-glare,
which is what you want (in this authors opinion).
@@ -176,29 +177,27 @@ Sources:
X200](http://forum.thinkpads.com/viewtopic.php?f=2&t=84941)
- [ThinkPad Forums - Parts for X200 AFFS
Mod](http://forum.thinkpads.com/viewtopic.php?p=660662#p660662)
-- [ThinkWiki.de - X200
- Displayumbau](http://thinkwiki.de/X200_Displayumbau)
+- [ThinkWiki.de - X200 Displayumbau](http://thinkwiki.de/X200_Displayumbau)
### X200S
-<http://forum.thinkpads.com/viewtopic.php?p=618928#p618928> explains
-that the X200S screens/assemblies are thinner. You need to replace the
-whole lid with one from a normal X200/X201.
+<http://forum.thinkpads.com/viewtopic.php?p=618928#p618928> explains that the
+X200S screens/assemblies are thinner. You need to replace the whole lid with
+one from a normal X200/X201.
How to tell if it has an LED or CCFL? {#led_howtotell}
-------------------------------------
-Some X200s have a CCFL backlight and some have an LED backlight, in
-their LCD panel. This also means that the inverters will vary, so you
-must be careful if ever replacing either the panel and/or inverter. (a
-CCFL inverter is high-voltage and will destroy an LED backlit panel).
+Some X200s have a CCFL backlight and some have an LED backlight, in their LCD
+panel. This also means that the inverters will vary, so you must be careful if
+ever replacing either the panel and/or inverter. (a CCFL inverter is
+high-voltage and will destroy an LED backlit panel).
-CCFLs contain mercury. An X200 with a CCFL backlight will (****unless it
-has been changed to an LED, with the correct inverter. Check with your
-supplier!) the following: *"This product contains Lithium Ion Battery,
-Lithium Battery and a lamp which contains mercury; dispose according to
-local, state or federal laws"* (one with an LED backlit panel will say
-something different).
+CCFLs contain mercury. An X200 with a CCFL backlight will (unless it has been
+changed to an LED, with the correct inverter. Check with your supplier!) say
+the following: *"This product contains Lithium Ion Battery, Lithium Battery and
+a lamp which contains mercury; dispose according to local, state or federal
+laws"* (one with an LED backlit panel will say something different).
Hardware register dumps {#regdumps}
-----------------------
@@ -226,9 +225,11 @@ be useful for RAM compatibility info (note: coreboot raminit is
different, so this page might be BS)
pehjota started collecting some steppings for different CPUs on several
-X200 laptops. You can get the CPUID by running:\
-\$ **dmesg | sed -n 's/\^.\* microcode: CPU0
-sig=0x\\(\[\^,\]\*\\),.\*\$/\\1/p'**
+X200 laptops. You can get the CPUID by running:
+
+ # dmesg | sed -n 's/\^.\* microcode: CPU0
+
+sig=0x\\(\[\^,\]\*\\),.\*\$/\\1/p'
What pehjota wrote: The laptops that have issues resuming from suspend,
as well as a laptop that (as I mentioned earlier in \#libreboot) won't
@@ -246,11 +247,12 @@ the two CPUIDs and steppings for Intel Core 2 Duo P8xxx CPUs with
factory microcode. (1067 is the family and model, and 6 or A is the
stepping ID.)
-**TODO: check the CPUIDs and test S3 resume and/or KVM on any C2D
+*TODO: check the CPUIDs and test S3 resume and/or KVM on any C2D
systems (including non-P8xxx ones, which I don't have here) you have
-available. I'd be curious if you could confirm these results.** It
-might not be coreboot that's buggy with raminit/S3; it might just be
-down to the microcode updates.
+available. I'd be curious if you could confirm these results.*
+
+It might not be coreboot that's buggy with raminit/S3; it might just be down to
+the microcode updates.
Unsorted notes {#unsorted}
--------------
@@ -264,8 +266,6 @@ Unsorted notes {#unsorted}
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
Copyright © 2015 Patrick "P. J." McDermott <pj@pehjota.net>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/index.md b/docs/index.md
index c9ecbc33..64bad0fe 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -56,7 +56,7 @@ in the flash chip and more.
The libreboot project has three main goals:
-------------------------------------------
-- ***Recommend and distribute only free software***. Coreboot
+- *Recommend and distribute only free software*. Coreboot
distributes certain pieces of proprietary software which is needed
on some systems. Examples can include things like CPU microcode
updates, memory initialization blobs and so on. The coreboot project
@@ -64,12 +64,12 @@ The libreboot project has three main goals:
such as the Video BIOS or Intel's *Management Engine*. However, a
lot of dedicated and talented individuals in coreboot work hard to
replace these blobs whenever possible.
-- ***Support as much hardware as possible!*** Libreboot supports less
+- *Support as much hardware as possible!* Libreboot supports less
hardware than coreboot, because most systems from coreboot still
require certain proprietary software to work properly. Libreboot is
an attempt to support as much hardware as possible, without any
proprietary software.
-- ***Make coreboot easy to use***. Coreboot is notoriously difficult
+- *Make coreboot easy to use*. Coreboot is notoriously difficult
to install, due to an overall lack of user-focussed documentation
and support. Most people will simply give up before attempting to
install coreboot.
@@ -128,23 +128,25 @@ How do I know what version I'm running? {#version}
If you are at least 127 commits after release 20150518 (commit message
*build/roms/helper: add version information to CBFS*) (or you have any
-**upstream** stable release of libreboot after 20150518), then you can
+*upstream* stable release of libreboot after 20150518), then you can
press C at the GRUB console, and use this command to find out what
-version of libreboot you have:\
-**cat (cbfsdisk)/lbversion**\
+version of libreboot you have:
+
+ cat (cbfsdisk)/lbversion
+
This will also work on non-release images (the version string is
-automatically generated, using *git describe --tags HEAD*), built from
-the git repository. A file named *version* will also be included in the
+automatically generated, using `git describe --tags HEAD`), built from
+the git repository. A file named `version` will also be included in the
archives that you downloaded (if you are using release archives).
-If it exists, you can also extract this *lbversion* file by using the
-*cbfstool* utility which libreboot includes, from a ROM image that you
+If it exists, you can also extract this `lbversion` file by using the
+`cbfstool` utility which libreboot includes, from a ROM image that you
either dumped or haven't flashed yet. In your distribution, run
-cbfstool on your ROM image (*libreboot.rom*, in this example):
+cbfstool on your ROM image (`libreboot.rom`, in this example):
$ ./cbfstool libreboot.rom extract -n lbversion -f lbversion
-You will now have a file, named *lbversion*, which you can read in
+You will now have a file, named `lbversion`, which you can read in
whatever program it is that you use for reading/writing text files.
For git, it's easy. Just check the git log.
@@ -153,8 +155,10 @@ For releases on or below 20150518, or snapshots generated from the git
repository below 127 commits after 20150518, you can find a file named
*commitid* inside the archives. If you are using pre-built ROM images
from the libreboot project, you can press C in GRUB for access to the
-terminal, and then run this command:\
-**lscoreboot**\
+terminal, and then run this command:
+
+ lscoreboot
+
You may find a date in here, detailing when that ROM image was built.
For pre-built images distributed by the libreboot project, this is a
rough approximation of what version you have, because the version
@@ -180,8 +184,6 @@ libreboot.
Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/bbb_setup.md b/docs/install/bbb_setup.md
index 1182bb16..18f0c7be 100644
--- a/docs/install/bbb_setup.md
+++ b/docs/install/bbb_setup.md
@@ -8,15 +8,15 @@ flash chip with the BeagleBone Black, using the
rev. C was used when creating this guide, but earlier revisions may also
work.
-**NOTE: this documentation may be outdated, and discusses configuring
+*NOTE: this documentation may be outdated, and discusses configuring
SPI flashing on the default Debian system that the BBB sometimes comes
with. If you want an easier time, just use [BBB
ScrewDriver](https://www.coreboot.org/BBB_screwdriver) which comes
-pre-configured.**
+pre-configured.*
-**This guide is written for Debian Wheezy 7.5, which is what came on the
+*This guide is written for Debian Wheezy 7.5, which is what came on the
BBB at the time this guide was written. This one:
-<https://debian.beagleboard.org/images/bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img.xz>**
+<https://debian.beagleboard.org/images/bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img.xz>*
There was no justification for a further section for the Teensy. Simply
refer to [this page on
@@ -28,7 +28,7 @@ flashing on the ThinkPad X200, but it should work for other targets.
here is a photo of the setup for the teensy:
<http://h5ai.swiftgeek.net/IMG_20160601_120855.jpg>
-Onto the Beaglebone black\...
+Onto the Beaglebone black...
Hardware requirements
=====================
@@ -36,7 +36,7 @@ Hardware requirements
Shopping list (pictures of this hardware is shown later):
- A [Flashrom](http://flashrom.org)-compatible external SPI
- programmer: **BeagleBone Black**, sometimes referred to as 'BBB',
+ programmer: *BeagleBone Black*, sometimes referred to as 'BBB',
(rev. C) is highly recommended. You can buy one from
[Adafruit](https://www.adafruit.com) (USA),
[ElectroKit](http://electrokit.com) (Sweden) or any of the
@@ -52,30 +52,30 @@ Shopping list (pictures of this hardware is shown later):
bottom half of a [hammond plastic
enclosure](http://www.hammondmfg.com/1593HAM.htm#BeagleBoneBlack).
- Clip for connecting to the flash chip: if you have a SOIC-16 flash
- chip (16 pins), you will need the **Pomona 5252** or equivalent. For
- SOIC-8 flash chips (8 pins), you will need the **Pomona 5250** or
+ chip (16 pins), you will need the *Pomona 5252* or equivalent. For
+ SOIC-8 flash chips (8 pins), you will need the *Pomona 5250* or
equivalent. Do check which chip you have, before ordering a clip.
Also, you might as well buy two clips or more since they break
easily. [Farnell element 14](http://farnell.com/) sells these and
ships to many countries. Some people find these clips difficult to
get hold of, especially in South America. If you know of any good
suppliers, please contact the libreboot project with the relevant
- information. **If you can't get hold of a pomona clip, some other
+ information. *If you can't get hold of a pomona clip, some other
clips might work, e.g. 3M, but they are not always reliable. You can
also directly solder the wires to the chip, if that suits you; the
- clip is just for convenience, really.**
-- **External 3.3V DC power supply**, for powering the flash chip: an
+ clip is just for convenience, really.*
+- *External 3.3V DC power supply*, for powering the flash chip: an
ATX power supply / PSU (common on Intel/AMD desktop computers) will
work for this. A lab PSU (DC) will also work (adjusted to 3.3V).
- Getting a multimeter might be worthwhile, to verify that it's
supplying 3.3V.
-- **External 5V DC power supply** (barrel connector), for powering the
+- *External 5V DC power supply* (barrel connector), for powering the
BBB: the latter can have power supplied via USB, but a dedicated
power supply is recommended. These should be easy to find in most
- places that sell electronics. **OPTIONAL. Only needed if not
+ places that sell electronics. OPTIONAL. Only needed if not
powering with the USB cable, or if you want to use [EHCI
- debug](../misc/bbb_ehci.md)**.
-- **Pin header / jumper cables** (2.54mm / 0.1" headers): you should
+ debug](../misc/bbb_ehci.md).
+- *Pin header / jumper cables* (2.54mm / 0.1" headers): you should
get male--male, male--female and female--female cables in 10cm
size. Just get a load of them. Other possible names for these
cables/wires/leads are as follows:
@@ -84,20 +84,20 @@ Shopping list (pictures of this hardware is shown later):
- You might also be able to make these cables yourself.
[Adafruit](https://www.adafruit.com) sell them, as do many others.
- **Some people find them difficult to buy. Please contact the
- libreboot project if you know of any good sellers.** You might also
+ *Some people find them difficult to buy. Please contact the
+ libreboot project if you know of any good sellers.* You might also
be able to make these cables yourself. For PSU connections, using
long cables, e.g. 20cm, is fine, and you can extend them longer than
that if needed.
-- **Mini USB A-B cable** (the BeagleBone probably already comes with
- one.) - **OPTIONAL - only needed for [EHCI
+- *Mini USB A-B cable* (the BeagleBone probably already comes with
+ one.) - *OPTIONAL - only needed for [EHCI
debug](../misc/bbb_ehci.md) or for serial/ssh access without
- ethernet cable (g\_multi kernel module)**
-- **FTDI TTL cable or debug board**: used for accessing the serial
+ ethernet cable (g\_multi kernel module)*
+- *FTDI TTL cable or debug board*: used for accessing the serial
console on the BBB. [This
page](http://elinux.org/Beagleboard:BeagleBone_Black_Serial)
- contains a list. **OPTIONAL\---only needed for serial console on
- the BBB, if not using SSH via ethernet cable.**
+ contains a list. *OPTIONAL\---only needed for serial console on
+ the BBB, if not using SSH via ethernet cable.*
Setting up the 3.3V DC PSU
==========================
@@ -112,13 +112,13 @@ Short PS\_ON\# / Power on (green wire; pin 16 on 24-pin ATX PSU, or pin
it) using a wire/paperclip/jumper, then power on the PSU by grounding
PS\_ON\# (this is also how an ATX motherboard turns on a PSU).
-**DO \*\*NOT\*\* use pin 4, 6, do \*\*NOT\*\* use pin 19 or 20 (on a
-20-pin ATX PSU), and DO \*\*NOT\*\* use pin 21, 22 or 23 (on a 24-pin
-ATX PSU). Those wires (the red ones) are 5V, and they \*\*WILL\*\* kill
-your flash chip. \*\*\*NEVER\*\*\* supply more than 3.3V to your flash
+*DO NOT use pin 4, 6, do NOT use pin 19 or 20 (on a
+20-pin ATX PSU), and DO NOT use pin 21, 22 or 23 (on a 24-pin
+ATX PSU). Those wires (the red ones) are 5V, and they WILL kill
+your flash chip. NEVER supply more than 3.3V to your flash
chip (that is, if it's a 3.3V flash chip; 5V and 1.8V SPI flash chips
do exist, but they are rare. Always check what voltage your chip takes.
-Most of them take 3.3V).**
+Most of them take 3.3V).*
You only need one 3.3V supply and one ground for the flash chip, after
grounding PS\_ON\#.
@@ -150,12 +150,14 @@ Alternatives to SSH (in case SSH fails)
You can also use a serial FTDI debug board with GNU Screen, to access
the serial console.
# screen /dev/ttyUSB0 115200
+
Here are some example photos:\
![](images/x200/ftdi.jpg) ![](images/x200/ftdi_port.jpg)\
You can also connect the USB cable from the BBB to another computer and
a new network interface will appear, with its own IP address. This is
directly accessible from SSH, or screen:
+
# screen /dev/ttyACM0 115200
You can also access the uboot console, using the serial method instead
@@ -197,19 +199,21 @@ contents of this file with:
/usr/bin/led_acc &
fi
-Run **apt-get update** and **apt-get upgrade** then reboot the BBB,
+Run `apt-get update` and `apt-get upgrade` then reboot the BBB,
before continuing.
Check that the firmware exists:
- # ls /lib/firmware/BB-SPI0-01-00A0.\*
+ # ls /lib/firmware/BB-SPI0-01-00A0.
+
Output:
/lib/firmware/BB-SPI0-01-00A0.dtbo
Then:
- # echo BB-SPI0-01 > /sys/devices/bone\_capemgr.\*/slots
- # cat /sys/devices/bone\_capemgr.\*/slots
+ # echo BB-SPI0-01 > /sys/devices/bone_capemgr./slots
+ # cat /sys/devices/bone_capemgr./slots
+
Output:
0: 54:PF---
@@ -222,15 +226,16 @@ Output:
Verify that the spidev device now exists:
- # ls -al /dev/spid\*
+ # ls -al /dev/spid
+
Output:
crw-rw---T 1 root spi 153, 0 Nov 19 21:07 /dev/spidev1.0
Now the BBB is ready to be used for flashing. Make this persist across
reboots:\
-In /etc/default/capemgr add **CAPE=BB-SPI0-01** at the end (or change
-the existing **CAPE=** entry to say that, if an entry already exists.
+In /etc/default/capemgr add `CAPE=BB-SPI0-01` at the end (or change
+the existing `CAPE=` entry to say that, if an entry already exists.
Get flashrom from the libreboot\_util release archive, or build it from
libreboot\_src/git if you need to. An ARM binary (statically compiled)
@@ -246,7 +251,8 @@ your BBB.
Now test flashrom:
- # ./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512
+
Output:
Calibrating delay loop... OK.
@@ -311,18 +317,18 @@ for SOIC-8 (clip: Pomona 5250):
WP 3-6 SCK
GND 4-5 MOSI
-**NC = no connection**
+`NC = no connection`
-**DO NOT connect 3.3V (PSU) yet. ONLY connect this once the pomona is
-connected to the flash chip.**
+*DO NOT connect 3.3V (PSU) yet. ONLY connect this once the pomona is
+connected to the flash chip.*
-**You also need to connect the BLACK wire (ground/earth) from the 3.3V
+*You also need to connect the BLACK wire (ground/earth) from the 3.3V
PSU to pin 2 on the BBB (P9 header). It is safe to install this now
(that is, before you connect the pomona to the flash chip); in fact, you
-should.**
+should.*
if you need to extend the 3.3v psu leads, just use the same colour M-F
-leads, **but** keep all other leads short (10cm or less)
+leads, *but* keep all other leads short (10cm or less)
You should now have something that looks like this:\
![](images/x200/5252_bbb0.jpg) ![](images/x200/5252_bbb1.jpg)
@@ -331,8 +337,6 @@ Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
Copyright © 2015 Patrick "P. J." McDermott <pj@pehjota.net>\
Copyright © 2015 Albin Söderqvist\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/c201.md b/docs/install/c201.md
index 2e1d23b8..4bb0583b 100644
--- a/docs/install/c201.md
+++ b/docs/install/c201.md
@@ -1,5 +1,6 @@
---
title: ASUS Chromebook C201 installation guide
+x-toc-enable: true
...
These instructions are for installing Libreboot to the ASUS Chromebook
@@ -7,44 +8,32 @@ C201. Since the device ships with Coreboot, the installation
instructions are the same before and after flashing Libreboot for the
first time.
-**If you are using libreboot\_src or git, then make sure that you built
-the sources first (see [../git/\#build](../git/#build)).**
+*If you are using libreboot\_src or git, then make sure that you built
+the sources first (see [../git/\#build](../git/#build)).*
Look at the [list of ROM images](#rom) to see which image is compatible
with your device.
Libreboot can be installed internally from the device, with sufficient
-privileges. The installation process requires using **Google's modified
-version of flashrom**, that has support for reflashing the Chromebook's
+privileges. The installation process requires using *Google's modified
+version of flashrom*, that has support for reflashing the Chromebook's
SPI flash. Otherwise, flashing externally will work with the upstream
flashrom version.
-**Google's modified version of flashrom** is free software and its
+*Google's modified version of flashrom* is free software and its
source code is made available by Google:
[flashrom](https://chromium.googlesource.com/chromiumos/third_party/flashrom/).\
It is not distributed along with Libreboot yet. However, it is
preinstalled on the device, with ChromeOS.
-Installing Libreboot internally requires sufficient privileges on the
-system installed on the device.\
-When the device has ChromeOS installed (as it does initially), it is
-necessary to gain root privileges in ChromeOS, to be able to access a
-root shell.
-
-- [Gaining root privileges on ChromeOS](#root_chromeos)
-- [Preparing the device for the installation](#preparing_device)
- - [Configuring verified boot
- parameters](#configuring_verified_boot_parameters)
- - [Removing the write protect
- screw](#removing_write_protect_screw)
-- [Installing Libreboot to the SPI flash]()
- - [Installing Libreboot internally, from the
- device](#installing_libreboot_internally)
- - [Installing Libreboot externally, with a SPI flash
- programmer](#installing_libreboot_externally)
-- [Debian GNU+Linux is recommended for this device](#debian)
+Installing Libreboot internally requires sufficient privileges on the system
+installed on the device. When the device has ChromeOS installed (as it does
+initially), it is necessary to gain root privileges in ChromeOS, to be able to
+access a root shell.
Gaining root privileges on ChromeOS
+--------------------------------
+
In order to gain root privileges on ChromeOS, developer mode has to be
enabled from the recovery mode screen and debugging features have to be
enabled in ChromeOS.
@@ -57,25 +46,25 @@ dedicated to [depthcharge](../depthcharge/).
Once developer mode is enabled, the device will boot to the [developer
mode screen](../depthcharge/#developer_mode_screen). ChromeOS can be
booted by waiting for 30 seconds (the delay is shortened in Libreboot)
-or by pressing **Ctrl + D**
+or by pressing *Ctrl + D*
After the system has booted, root access can be enabled by clicking on
-the **Enable debugging features** link. A confirmation dialog will ask
+the *Enable debugging features* link. A confirmation dialog will ask
whether to proceed.\
-After confirming by clicking **Proceed**, the device will reboot and ask
+After confirming by clicking *Proceed*, the device will reboot and ask
for the root password to set. Finally, the operation has to be confirmed
-by clicking **Enable**.
+by clicking *Enable*.
After setting the root password, it becomes possible to log-in as root.
-A tty prompt can be obtained by pressing **Ctrl + Alt + Next**. The
-**Next** key is the one on the top left of the keyboard.
+A tty prompt can be obtained by pressing *Ctrl + Alt + Next*. The
+*Next* key is the one on the top left of the keyboard.
Preparing the device for the installation
Before installing Libreboot on the device, both its software and
hardware has to be prepared to allow the installation procedure and to
ensure that security features don't get in the way.
-Configuring verified boot parameters {#configuring_verified_boot_parameters}
+Configuring verified boot parameters
------------------------------------
It is recommended to have access to the [developer mode
@@ -89,7 +78,7 @@ parameters](../depthcharge/#configuring_verified_boot_parameters):
Those changes can be reverted later, when the device is known to be in a
working state.
-Removing the write protect screw {#removing_write_protect_screw}
+Removing the write protect screw
--------------------------------
Since part of the SPI flash is write-protected by a screw, it is
@@ -99,8 +88,8 @@ writing Libreboot to the *read-only* part of the flash.
To access the screw, the device has to be opened. There are 8 screws to
remove from the bottom of the device, as shown on the picture below. Two
are hidden under the top pads. After removing the screws, the keyboard
-plastic part can be carefully detached from the rest. **Beware: there
-are cables attached to it!** It is advised to flip the keyboard plastic
+plastic part can be carefully detached from the rest. *Beware: there
+are cables attached to it!* It is advised to flip the keyboard plastic
part over, as shown on the picture below. The write protect screw is
located next to the SPI flash chip, circled in red in the picture below.
It has to be removed.
@@ -111,7 +100,7 @@ screw](images/c201/wp-screw.jpg)](images/c201/wp-screw.jpg)
The write protect screw can be put back in place later, when the device
is known to be in a working state.
-Installing Libreboot to the SPI flash {#installing_libreboot_spi_flash}
+Installing Libreboot to the SPI flash
=====================================
The SPI flash (that holds Libreboot) is divided into various partitions
@@ -119,28 +108,32 @@ that are used to implement parts of the CrOS security system. Libreboot
is installed in the *read-only* coreboot partition, that becomes
writable after removing the write-protect screw.
-Installing Libreboot internally, from the device {#installing_libreboot_internally}
+Installing Libreboot internally, from the device
------------------------------------------------
Before installing Libreboot to the SPI flash internally, the device has
to be reassembled.
-All the files from the **veyron\_speedy** release (or build) have to be
+All the files from the `veyron_speedy` release (or build) have to be
transferred to the device.
The following operations have to be executed with root privileges on the
-device (e.g. using the *root* account). In addition, the
-**cros-flash-replace** script has to be made executable:
+device (e.g. using the `root` account). In addition, the
+`cros-flash-replace` script has to be made executable:
+
# chmod a+x cros-flash-replace
The SPI flash has to be read first:
- # flashrom -p host -r flash.img\
-**Note: it might be a good idea to copy the produced flash.img file at
-this point and store it outside of the device for backup purposes.**
-Then, the **cros-flash-replace** script has to be executed as such:
+ # flashrom -p host -r flash.img
+
+*Note: it might be a good idea to copy the produced flash.img file at
+this point and store it outside of the device for backup purposes.*
+
+Then, the `cros-flash-replace` script has to be executed as such:
# ./cros-flash-replace flash.img coreboot ro-frid
+
If any error is shown, it is definitely a bad idea to go further than
this point.
@@ -148,12 +141,13 @@ The resulting flash image can then be flashed back:
# flashrom -p host -w flash.img
-You should also see within the output the following:\
-**"Verifying flash\... VERIFIED."**
+You should also see within the output the following:
+
+ Verifying flash... VERIFIED.
Shut down. The device will now boot to Libreboot.
-Installing Libreboot externally, with a SPI flash programmer {#installing_libreboot_externally}
+Installing Libreboot externally, with a SPI flash programmer
------------------------------------------------------------
Before installing Libreboot to the SPI flash internally, the device has
@@ -161,7 +155,7 @@ to be opened.
The SPI flash is located next to the write protect screw. Its layout is
indicated in the picture below. Note that it is not necessary to connect
-**WP\#** since removing the screw already connects it to ground. Before
+`WP#` since removing the screw already connects it to ground. Before
writing to the chip externally, the battery connector has to be
detached. It is located under the heat spreader, that has to be
unscrewed from the rest of the case. The battery connector is located on
@@ -172,24 +166,26 @@ layout](images/c201/spi-flash-layout.jpg)](images/c201/spi-flash-layout.jpg)
[![Battery
connector](images/c201/battery-connector.jpg)](images/c201/battery-connector.jpg)
-All the files from the **veyron\_speedy** release (or build) have to be
+All the files from the `veyron_speedy` release (or build) have to be
transferred to the host.
The following operations have to be executed with root privileges on the
-host (e.g. using the *root* account). In addition, the
-**cros-flash-replace** script has to be made executable:
+host (e.g. using the `root` account). In addition, the
+`cros-flash-replace` script has to be made executable:
# chmod a+x cros-flash-replace
The SPI flash has to be read first (using the right spi programmer):
# flashrom -p *programmer* -r flash.img
-**Note: it might be a good idea to copy the produced flash.img file at
-this point and store it outside of the device for backup purposes.**
-Then, the **cros-flash-replace** script has to be executed as such:
+*Note: it might be a good idea to copy the produced flash.img file at
+this point and store it outside of the device for backup purposes.*
+
+Then, the `cros-flash-replace` script has to be executed as such:
# ./cros-flash-replace flash.img coreboot ro-frid
+
If any error is shown, it is definitely a bad idea to go further than
this point.
@@ -198,8 +194,9 @@ programmer):
# flashrom -p *programmer* -w flash.img
-You should also see within the output the following:\
-**"Verifying flash\... VERIFIED."**
+You should also see within the output the following:
+
+ Verifying flash... VERIFIED.
The device will now boot to Libreboot.
@@ -211,8 +208,6 @@ See <https://wiki.debian.org/InstallingDebianOn/Asus/C201>.
Copyright © 2015 Paul Kocialkowski <contact@paulk.fr>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/d510mo.md b/docs/install/d510mo.md
index 818b5464..4a03c29c 100644
--- a/docs/install/d510mo.md
+++ b/docs/install/d510mo.md
@@ -9,6 +9,7 @@ Flash chip size {#flashchips}
===============
Use this to find out:
+
# flashrom -p internal -V
Flashing instructions {#clip}
@@ -22,8 +23,6 @@ This is an image of the flash chip, for reference:\
Copyright © 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/d945gclf.md b/docs/install/d945gclf.md
index 4a87b1c3..ddb52a64 100644
--- a/docs/install/d945gclf.md
+++ b/docs/install/d945gclf.md
@@ -19,8 +19,6 @@ Here is an image of the flash chip:\
Copyright © 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/ga-g41m-es2l.md b/docs/install/ga-g41m-es2l.md
index a11364ed..0330c076 100644
--- a/docs/install/ga-g41m-es2l.md
+++ b/docs/install/ga-g41m-es2l.md
@@ -9,17 +9,18 @@ Flash chip size {#flashchips}
===============
Use this to find out:
+
# flashrom -p internal -V
Flashing instructions {#clip}
=====================
Refer to [bbb\_setup.md](bbb_setup.md) for how to set up the BBB for
-external flashing. **You can only externally reprogram one of the chips
+external flashing. *You can only externally reprogram one of the chips
at a time, and you need to disable the chip that you're not flashing,
by connecting 3v3 to /CS of that chip, so you will actually need 2 test
clips (you also need to connect GND on the chip that you're
-disabling).**
+disabling).*
Here is an image of the flash chip:\
![](../images/ga-g41m-es2l/ga-g41m-es2l.jpg)
@@ -27,11 +28,13 @@ Here is an image of the flash chip:\
Internal flashing is possible. Boot with the proprietary BIOS and
GNU+Linux. There are 2 flash chips (one is backup).
-Flash the first chip:\
-**./flashrom -p internal:dualbiosindex=0 -w libreboot.rom**
+Flash the first chip:
+
+ ./flashrom -p internal:dualbiosindex=0 -w libreboot.rom
+
+Flash the second chip:
-Flash the second chip:\
-**./flashrom -p internal:dualbiosindex=1 -w libreboot.rom**
+ ./flashrom -p internal:dualbiosindex=1 -w libreboot.rom
NOTE: you can still boot the system with just the main flash chip
connected, after desoldering the backup chip. This has been tested while
@@ -46,8 +49,6 @@ operating system.
Copyright © 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/images/x200/disassembly/0006.1.jpg b/docs/install/images/x200/disassembly/0006.1.jpg
new file mode 100644
index 00000000..1888012b
--- /dev/null
+++ b/docs/install/images/x200/disassembly/0006.1.jpg
Binary files differ
diff --git a/docs/install/index.md b/docs/install/index.md
index 4bd14cf1..70dd554e 100644
--- a/docs/install/index.md
+++ b/docs/install/index.md
@@ -4,10 +4,10 @@ title: Installation instructions
This section relates to installing Libreboot on supported targets.
-**NOTE: if running flashrom -p internal for software based flashing, and
-you get an error related to /dev/mem access, you should reboot with
-iomem=relaxed kernel parameter before running flashrom, or use a kernel
-that has CONFIG\_STRICT\_DEVMEM not enabled.**
+NOTE: if running `flashrom -p internal` for software based flashing, and you
+get an error related to `/dev/mem` access, you should reboot with
+`iomem=relaxed` kernel parameter before running flashrom, or use a kernel that
+has `CONFIG_STRICT_DEVMEM` not enabled.
Which systems are Libreboot compatible with?
--------------------------------------------
@@ -28,14 +28,11 @@ Flashing via software methods, on system:
- [Apple MacBook2,1](#flashrom_macbook21)
- [ASUS Chromebook C201](c201.md)
-Setting up programmers, for external flashing via hardware method
+Setting up programmers, for external SPI flashing
-----------------------------------------------------------------
-- [How to program an SPI flash chip with the BeagleBone
- Black](bbb_setup.md)
-
-- [How to program an SPI flash chip with the Raspberry
- Pi](rpi_setup.md)
+- [BeagleBone Black Setup](bbb_setup.md)
+- [Raspberry Pi Setup](rpi_setup.md)
Flashing via hardware methods, on system:
-----------------------------------------
@@ -63,15 +60,14 @@ source code. These images are provided for user convenience, so that
they don't have to build anything from source on their own.
The ROM images in each archive use the following at the end of the file
-name, if they are built with the GRUB payload:
-**\_*keymap*\_*mode*.rom**
+name, if they are built with the GRUB payload: `*_*keymap*_*mode*.rom`
-Available *modes*: **vesafb** or **txtmode**. The *vesafb* ROM images
-are recommended, in most cases; *txtmode* ROM images come with
+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.
-*keymap* can be one of several keymaps that keyboard supports (there are
+`keymap` can be one of several keymaps that keyboard supports (there are
quite a few), which affects the keyboard layout configuration that is
used in GRUB. It doesn't matter which ROM image you choose here, as far
as the keymap in GNU+Linux is concerned.
@@ -87,12 +83,10 @@ Libreboot comes with ROM images built for QEMU, by default:
Examples of how to use libreboot ROM images 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**
+ $ 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
+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).
@@ -108,8 +102,8 @@ 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/\#build](../git/#build)).**
+*If you are using `libreboot_src` or git, then make sure that you built the
+sources first (see [../git/\#build](../git/#build)).*
Look at the [list of ROM images](#rom) to see which image is compatible
with your device.
@@ -149,9 +143,9 @@ now have a backup of the old image).
Keeping at least one spare LPC PLCC chip with working firmware on it is
highly recommended, in case of bricks.
-**DO NOT hot-swap the chip with your bare hands. Use a PLCC chip
+*DO NOT hot-swap the chip with your bare hands. Use a PLCC chip
extractor. These can be found online. See
-<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>**
+<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>*
Do check the HCL entry: [../hardware/kfsn4-dre.md](../hardware/kfsn4-dre.md)
@@ -165,9 +159,9 @@ If you already have coreboot or libreboot installed, without write
protection on the flash chip, then you can do it in software (otherwise,
see link above).
-**DO NOT hot-swap the chip with your bare hands. Use a PDIP-8 chip
+*DO NOT hot-swap the chip with your bare hands. Use a PDIP-8 chip
extractor. These can be found online. See
-<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>**
+<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>*
Do check the HCL entry: [../hardware/kgpe-d16.md](../hardware/kgpe-d16.md)
@@ -181,9 +175,9 @@ If you already have coreboot or libreboot installed, without write
protection on the flash chip, then you can do it in software (otherwise,
see link above).
-**DO NOT hot-swap the chip with your bare hands. Use a PDIP-8 chip
+*DO NOT hot-swap the chip with your bare hands. Use a PDIP-8 chip
extractor. These can be found online. See
-<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>**
+<http://www.coreboot.org/Developer_Manual/Tools#Chip_removal_tools>*
Do check the HCL entry: [../hardware/kcma-d8.md](../hardware/kcma-d8.md)
@@ -215,13 +209,13 @@ 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!
+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/W500)
-----------------------------------------
-**Users of the X200/R400/T400/T500/W500 take note:** The MAC address for the
+*Users of the X200/R400/T400/T500/W500 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, but
this is not what you want. *Make sure to change the MAC address inside
@@ -241,20 +235,21 @@ Apple iMac 5,2?
Internal flashing works, even when flashing from Apple EFI to libreboot.
Continue reading the instructions below.
-**NOTE: If you're flashing an older version of Libreboot, the iMac5,2
+*NOTE: If you're flashing an older version of Libreboot, the iMac5,2
motherboard is compatible with the MacBook2,1. Simply flash a MacBook2,1
-ROM image, and it should work.**
+ROM image, and it should work.*
Flash chip size
---------------
Use this to find out:
+
# flashrom -p internal -V
All good?
---------
-Excellent! Moving on\...
+Excellent! Moving on...
Download the *libreboot\_util.tar.xz* archive, and extract it. Inside,
you will find a directory called *flashrom*. This contains statically
@@ -268,6 +263,7 @@ 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](#rom)
Ocassionally, coreboot changes the name of a given board. If flashrom
@@ -276,88 +272,100 @@ correct ROM image, then run this alternative command:
$ sudo ./flash forceupdate [yourrom.rom](#rom)
-You should see **"Verifying flash\... VERIFIED."** written at the end
-of the flashrom output. **Shut down** after you see this, and then boot
+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.
ThinkPad X60/T60: Initial installation guide (if running the proprietary firmware) {#flashrom_lenovobios}
==================================================================================
-**This is for the ThinkPad X60 and T60 while running Lenovo BIOS. If you
+*This is for the ThinkPad X60 and T60 while running Lenovo BIOS. If you
already have coreboot or libreboot running, then go to
-[\#flashrom](#flashrom) instead!**
+[\#flashrom](#flashrom) instead!*
-**If you are flashing a Lenovo ThinkPad T60, be sure to read
-[../hardware/\#supported\_t60\_list](../hardware/#supported_t60_list)**
+*If you are flashing a Lenovo ThinkPad T60, be sure to read
+[../hardware/\#supported\_t60\_list](../hardware/#supported_t60_list)*
-**If you are using libreboot\_src or git, then make sure that you built
-the sources first (see [../git/\#build](../git/#build)).**
+*If you are using libreboot\_src or git, then make sure that you built
+the sources first (see [../git/\#build](../git/#build)).*
-**Warning: this guide will not instruct the user how to backup the
+*Warning: this guide will not instruct the user how to backup the
original Lenovo BIOS firmware. These backups are tied to each system,
and will not work on any other. For that, please refer to
-<http://www.coreboot.org/Board:lenovo/x60/Installation>.**
+<http://www.coreboot.org/Board:lenovo/x60/Installation>.*
+
+*If you're using libreboot 20150518, note that there is a mistake in
+the flashing script. do this: *
-**If you're using libreboot 20150518, note that there is a mistake in
-the flashing script. do this: *rm -f patch && wget -O flash
-https://notabug.org/libreboot/libreboot/raw/9d850543ad90b72e0e333c98075530b31e5d23f1/flash
-&& chmod +x flash***
+ rm -f patch
+ wget -O flash https://notabug.org/libreboot/libreboot/raw/9d850543ad90b72e0e333c98075530b31e5d23f1/flash
+ chmod +x flash
The first half of the procedure is as follows:
$ sudo ./flash i945lenovo\_firstflash [yourrom.rom](#rom).
-You should see within the output the following:\
-**"Updated BUC.TS=1 - 64kb address ranges at 0xFFFE0000 and 0xFFFF0000
-are swapped"**.
+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:
+
+ Your flash chip is in an unknown state
+ ...
+ FAILED
+ ...
+ DO NOT REBOOT OR POWEROFF
-You should also see within the output the following:\
-**"Your flash chip is in an unknown state"**, **"FAILED"** and
-**"DO NOT REBOOT OR POWEROFF"**\
-Seeing this means that the operation was a **resounding** success!
-**DON'T PANIC**.
+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,
+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).
+needed (see below).
When you have booted up again, you must also do this:
$ sudo ./flash i945lenovo\_secondflash [yourrom.rom](#rom)
-If flashing fails at this stage, try the following:\
-\$ **sudo ./flashrom/i686/flashrom -p
-internal:laptop=force\_I\_want\_a\_brick -w [yourrom.rom](#rom)**
+If flashing fails at this stage, try the following:
-You should see within the output the following:\
-**"Updated BUC.TS=0 - 128kb address range 0xFFFE0000-0xFFFFFFFF is
-untranslated"**
+ # sudo ./flashrom/i686/flashrom -p
-You should also see within the output the following:\
-**"Verifying flash\... VERIFIED."**
+internal:laptop=force\_I\_want\_a\_brick -w [yourrom.rom](#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.
MacBook2,1: Initial installation guide (if running the proprietary firmware) {#flashrom_macbook21}
============================================================================
-**If you have a MacBook1,1, refer to
-[../hardware/\#macbook11](../hardware/#macbook11) for flashing instructions.**
+*If you have a MacBook1,1, refer to
+[../hardware/\#macbook11](../hardware/#macbook11) for flashing instructions.*
-**This is for the MacBook2,1 while running Apple EFI firmware. If you
+*This is for the MacBook2,1 while running Apple EFI firmware. If you
already have coreboot or libreboot running, then go to
-[\#flashrom](#flashrom) instead!**
+[\#flashrom](#flashrom) instead!*
Be sure to read the information in
[../hardware/\#macbook21](../hardware/#macbook21).
-**Warning: this guide will not instruct the user how to backup the
+*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>.**
+<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/\#build](../git/#build)).**
+*If you are using libreboot\_src or git, then make sure that you built
+the sources first (see [../git/\#build](../git/#build)).*
Look at the [list of ROM images](#rom) to see which image is compatible
with your device.
@@ -366,15 +374,14 @@ Use this flashing script, to install libreboot:
$ sudo ./flash i945apple\_firstflash [yourrom.rom](#rom)
-You should also see within the output the following:\
-**"Verifying flash\... VERIFIED."**
+You should also see within the output the following:
+
+ Verifying flash... VERIFIED.
Shut down.
Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/kcma-d8.md b/docs/install/kcma-d8.md
index 5c2f8d47..8f9ecfc1 100644
--- a/docs/install/kcma-d8.md
+++ b/docs/install/kcma-d8.md
@@ -1,5 +1,6 @@
---
title: KCMA-D8 external flashing instructions
+x-toc-enable: true
...
Initial flashing instructions for kcma-d8.
@@ -9,19 +10,14 @@ motherboard, while they still have the proprietary ASUS BIOS present.
This guide can also be followed (adapted) if you brick you board, to
know how to recover.
-**Memory initialization is still problematic, for some modules. We
-recommend avoiding Kingston modules.**
+*Memory initialization is still problematic, for some modules. We
+recommend avoiding Kingston modules.*
For more general information about this board, refer to
[../hardware/kcma-d8.md](../hardware/kcma-d8.md).
TODO: show photos here, and other info.
-- [kcma-d8 boards (and full systems) with libreboot
- preinstalled](#preinstall)
-
-- [External programmer](#programmer)
-
External programmer {#programmer}
===================
@@ -30,13 +26,11 @@ an external SPI programmer.
The flash chip is in a PDIP 8 socket (SPI flash chip) on the
motherboard, which you take out and then re-flash with libreboot, using
-the programmer. **DO NOT** remove the chip with your hands. Use a chip
+the programmer. *DO NOT* remove the chip with your hands. Use a chip
extractor tool.
Copyright © 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/kgpe-d16.md b/docs/install/kgpe-d16.md
index ab73cdea..9810179f 100644
--- a/docs/install/kgpe-d16.md
+++ b/docs/install/kgpe-d16.md
@@ -1,5 +1,6 @@
---
title: KGPE-D16 external flashing instructions
+x-toc-enable: true
...
Initial flashing instructions for KGPE-D16.
@@ -9,20 +10,15 @@ motherboard, while they still have the proprietary ASUS BIOS present.
This guide can also be followed (adapted) if you brick you board, to
know how to recover.
-**Memory initialization is still problematic, for some modules. We
-recommend avoiding Kingston modules.**
+*Memory initialization is still problematic, for some modules. We
+recommend avoiding Kingston modules.*
For more general information about this board, refer to
[../hardware/kgpe-d16.md](../hardware/kgpe-d16.md).
TODO: show photos here, and other info.
-- [KGPE-D16 boards (and full systems) with libreboot
- preinstalled](#preinstall)
-
-- [External programmer](#programmer)
-
-External programmer {#programmer}
+External programmer
===================
Refer to [bbb\_setup.md](bbb_setup.md) for a guide on how to set up
@@ -30,13 +26,11 @@ an external SPI programmer.
The flash chip is in a PDIP 8 socket (SPI flash chip) on the
motherboard, which you take out and then re-flash with libreboot, using
-the programmer. **DO NOT** remove the chip with your hands. Use a chip
+the programmer. *DO NOT* remove the chip with your hands. Use a chip
extractor tool.
Copyright © 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/r400_external.md b/docs/install/r400_external.md
index 7d5721aa..366896cb 100644
--- a/docs/install/r400_external.md
+++ b/docs/install/r400_external.md
@@ -32,8 +32,8 @@ A note about CPUs
[ThinkWiki](http://www.thinkwiki.org/wiki/Category:R400) has a list of
CPUs for this system. The Core 2 Duo P8400 and P8600 are believed to
work in libreboot. The Core 2 Duo T9600 was confirmed to work, so the
-T9400 probably also works. **The Core 2 Duo T5870/5670 and Celeron M
-575/585 are untested!**
+T9400 probably also works. *The Core 2 Duo T5870/5670 and Celeron M
+575/585 are untested!*
Quad-core CPUs
--------------
@@ -62,6 +62,7 @@ Flash chip size {#flashchips}
===============
Use this to find out:
+
# flashrom -p internal -V
MAC address {#macaddress}
@@ -214,7 +215,9 @@ Log in as root on your BBB, using the instructions in
[bbb\_setup.html\#bbb\_access](bbb_setup.html#bbb_access).
Test that flashrom works:
- # ./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512\
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512\
+
In this case, the output was:
flashrom v0.9.7-r1854 on Linux 3.8.13-bone47 (armv7l)
@@ -227,19 +230,28 @@ In this case, the output was:
Please specify which chip definition to use with the -c <chipname> option.
How to backup factory.rom (change the -c option as neeed, for your flash
-chip):\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory.rom**\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory1.rom**\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory2.rom**\
-Note: the **-c** option is not required in libreboot's patched
+chip):
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r
+
+factory.rom
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r
+
+factory1.rom
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r
+
+factory2.rom
+
+Note: the `-c` option is not required in libreboot's patched
flashrom, because the redundant flash chip definitions in *flashchips.c*
-have been removed.\
+have been removed.
+
Now compare the 3 images:
- # sha512sum factory\*.rom
+ # sha512sum factory*.rom
+
If the hashes match, then just copy one of them (the factory.rom) to a
safe place (on a drive connected to another system, not the BBB). This
is useful for reverse engineering work, if there is a desirable
@@ -250,19 +262,21 @@ Follow the instructions at
[../hardware/gm45\_remove\_me.html\#ich9gen](../hardware/gm45_remove_me.html#ich9gen)
to change the MAC address inside the libreboot ROM image, before
flashing it. Although there is a default MAC address inside the ROM
-image, this is not what you want. **Make sure to always change the MAC
-address to one that is correct for your system.**
+image, this is not what you want. *Make sure to always change the MAC
+address to one that is correct for your system.*
-Now flash it:\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -w
-path/to/libreboot/rom/image.rom -V**
+Now flash it:
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -w
+
+path/to/libreboot/rom/image.rom -V
![](images/x200/disassembly/0015.jpg)
-You might see errors, but if it says **Verifying flash\... VERIFIED** at
+You might see errors, but if it says `Verifying flash... VERIFIED` at
the end, then it's flashed and should boot. If you see errors, try
-again (and again, and again); the message **Chip content is identical to
-the requested image** is also an indication of a successful
+again (and again, and again); the message `Chip content is identical to
+the requested image` is also an indication of a successful
installation.
Example output from running the command (see above):
@@ -352,8 +366,6 @@ Now [install GNU+Linux](../gnulinux/).
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/rpi_setup.md b/docs/install/rpi_setup.md
index 64389a78..e74432d4 100644
--- a/docs/install/rpi_setup.md
+++ b/docs/install/rpi_setup.md
@@ -2,33 +2,29 @@
title: How to program an SPI flash chip with the Raspberry Pi
...
-This document exists as a guide for reading from or writing to an SPI
-flash chip with the Raspberry Pi, using the
-[flashrom](http://flashrom.org/Flashrom) software. Most revisions of the
-RPi should work.
+This document exists as a guide for reading from or writing to an SPI flash
+chip with the Raspberry Pi, using the [flashrom](http://flashrom.org/Flashrom)
+software. Most revisions of the RPi should work.
The Libreboot project recommends using
[blobless GNU+Linux](https://blog.rosenzweig.io/blobless-linux-on-the-pi.html)
-on the Raspberry Pi, to avoid having to run non-free software. This
-only became possible in February 2017 and the instructions below are
-not yet updated with the necessary steps, so please do not follow the
-steps below unless you are willing to run non-free software on your
-Raspberry Pi.
+on the Raspberry Pi, to avoid having to run non-free software. This only became
+possible in February 2017 and the instructions below are not yet updated with
+the necessary steps, so please do not follow the steps below unless you are
+willing to run non-free software on your Raspberry Pi.
-This only covers SOIC-8 flash chips, for now. SOIC-16 guide coming later
-(for now, it should be easy enough for you to figure this out for
-SOIC-16).
+This only covers SOIC-8 flash chips, for now. SOIC-16 guide coming later (for
+now, it should be easy enough for you to figure this out for SOIC-16).
-[](#raspberry-pi-thinkpad-x60t60-and-macbook-21){#user-content-raspberry-pi-thinkpad-x60t60-and-macbook-21 .anchor}Raspberry Pi (ThinkPad X60/T60 and Macbook 2,1)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Raspberry Pi (ThinkPad X60/T60 and Macbook 2,1)
+------------------------------------------------
The Raspberry Pi (a multipurpose \$25 GNU+Linux computer) can be used as
a BIOS flashing tool, thanks to its GPIO pins and SPI support.
-> **Note:** The Raspberry Pi Model A is not supported, since it has no
-> GPIO pins.
+Note: The Raspberry Pi Model A is not supported, since it has no GPIO pins.
-### [](#disassembling-the-thinkpad){#user-content-disassembling-the-thinkpad .anchor}Disassembling the ThinkPad
+### Disassembling the ThinkPad
Follow the [X60 Hardware Maintenance
Manual](http://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/42x3550_04.pdf)
@@ -45,7 +41,7 @@ Guide](t60_unbrick.md).
- On the T60, the BIOS chip is just under the palmrest, but blocked by
a magnesium frame (which you will have to remove).
-### [](#pomona-clip-pinout){#user-content-pomona-clip-pinout .anchor}Pomona Clip Pinout
+### Pomona Clip Pinout
Diagram of the 26 GPIO Pins of the Raspberry Pi Model B (for the Model
B+ with 40 pins, start counting from the right and leave 14 pins):
@@ -78,7 +74,7 @@ detect a chip, or it will "detect" a `0x0` chip. Finally, make sure
that the Pomona clip makes contact with the metal wires of the chip. It
can be a challenge, but keep trying.
-### [](#how-to-supply-power-to-the-flashchip){#user-content-how-to-supply-power-to-the-flashchip .anchor}How to supply power to the flashchip
+### How to supply power to the flashchip
There are two ways to supply power to the chip: plugging in an AC
adapter (without turning the laptop on), and using the 8th 3.3v pin.
@@ -86,12 +82,12 @@ adapter (without turning the laptop on), and using the 8th 3.3v pin.
I have found that the SST chips work best with the 8th pin, while the
Macronix chips require an AC Adapter to power up.
-**Never connect both the 8th pin and the AC adapter at the same time.**
+*Never connect both the 8th pin and the AC adapter at the same time.*
Your results may vary.
-[](#reading-the-flashchip){#user-content-reading-the-flashchip .anchor}Reading the Flashchip
---------------------------------------------------------------------------------------------
+Reading the Flashchip
+----------------------
First, visually inspect (with a magnifying glass) the type of flashchip
on the motherboard.
@@ -99,7 +95,7 @@ on the motherboard.
Next, download and compile the latest Flashrom source code on the
Raspberry Pi.
- sudo apt-get install build-essential pciutils usbutils libpci-dev libusb-dev libftdi1 libftdi-dev zlib1g-dev subversion
+ sudo apt-get install build-essential pciutils usbutils libpci-dev libusb-dev libftdi1 libftdi-dev zlib1g-dev subversion libusb-1.0-0-dev
svn co svn://flashrom.org/flashrom/trunk flashrom
cd flashrom
make
@@ -127,11 +123,11 @@ If the md5sums match after three tries, `flashrom` has managed to read
the flashchip precisely (but not always accurately). You may try and
flash Libreboot now.
-[](#flashing-libreboot){#user-content-flashing-libreboot .anchor}Flashing Libreboot
------------------------------------------------------------------------------------
+Flashing Libreboot
+-------------------
-> **Note:** replace `/path/to/libreboot.rom` with the location of your
-> chosen ROM, such as `../bin/x60/libreboot_usqwerty.rom`):
+Note: replace `/path/to/libreboot.rom` with the location of your chosen ROM,
+such as `../bin/x60/libreboot_usqwerty.rom`):
If your chip is an SST, run this command:
@@ -148,14 +144,14 @@ successfully. If not, just flash again.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.
-### [](#sources){#user-content-sources .anchor}Sources
+### Sources
- [Scruss - Simple ADC with the Raspberry
Pi](http://scruss.com/blog/2013/02/02/simple-adc-with-the-raspberry-pi/)
- [Flashing coreboot on a T60 with a Raspberry Pi -
the\_unconventional's
blog](https://blogs.fsfe.org/the_unconventional/2015/05/08/flashing-coreboot-on-a-t60-with-a-raspberry-pi/)
-- **Pomona SOIC Clip flashing**
+- *Pomona SOIC Clip flashing*
- [Arch Linux Wiki - Installing Arch Linux on
Chromebook](https://wiki.archlinux.org/index.php/Chromebook)
- [Google Drive - Raspberry Pi SOIC Clip
@@ -163,7 +159,7 @@ successfully. If not, just flash again.
- [rPI with Flashrom and SOIC Clip
Powerpoint](http://satxhackers.org/wp/hack-content/uploads/2013/04/rPI_flashrom.pdf)
-### [](#raspberry-pi-pinout-diagrams){#user-content-raspberry-pi-pinout-diagrams .anchor}Raspberry Pi Pinout Diagrams
+### Raspberry Pi Pinout Diagrams
MCP 3008 Pin Pi GPIO Pin \# Pi Pin Name
----- ---------- ---------------- --------------------
@@ -179,10 +175,10 @@ successfully. If not, just flash again.
- Source: [Perl & Raspberry Pi - Raspberry Pi GPIO
Pinout](http://raspberrypi.znix.com/hipidocs/topic_gpiopins.htm)
-[](#raspberry-pi-thinkpad-x200){#user-content-raspberry-pi-thinkpad-x200 .anchor}Raspberry Pi (ThinkPad X200)
--------------------------------------------------------------------------------------------------------------
+Raspberry Pi (ThinkPad X200)
+-----------------------------
-### [](#requirements){#user-content-requirements .anchor}Requirements:
+### Requirements:
- An x86, x86\_64, or arm7l (for changing the libreboot.rom image mac
address)
@@ -196,16 +192,12 @@ Follow the [ThinkPad X200: Initial installation
guide](x200_external.md) to
disassemble the laptop, and access the BIOS rom chip.
-> **Note:** `x86#` refers to commands to be run on the x86 computer, and
-> `pi#` refers to commands to be run on the pi. A good practice is to
-> make a work directory to keep your libreboot stuff inside.
+Note: `x86#` refers to commands to be run on the x86 computer, and `pi#` refers
+to commands to be run on the pi. A good practice is to make a work directory to
+keep your libreboot stuff inside.
x86# mkdir ~/work
-Download NOOBS from [The Raspberry Pi
-Foundation.](https://www.raspberrypi.org/downloads/) Torrent download
-recommended, and remember to seed. :)
-
If you're running Raspian, you can do **sudo raspi-config**, enable SPI
under Advanced and then spidev will be enabled. Simple, eh?
@@ -217,43 +209,9 @@ GPG signature as well.
x86# for signature in $(ls *.sig); do gpg --verify $signature; done
-Extract NOOBS and libreboot.
-
- x86# mkdir ~/work/noobs
-
- x86# unzip ~/Downloads/NOOBS_v1_4_1.zip -d ~/work/noobs/
-
- x86# cd ~/work && tar -xvJf ~/Downloads/libreboot_bin.tar.xz
-
-Install Noobs to your fat32 formatted SD card
-
- x86# cp -R ~/work/noobs/* /path/to/mounted/SDcard/
-
-### [](#set-up-noobs-on-raspberry-pi){#user-content-set-up-noobs-on-raspberry-pi .anchor}Set up NOOBS on Raspberry Pi
-
-Plug in the NOOBs SDCard to your Raspberry Pi, and enable the following
-under 'Advanced Options':
-
-SSH server
-
-SPI
-
-I2C
-
-On first boot
-
- pi# sudo apt-get update && sudo apt-get dist-upgrade && reboot
-
-On second boot
-
- pi# sudo apt-get update && sudo apt-get install libftdi1 libftdi-dev libusb-dev libpci-dev subversion
-
-Other dependencies that should already be installed with the noobs base
-install include:
-
-pciutils, zlib, libusb, build-essential
+Install dependencies:
-If they are missing then install them.
+ pi# sudo apt-get update && sudo apt-get install libftdi1 libftdi-dev libusb-dev libpci-dev subversion libusb-1.0-0-dev pciutils, zlib, libusb, build-essential
Download and build flashrom.
@@ -309,10 +267,10 @@ text.
15 S1/SIO0 19
16 SCLK 23
-> **Note:** The raspberry pi 3.3V rail should be sufficient to power the
-> chip during flashing, so no external power supply should be required;
-> however, at the time of writing that has only been tested and
-> confirmed for one chip, the MX25L6405D.
+Note: The raspberry pi 3.3V rail should be sufficient to power the chip during
+flashing, so no external power supply should be required; however, at the time
+of writing that has only been tested and confirmed for one chip, the
+MX25L6405D.
Macronix Spec sheet so you can adjust your pinout for 8 pin 4Mb chips as
necessary
@@ -353,8 +311,8 @@ done.
Shut down your pi, put your box back together, and install a libre OS
for great good!
-[](#raspberry-pi-c720-chromebook){#user-content-raspberry-pi-c720-chromebook .anchor}Raspberry Pi (C720 Chromebook)
--------------------------------------------------------------------------------------------------------------------
+Raspberry Pi (C720 Chromebook)
+-------------------------------
The Raspberry Pi (a multipurpose \$25 GNU+Linux computer) can be used as
a BIOS flashing tool, thanks to its GPIO pins and SPI support.
@@ -408,14 +366,14 @@ Finally, put the Pomona SOIC clip on the chip:
![Pomona Clip Connected](images/rpi/0008.jpg)
-### [](#flashrom){#user-content-flashrom .anchor}Flashrom
+### Flashrom
[Once it's all set up, flashrom works out of the
box.](http://www.flashrom.org/RaspberryPi)
-### [](#sources-1){#user-content-sources-1 .anchor}Sources
+### Sources
-- **Pomona SOIC Clip flashing**
+- *Pomona SOIC Clip flashing*
- [Arch Linux Wiki - Installing Arch Linux on
Chromebook](https://wiki.archlinux.org/index.php/Chromebook)
- [Google Drive - Raspberry Pi SOIC Clip
@@ -424,7 +382,7 @@ box.](http://www.flashrom.org/RaspberryPi)
Powerpoint](http://satxhackers.org/wp/hack-content/uploads/2013/04/rPI_flashrom.pdf)
- [Tnhh - Unbricking Chromebook with
Beaglebone](http://www.tnhh.net/2014/08/25/unbricking-chromebook-with-beaglebone.md)
-- **Use a DIY DIP System to flash an desoldered BIOS chip**
+- *Use a DIY DIP System to flash an desoldered BIOS chip*
- [Viktak - How to recover laptop after failed BIOS
flash](http://diy.viktak.com/2014/07/how-to-recover-laptop-after-failed-bios.md)
- [Win-Raid - Recover from Failed BIOS Flashing using Raspberry
diff --git a/docs/install/t400_external.md b/docs/install/t400_external.md
index b3773c34..d48c15d4 100644
--- a/docs/install/t400_external.md
+++ b/docs/install/t400_external.md
@@ -59,6 +59,7 @@ Flash chip size {#flashchips}
===============
Use this to find out:
+
# flashrom -p internal -V
MAC address {#macaddress}
@@ -212,7 +213,9 @@ Log in as root on your BBB, using the instructions in
[bbb\_setup.html\#bbb\_access](bbb_setup.html#bbb_access).
Test that flashrom works:
- # ./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512
+
In this case, the output was:
flashrom v0.9.7-r1854 on Linux 3.8.13-bone47 (armv7l)
@@ -225,19 +228,27 @@ In this case, the output was:
Please specify which chip definition to use with the -c <chipname> option.
How to backup factory.rom (change the -c option as neeed, for your flash
-chip):\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory.rom**\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory1.rom**\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory2.rom**\
-Note: the **-c** option is not required in libreboot's patched
-flashrom, because the redundant flash chip definitions in *flashchips.c*
-have been removed.\
+chip):
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r
+
+factory.rom
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r
+
+factory1.rom
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r
+
+factory2.rom
+
+Note: the `-c` option is not required in libreboot's patched flashrom, because
+the redundant flash chip definitions in `flashchips.c` have been removed.
+
Now compare the 3 images:
- # sha512sum factory\*.rom
+ # sha512sum factory*.rom
+
If the hashes match, then just copy one of them (the factory.rom) to a
safe place (on a drive connected to another system, not the BBB). This
is useful for reverse engineering work, if there is a desirable
@@ -248,19 +259,21 @@ Follow the instructions at
[../hardware/gm45\_remove\_me.html\#ich9gen](../hardware/gm45_remove_me.html#ich9gen)
to change the MAC address inside the libreboot ROM image, before
flashing it. Although there is a default MAC address inside the ROM
-image, this is not what you want. **Make sure to always change the MAC
-address to one that is correct for your system.**
+image, this is not what you want. *Make sure to always change the MAC
+address to one that is correct for your system.*
-Now flash it:\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -w
-path/to/libreboot/rom/image.rom -V**
+Now flash it:
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -w
+
+path/to/libreboot/rom/image.rom -V
![](images/x200/disassembly/0015.jpg)
-You might see errors, but if it says **Verifying flash\... VERIFIED** at
+You might see errors, but if it says `Verifying flash... VERIFIED` at
the end, then it's flashed and should boot. If you see errors, try
-again (and again, and again); the message **Chip content is identical to
-the requested image** is also an indication of a successful
+again (and again, and again); the message `Chip content is identical to
+the requested image` is also an indication of a successful
installation.
Example output from running the command (see above):
@@ -350,8 +363,6 @@ Now [install GNU+Linux](../gnulinux/).
Copyright © 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/t500_external.md b/docs/install/t500_external.md
index 567f9159..5490744f 100644
--- a/docs/install/t500_external.md
+++ b/docs/install/t500_external.md
@@ -61,6 +61,7 @@ Flash chip size {#flashchips}
===============
Use this to find out:
+
# flashrom -p internal -V
MAC address {#macaddress}
@@ -229,7 +230,9 @@ Log in as root on your BBB, using the instructions in
[bbb\_setup.html\#bbb\_access](bbb_setup.html#bbb_access).
Test that flashrom works:
- # ./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512
+
In this case, the output was:
flashrom v0.9.7-r1854 on Linux 3.8.13-bone47 (armv7l)
@@ -242,19 +245,27 @@ In this case, the output was:
Please specify which chip definition to use with the -c <chipname> option.
How to backup factory.rom (change the -c option as neeed, for your flash
-chip):\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory.rom**\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory1.rom**\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory2.rom**\
-Note: the **-c** option is not required in libreboot's patched
+chip):
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r
+
+factory.rom
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r
+
+factory1.rom
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r
+
+factory2.rom
+
+Note: the `-c` option is not required in libreboot's patched
flashrom, because the redundant flash chip definitions in *flashchips.c*
have been removed.\
Now compare the 3 images:
# sha512sum factory\*.rom
+
If the hashes match, then just copy one of them (the factory.rom) to a
safe place (on a drive connected to another system, not the BBB). This
is useful for reverse engineering work, if there is a desirable
@@ -265,19 +276,21 @@ Follow the instructions at
[../hardware/gm45\_remove\_me.html\#ich9gen](../hardware/gm45_remove_me.html#ich9gen)
to change the MAC address inside the libreboot ROM image, before
flashing it. Although there is a default MAC address inside the ROM
-image, this is not what you want. **Make sure to always change the MAC
-address to one that is correct for your system.**
+image, this is not what you want. *Make sure to always change the MAC
+address to one that is correct for your system.*
+
+Now flash it:
-Now flash it:\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -w
-path/to/libreboot/rom/image.rom -V**
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -w
+
+path/to/libreboot/rom/image.rom -V
![](images/x200/disassembly/0015.jpg)
-You might see errors, but if it says **Verifying flash\... VERIFIED** at
+You might see errors, but if it says `Verifying flash... VERIFIED` at
the end, then it's flashed and should boot. If you see errors, try
-again (and again, and again); the message **Chip content is identical to
-the requested image** is also an indication of a successful
+again (and again, and again); the message `Chip content is identical to
+the requested image` is also an indication of a successful
installation.
Example output from running the command (see above):
@@ -367,8 +380,6 @@ Now [install GNU+Linux](../gnulinux/).
Copyright © 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/t60_unbrick.md b/docs/install/t60_unbrick.md
index 98c0be51..c61c3a5e 100644
--- a/docs/install/t60_unbrick.md
+++ b/docs/install/t60_unbrick.md
@@ -1,30 +1,23 @@
---
title: ThinkPad T60 Recovery guide
+x-toc-enable: true
...
This section documents how to recover from a bad flash that prevents
your ThinkPad T60 from booting.
-Table of Contents
------------------
-
-- Types of brick:
- - [Brick type 1: bucts not reset](#bucts_brick)
- - [Brick type 2: bad rom (or user error), system won't
- boot](#recovery)
-
Brick type 1: bucts not reset. {#bucts_brick}
==============================
You still have Lenovo BIOS, or you had libreboot running and you flashed
another ROM; and you had bucts 1 set and the ROM wasn't dd'd.\* or if
Lenovo BIOS was present and libreboot wasn't flashed.\
-\
+
In this case, unbricking is easy: reset BUC.TS to 0 by removing that
yellow cmos coin (it's a battery) and putting it back after a minute or
two:\
![](../images/t60_dev/0006.JPG)\
-\
+
\*Those dd commands should be applied to all newly compiled T60 ROM
images (the ROM images in libreboot binary archives already have this
applied!):\
@@ -116,20 +109,24 @@ Remove these screws, placing them on a steady surface in the same layout
as they were in before you removed them. Also, you should mark each
screw hole after removing the screw (a permanent marker pen will do),
this is so that you have a point of reference when re-assembling the
-system:\
+system:
+
![](../images/t60_dev/0027.JPG) ![](../images/t60_dev/0028.JPG)
![](../images/t60_dev/0029.JPG) ![](../images/t60_dev/0031.JPG)
![](../images/t60_dev/0032.JPG) ![](../images/t60_dev/0033.JPG)
Now wire up the BBB and the Pomona with your PSU.\
Refer to [bbb\_setup.md](bbb_setup.md) for how to setup the BBB for
-flashing.\
-**Note, the guide mentions a 3.3v DC PSU but you don't need this on the
+flashing.
+
+*Note, the guide mentions a 3.3v DC PSU but you don't need this on the
T60: if you don't have or don't want to use an external PSU, then make
sure not to connect the 3.3v leads mentioned in the guide; instead,
connect the AC adapter (the one that normally charges your battery) so
-that the board has power (but don't boot it up)**\
-![](../images/t60_dev/0030.JPG)\
+that the board has power (but don't boot it up)*
+
+![](../images/t60_dev/0030.JPG)
+
Correlate the following with the BBB guide linked above:
POMONA 5250:
@@ -148,11 +145,13 @@ Flashrom binaries for ARM (tested on a BBB) are distributed in
libreboot\_util. Alternatively, libreboot also distributes flashrom
source code which can be built.
-SSH'd into the BBB:\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -w
-yourrom.rom**
+SSH'd into the BBB:
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -w
-It should be **Verifying flash\... VERIFIED** at the end. If flashrom
+yourrom.rom
+
+It should be `Verifying flash... VERIFIED` at the end. If flashrom
complains about multiple flash chip definitions detected, then choose
one of them following the instructions in the output.
@@ -205,8 +204,6 @@ replacing cpu paste/heatsink:\
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/x200_external.md b/docs/install/x200_external.md
index cf4f74c7..6414fe7c 100644
--- a/docs/install/x200_external.md
+++ b/docs/install/x200_external.md
@@ -1,42 +1,31 @@
---
-title: Flashing the X200 with a BeagleBone Black
+title: Flashing the X200 with a BeagleBone Black
+x-toc-enable: true
...
-Initial flashing instructions for X200.
-
This guide is for those who want libreboot on their ThinkPad X200 while
they still have the original Lenovo BIOS present. This guide can also be
followed (adapted) if you brick your X200, to know how to recover.
-- [X200 laptops with libreboot pre-installed](#preinstall)
-- [Flash chips](#flashchips)
-- [MAC address](#macaddress)
-- [Initial BBB configuration and installation procedure](#clip)
-- [Boot it!](#boot)
-- [Wifi](#wifi)
-- [wwan](#wwan)
-- [Memory](#memory)
-- [X200S and X200 Tablet users: GPIO33 trick will not work.](#gpio33)
-
-X200 laptops with libreboot pre-installed {#preinstall}
+X200 laptops with libreboot pre-installed
=========================================
If you don't want to install libreboot yourself, companies exist that
sell these laptops with libreboot pre-installed, along with a free
GNU+Linux distribution.
-Flash chip size {#flashchips}
+Flash chip size
===============
Use this to find out:
+
# flashrom -p internal -V
-The X200S and X200 Tablet will use a WSON-8 flash chip, on the bottom of
-the motherboard (this requires removal of the motherboard). **Not all
-X200S/X200T are supported; see
-[../hardware/x200.html\#x200s](../hardware/x200.html#x200s).**
+The X200S and X200 Tablet will use a WSON-8 flash chip, on the bottom of the
+motherboard (this requires removal of the motherboard). Not all X200S/X200T are
+supported; see [here](../hardware/x200.html#x200s).
-MAC address {#macaddress}
+MAC address
===========
On the X200/X200S/X200T, the MAC address for the onboard gigabit
@@ -50,7 +39,7 @@ image before flashing it. It will be written in one of these locations:
![](images/x200/disassembly/0002.jpg)
![](images/x200/disassembly/0001.jpg)
-Initial BBB configuration {#clip}
+Initial BBB configuration
=========================
Refer to [bbb\_setup.md](bbb_setup.md) for how to set up the BBB for
@@ -73,8 +62,6 @@ header), for SOIC-16 (clip: Pomona 5252):
This is how you will connect. Numbers refer to pin numbers on the BBB, on the plugs near the DC jack.
Here is a photo of the SOIC-16 flash chip. Pins are labelled:
-
-
The following shows how to connect the clip to the BBB (on the P9
header), for SOIC-8 (clip: Pomona 5250):
@@ -91,12 +78,15 @@ header), for SOIC-8 (clip: Pomona 5250):
Look at the pads in that photo, on the left and right. Those are for SOIC-16. Would it be possible to remove the SOIC-8 and solder a SOIC-16
chip on those pins?
-**On the X200S and X200 Tablet the flash chip is underneath the board,
-in a WSON package. The pinout is very much the same as a SOIC-8, but such package makes it impossible to use testclip.
-In order to enable external flashing of device, chip has to be changed to SOIC-8 one. Such procedure requires hot air station and soldering station (with "knife" K-Tip to easily solder SOIC-8).\
-Check the list of SOIC-8 flash chips at
-[List of supported flash chips](https://www.flashrom.org/Supported_hardware#Supported_flash_chips)\
-25XX series SPI NOR Flash in 8/16MiB sizes will work fine with libreboot.
+On the X200S and X200 Tablet the flash chip is underneath the board, in a WSON
+package. The pinout is very much the same as a SOIC-8, but such package makes
+it impossible to use testclip. In order to enable external flashing of device,
+chip has to be changed to SOIC-8 one. Such procedure requires hot air station
+and soldering station (with "knife" K-Tip to easily solder SOIC-8).
+
+Check the list of SOIC-8 flash chips at [List of supported flash
+chips](https://www.flashrom.org/Supported_hardware#Supported_flash_chips)\ 25XX
+series SPI NOR Flash in 8/16MiB sizes will work fine with libreboot.
The procedure
-------------
@@ -108,13 +98,14 @@ completely, since the flash chip is on the other side of the board).
Remove these screws:\
![](images/x200/disassembly/0003.jpg)
-Push the keyboard forward, gently, then lift it off and disconnect it
-from the board:\
+Gently push the keyboard towards the screen, then lift it off, and optionally
+disconnect it from the board:\
![](images/x200/disassembly/0004.jpg)
![](images/x200/disassembly/0005.jpg)
-Pull the palm rest off, lifting from the left and right side at the back
-of the palm rest:\
+Disconnect the cable of the fingerpring reader, and then pull up the palm rest,
+lifting up the left and right side of it:\
+![](images/x200/disassembly/0006.1.jpg)
![](images/x200/disassembly/0006.jpg)
Lift back the tape that covers a part of the flash chip, and then
@@ -127,19 +118,10 @@ to your PSU:\
![](images/x200/disassembly/0009.jpg)
![](images/x200/disassembly/0010.jpg)
-Connect the 3.3V supply from your PSU to the flash chip (via the clip):\
+Connect the 3.3V DC supply from your PSU to the flash chip (via the clip):\
![](images/x200/disassembly/0011.jpg)
![](images/x200/disassembly/0012.jpg)
-Of course, make sure that your PSU is also plugged in and turn on:\
-![](images/x200/disassembly/0013.jpg)
-
-This tutorial tells you to use an ATX PSU, for the 3.3V DC supply. The
-PSU used when taking these photos is actually not an ATX PSU, but a PSU
-that is designed specifically for providing 3.3V DC (an ATX PSU will
-also work):\
-![](images/x200/disassembly/0014.jpg)
-
Now, you should be ready to install libreboot.
Flashrom binaries for ARM (tested on a BBB) are distributed in
@@ -150,7 +132,9 @@ Log in as root on your BBB, using the instructions in
[bbb\_setup.html\#bbb\_access](bbb_setup.html#bbb_access).
Test that flashrom works:
- # ./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512
+
In this case, the output was:
flashrom v0.9.7-r1854 on Linux 3.8.13-bone47 (armv7l)
@@ -162,20 +146,20 @@ In this case, the output was:
Multiple flash chip definitions match the detected chip(s): "MX25L6405(D)", "MX25L6406E/MX25L6436E", "MX25L6445E/MX25L6473E"
Please specify which chip definition to use with the -c <chipname> option.
-How to backup factory.rom (change the -c option as neeed, for your flash
-chip):\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory.rom**\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory1.rom**\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -r
-factory2.rom**\
-Note: the **-c** option is not required in libreboot's patched
+Here is how to backup factory.rom:
+
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r factory.rom
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r factory1.rom
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r factory2.rom
+
+Note: the `-c` option is not required in libreboot's patched
flashrom, because the redundant flash chip definitions in *flashchips.c*
-have been removed.\
+have been removed.
+
Now compare the 3 images:
- # sha512sum factory\*.rom
+ # sha512sum factory*.rom
+
If the hashes match, then just copy one of them (the factory.rom) to a
safe place (on a drive connected to another system, not the BBB). This
is useful for reverse engineering work, if there is a desirable
@@ -186,19 +170,19 @@ Follow the instructions at
[../hardware/gm45\_remove\_me.html\#ich9gen](../hardware/gm45_remove_me.html#ich9gen)
to change the MAC address inside the libreboot ROM image, before
flashing it. Although there is a default MAC address inside the ROM
-image, this is not what you want. **Make sure to always change the MAC
-address to one that is correct for your system.**
+image, this is not what you want. Make sure to always change the MAC
+address to one that is correct for your system.
+
+Now flash it:
-Now flash it:\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -w
-path/to/libreboot/rom/image.rom -V**
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -w path/to/libreboot/rom/image.rom -V
![](images/x200/disassembly/0015.jpg)
-You might see errors, but if it says **Verifying flash\... VERIFIED** at
+You might see errors, but if it says `Verifying flash... VERIFIED` at
the end, then it's flashed and should boot. If you see errors, try
-again (and again, and again); the message **Chip content is identical to
-the requested image** is also an indication of a successful
+again (and again, and again); the message `Chip content is identical to
+the requested image` is also an indication of a successful
installation.
Example output from running the command (see above):
@@ -231,7 +215,8 @@ whitelist of approved chips, and it will refuse to boot if you use an
'unauthorized' wifi card.
The following photos show an Atheros AR5B95 being installed, to replace
-the Intel chip that this X200 came with:\
+the Intel chip that this X200 came with:
+
![](images/x200/disassembly/0016.jpg)
![](images/x200/disassembly/0017.jpg)
@@ -245,6 +230,17 @@ track your movements.
Not to be confused with wifi (wifi is fine).
+Intel Turbo Memory
+==================
+
+Some X200 devices were sold with Intel Turbo Memory installed in the top-most
+mini PCI-e slot. This has been [shown to be
+ineffective](http://www.anandtech.com/show/2252) at disk caching or battery
+saving in most use cases. While there are [Linux
+drivers](https://github.com/yarrick/turbomem) available, it is blacklisted in
+at least GNU+Trisquel, and possibly other free operating systems. It should
+probably be removed.
+
Memory
======
@@ -257,10 +253,11 @@ work in some cases.
Make sure that the RAM you buy is the 2Rx8 density.
-In this photo, 8GiB of RAM (2x4GiB) is installed:\
+In this photo, 8GiB of RAM (2x4GiB) is installed:
+
![](images/x200/disassembly/0018.jpg)
-Boot it! {#boot}
+Boot it!
--------
You should see something like this:
@@ -269,7 +266,7 @@ You should see something like this:
Now [install GNU+Linux](../gnulinux/).
-X200S and X200 Tablet users: GPIO33 trick will not work. {#gpio33}
+X200S and X200 Tablet users: GPIO33 trick will not work.
--------------------------------------------------------
sgsit found out about a pin called GPIO33, which can be grounded to
@@ -277,7 +274,8 @@ disable the flashing protections by the descriptor and stop the ME from
starting (which itself interferes with flashing attempts). The theory
was proven correct; however, it is still useless in practise.
-Look just above the 7 in TP37 (that's GPIO33):\
+Look just above the 7 in TP37 (that's GPIO33):
+
![](../hardware/images/x200/gpio33_location.jpg)
By default we would see this in lenovobios, when trying flashrom -p
@@ -310,9 +308,7 @@ On a related note, libreboot has a utility that could help with
investigating this:
[../hardware/gm45\_remove\_me.html\#demefactory](../hardware/gm45_remove_me.md#demefactory)
-Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
-
-
+Copyright © 2014, 2015 Leah Rowe <info@minifree.org>
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
diff --git a/docs/install/x60_unbrick.md b/docs/install/x60_unbrick.md
index e1c9098a..0f215302 100644
--- a/docs/install/x60_unbrick.md
+++ b/docs/install/x60_unbrick.md
@@ -1,30 +1,23 @@
---
title: ThinkPad X60 Recovery guide
+x-toc-enable: true
...
This section documents how to recover from a bad flash that prevents
your ThinkPad X60 from booting.
-Table of Contents
-=================
-
-- Types of brick:
- - [Brick type 1: bucts not reset](#bucts_brick)
- - [Brick type 2: bad rom (or user error), system won't
- boot](#recovery)
-
Brick type 1: bucts not reset. {#bucts_brick}
==============================
You still have Lenovo BIOS, or you had libreboot running and you flashed
another ROM; and you had bucts 1 set and the ROM wasn't dd'd.\* or if
Lenovo BIOS was present and libreboot wasn't flashed.\
-\
+
In this case, unbricking is easy: reset BUC.TS to 0 by removing that
yellow cmos coin (it's a battery) and putting it back after a minute or
two:\
![](../images/x60_unbrick/0004.jpg)\
-\
+
\*Those dd commands should be applied to all newly compiled X60 ROM
images (the ROM images in libreboot binary archives already have this
applied!):\
@@ -108,11 +101,11 @@ flash chip:\
Now wire up the BBB and the Pomona with your PSU.\
Refer to [bbb\_setup.md](bbb_setup.md) for how to setup the BBB for
flashing.\
-**Note, the guide mentions a 3.3v DC PSU but you don't need this on the
+*Note, the guide mentions a 3.3v DC PSU but you don't need this on the
X60: if you don't have or don't want to use an external PSU, then make
sure not to connect the 3.3v leads mentioned in the guide; instead,
connect the AC adapter (the one that normally charges your battery) so
-that the board has power (but don't boot it up)**
+that the board has power (but don't boot it up)*
![](../images/x60_unbrick/0017.jpg)\
Correlate the following with the BBB guide linked above:
@@ -133,11 +126,13 @@ Flashrom binaries for ARM (tested on a BBB) are distributed in
libreboot\_util. Alternatively, libreboot also distributes flashrom
source code which can be built.
-SSH'd into the BBB:\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -w
-yourrom.rom**
+SSH'd into the BBB:
-It should be **Verifying flash\... VERIFIED** at the end. If flashrom
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -w
+
+yourrom.rom
+
+It should be `Verifying flash... VERIFIED` at the end. If flashrom
complains about multiple flash chip definitions detected, then choose
one of them following the instructions in the output.
@@ -217,8 +212,6 @@ Operating system:\
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/install/x60tablet_unbrick.md b/docs/install/x60tablet_unbrick.md
index d11e7cbb..f4baebf4 100644
--- a/docs/install/x60tablet_unbrick.md
+++ b/docs/install/x60tablet_unbrick.md
@@ -1,30 +1,23 @@
---
title: ThinkPad X60 Tablet Recovery guide
+x-toc-enable: true
...
This section documents how to recover from a bad flash that prevents
your ThinkPad X60 Tablet from booting.
-Table of Contents
------------------
-
-- Types of brick:
- - [Brick type 1: bucts not reset](#bucts_brick)
- - [Brick type 2: bad rom (or user error), system won't
- boot](#recovery)
-
Brick type 1: bucts not reset. {#bucts_brick}
==============================
You still have Lenovo BIOS, or you had libreboot running and you flashed
another ROM; and you had bucts 1 set and the ROM wasn't dd'd.\* or if
Lenovo BIOS was present and libreboot wasn't flashed.\
-\
+
In this case, unbricking is easy: reset BUC.TS to 0 by removing that
yellow cmos coin (it's a battery) and putting it back after a minute or
two:\
![](../images/x60t_unbrick/0008.JPG)\
-\
+
\*Those dd commands should be applied to all newly compiled X60 ROM
images (the ROM images in libreboot binary archives already have this
applied!):\
@@ -87,11 +80,11 @@ Remove that screw and then remove the board:\
Now wire up the BBB and the Pomona with your PSU.\
Refer to [bbb\_setup.md](bbb_setup.md) for how to setup the BBB for
flashing.\
-**Note, the guide mentions a 3.3v DC PSU but you don't need this on the
+*Note, the guide mentions a 3.3v DC PSU but you don't need this on the
X60 Tablet: if you don't have or don't want to use an external PSU,
then make sure not to connect the 3.3v leads mentioned in the guide;
instead, connect the AC adapter (the one that normally charges your
-battery) so that the board has power (but don't boot it up)**
+battery) so that the board has power (but don't boot it up)*
![](../images/x60t_unbrick/0011.JPG)\
Correlate the following with the BBB guide linked above:
@@ -112,11 +105,13 @@ Flashrom binaries for ARM (tested on a BBB) are distributed in
libreboot\_util. Alternatively, libreboot also distributes flashrom
source code which can be built.
-SSH'd into the BBB:\
-\# **./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 -w
-yourrom.rom**
+SSH'd into the BBB:
-It should be **Verifying flash\... VERIFIED** at the end. If flashrom
+ # ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -w
+
+yourrom.rom
+
+It should be `Verifying flash... VERIFIED` at the end. If flashrom
complains about multiple flash chip definitions detected, then choose
one of them following the instructions in the output.
@@ -124,8 +119,6 @@ Reverse the steps to re-assemble your system.
Copyright © 2014, 2015 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/misc/bbb_ehci.md b/docs/misc/bbb_ehci.md
index f1240d24..6f072154 100644
--- a/docs/misc/bbb_ehci.md
+++ b/docs/misc/bbb_ehci.md
@@ -21,11 +21,11 @@ EHCI debugging
recommended)](#EnebleEHCIDebugonthetargetskerneloptionalrecommended)
7. [References](#References)
-**NOTE: this documentation may be outdated, and discusses configuring
+*NOTE: this documentation may be outdated, and discusses configuring
EHCI debug on the default Debian system that the BBB sometimes comes
with. If you want an easier time, just use [BBB
ScrewDriver](https://www.coreboot.org/BBB_screwdriver) which comes
-pre-configured.**
+pre-configured.*
If your computer does not boot after installing libreboot, it is very
useful to get debug logs from it, from the payload (grub) and/or the
@@ -40,17 +40,17 @@ it (TODO: grub).
I will refer to three computers:
-- **host** - this is the computer you use, have tools, compiler,
+- *host* - this is the computer you use, have tools, compiler,
Internet, etc
-- **BBB** - Beaglebone Black (rev. B or higher, i use rev. C)
-- **target** - the computer you are trying to install liberboot
+- *BBB* - Beaglebone Black (rev. B or higher, i use rev. C)
+- *target* - the computer you are trying to install liberboot
### Find USB port on the target that supports EHCI debug {#FindUSBportonthetargetthatsupportsEHCIdebug}
Not all USB controllers support EHCI debug (see: [EHCI Debug
Port](http://www.coreboot.org/EHCI_Debug_Port#Hardware_capability) ).
Even more, if a USB controller supports EHCI debug, it is available only
-**on a single port** that might or might not be exposed externally.
+*on a single port* that might or might not be exposed externally.
- You need running OS (GNU+Linux) on your target for this step (If
you've flashed libreboot and it does not boot, you have to flush
@@ -76,8 +76,8 @@ Even more, if a USB controller supports EHCI debug, it is available only
support debug (bold).
Remember (write down) for each port (external plug) you found that
-supports debug: **PCI device id, the bus id, the port number, and the
-physical location of the usb plug.**
+supports debug: *PCI device id, the bus id, the port number, and the
+physical location of the usb plug.*
If you do not find a match, you can not get debug over EHCI. Sorry.
@@ -235,7 +235,7 @@ Then:\
CONFIG_CONSOLE_USB=y (Console -> USB dongle console output)
-Also Debugging \---> Output verbose XYZ ) (**FIXME** somebody verify
+Also Debugging \---> Output verbose XYZ ) (*FIXME* somebody verify
these):
CONFIG_DEBUG_CBFS=y (Output verbose CBFS debug messages )
@@ -247,7 +247,7 @@ these):
If some of the above mentioned configuration options are not as
specified, you have to configure and compile libreboot yourself. Please
-refer to the doc(**FIXME: link** about compiling libreboot.
+refer to the doc(*FIXME: link* about compiling libreboot.
#### Selecting HCD Index and USB Debug port {#SelectingHCDIndexandUSBDebugport}
@@ -342,7 +342,7 @@ Interface](http://cs.usfca.edu/~cruse/cs698s10/)
^21^ https://wiki.ubuntu.com/Kernel/Debugging/USBearlyprintk
-**TODO**:
+*TODO*:
1. grub does not send messages to EHCI debug. Investigate.
2. The section “Configure libreboot with EHCI debug” can be
@@ -353,8 +353,6 @@ Interface](http://cs.usfca.edu/~cruse/cs698s10/)
Copyright © 2015 Alex David <opdecirkel@gmail.com>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/misc/index.md b/docs/misc/index.md
index 6abd95ad..912a5b81 100644
--- a/docs/misc/index.md
+++ b/docs/misc/index.md
@@ -75,9 +75,9 @@ using [this guide](../gnulinux/grub_cbfs.md).
X60/T60: Serial port - how to use (for dock owners)
===================================================
-For the Thinkpad X60 you can use the **"UltraBase X6"** dock (for the
+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"**.
+can use the "Advanced Mini Dock".
If you are using one of the ROM images with 'serial' in the name, then
you have serial port enabled in libreboot and you have memtest86+
@@ -107,7 +107,7 @@ recommend Ubuntu, because it contains non-free software in the default
repos. Use Debian or Devuan)
Note: part of the tutorial above requires changing your grub.cfg. Just
-change the **linux** line to add instructions for enabling getty. See
+change the `linux` line to add instructions for enabling getty. See
[../gnulinux/grub\_cbfs.md](../gnulinux/grub_cbfs.md).
Finetune backlight control on intel gpu's
@@ -121,10 +121,12 @@ needs to be set. See p94 of
<https://01.org/sites/default/files/documentation/g45_vol_3_register_0_0.pdf>
for more information on this reg. The tool for setting registry values
on intel gpu's is included in intel-gpu-tools. Install intel-gpu-tools:
-**sudo apt-get install intel-gpu-tools**
-You can set values: **sudo intel\_reg write 0x00061254
-your_value_in_C_hex_format**
+ sudo apt-get install intel-gpu-tools
+
+You can set values:
+
+ sudo intel_reg write 0x00061254 your_value_in_C_hex_format
The value set has the following structure: bits \[31:16\] is PWM
divider. PWM / PWM\_divider = frequency bits \[15:0\] is the duty cycle
@@ -134,7 +136,7 @@ backlight modulation frequency means full on. The value should not be
larger than the backlight modulation frequency.
On displays with a CCFL backlight start from: 0x60016001 To verify if
-all modes work as desired use: **xbacklight -set 10** and gradually
+all modes work as desired use: `xbacklight -set 10` and gradually
increase until 100. Displays with an LED backlight need a lower
backlight modulation. Do the same thing but start from 0x01290129 . Try
setting different values until you have found a value which presents no
@@ -172,8 +174,10 @@ before exit 0 in /etc/rc.local or create a systemd service file
WantedBy=multi-user.target
-Now start and enable it: **sudo systemctl start backlight && sudo
-systemctl enable backlight**
+Now start and enable it:
+
+ sudo systemctl start backlight && sudo systemctl enable backlight
+
Special note on i945:
i945 behaves differently. Bit 16 needs to be 1 and the duty cycle is not
@@ -201,10 +205,12 @@ is included in libreboot, and can be used to enable or disable this
behaviour.
Disable or enable beeps when removing/adding the charger:
+
$ sudo ./nvramtool -w power\_management\_beeps=Enable
$ sudo ./nvramtool -w power\_management\_beeps=Disable
Disable or enable beeps when battery is low:
+
$ sudo ./nvramtool -w low\_battery\_beep=Enable
$ sudo ./nvramtool -w low\_battery\_beep=Disable
@@ -214,17 +220,22 @@ A reboot is required, for these changes to take effect.
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**
+Get the panel name:
+
+ sudo get-edid | strings
+
+Or look in `/sys/class/drm/card0-LVDS-1/edid`
Alternatively you can use i2cdump. In Debian and Devuan, this is in the
package i2c-tools.
$ sudo modprobe i2c-dev
$ sudo i2cdump -y 5 0x50 (you might have to change the value for
+
-y)
$ sudo rmmod i2c-dev
+
You'll see the panel name in the output (from the EDID dump).
If neither of these options work (or they are unavailable), physically
@@ -239,16 +250,20 @@ needed for cause):
e1000e 0000:00:19.0 enp0s25: Detected Hardware Unit Hang
-Possible workaround, tested by Nazara: Disable C-STATES.\
-**NOTE: this also disables power management, because disabling C-States
+Possible workaround, tested by Nazara: Disable C-STATES.
+
+*NOTE: this also disables power management, because disabling C-States
means that your CPU will now be running at full capacity (and therefore
using more power) non-stop, which will drain battery life if this is a
laptop. If power usage is a concern, then you should not use this.
-(we're also not sure whether this workaround is appropriate)**
+(we're also not sure whether this workaround is appropriate)*
-To disable c-states, do this in GNU+Linux:\
-**for i in /sys/devices/system/cpu/cpu/cpuidle/state/disable; do echo 1
-> \$i; done**
+To disable c-states, do this in GNU+Linux:
+
+ for i in /sys/devices/system/cpu/cpu/cpuidle/state/disable;
+ do
+ echo 1 > $i;
+ done
You can reproduce this issue more easily by sending lots of traffic
across subnets on the same interface (NIC).
@@ -265,8 +280,6 @@ Put this script in /etc/init.d/ on debian-based systems.
Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/docs/release.md b/docs/release.md
index 7c73a4d8..0cfdf8ef 100644
--- a/docs/release.md
+++ b/docs/release.md
@@ -37,8 +37,8 @@ Libreboot 20160818 {#release20160818}
Release date: 18th August 2016.
-Installation instructions can be found at ***docs/install/***. Building
-instructions (for source code) can be found at ***docs/git/\#build***.
+Installation instructions can be found at `docs/install/`. Building
+instructions (for source code) can be found at `docs/git/\#build`.
Machines supported in this release:
-----------------------------------
@@ -425,8 +425,6 @@ Changes for this release, relative to r20150208 (earliest changes last, recent c
- **New board:** ThinkPad R400 support added to libreboot.
- bbb\_setup.html: tell user to use libreboot's own flashrom
-
-
Release 20150124, 20150126 and 20150208 {#release20150124}
=======================================
@@ -638,8 +636,6 @@ Changes for this release (latest changes first, earliest changes last)
html errors
- Documentation (macbook21 related): clean up
-
-
Release 20141015 {#release20141015}
================
@@ -1482,11 +1478,8 @@ Development notes
- initial release
- source code deblobbed
-
Copyright © 2014, 2015, 2016 Leah Rowe <info@minifree.org>\
-
-
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License Version 1.3 or any later
version published by the Free Software Foundation
diff --git a/libreboot b/libreboot
index a8110e2d..f02de202 100755
--- a/libreboot
+++ b/libreboot
@@ -15,17 +15,19 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+GLOBIGNORE=".:.." # This enables the shell option 'dotglob' as well.
+shopt -s nullglob
+
libreboot_usage() {
local action
local target
- printf "$executable [action] [target] [arguments]\n" >&2
+ printf "${executable} [action] [target] [arguments]\n" >&2
printf "\nGeneric project actions:\n" >&2
- for action in $PROJECT_ACTIONS_GENERIC
- do
- printf " $action\n" >&2
+ for action in ${PROJECT_ACTIONS_GENERIC}; do
+ printf " ${action}\n" >&2
done
printf "\nVirtual project actions:\n" >&2
@@ -36,28 +38,23 @@ libreboot_usage() {
printf "\nProject targets:\n" >&2
- ls -A "$root/$PROJECTS/" | while read target
- do
- if project_check "$target"
- then
- printf " $target\n" >&2
+ for target in "${root}/${PROJECTS}"/*; do
+ if project_check "${target}"; then
+ printf " ${target}\n" >&2
fi
done
printf "\nGeneric tool actions:\n" >&2
- for action in $TOOL_ACTIONS_GENERIC
- do
- printf " $action\n" >&2
+ for action in ${TOOL_ACTIONS_GENERIC}; do
+ printf " ${action}\n" >&2
done
printf "\nTool targets:\n" >&2
- ls -A "$root/$TOOLS/" | while read target
- do
- if tool_check "$target"
- then
- printf " $target\n" >&2
+ for target in "${root}/${TOOLS}"/*; do
+ if tool_check "${target}"; then
+ printf " ${target}\n" >&2
fi
done
@@ -70,89 +67,74 @@ libreboot_usage() {
printf " VERSION - Version string to use\n" >&2
printf "\nConfiguration files:\n" >&2
- printf " $BUILD_SYSTEM.conf - Environment variables configuration\n" >&2
+ printf " ${BUILD_SYSTEM}.conf - Environment variables configuration\n" >&2
}
libreboot_project() {
- action=$1
+ action="$1"
shift
- project=$1
+ project="$1"
shift
- case $action in
+ case ${action} in
"sources")
(
set +e
- project_action_arguments "extract" "$project" "$@"
- if [ $? -eq 0 ]
- then
- return 0
- fi
-
- project_action_arguments "download" "$project" "$@"
- if [ $? -eq 0 ]
- then
- return 0
- fi
+ project_action_arguments "extract" "${project}" "$@" && return 0
+ project_action_arguments "download" "${project}" "$@" && return 0
)
;;
"produce")
- for action in "build" "install" "release"
- do
- project_action_arguments "$action" "$project" "$@"
+ for action in "build" "install" "release"; do
+ project_action_arguments "${action}" "${project}" "$@"
done
;;
"test")
- for action in $PROJECT_ACTIONS
- do
- project_action_arguments "$action" "$project" "$@"
+ for action in ${PROJECT_ACTIONS}; do
+ project_action_arguments "${action}" "${project}" "$@"
done
;;
*)
- if ! project_function_check "$project" "$action"
- then
+ if ! project_function_check "${project}" "${action}"; then
libreboot_usage
exit 1
fi
- if [ "$action" = "usage" ]
- then
- project_action "$action" "$project" "$@"
+ if [[ "${action}" == "usage" ]]; then
+ project_action "${action}" "${project}" "$@"
else
- project_action_arguments "$action" "$project" "$@"
+ project_action_arguments "${action}" "${project}" "$@"
fi
;;
esac
}
libreboot_tool() {
- action=$1
+ action="$1"
shift
- tool=$1
+ tool="$1"
shift
- case $action in
+ case ${action} in
*)
- if ! tool_function_check "$tool" "$action"
- then
+ if ! tool_function_check "${tool}" "${action}"; then
libreboot_usage
exit 1
fi
- if [ "$action" = "usage" ]
- then
- tool_action "$action" "$tool" "$@"
+ if [[ "${action}" == "usage" ]]; then
+ tool_action "${action}" "${tool}" "$@"
else
- tool_action_arguments_recursive "$action" "$tool" "$@"
+ tool_action_arguments_recursive "${action}" "${tool}" "$@"
fi
;;
esac
}
libreboot_setup() {
- root=$( realpath "$( dirname "$0" )" )
- executable=$( basename "$0" )
+ root="$(readlink -f "$(dirname "$0")")"
+ executable="$(basename "$0")"
local requirements="git"
local requirement_path
@@ -160,106 +142,91 @@ libreboot_setup() {
libreboot_setup_include
libreboot_setup_variables
- for requirement in $requirements
- do
- requirement_path=$( which "$requirement" || true )
+ for requirement in ${requirements}; do
+ requirement_path="$(which "${requirement}" || true)"
- if [ -z "$requirement_path" ]
- then
- printf "Missing requirement: $requirement\n" >&2
+ if [[ -z "${requirement_path}" ]]; then
+ printf "Missing requirement: ${requirement}\n" >&2
exit 1
fi
done
}
libreboot_setup_include() {
- local libs_path="$root/libs"
+ local libs_path="${root}/libs"
local conf_path
- . "$libs_path/project"
- . "$libs_path/tool"
- . "$libs_path/common"
- . "$libs_path/git"
+ source "${libs_path}/project"
+ source "${libs_path}/tool"
+ source "${libs_path}/common"
+ source "${libs_path}/git"
- conf_path="$root/$BUILD_SYSTEM.conf"
+ conf_path="${root}/${BUILD_SYSTEM}.conf"
- if [ -f "$conf_path" ]
- then
- . "$conf_path"
+ if [[ -f "${conf_path}" ]]; then
+ source "${conf_path}"
fi
}
libreboot_setup_variables() {
- local vboot_tools_path=$( project_install_path "vboot" "tools" )
- local version_path="$root/$DOTVERSION"
- local epoch_path="$root/$DOTEPOCH"
+ local vboot_tools_path="$(project_install_path 'vboot' 'tools')"
+ local version_path="${root}/${DOTVERSION}"
+ local epoch_path="${root}/${DOTEPOCH}"
- if [ -z "$TASKS" ]
- then
+ if [[ -z "${TASKS}" ]]; then
TASKS=1
fi
- if [ -z "$VERSION" ]
- then
- if git_check "$root"
- then
- VERSION="$BUILD_SYSTEM-"$( git_describe "$root" 2> /dev/null || echo "git" )
- elif [ -f "$version_path" ]
- then
- VERSION=$( cat "$version_path" )
+ if [[ -z "${VERSION}" ]]; then
+ if git_check "${root}"; then
+ VERSION="${BUILD_SYSTEM}-$(git_describe "${root}" 2> /dev/null || echo 'git')"
+ elif [[ -f "${version_path}" ]]; then
+ VERSION="$(cat "${version_path}")"
else
- VERSION=$BUILD_SYSTEM
+ VERSION="${BUILD_SYSTEM}"
fi
fi
- if [ -z "$SOURCE_DATE_EPOCH" ]
- then
- if git_check "$root"
- then
- SOURCE_DATE_EPOCH=$( git log -1 --format=%ct )
- elif [ -f "$epoch_path" ]
- then
- SOURCE_DATE_EPOCH=$( cat "$epoch_path" )
+ if [[ -z "${SOURCE_DATE_EPOCH}" ]]; then
+ if git_check "${root}"; then
+ SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)"
+ elif [[ -f "${epoch_path}" ]]; then
+ SOURCE_DATE_EPOCH="$(cat "${epoch_path}")"
else
- SOURCE_DATE_EPOCH=$( date +%s )
+ SOURCE_DATE_EPOCH="$(date +%s)"
fi
fi
- if [ -z "$VBOOT_KEYS_PATH" ] && [ -d "$vboot_tools_path/devkeys/" ]
- then
- VBOOT_KEYS_PATH="$vboot_tools_path/devkeys/"
+ if [[ -z "${VBOOT_KEYS_PATH}" ]] && [[ -d "${vboot_tools_path}/devkeys/" ]]; then
+ VBOOT_KEYS_PATH="${vboot_tools_path}/devkeys/"
fi
- if [ -z "$EDITOR" ]
- then
+ if [[ -z "${EDITOR}" ]]; then
EDITOR="vi"
fi
}
libreboot() {
- action=$1
+ action="$1"
shift
- target=$1
+ target="$1"
shift
set -e
libreboot_setup "$@"
- if [ -z "$action" ] || [ -z "$target" ]
- then
+ if [[ -z "${action}" ]] || [[ -z "${target}" ]]; then
libreboot_usage
exit 1
fi
requirements "tar" "sed" "gpg" "sha256sum"
- if project_check "$target"
- then
- libreboot_project "$action" "$target" "$@"
- elif tool_check "$target"
- then
- libreboot_tool "$action" "$target" "$@"
+ if project_check "${target}"; then
+ libreboot_project "${action}" "${target}" "$@"
+ elif tool_check "${target}"; then
+ libreboot_tool "${action}" "${target}" "$@"
else
libreboot_usage
exit 1
diff --git a/libs/common b/libs/common
index a64a7b9b..8f1379ee 100755
--- a/libs/common
+++ b/libs/common
@@ -63,6 +63,23 @@ arguments_list() {
done
}
+diff_patch_file() {
+ local repository_path="$1"
+ local patch_file_path="$2"
+
+ local filename_in_diff="$(sed -rne 's/^-{3} {1}(.*)$/\1/p' <"${patch_file_path}")"
+
+ local source_file_path
+
+ if ! ( grep -E '^-{3}.*/' <"${patch_file_path}" >/dev/null 2>&1 ); then
+ source_file_path="${repository_path}/${filename_in_diff##\ }"
+ else
+ source_file_path="${repository_path}/${filename_in_diff##*/}"
+ fi
+
+ patch "${source_file_path}" "${patch_file_path}"
+}
+
path_wildcard_expand() {
local path=$@
diff --git a/libs/git b/libs/git
index e64173d9..a750be32 100755
--- a/libs/git
+++ b/libs/git
@@ -226,29 +226,29 @@ git_project_check() {
}
git_project_patch_recursive() {
- local project=$1
- local repository=$2
- local branch=$3
- local path=$4
+ local project="$1"
+ local repository="$2"
+ local branch="$3"
+ local path="${4:-.}"
- local repository_path=$( git_project_repository_path "$repository" )
- local project_path=$( project_path "$project" )
- local patches_path="$project_path/$PATCHES/$path/$WILDDOTPATCH"
- local patch_path
+ local repository_path="$(git_project_repository_path "${repository}")"
+ local project_path="$(project_path "${project}")"
+ local patches_path="${project_path}/${PATCHES}/${path}"
- if ! [ -z "$path" ] && [ "$path" != "." ]
- then
- git_project_patch_recursive "$project" "$repository" "$branch" "$( dirname "$path" )"
+ if ! [[ -d "${patches_path}" ]]; then
+ return
fi
- path_wildcard_expand "$patches_path" | while read patch_path
- do
- if ! [ -f "$patch_path" ]
- then
- continue
- fi
+ if [[ "${path}" != "." ]]; then
+ git_project_patch_recursive "${project}" "${repository}" "${branch}" "$(dirname "${path}")"
+ fi
- git_patch "$repository_path" "$branch" "$patch_path"
+ for patch in "${patches_path}"/[!.]*.{patch,diff}; do
+ if [[ "${patch##*.}" == "patch" ]]; then
+ git_patch "${repository_path}" "${branch}" "${patch}"
+ else
+ diff_patch_file "${repository_path}" "${patch}"
+ fi
done
}
diff --git a/libs/project b/libs/project
index 00ad76c6..20a6fe77 100755
--- a/libs/project
+++ b/libs/project
@@ -46,16 +46,13 @@ project_helper_include() {
}
project_check() {
- local project=$1
+ local project="${1##*/}"
- local project_path=$( project_path "$project" )
+ local project_path="$(project_path "${project}")"
- if ! [ -f "$project_path/$project" ]
- then
+ if ! [[ -f "${project_path}/${project}" ]]; then
return 1
fi
-
- return 0
}
project_function_check() {
@@ -90,10 +87,11 @@ project_action() {
project_action_check "$action" "$project" "$@"
- if [ $? -eq 0 ]
- then
- return 0
- fi
+ # Why is this here? Commented out for now.
+ # if [ $? -eq 0 ]
+ # then
+ # return 0
+ # fi
project_include "$project"
diff --git a/libs/tool b/libs/tool
index 6bf57be1..3a9c4a1b 100755
--- a/libs/tool
+++ b/libs/tool
@@ -44,16 +44,13 @@ tool_helper_include() {
}
tool_check() {
- local tool=$1
+ local tool="${1##*/}"
- local tool_path=$( tool_path "$tool" )
+ local tool_path="$(tool_path "${tool}")"
- if ! [ -f "$tool_path/$tool" ]
- then
+ if ! [[ -f "${tool_path}/${tool}" ]]; then
return 1
fi
-
- return 0
}
tool_function_check() {
diff --git a/projects/bucts/bucts b/projects/bucts/bucts
new file mode 100644
index 00000000..02766f8e
--- /dev/null
+++ b/projects/bucts/bucts
@@ -0,0 +1,110 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+arguments() {
+ project_arguments_targets "${project}" "$@"
+}
+
+usage() {
+ project_usage_actions "${project}"
+ project_usage_arguments "${project}" "$@"
+}
+
+download() {
+ local repository="${project}"
+
+ project_download_git "${project}" "${repository}" 'git://git.stuge.se/bucts.git' "$@"
+}
+
+download_check() {
+ local repository="${project}"
+
+ project_download_check_git "${project}" "${repository}" "$@"
+}
+
+extract() {
+ local repository="${project}"
+
+ project_extract "${project}" "$@"
+}
+
+extract_check() {
+ local repository="${project}"
+
+ project_extract_check "${project}" "$@"
+}
+
+update() {
+ local repository="${project}"
+
+ project_update_git "${project}" "${repository}" "$@"
+}
+
+update_check() {
+ local repository="${project}"
+
+ project_update_check_git "${project}" "${repository}" "$@"
+}
+
+build() {
+ local repository="${project}"
+
+ project_sources_directory_missing_empty_error "${project}" "${repository}" "$@"
+
+ if git_project_check "${repository}"; then
+ git_project_checkout "${project}" "${repository}" "$@"
+ fi
+
+ local sources_path="$(project_sources_path "${project}" "${repository}" "$@")"
+
+ local build_path="$(project_build_path "${project}" "$@")"
+
+ mkdir -p "${build_path}"
+ make -C "${sources_path}" -j"${TASKS}"
+ cp "${sources_path}/bucts" "${build_path}"
+ make -C "${sources_path}" 'clean'
+}
+
+build_check() {
+ project_build_check "${project}" "$@"
+}
+
+install() {
+ project_install "${project}" "$@"
+}
+
+install_check() {
+ project_install_check "${project}" "$@"
+}
+
+release() {
+ local repository="${project}"
+
+ project_release_install_archive "${project}" "${TOOLS}" "$@"
+ project_release_sources_git "${project}" "${repository}" "$@"
+}
+
+release_check() {
+ local repository="bucts"
+
+ project_release_install_archive_check "${project}" "${TOOLS}" "$@"
+ project_release_check_sources_git "${project}" "${repository}" "$@"
+}
+
+clean() {
+ project_clean "${project}" "$@"
+}
diff --git a/projects/bucts/configs/install b/projects/bucts/configs/install
new file mode 100644
index 00000000..28b72bcb
--- /dev/null
+++ b/projects/bucts/configs/install
@@ -0,0 +1 @@
+bucts:bucts
diff --git a/projects/bucts/configs/revision b/projects/bucts/configs/revision
new file mode 100644
index 00000000..1ac89ef2
--- /dev/null
+++ b/projects/bucts/configs/revision
@@ -0,0 +1 @@
+dc27919d7a66a6e8685ce07c71aefa4f03ef7c07
diff --git a/projects/bucts/configs/targets b/projects/bucts/configs/targets
new file mode 100644
index 00000000..915652d5
--- /dev/null
+++ b/projects/bucts/configs/targets
@@ -0,0 +1,2 @@
+generic
+lenovobios
diff --git a/projects/bucts/patches/0001-Makefile-don-t-use-git.patch b/projects/bucts/patches/0001-Makefile-don-t-use-git.patch
new file mode 100644
index 00000000..9a0e719c
--- /dev/null
+++ b/projects/bucts/patches/0001-Makefile-don-t-use-git.patch
@@ -0,0 +1,24 @@
+From 63312528ea81207865077ab2c75963e3660859f0 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <info@minifree.org>
+Date: Sat, 14 Feb 2015 00:56:43 +0000
+Subject: [PATCH] Makefile: don't use git
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 68541e6..b5f43d5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ CC:=gcc
+ OBJ:=bucts.o
+-VERSION:=$(shell git describe)
++VERSION:=withoutgit
+
+ ifeq ($(shell uname), FreeBSD)
+ CFLAGS = -I/usr/local/include
+--
+1.9.1
+
diff --git a/projects/bucts/patches/staticlink.diff b/projects/bucts/patches/staticlink.diff
new file mode 100644
index 00000000..52da8cc8
--- /dev/null
+++ b/projects/bucts/patches/staticlink.diff
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 68541e6..b8579eb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -10,7 +10,7 @@ endif
+ all: bucts
+
+ bucts: $(OBJ)
+- $(CC) -o $@ $(OBJ) $(LDFLAGS) -lpci
++ $(CC) -o $@ $(OBJ) $(LDFLAGS) -lpci -lz -static
+
+ %.o: %.c
+ $(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c $<
diff --git a/projects/cros-scripts/install/cros-boot-keys b/projects/cros-scripts/install/cros-boot-keys
index cf239718..416b7604 100755
--- a/projects/cros-scripts/install/cros-boot-keys
+++ b/projects/cros-scripts/install/cros-boot-keys
@@ -158,7 +158,7 @@ requirements() {
}
setup() {
- root=$( realpath "$( dirname "$0" )" )
+ root=$(readlink -f "$( dirname "$0" )" )
executable=$( basename "$0" )
if [ -z "$KEYS_VERSION" ]
diff --git a/projects/cros-scripts/install/cros-firmware-prepare b/projects/cros-scripts/install/cros-firmware-prepare
index d225e565..73820f05 100755
--- a/projects/cros-scripts/install/cros-firmware-prepare
+++ b/projects/cros-scripts/install/cros-firmware-prepare
@@ -244,7 +244,7 @@ requirements() {
}
setup() {
- root=$( realpath "$( dirname "$0" )" )
+ root=$(readlink -f "$( dirname "$0" )" )
executable=$( basename "$0" )
if ! [ -z "$VBOOT_TOOLS_PATH" ]
diff --git a/projects/cros-scripts/install/cros-kernel-install b/projects/cros-scripts/install/cros-kernel-install
index 33168caa..589a36c0 100755
--- a/projects/cros-scripts/install/cros-kernel-install
+++ b/projects/cros-scripts/install/cros-kernel-install
@@ -228,7 +228,7 @@ requirements() {
}
setup() {
- root=$( realpath "$( dirname "$0" )" )
+ root=$(readlink -f "$( dirname "$0" )" )
executable=$( basename "$0" )
if ! [ -z "$VBOOT_TOOLS_PATH" ]
diff --git a/projects/cros-scripts/install/cros-kernel-prepare b/projects/cros-scripts/install/cros-kernel-prepare
index 71a88cf8..4f374db4 100755
--- a/projects/cros-scripts/install/cros-kernel-prepare
+++ b/projects/cros-scripts/install/cros-kernel-prepare
@@ -95,7 +95,7 @@ requirements() {
}
setup() {
- root=$( realpath "$( dirname "$0" )" )
+ root=$(readlink -f "$( dirname "$0" )" )
executable=$( basename "$0" )
if ! [ -z "$VBOOT_TOOLS_PATH" ]
diff --git a/projects/cros-scripts/install/cros-medium-setup b/projects/cros-scripts/install/cros-medium-setup
index ffb4d894..c3419868 100755
--- a/projects/cros-scripts/install/cros-medium-setup
+++ b/projects/cros-scripts/install/cros-medium-setup
@@ -250,7 +250,7 @@ requirements() {
}
setup() {
- root=$( realpath "$( dirname "$0" )" )
+ root=$(readlink -f "$( dirname "$0" )" )
executable=$( basename "$0" )
if [ -z "$KERNEL_PATH" ]
diff --git a/projects/libreboot-release/install/libreboot-release b/projects/libreboot-release/install/libreboot-release
index 3dd85336..b916adac 100644
--- a/projects/libreboot-release/install/libreboot-release
+++ b/projects/libreboot-release/install/libreboot-release
@@ -246,7 +246,7 @@ requirements() {
}
setup() {
- root=$( realpath "$( dirname "$0" )" )
+ root=$(readlink -f "$( dirname "$0" )" )
executable=$( basename "$0" )
if [ -z "$MACHINE" ]
diff --git a/projects/libreboot-sources/install/libreboot-sources b/projects/libreboot-sources/install/libreboot-sources
index 953d4a1e..d2f19753 100755
--- a/projects/libreboot-sources/install/libreboot-sources
+++ b/projects/libreboot-sources/install/libreboot-sources
@@ -103,7 +103,7 @@ requirements() {
}
setup() {
- root=$( realpath "$( dirname "$0" )" )
+ root=$(readlink -f "$( dirname "$0" )" )
executable=$( basename "$0" )
}
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch
deleted file mode 100644
index 26632b7d..00000000
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-From 51dc727c71bbb10519a670b83b67a84f704e003a Mon Sep 17 00:00:00 2001
-From: Arthur Heymans <arthur@aheymans.xyz>
-Date: Mon, 22 Aug 2016 17:58:46 +0200
-Subject: [PATCH 1/2] gm45/gma.c: use screen on vga connector if connected
-
-The intel x4x and gm45 have very similar integrated graphic devices.
-Currently the x4x native graphic init enables VGA, while gm45 can output
-on LVDS.
-
-This patch reuses the x4x graphic initialisation code
-to enable output on VGA in gm45 in a way that the behavior is similar to vbios:
-If no VGA display is connected the internal LVDS screen is used.
-If an external screen is detected on the VGA port it will be used instead.
-
-Change-Id: I7e9ff793a5384ad8b4220fb1c0d9b28e6cee8391
-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
----
- src/northbridge/intel/gm45/gma.c | 157 ++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 153 insertions(+), 4 deletions(-)
-
-diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
-index d5f6471..74c9bc3 100644
---- a/src/northbridge/intel/gm45/gma.c
-+++ b/src/northbridge/intel/gm45/gma.c
-@@ -47,7 +47,7 @@ void gtt_write(u32 reg, u32 data)
- write32(res2mmio(gtt_res, reg, 0), data);
- }
-
--static void intel_gma_init(const struct northbridge_intel_gm45_config *info,
-+static void gma_init_lvds(const struct northbridge_intel_gm45_config *info,
- u8 *mmio, u32 physbase, u16 piobase, u32 lfb)
- {
-
-@@ -101,7 +101,7 @@ static void intel_gma_init(const struct northbridge_intel_gm45_config *info,
- sizeof(edid_data), &edid);
- mode = &edid.mode;
-
-- /* Disable screen memory to prevent garbage from appearing. */
-+ /* Disable screen memory to prevent garbage from appearing. */
- vga_sr_write(1, vga_sr_read(1) | 0x20);
-
- hactive = edid.x_resolution;
-@@ -344,6 +344,152 @@ static void intel_gma_init(const struct northbridge_intel_gm45_config *info,
- }
- }
-
-+static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
-+ u8 *mmio)
-+{
-+
-+ int i;
-+ u32 hactive, vactive;
-+
-+ vga_gr_write(0x18, 0);
-+
-+ write32(mmio + VGA0, 0x31108);
-+ write32(mmio + VGA1, 0x31406);
-+
-+ write32(mmio + ADPA, ADPA_DAC_ENABLE
-+ | ADPA_PIPE_A_SELECT
-+ | ADPA_CRT_HOTPLUG_MONITOR_COLOR
-+ | ADPA_CRT_HOTPLUG_ENABLE
-+ | ADPA_USE_VGA_HVPOLARITY
-+ | ADPA_VSYNC_CNTL_ENABLE
-+ | ADPA_HSYNC_CNTL_ENABLE
-+ | ADPA_DPMS_ON
-+ );
-+
-+ write32(mmio + 0x7041c, 0x0);
-+ write32(mmio + DPLL_MD(0), 0x3);
-+ write32(mmio + DPLL_MD(1), 0x3);
-+
-+ vga_misc_write(0x67);
-+
-+ const u8 cr[] = { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
-+ 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
-+ 0x9c, 0x8e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3,
-+ 0xff
-+ };
-+ vga_cr_write(0x11, 0);
-+
-+ for (i = 0; i <= 0x18; i++)
-+ vga_cr_write(i, cr[i]);
-+
-+ /* Disable screen memory to prevent garbage from appearing. */
-+ vga_sr_write(1, vga_sr_read(1) | 0x20);
-+
-+ hactive = 640;
-+ vactive = 400;
-+
-+ mdelay(1);
-+ write32(mmio + FP0(0), 0x31108);
-+ write32(mmio + DPLL(0),
-+ DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-+ | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-+ | 0x10601
-+ );
-+ mdelay(1);
-+ write32(mmio + DPLL(0),
-+ DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-+ | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-+ | 0x10601
-+ );
-+
-+ write32(mmio + ADPA, ADPA_DAC_ENABLE
-+ | ADPA_PIPE_A_SELECT
-+ | ADPA_CRT_HOTPLUG_MONITOR_COLOR
-+ | ADPA_CRT_HOTPLUG_ENABLE
-+ | ADPA_USE_VGA_HVPOLARITY
-+ | ADPA_VSYNC_CNTL_ENABLE
-+ | ADPA_HSYNC_CNTL_ENABLE
-+ | ADPA_DPMS_ON
-+ );
-+
-+ write32(mmio + HTOTAL(0),
-+ ((hactive - 1) << 16)
-+ | (hactive - 1));
-+ write32(mmio + HBLANK(0),
-+ ((hactive - 1) << 16)
-+ | (hactive - 1));
-+ write32(mmio + HSYNC(0),
-+ ((hactive - 1) << 16)
-+ | (hactive - 1));
-+
-+ write32(mmio + VTOTAL(0), ((vactive - 1) << 16)
-+ | (vactive - 1));
-+ write32(mmio + VBLANK(0), ((vactive - 1) << 16)
-+ | (vactive - 1));
-+ write32(mmio + VSYNC(0),
-+ ((vactive - 1) << 16)
-+ | (vactive - 1));
-+
-+ write32(mmio + PIPECONF(0), PIPECONF_DISABLE);
-+
-+ write32(mmio + PF_WIN_POS(0), 0);
-+
-+ write32(mmio + PIPESRC(0), (639 << 16) | 399);
-+ write32(mmio + PF_CTL(0), PF_ENABLE | PF_FILTER_MED_3x3);
-+ write32(mmio + PF_WIN_SZ(0), vactive | (hactive << 16));
-+ write32(mmio + PFIT_CONTROL, 0xa0000000);
-+
-+ mdelay(1);
-+
-+ write32(mmio + 0x000f000c, 0x00002040);
-+ mdelay(1);
-+ write32(mmio + 0x000f000c, 0x00002050);
-+ write32(mmio + 0x00060100, 0x00044000);
-+ mdelay(1);
-+ write32(mmio + PIPECONF(0), PIPECONF_ENABLE
-+ | PIPECONF_BPP_6 | PIPECONF_DITHER_EN);
-+
-+ write32(mmio + VGACNTRL, 0x0);
-+ write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888);
-+ mdelay(1);
-+
-+ write32(mmio + ADPA, ADPA_DAC_ENABLE
-+ | ADPA_PIPE_A_SELECT
-+ | ADPA_CRT_HOTPLUG_MONITOR_COLOR
-+ | ADPA_CRT_HOTPLUG_ENABLE
-+ | ADPA_USE_VGA_HVPOLARITY
-+ | ADPA_VSYNC_CNTL_ENABLE
-+ | ADPA_HSYNC_CNTL_ENABLE
-+ | ADPA_DPMS_ON
-+ );
-+
-+ vga_textmode_init();
-+
-+ /* Enable screen memory. */
-+ vga_sr_write(1, vga_sr_read(1) & ~0x20);
-+
-+ /* Clear interrupts. */
-+ write32(mmio + DEIIR, 0xffffffff);
-+ write32(mmio + SDEIIR, 0xffffffff);
-+}
-+
-+/* compare the header of the vga edid header */
-+/* if vga is not connected it should not have a correct header */
-+static u8 vga_connected(u8 *mmio)
-+{
-+ u8 vga_edid[128];
-+ u8 header[8] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
-+ intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, vga_edid, 128);
-+ for (int i = 0; i < 8; i++) {
-+ if (vga_edid[i] != header[i]) {
-+ printk(BIOS_DEBUG, "VGA not connected. Using LVDS display\n");
-+ return 0;
-+ }
-+ }
-+ printk(BIOS_SPEW, "VGA display connected\n");
-+ return 1;
-+}
-+
- static void gma_pm_init_post_vbios(struct device *const dev)
- {
- const struct northbridge_intel_gm45_config *const conf = dev->chip_info;
-@@ -419,8 +565,11 @@ static void gma_func0_init(struct device *dev)
- printk(BIOS_SPEW,
- "Initializing VGA without OPROM. MMIO 0x%llx\n",
- gtt_res->base);
-- intel_gma_init(conf, res2mmio(gtt_res, 0, 0), physbase,
-- pio_res->base, lfb_res->base);
-+ if (vga_connected(res2mmio(gtt_res, 0, 0)))
-+ gma_init_vga(conf, res2mmio(gtt_res, 0, 0));
-+ else
-+ gma_init_lvds(conf, res2mmio(gtt_res, 0, 0),
-+ physbase, pio_res->base, lfb_res->base);
- }
-
- /* Linux relies on VBT for panel info. */
---
-2.9.3
-
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch
deleted file mode 100644
index ef42f3e8..00000000
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch
+++ /dev/null
@@ -1,379 +0,0 @@
-From 44423cb3e0118b04739f89409e71a0ed1622ccd2 Mon Sep 17 00:00:00 2001
-From: Arthur Heymans <arthur@aheymans.xyz>
-Date: Sat, 27 Aug 2016 01:09:19 +0200
-Subject: [PATCH 2/2] nb/gm45/gma.c: enable VESA framebuffer mode on VGA output
-
-This implements "Keep VESA framebuffer" behavior on VGA output of gm45.
-This patch reuses Linux code to compute vga divisors.
-
-Change-Id: I2db5dd9bb1a7e309ca763b1559b89f7f5c8e6d3d
-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
----
- src/northbridge/intel/gm45/gma.c | 251 ++++++++++++++++++++++++++++++++-------
- 1 file changed, 209 insertions(+), 42 deletions(-)
-
-diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
-index 74c9bc3..efaa210 100644
---- a/src/northbridge/intel/gm45/gma.c
-+++ b/src/northbridge/intel/gm45/gma.c
-@@ -25,6 +25,7 @@
- #include <cpu/x86/msr.h>
- #include <cpu/x86/mtrr.h>
- #include <kconfig.h>
-+#include <commonlib/helpers.h>
-
- #include "drivers/intel/gma/i915_reg.h"
- #include "chip.h"
-@@ -35,6 +36,8 @@
- #include <pc80/vga.h>
- #include <pc80/vga_io.h>
-
-+#define BASE_FREQUECY 96000
-+
- static struct resource *gtt_res = NULL;
-
- u32 gtt_read(u32 reg)
-@@ -345,14 +348,38 @@ static void gma_init_lvds(const struct northbridge_intel_gm45_config *info,
- }
-
- static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
-- u8 *mmio)
-+ u8 *mmio, u32 physbase, u16 piobase, u32 lfb)
- {
-
- int i;
-- u32 hactive, vactive;
-+ u8 edid_data[128];
-+ struct edid edid;
-+ struct edid_mode *mode;
-+ u32 hactive, vactive, right_border, bottom_border;
-+ int hpolarity, vpolarity;
-+ u32 vsync, hsync, vblank, hblank, hfront_porch, vfront_porch;
-+ u32 target_frequency;
-+ u32 smallest_err = 0xffffffff;
-+ u32 pixel_p1 = 1;
-+ u32 pixel_n = 1;
-+ u32 pixel_m1 = 1;
-+ u32 pixel_m2 = 1;
-+ u32 link_frequency = info->gfx.link_frequency_270_mhz ? 270000 : 162000;
-+ u32 data_m1;
-+ u32 data_n1 = 0x00800000;
-+ u32 link_m1;
-+ u32 link_n1 = 0x00040000;
-+
-
- vga_gr_write(0x18, 0);
-
-+ /* Setup GTT. */
-+ for (i = 0; i < 0x2000; i++) {
-+ outl((i << 2) | 1, piobase);
-+ outl(physbase + (i << 12) + 1, piobase + 4);
-+ }
-+
-+
- write32(mmio + VGA0, 0x31108);
- write32(mmio + VGA1, 0x31406);
-
-@@ -363,8 +390,7 @@ static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
- | ADPA_USE_VGA_HVPOLARITY
- | ADPA_VSYNC_CNTL_ENABLE
- | ADPA_HSYNC_CNTL_ENABLE
-- | ADPA_DPMS_ON
-- );
-+ | ADPA_DPMS_ON);
-
- write32(mmio + 0x7041c, 0x0);
- write32(mmio + DPLL_MD(0), 0x3);
-@@ -382,95 +408,234 @@ static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
- for (i = 0; i <= 0x18; i++)
- vga_cr_write(i, cr[i]);
-
-+ udelay(1);
-+
-+ intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, edid_data, 128);
-+ intel_gmbus_stop(mmio + GMBUS0);
-+ decode_edid(edid_data,
-+ sizeof(edid_data), &edid);
-+ mode = &edid.mode;
-+
-+
- /* Disable screen memory to prevent garbage from appearing. */
- vga_sr_write(1, vga_sr_read(1) | 0x20);
-
-- hactive = 640;
-- vactive = 400;
-+ hactive = edid.x_resolution;
-+ vactive = edid.y_resolution;
-+ right_border = mode->hborder;
-+ bottom_border = mode->vborder;
-+ hpolarity = (mode->phsync == '-');
-+ vpolarity = (mode->pvsync == '-');
-+ vsync = mode->vspw;
-+ hsync = mode->hspw;
-+ vblank = mode->vbl;
-+ hblank = mode->hbl;
-+ hfront_porch = mode->hso;
-+ vfront_porch = mode->vso;
-+ target_frequency = mode->pixel_clock;
-+
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ vga_sr_write(1, 1);
-+ vga_sr_write(0x2, 0xf);
-+ vga_sr_write(0x3, 0x0);
-+ vga_sr_write(0x4, 0xe);
-+ vga_gr_write(0, 0x0);
-+ vga_gr_write(1, 0x0);
-+ vga_gr_write(2, 0x0);
-+ vga_gr_write(3, 0x0);
-+ vga_gr_write(4, 0x0);
-+ vga_gr_write(5, 0x0);
-+ vga_gr_write(6, 0x5);
-+ vga_gr_write(7, 0xf);
-+ vga_gr_write(0x10, 0x1);
-+ vga_gr_write(0x11, 0);
-+
-+ edid.bytes_per_line = (edid.bytes_per_line + 63) & ~63;
-+
-+ write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE
-+ | DISPPLANE_BGRX888);
-+ write32(mmio + DSPADDR(0), 0);
-+ write32(mmio + DSPSTRIDE(0), edid.bytes_per_line);
-+ write32(mmio + DSPSURF(0), 0);
-+ for (i = 0; i < 0x100; i++)
-+ write32(mmio + LGC_PALETTE(0) + 4 * i, i * 0x010101);
-+ } else {
-+ vga_textmode_init();
-+ }
-+
-+ u32 candn, candm1, candm2, candp1;
-+ for (candn = 1; candn <= 4; candn++) {
-+ for (candm1 = 23; candm1 >= 17; candm1--) {
-+ for (candm2 = 11; candm2 >= 5; candm2--) {
-+ for (candp1 = 8; candp1 >= 1; candp1--) {
-+ u32 m = 5 * (candm1 + 2) + (candm2 + 2);
-+ u32 p = candp1 * 10; /* 10 == p2 */
-+ u32 vco = DIV_ROUND_CLOSEST(BASE_FREQUECY * m, candn + 2);
-+ u32 dot = DIV_ROUND_CLOSEST(vco, p);
-+ u32 this_err = ABS(dot - target_frequency);
-+ if (this_err < smallest_err) {
-+ smallest_err= this_err;
-+ pixel_n = candn;
-+ pixel_m1 = candm1;
-+ pixel_m2 = candm2;
-+ pixel_p1 = candp1;
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ if (smallest_err == 0xffffffff) {
-+ printk(BIOS_ERR, "Couldn't find GFX clock divisors\n");
-+ return;
-+ }
-+
-+ link_m1 = ((uint64_t)link_n1 * mode->pixel_clock) / link_frequency;
-+ data_m1 = ((uint64_t)data_n1 * 18 * mode->pixel_clock)
-+ / (link_frequency * 8 * 4);
-+
-+ printk(BIOS_INFO, "bringing up panel at resolution %d x %d\n",
-+ hactive, vactive);
-+ printk(BIOS_DEBUG, "Borders %d x %d\n",
-+ right_border, bottom_border);
-+ printk(BIOS_DEBUG, "Blank %d x %d\n",
-+ hblank, vblank);
-+ printk(BIOS_DEBUG, "Sync %d x %d\n",
-+ hsync, vsync);
-+ printk(BIOS_DEBUG, "Front porch %d x %d\n",
-+ hfront_porch, vfront_porch);
-+ printk(BIOS_DEBUG, (info->gfx.use_spread_spectrum_clock
-+ ? "Spread spectrum clock\n" : "DREF clock\n"));
-+ printk(BIOS_DEBUG, "Polarities %d, %d\n",
-+ hpolarity, vpolarity);
-+ printk(BIOS_DEBUG, "Data M1=%d, N1=%d\n",
-+ data_m1, data_n1);
-+ printk(BIOS_DEBUG, "Link frequency %d kHz\n",
-+ link_frequency);
-+ printk(BIOS_DEBUG, "Link M1=%d, N1=%d\n",
-+ link_m1, link_n1);
-+ printk(BIOS_DEBUG, "Pixel N=%d, M1=%d, M2=%d, P1=%d\n",
-+ pixel_n, pixel_m1, pixel_m2, pixel_p1);
-+ printk(BIOS_DEBUG, "Pixel clock %d kHz\n",
-+ BASE_FREQUECY * (5 * (pixel_m1 + 2) + (pixel_m2 + 2) / (pixel_n + 2)
-+ / (pixel_p1 * 10)));
-
- mdelay(1);
-- write32(mmio + FP0(0), 0x31108);
-- write32(mmio + DPLL(0),
-- DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-- | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-- | 0x10601
-- );
-+ write32(mmio + FP0(0), (pixel_n << 16)
-+ | (pixel_m1 << 8) | pixel_m2);
-+ write32(mmio + DPLL(0), DPLL_VCO_ENABLE
-+ | DPLL_VGA_MODE_DIS | DPLLB_MODE_DAC_SERIAL
-+ | (0x10000 << (pixel_p1 - 1))
-+ | (6 << 9));
-+
- mdelay(1);
-- write32(mmio + DPLL(0),
-- DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-- | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-- | 0x10601
-- );
-+ write32(mmio + DPLL(0), DPLL_VCO_ENABLE
-+ | DPLL_VGA_MODE_DIS | DPLLB_MODE_DAC_SERIAL
-+ | (0x10000 << (pixel_p1 - 1))
-+ | (6 << 9));
-
- write32(mmio + ADPA, ADPA_DAC_ENABLE
- | ADPA_PIPE_A_SELECT
- | ADPA_CRT_HOTPLUG_MONITOR_COLOR
- | ADPA_CRT_HOTPLUG_ENABLE
-- | ADPA_USE_VGA_HVPOLARITY
- | ADPA_VSYNC_CNTL_ENABLE
- | ADPA_HSYNC_CNTL_ENABLE
- | ADPA_DPMS_ON
-- );
-+ | (vpolarity ? ADPA_VSYNC_ACTIVE_LOW :
-+ ADPA_VSYNC_ACTIVE_HIGH)
-+ | (hpolarity ? ADPA_HSYNC_ACTIVE_LOW :
-+ ADPA_HSYNC_ACTIVE_HIGH));
-
- write32(mmio + HTOTAL(0),
-- ((hactive - 1) << 16)
-+ ((hactive + right_border + hblank - 1) << 16)
- | (hactive - 1));
- write32(mmio + HBLANK(0),
-- ((hactive - 1) << 16)
-- | (hactive - 1));
-+ ((hactive + right_border + hblank - 1) << 16)
-+ | (hactive + right_border - 1));
- write32(mmio + HSYNC(0),
-- ((hactive - 1) << 16)
-- | (hactive - 1));
-+ ((hactive + right_border + hfront_porch + hsync - 1) << 16)
-+ | (hactive + right_border + hfront_porch - 1));
-
-- write32(mmio + VTOTAL(0), ((vactive - 1) << 16)
-- | (vactive - 1));
-- write32(mmio + VBLANK(0), ((vactive - 1) << 16)
-+ write32(mmio + VTOTAL(0), ((vactive + bottom_border + vblank - 1) << 16)
- | (vactive - 1));
-+ write32(mmio + VBLANK(0), ((vactive + bottom_border + vblank - 1) << 16)
-+ | (vactive + bottom_border - 1));
- write32(mmio + VSYNC(0),
-- ((vactive - 1) << 16)
-- | (vactive - 1));
-+ ((vactive + bottom_border + vfront_porch + vsync - 1) << 16)
-+ | (vactive + bottom_border + vfront_porch - 1));
-
- write32(mmio + PIPECONF(0), PIPECONF_DISABLE);
-
- write32(mmio + PF_WIN_POS(0), 0);
--
-- write32(mmio + PIPESRC(0), (639 << 16) | 399);
-- write32(mmio + PF_CTL(0), PF_ENABLE | PF_FILTER_MED_3x3);
-- write32(mmio + PF_WIN_SZ(0), vactive | (hactive << 16));
-- write32(mmio + PFIT_CONTROL, 0xa0000000);
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ write32(mmio + PIPESRC(0), ((hactive - 1) << 16)
-+ | (vactive - 1));
-+ write32(mmio + PF_CTL(0), 0);
-+ write32(mmio + PF_WIN_SZ(0), 0);
-+ write32(mmio + PFIT_CONTROL, 0);
-+ } else {
-+ write32(mmio + PIPESRC(0), (639 << 16) | 399);
-+ write32(mmio + PF_CTL(0), PF_ENABLE | PF_FILTER_MED_3x3);
-+ write32(mmio + PF_WIN_SZ(0), vactive | (hactive << 16));
-+ write32(mmio + PFIT_CONTROL, 0x80000000);
-+ }
-
- mdelay(1);
-
-+ write32(mmio + PIPE_DATA_M1(0), 0x7e000000 | data_m1);
-+ write32(mmio + PIPE_DATA_N1(0), data_n1);
-+ write32(mmio + PIPE_LINK_M1(0), link_m1);
-+ write32(mmio + PIPE_LINK_N1(0), link_n1);
-+
- write32(mmio + 0x000f000c, 0x00002040);
- mdelay(1);
- write32(mmio + 0x000f000c, 0x00002050);
- write32(mmio + 0x00060100, 0x00044000);
- mdelay(1);
-+ write32(mmio + PIPECONF(0), PIPECONF_BPP_6);
-+ write32(mmio + 0x000f0008, 0x00000040);
-+ write32(mmio + 0x000f000c, 0x00022050);
-+ write32(mmio + PIPECONF(0), PIPECONF_BPP_6 | PIPECONF_DITHER_EN);
- write32(mmio + PIPECONF(0), PIPECONF_ENABLE
- | PIPECONF_BPP_6 | PIPECONF_DITHER_EN);
-
-- write32(mmio + VGACNTRL, 0x0);
-- write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888);
-- mdelay(1);
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ write32(mmio + VGACNTRL, VGA_DISP_DISABLE);
-+ write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE
-+ | DISPPLANE_BGRX888);
-+ mdelay(1);
-+ } else {
-+ write32(mmio + VGACNTRL, 0xc4008e);
-+ }
-
- write32(mmio + ADPA, ADPA_DAC_ENABLE
- | ADPA_PIPE_A_SELECT
- | ADPA_CRT_HOTPLUG_MONITOR_COLOR
- | ADPA_CRT_HOTPLUG_ENABLE
-- | ADPA_USE_VGA_HVPOLARITY
- | ADPA_VSYNC_CNTL_ENABLE
- | ADPA_HSYNC_CNTL_ENABLE
- | ADPA_DPMS_ON
-- );
-+ | (vpolarity ? ADPA_VSYNC_ACTIVE_LOW :
-+ ADPA_VSYNC_ACTIVE_HIGH)
-+ | (hpolarity ? ADPA_HSYNC_ACTIVE_LOW :
-+ ADPA_HSYNC_ACTIVE_HIGH));
-
-- vga_textmode_init();
-+ write32(mmio + PP_CONTROL, PANEL_POWER_ON | PANEL_POWER_RESET);
-
-- /* Enable screen memory. */
-+ /* Enable screen memory. */
- vga_sr_write(1, vga_sr_read(1) & ~0x20);
-
- /* Clear interrupts. */
- write32(mmio + DEIIR, 0xffffffff);
- write32(mmio + SDEIIR, 0xffffffff);
-+
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ memset((void *) lfb, 0,
-+ edid.x_resolution * edid.y_resolution * 4);
-+ set_vbe_mode_info_valid(&edid, lfb);
-+ }
-+
-+
- }
-
- /* compare the header of the vga edid header */
-@@ -480,6 +645,7 @@ static u8 vga_connected(u8 *mmio)
- u8 vga_edid[128];
- u8 header[8] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
- intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, vga_edid, 128);
-+ intel_gmbus_stop(mmio + GMBUS0);
- for (int i = 0; i < 8; i++) {
- if (vga_edid[i] != header[i]) {
- printk(BIOS_DEBUG, "VGA not connected. Using LVDS display\n");
-@@ -566,7 +732,8 @@ static void gma_func0_init(struct device *dev)
- "Initializing VGA without OPROM. MMIO 0x%llx\n",
- gtt_res->base);
- if (vga_connected(res2mmio(gtt_res, 0, 0)))
-- gma_init_vga(conf, res2mmio(gtt_res, 0, 0));
-+ gma_init_vga(conf, res2mmio(gtt_res, 0, 0),
-+ physbase, pio_res->base, lfb_res->base);
- else
- gma_init_lvds(conf, res2mmio(gtt_res, 0, 0),
- physbase, pio_res->base, lfb_res->base);
---
-2.9.3
-
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch
deleted file mode 100644
index fb30c4c2..00000000
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From d7fe366539f2a492b4a64030618506690bfbb232 Mon Sep 17 00:00:00 2001
-From: Arthur Heymans <arthur@aheymans.xyz>
-Date: Thu, 8 Sep 2016 22:21:54 +0200
-Subject: [PATCH] gm45/gma.c: use correct id string for fake VBT
-
-The correct id string for gm45 is "$VBT CANTIGA ".
-This can be found in the gm45 option rom:
-"strings vbios.bin | grep VBT".
-
-Change-Id: Icd67a87dac774b4b3c211511c784c4fb4e2ea97c
-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
----
- src/northbridge/intel/gm45/gma.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
-index d5f6471..19bd944 100644
---- a/src/northbridge/intel/gm45/gma.c
-+++ b/src/northbridge/intel/gm45/gma.c
-@@ -425,7 +425,7 @@ static void gma_func0_init(struct device *dev)
-
- /* Linux relies on VBT for panel info. */
- generate_fake_intel_oprom(&conf->gfx, dev,
-- "$VBT IRONLAKE-MOBILE");
-+ "$VBT CANTIGA ");
- }
- }
-
---
-2.9.3
-
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/reused.list b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/reused.list
index 59e0a36a..30301d55 100644
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/reused.list
+++ b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_16mb/reused.list
@@ -4,4 +4,3 @@
/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0002-make-256M-vram-the-default-for-gm45-laptops.patch
/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0003-hardcode-use-on-intel-integrated-graphic-device-on-t.patch
/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-gm45-gma.c-clean-up-some-registers.patch
-/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-nb-intel-gm45-Fix-IOMMU.patch
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch
deleted file mode 100644
index 26632b7d..00000000
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-From 51dc727c71bbb10519a670b83b67a84f704e003a Mon Sep 17 00:00:00 2001
-From: Arthur Heymans <arthur@aheymans.xyz>
-Date: Mon, 22 Aug 2016 17:58:46 +0200
-Subject: [PATCH 1/2] gm45/gma.c: use screen on vga connector if connected
-
-The intel x4x and gm45 have very similar integrated graphic devices.
-Currently the x4x native graphic init enables VGA, while gm45 can output
-on LVDS.
-
-This patch reuses the x4x graphic initialisation code
-to enable output on VGA in gm45 in a way that the behavior is similar to vbios:
-If no VGA display is connected the internal LVDS screen is used.
-If an external screen is detected on the VGA port it will be used instead.
-
-Change-Id: I7e9ff793a5384ad8b4220fb1c0d9b28e6cee8391
-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
----
- src/northbridge/intel/gm45/gma.c | 157 ++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 153 insertions(+), 4 deletions(-)
-
-diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
-index d5f6471..74c9bc3 100644
---- a/src/northbridge/intel/gm45/gma.c
-+++ b/src/northbridge/intel/gm45/gma.c
-@@ -47,7 +47,7 @@ void gtt_write(u32 reg, u32 data)
- write32(res2mmio(gtt_res, reg, 0), data);
- }
-
--static void intel_gma_init(const struct northbridge_intel_gm45_config *info,
-+static void gma_init_lvds(const struct northbridge_intel_gm45_config *info,
- u8 *mmio, u32 physbase, u16 piobase, u32 lfb)
- {
-
-@@ -101,7 +101,7 @@ static void intel_gma_init(const struct northbridge_intel_gm45_config *info,
- sizeof(edid_data), &edid);
- mode = &edid.mode;
-
-- /* Disable screen memory to prevent garbage from appearing. */
-+ /* Disable screen memory to prevent garbage from appearing. */
- vga_sr_write(1, vga_sr_read(1) | 0x20);
-
- hactive = edid.x_resolution;
-@@ -344,6 +344,152 @@ static void intel_gma_init(const struct northbridge_intel_gm45_config *info,
- }
- }
-
-+static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
-+ u8 *mmio)
-+{
-+
-+ int i;
-+ u32 hactive, vactive;
-+
-+ vga_gr_write(0x18, 0);
-+
-+ write32(mmio + VGA0, 0x31108);
-+ write32(mmio + VGA1, 0x31406);
-+
-+ write32(mmio + ADPA, ADPA_DAC_ENABLE
-+ | ADPA_PIPE_A_SELECT
-+ | ADPA_CRT_HOTPLUG_MONITOR_COLOR
-+ | ADPA_CRT_HOTPLUG_ENABLE
-+ | ADPA_USE_VGA_HVPOLARITY
-+ | ADPA_VSYNC_CNTL_ENABLE
-+ | ADPA_HSYNC_CNTL_ENABLE
-+ | ADPA_DPMS_ON
-+ );
-+
-+ write32(mmio + 0x7041c, 0x0);
-+ write32(mmio + DPLL_MD(0), 0x3);
-+ write32(mmio + DPLL_MD(1), 0x3);
-+
-+ vga_misc_write(0x67);
-+
-+ const u8 cr[] = { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
-+ 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
-+ 0x9c, 0x8e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3,
-+ 0xff
-+ };
-+ vga_cr_write(0x11, 0);
-+
-+ for (i = 0; i <= 0x18; i++)
-+ vga_cr_write(i, cr[i]);
-+
-+ /* Disable screen memory to prevent garbage from appearing. */
-+ vga_sr_write(1, vga_sr_read(1) | 0x20);
-+
-+ hactive = 640;
-+ vactive = 400;
-+
-+ mdelay(1);
-+ write32(mmio + FP0(0), 0x31108);
-+ write32(mmio + DPLL(0),
-+ DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-+ | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-+ | 0x10601
-+ );
-+ mdelay(1);
-+ write32(mmio + DPLL(0),
-+ DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-+ | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-+ | 0x10601
-+ );
-+
-+ write32(mmio + ADPA, ADPA_DAC_ENABLE
-+ | ADPA_PIPE_A_SELECT
-+ | ADPA_CRT_HOTPLUG_MONITOR_COLOR
-+ | ADPA_CRT_HOTPLUG_ENABLE
-+ | ADPA_USE_VGA_HVPOLARITY
-+ | ADPA_VSYNC_CNTL_ENABLE
-+ | ADPA_HSYNC_CNTL_ENABLE
-+ | ADPA_DPMS_ON
-+ );
-+
-+ write32(mmio + HTOTAL(0),
-+ ((hactive - 1) << 16)
-+ | (hactive - 1));
-+ write32(mmio + HBLANK(0),
-+ ((hactive - 1) << 16)
-+ | (hactive - 1));
-+ write32(mmio + HSYNC(0),
-+ ((hactive - 1) << 16)
-+ | (hactive - 1));
-+
-+ write32(mmio + VTOTAL(0), ((vactive - 1) << 16)
-+ | (vactive - 1));
-+ write32(mmio + VBLANK(0), ((vactive - 1) << 16)
-+ | (vactive - 1));
-+ write32(mmio + VSYNC(0),
-+ ((vactive - 1) << 16)
-+ | (vactive - 1));
-+
-+ write32(mmio + PIPECONF(0), PIPECONF_DISABLE);
-+
-+ write32(mmio + PF_WIN_POS(0), 0);
-+
-+ write32(mmio + PIPESRC(0), (639 << 16) | 399);
-+ write32(mmio + PF_CTL(0), PF_ENABLE | PF_FILTER_MED_3x3);
-+ write32(mmio + PF_WIN_SZ(0), vactive | (hactive << 16));
-+ write32(mmio + PFIT_CONTROL, 0xa0000000);
-+
-+ mdelay(1);
-+
-+ write32(mmio + 0x000f000c, 0x00002040);
-+ mdelay(1);
-+ write32(mmio + 0x000f000c, 0x00002050);
-+ write32(mmio + 0x00060100, 0x00044000);
-+ mdelay(1);
-+ write32(mmio + PIPECONF(0), PIPECONF_ENABLE
-+ | PIPECONF_BPP_6 | PIPECONF_DITHER_EN);
-+
-+ write32(mmio + VGACNTRL, 0x0);
-+ write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888);
-+ mdelay(1);
-+
-+ write32(mmio + ADPA, ADPA_DAC_ENABLE
-+ | ADPA_PIPE_A_SELECT
-+ | ADPA_CRT_HOTPLUG_MONITOR_COLOR
-+ | ADPA_CRT_HOTPLUG_ENABLE
-+ | ADPA_USE_VGA_HVPOLARITY
-+ | ADPA_VSYNC_CNTL_ENABLE
-+ | ADPA_HSYNC_CNTL_ENABLE
-+ | ADPA_DPMS_ON
-+ );
-+
-+ vga_textmode_init();
-+
-+ /* Enable screen memory. */
-+ vga_sr_write(1, vga_sr_read(1) & ~0x20);
-+
-+ /* Clear interrupts. */
-+ write32(mmio + DEIIR, 0xffffffff);
-+ write32(mmio + SDEIIR, 0xffffffff);
-+}
-+
-+/* compare the header of the vga edid header */
-+/* if vga is not connected it should not have a correct header */
-+static u8 vga_connected(u8 *mmio)
-+{
-+ u8 vga_edid[128];
-+ u8 header[8] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
-+ intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, vga_edid, 128);
-+ for (int i = 0; i < 8; i++) {
-+ if (vga_edid[i] != header[i]) {
-+ printk(BIOS_DEBUG, "VGA not connected. Using LVDS display\n");
-+ return 0;
-+ }
-+ }
-+ printk(BIOS_SPEW, "VGA display connected\n");
-+ return 1;
-+}
-+
- static void gma_pm_init_post_vbios(struct device *const dev)
- {
- const struct northbridge_intel_gm45_config *const conf = dev->chip_info;
-@@ -419,8 +565,11 @@ static void gma_func0_init(struct device *dev)
- printk(BIOS_SPEW,
- "Initializing VGA without OPROM. MMIO 0x%llx\n",
- gtt_res->base);
-- intel_gma_init(conf, res2mmio(gtt_res, 0, 0), physbase,
-- pio_res->base, lfb_res->base);
-+ if (vga_connected(res2mmio(gtt_res, 0, 0)))
-+ gma_init_vga(conf, res2mmio(gtt_res, 0, 0));
-+ else
-+ gma_init_lvds(conf, res2mmio(gtt_res, 0, 0),
-+ physbase, pio_res->base, lfb_res->base);
- }
-
- /* Linux relies on VBT for panel info. */
---
-2.9.3
-
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch
deleted file mode 100644
index ef42f3e8..00000000
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch
+++ /dev/null
@@ -1,379 +0,0 @@
-From 44423cb3e0118b04739f89409e71a0ed1622ccd2 Mon Sep 17 00:00:00 2001
-From: Arthur Heymans <arthur@aheymans.xyz>
-Date: Sat, 27 Aug 2016 01:09:19 +0200
-Subject: [PATCH 2/2] nb/gm45/gma.c: enable VESA framebuffer mode on VGA output
-
-This implements "Keep VESA framebuffer" behavior on VGA output of gm45.
-This patch reuses Linux code to compute vga divisors.
-
-Change-Id: I2db5dd9bb1a7e309ca763b1559b89f7f5c8e6d3d
-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
----
- src/northbridge/intel/gm45/gma.c | 251 ++++++++++++++++++++++++++++++++-------
- 1 file changed, 209 insertions(+), 42 deletions(-)
-
-diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
-index 74c9bc3..efaa210 100644
---- a/src/northbridge/intel/gm45/gma.c
-+++ b/src/northbridge/intel/gm45/gma.c
-@@ -25,6 +25,7 @@
- #include <cpu/x86/msr.h>
- #include <cpu/x86/mtrr.h>
- #include <kconfig.h>
-+#include <commonlib/helpers.h>
-
- #include "drivers/intel/gma/i915_reg.h"
- #include "chip.h"
-@@ -35,6 +36,8 @@
- #include <pc80/vga.h>
- #include <pc80/vga_io.h>
-
-+#define BASE_FREQUECY 96000
-+
- static struct resource *gtt_res = NULL;
-
- u32 gtt_read(u32 reg)
-@@ -345,14 +348,38 @@ static void gma_init_lvds(const struct northbridge_intel_gm45_config *info,
- }
-
- static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
-- u8 *mmio)
-+ u8 *mmio, u32 physbase, u16 piobase, u32 lfb)
- {
-
- int i;
-- u32 hactive, vactive;
-+ u8 edid_data[128];
-+ struct edid edid;
-+ struct edid_mode *mode;
-+ u32 hactive, vactive, right_border, bottom_border;
-+ int hpolarity, vpolarity;
-+ u32 vsync, hsync, vblank, hblank, hfront_porch, vfront_porch;
-+ u32 target_frequency;
-+ u32 smallest_err = 0xffffffff;
-+ u32 pixel_p1 = 1;
-+ u32 pixel_n = 1;
-+ u32 pixel_m1 = 1;
-+ u32 pixel_m2 = 1;
-+ u32 link_frequency = info->gfx.link_frequency_270_mhz ? 270000 : 162000;
-+ u32 data_m1;
-+ u32 data_n1 = 0x00800000;
-+ u32 link_m1;
-+ u32 link_n1 = 0x00040000;
-+
-
- vga_gr_write(0x18, 0);
-
-+ /* Setup GTT. */
-+ for (i = 0; i < 0x2000; i++) {
-+ outl((i << 2) | 1, piobase);
-+ outl(physbase + (i << 12) + 1, piobase + 4);
-+ }
-+
-+
- write32(mmio + VGA0, 0x31108);
- write32(mmio + VGA1, 0x31406);
-
-@@ -363,8 +390,7 @@ static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
- | ADPA_USE_VGA_HVPOLARITY
- | ADPA_VSYNC_CNTL_ENABLE
- | ADPA_HSYNC_CNTL_ENABLE
-- | ADPA_DPMS_ON
-- );
-+ | ADPA_DPMS_ON);
-
- write32(mmio + 0x7041c, 0x0);
- write32(mmio + DPLL_MD(0), 0x3);
-@@ -382,95 +408,234 @@ static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
- for (i = 0; i <= 0x18; i++)
- vga_cr_write(i, cr[i]);
-
-+ udelay(1);
-+
-+ intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, edid_data, 128);
-+ intel_gmbus_stop(mmio + GMBUS0);
-+ decode_edid(edid_data,
-+ sizeof(edid_data), &edid);
-+ mode = &edid.mode;
-+
-+
- /* Disable screen memory to prevent garbage from appearing. */
- vga_sr_write(1, vga_sr_read(1) | 0x20);
-
-- hactive = 640;
-- vactive = 400;
-+ hactive = edid.x_resolution;
-+ vactive = edid.y_resolution;
-+ right_border = mode->hborder;
-+ bottom_border = mode->vborder;
-+ hpolarity = (mode->phsync == '-');
-+ vpolarity = (mode->pvsync == '-');
-+ vsync = mode->vspw;
-+ hsync = mode->hspw;
-+ vblank = mode->vbl;
-+ hblank = mode->hbl;
-+ hfront_porch = mode->hso;
-+ vfront_porch = mode->vso;
-+ target_frequency = mode->pixel_clock;
-+
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ vga_sr_write(1, 1);
-+ vga_sr_write(0x2, 0xf);
-+ vga_sr_write(0x3, 0x0);
-+ vga_sr_write(0x4, 0xe);
-+ vga_gr_write(0, 0x0);
-+ vga_gr_write(1, 0x0);
-+ vga_gr_write(2, 0x0);
-+ vga_gr_write(3, 0x0);
-+ vga_gr_write(4, 0x0);
-+ vga_gr_write(5, 0x0);
-+ vga_gr_write(6, 0x5);
-+ vga_gr_write(7, 0xf);
-+ vga_gr_write(0x10, 0x1);
-+ vga_gr_write(0x11, 0);
-+
-+ edid.bytes_per_line = (edid.bytes_per_line + 63) & ~63;
-+
-+ write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE
-+ | DISPPLANE_BGRX888);
-+ write32(mmio + DSPADDR(0), 0);
-+ write32(mmio + DSPSTRIDE(0), edid.bytes_per_line);
-+ write32(mmio + DSPSURF(0), 0);
-+ for (i = 0; i < 0x100; i++)
-+ write32(mmio + LGC_PALETTE(0) + 4 * i, i * 0x010101);
-+ } else {
-+ vga_textmode_init();
-+ }
-+
-+ u32 candn, candm1, candm2, candp1;
-+ for (candn = 1; candn <= 4; candn++) {
-+ for (candm1 = 23; candm1 >= 17; candm1--) {
-+ for (candm2 = 11; candm2 >= 5; candm2--) {
-+ for (candp1 = 8; candp1 >= 1; candp1--) {
-+ u32 m = 5 * (candm1 + 2) + (candm2 + 2);
-+ u32 p = candp1 * 10; /* 10 == p2 */
-+ u32 vco = DIV_ROUND_CLOSEST(BASE_FREQUECY * m, candn + 2);
-+ u32 dot = DIV_ROUND_CLOSEST(vco, p);
-+ u32 this_err = ABS(dot - target_frequency);
-+ if (this_err < smallest_err) {
-+ smallest_err= this_err;
-+ pixel_n = candn;
-+ pixel_m1 = candm1;
-+ pixel_m2 = candm2;
-+ pixel_p1 = candp1;
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ if (smallest_err == 0xffffffff) {
-+ printk(BIOS_ERR, "Couldn't find GFX clock divisors\n");
-+ return;
-+ }
-+
-+ link_m1 = ((uint64_t)link_n1 * mode->pixel_clock) / link_frequency;
-+ data_m1 = ((uint64_t)data_n1 * 18 * mode->pixel_clock)
-+ / (link_frequency * 8 * 4);
-+
-+ printk(BIOS_INFO, "bringing up panel at resolution %d x %d\n",
-+ hactive, vactive);
-+ printk(BIOS_DEBUG, "Borders %d x %d\n",
-+ right_border, bottom_border);
-+ printk(BIOS_DEBUG, "Blank %d x %d\n",
-+ hblank, vblank);
-+ printk(BIOS_DEBUG, "Sync %d x %d\n",
-+ hsync, vsync);
-+ printk(BIOS_DEBUG, "Front porch %d x %d\n",
-+ hfront_porch, vfront_porch);
-+ printk(BIOS_DEBUG, (info->gfx.use_spread_spectrum_clock
-+ ? "Spread spectrum clock\n" : "DREF clock\n"));
-+ printk(BIOS_DEBUG, "Polarities %d, %d\n",
-+ hpolarity, vpolarity);
-+ printk(BIOS_DEBUG, "Data M1=%d, N1=%d\n",
-+ data_m1, data_n1);
-+ printk(BIOS_DEBUG, "Link frequency %d kHz\n",
-+ link_frequency);
-+ printk(BIOS_DEBUG, "Link M1=%d, N1=%d\n",
-+ link_m1, link_n1);
-+ printk(BIOS_DEBUG, "Pixel N=%d, M1=%d, M2=%d, P1=%d\n",
-+ pixel_n, pixel_m1, pixel_m2, pixel_p1);
-+ printk(BIOS_DEBUG, "Pixel clock %d kHz\n",
-+ BASE_FREQUECY * (5 * (pixel_m1 + 2) + (pixel_m2 + 2) / (pixel_n + 2)
-+ / (pixel_p1 * 10)));
-
- mdelay(1);
-- write32(mmio + FP0(0), 0x31108);
-- write32(mmio + DPLL(0),
-- DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-- | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-- | 0x10601
-- );
-+ write32(mmio + FP0(0), (pixel_n << 16)
-+ | (pixel_m1 << 8) | pixel_m2);
-+ write32(mmio + DPLL(0), DPLL_VCO_ENABLE
-+ | DPLL_VGA_MODE_DIS | DPLLB_MODE_DAC_SERIAL
-+ | (0x10000 << (pixel_p1 - 1))
-+ | (6 << 9));
-+
- mdelay(1);
-- write32(mmio + DPLL(0),
-- DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-- | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-- | 0x10601
-- );
-+ write32(mmio + DPLL(0), DPLL_VCO_ENABLE
-+ | DPLL_VGA_MODE_DIS | DPLLB_MODE_DAC_SERIAL
-+ | (0x10000 << (pixel_p1 - 1))
-+ | (6 << 9));
-
- write32(mmio + ADPA, ADPA_DAC_ENABLE
- | ADPA_PIPE_A_SELECT
- | ADPA_CRT_HOTPLUG_MONITOR_COLOR
- | ADPA_CRT_HOTPLUG_ENABLE
-- | ADPA_USE_VGA_HVPOLARITY
- | ADPA_VSYNC_CNTL_ENABLE
- | ADPA_HSYNC_CNTL_ENABLE
- | ADPA_DPMS_ON
-- );
-+ | (vpolarity ? ADPA_VSYNC_ACTIVE_LOW :
-+ ADPA_VSYNC_ACTIVE_HIGH)
-+ | (hpolarity ? ADPA_HSYNC_ACTIVE_LOW :
-+ ADPA_HSYNC_ACTIVE_HIGH));
-
- write32(mmio + HTOTAL(0),
-- ((hactive - 1) << 16)
-+ ((hactive + right_border + hblank - 1) << 16)
- | (hactive - 1));
- write32(mmio + HBLANK(0),
-- ((hactive - 1) << 16)
-- | (hactive - 1));
-+ ((hactive + right_border + hblank - 1) << 16)
-+ | (hactive + right_border - 1));
- write32(mmio + HSYNC(0),
-- ((hactive - 1) << 16)
-- | (hactive - 1));
-+ ((hactive + right_border + hfront_porch + hsync - 1) << 16)
-+ | (hactive + right_border + hfront_porch - 1));
-
-- write32(mmio + VTOTAL(0), ((vactive - 1) << 16)
-- | (vactive - 1));
-- write32(mmio + VBLANK(0), ((vactive - 1) << 16)
-+ write32(mmio + VTOTAL(0), ((vactive + bottom_border + vblank - 1) << 16)
- | (vactive - 1));
-+ write32(mmio + VBLANK(0), ((vactive + bottom_border + vblank - 1) << 16)
-+ | (vactive + bottom_border - 1));
- write32(mmio + VSYNC(0),
-- ((vactive - 1) << 16)
-- | (vactive - 1));
-+ ((vactive + bottom_border + vfront_porch + vsync - 1) << 16)
-+ | (vactive + bottom_border + vfront_porch - 1));
-
- write32(mmio + PIPECONF(0), PIPECONF_DISABLE);
-
- write32(mmio + PF_WIN_POS(0), 0);
--
-- write32(mmio + PIPESRC(0), (639 << 16) | 399);
-- write32(mmio + PF_CTL(0), PF_ENABLE | PF_FILTER_MED_3x3);
-- write32(mmio + PF_WIN_SZ(0), vactive | (hactive << 16));
-- write32(mmio + PFIT_CONTROL, 0xa0000000);
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ write32(mmio + PIPESRC(0), ((hactive - 1) << 16)
-+ | (vactive - 1));
-+ write32(mmio + PF_CTL(0), 0);
-+ write32(mmio + PF_WIN_SZ(0), 0);
-+ write32(mmio + PFIT_CONTROL, 0);
-+ } else {
-+ write32(mmio + PIPESRC(0), (639 << 16) | 399);
-+ write32(mmio + PF_CTL(0), PF_ENABLE | PF_FILTER_MED_3x3);
-+ write32(mmio + PF_WIN_SZ(0), vactive | (hactive << 16));
-+ write32(mmio + PFIT_CONTROL, 0x80000000);
-+ }
-
- mdelay(1);
-
-+ write32(mmio + PIPE_DATA_M1(0), 0x7e000000 | data_m1);
-+ write32(mmio + PIPE_DATA_N1(0), data_n1);
-+ write32(mmio + PIPE_LINK_M1(0), link_m1);
-+ write32(mmio + PIPE_LINK_N1(0), link_n1);
-+
- write32(mmio + 0x000f000c, 0x00002040);
- mdelay(1);
- write32(mmio + 0x000f000c, 0x00002050);
- write32(mmio + 0x00060100, 0x00044000);
- mdelay(1);
-+ write32(mmio + PIPECONF(0), PIPECONF_BPP_6);
-+ write32(mmio + 0x000f0008, 0x00000040);
-+ write32(mmio + 0x000f000c, 0x00022050);
-+ write32(mmio + PIPECONF(0), PIPECONF_BPP_6 | PIPECONF_DITHER_EN);
- write32(mmio + PIPECONF(0), PIPECONF_ENABLE
- | PIPECONF_BPP_6 | PIPECONF_DITHER_EN);
-
-- write32(mmio + VGACNTRL, 0x0);
-- write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888);
-- mdelay(1);
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ write32(mmio + VGACNTRL, VGA_DISP_DISABLE);
-+ write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE
-+ | DISPPLANE_BGRX888);
-+ mdelay(1);
-+ } else {
-+ write32(mmio + VGACNTRL, 0xc4008e);
-+ }
-
- write32(mmio + ADPA, ADPA_DAC_ENABLE
- | ADPA_PIPE_A_SELECT
- | ADPA_CRT_HOTPLUG_MONITOR_COLOR
- | ADPA_CRT_HOTPLUG_ENABLE
-- | ADPA_USE_VGA_HVPOLARITY
- | ADPA_VSYNC_CNTL_ENABLE
- | ADPA_HSYNC_CNTL_ENABLE
- | ADPA_DPMS_ON
-- );
-+ | (vpolarity ? ADPA_VSYNC_ACTIVE_LOW :
-+ ADPA_VSYNC_ACTIVE_HIGH)
-+ | (hpolarity ? ADPA_HSYNC_ACTIVE_LOW :
-+ ADPA_HSYNC_ACTIVE_HIGH));
-
-- vga_textmode_init();
-+ write32(mmio + PP_CONTROL, PANEL_POWER_ON | PANEL_POWER_RESET);
-
-- /* Enable screen memory. */
-+ /* Enable screen memory. */
- vga_sr_write(1, vga_sr_read(1) & ~0x20);
-
- /* Clear interrupts. */
- write32(mmio + DEIIR, 0xffffffff);
- write32(mmio + SDEIIR, 0xffffffff);
-+
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ memset((void *) lfb, 0,
-+ edid.x_resolution * edid.y_resolution * 4);
-+ set_vbe_mode_info_valid(&edid, lfb);
-+ }
-+
-+
- }
-
- /* compare the header of the vga edid header */
-@@ -480,6 +645,7 @@ static u8 vga_connected(u8 *mmio)
- u8 vga_edid[128];
- u8 header[8] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
- intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, vga_edid, 128);
-+ intel_gmbus_stop(mmio + GMBUS0);
- for (int i = 0; i < 8; i++) {
- if (vga_edid[i] != header[i]) {
- printk(BIOS_DEBUG, "VGA not connected. Using LVDS display\n");
-@@ -566,7 +732,8 @@ static void gma_func0_init(struct device *dev)
- "Initializing VGA without OPROM. MMIO 0x%llx\n",
- gtt_res->base);
- if (vga_connected(res2mmio(gtt_res, 0, 0)))
-- gma_init_vga(conf, res2mmio(gtt_res, 0, 0));
-+ gma_init_vga(conf, res2mmio(gtt_res, 0, 0),
-+ physbase, pio_res->base, lfb_res->base);
- else
- gma_init_lvds(conf, res2mmio(gtt_res, 0, 0),
- physbase, pio_res->base, lfb_res->base);
---
-2.9.3
-
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch
deleted file mode 100644
index fb30c4c2..00000000
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From d7fe366539f2a492b4a64030618506690bfbb232 Mon Sep 17 00:00:00 2001
-From: Arthur Heymans <arthur@aheymans.xyz>
-Date: Thu, 8 Sep 2016 22:21:54 +0200
-Subject: [PATCH] gm45/gma.c: use correct id string for fake VBT
-
-The correct id string for gm45 is "$VBT CANTIGA ".
-This can be found in the gm45 option rom:
-"strings vbios.bin | grep VBT".
-
-Change-Id: Icd67a87dac774b4b3c211511c784c4fb4e2ea97c
-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
----
- src/northbridge/intel/gm45/gma.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
-index d5f6471..19bd944 100644
---- a/src/northbridge/intel/gm45/gma.c
-+++ b/src/northbridge/intel/gm45/gma.c
-@@ -425,7 +425,7 @@ static void gma_func0_init(struct device *dev)
-
- /* Linux relies on VBT for panel info. */
- generate_fake_intel_oprom(&conf->gfx, dev,
-- "$VBT IRONLAKE-MOBILE");
-+ "$VBT CANTIGA ");
- }
- }
-
---
-2.9.3
-
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/reused.list b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/reused.list
index 59e0a36a..30301d55 100644
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/reused.list
+++ b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_4mb/reused.list
@@ -4,4 +4,3 @@
/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0002-make-256M-vram-the-default-for-gm45-laptops.patch
/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0003-hardcode-use-on-intel-integrated-graphic-device-on-t.patch
/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-gm45-gma.c-clean-up-some-registers.patch
-/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-nb-intel-gm45-Fix-IOMMU.patch
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch
deleted file mode 100644
index 26632b7d..00000000
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0002-gm45-gma.c-use-screen-on-vga-connector-if-connected.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-From 51dc727c71bbb10519a670b83b67a84f704e003a Mon Sep 17 00:00:00 2001
-From: Arthur Heymans <arthur@aheymans.xyz>
-Date: Mon, 22 Aug 2016 17:58:46 +0200
-Subject: [PATCH 1/2] gm45/gma.c: use screen on vga connector if connected
-
-The intel x4x and gm45 have very similar integrated graphic devices.
-Currently the x4x native graphic init enables VGA, while gm45 can output
-on LVDS.
-
-This patch reuses the x4x graphic initialisation code
-to enable output on VGA in gm45 in a way that the behavior is similar to vbios:
-If no VGA display is connected the internal LVDS screen is used.
-If an external screen is detected on the VGA port it will be used instead.
-
-Change-Id: I7e9ff793a5384ad8b4220fb1c0d9b28e6cee8391
-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
----
- src/northbridge/intel/gm45/gma.c | 157 ++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 153 insertions(+), 4 deletions(-)
-
-diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
-index d5f6471..74c9bc3 100644
---- a/src/northbridge/intel/gm45/gma.c
-+++ b/src/northbridge/intel/gm45/gma.c
-@@ -47,7 +47,7 @@ void gtt_write(u32 reg, u32 data)
- write32(res2mmio(gtt_res, reg, 0), data);
- }
-
--static void intel_gma_init(const struct northbridge_intel_gm45_config *info,
-+static void gma_init_lvds(const struct northbridge_intel_gm45_config *info,
- u8 *mmio, u32 physbase, u16 piobase, u32 lfb)
- {
-
-@@ -101,7 +101,7 @@ static void intel_gma_init(const struct northbridge_intel_gm45_config *info,
- sizeof(edid_data), &edid);
- mode = &edid.mode;
-
-- /* Disable screen memory to prevent garbage from appearing. */
-+ /* Disable screen memory to prevent garbage from appearing. */
- vga_sr_write(1, vga_sr_read(1) | 0x20);
-
- hactive = edid.x_resolution;
-@@ -344,6 +344,152 @@ static void intel_gma_init(const struct northbridge_intel_gm45_config *info,
- }
- }
-
-+static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
-+ u8 *mmio)
-+{
-+
-+ int i;
-+ u32 hactive, vactive;
-+
-+ vga_gr_write(0x18, 0);
-+
-+ write32(mmio + VGA0, 0x31108);
-+ write32(mmio + VGA1, 0x31406);
-+
-+ write32(mmio + ADPA, ADPA_DAC_ENABLE
-+ | ADPA_PIPE_A_SELECT
-+ | ADPA_CRT_HOTPLUG_MONITOR_COLOR
-+ | ADPA_CRT_HOTPLUG_ENABLE
-+ | ADPA_USE_VGA_HVPOLARITY
-+ | ADPA_VSYNC_CNTL_ENABLE
-+ | ADPA_HSYNC_CNTL_ENABLE
-+ | ADPA_DPMS_ON
-+ );
-+
-+ write32(mmio + 0x7041c, 0x0);
-+ write32(mmio + DPLL_MD(0), 0x3);
-+ write32(mmio + DPLL_MD(1), 0x3);
-+
-+ vga_misc_write(0x67);
-+
-+ const u8 cr[] = { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
-+ 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
-+ 0x9c, 0x8e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3,
-+ 0xff
-+ };
-+ vga_cr_write(0x11, 0);
-+
-+ for (i = 0; i <= 0x18; i++)
-+ vga_cr_write(i, cr[i]);
-+
-+ /* Disable screen memory to prevent garbage from appearing. */
-+ vga_sr_write(1, vga_sr_read(1) | 0x20);
-+
-+ hactive = 640;
-+ vactive = 400;
-+
-+ mdelay(1);
-+ write32(mmio + FP0(0), 0x31108);
-+ write32(mmio + DPLL(0),
-+ DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-+ | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-+ | 0x10601
-+ );
-+ mdelay(1);
-+ write32(mmio + DPLL(0),
-+ DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-+ | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-+ | 0x10601
-+ );
-+
-+ write32(mmio + ADPA, ADPA_DAC_ENABLE
-+ | ADPA_PIPE_A_SELECT
-+ | ADPA_CRT_HOTPLUG_MONITOR_COLOR
-+ | ADPA_CRT_HOTPLUG_ENABLE
-+ | ADPA_USE_VGA_HVPOLARITY
-+ | ADPA_VSYNC_CNTL_ENABLE
-+ | ADPA_HSYNC_CNTL_ENABLE
-+ | ADPA_DPMS_ON
-+ );
-+
-+ write32(mmio + HTOTAL(0),
-+ ((hactive - 1) << 16)
-+ | (hactive - 1));
-+ write32(mmio + HBLANK(0),
-+ ((hactive - 1) << 16)
-+ | (hactive - 1));
-+ write32(mmio + HSYNC(0),
-+ ((hactive - 1) << 16)
-+ | (hactive - 1));
-+
-+ write32(mmio + VTOTAL(0), ((vactive - 1) << 16)
-+ | (vactive - 1));
-+ write32(mmio + VBLANK(0), ((vactive - 1) << 16)
-+ | (vactive - 1));
-+ write32(mmio + VSYNC(0),
-+ ((vactive - 1) << 16)
-+ | (vactive - 1));
-+
-+ write32(mmio + PIPECONF(0), PIPECONF_DISABLE);
-+
-+ write32(mmio + PF_WIN_POS(0), 0);
-+
-+ write32(mmio + PIPESRC(0), (639 << 16) | 399);
-+ write32(mmio + PF_CTL(0), PF_ENABLE | PF_FILTER_MED_3x3);
-+ write32(mmio + PF_WIN_SZ(0), vactive | (hactive << 16));
-+ write32(mmio + PFIT_CONTROL, 0xa0000000);
-+
-+ mdelay(1);
-+
-+ write32(mmio + 0x000f000c, 0x00002040);
-+ mdelay(1);
-+ write32(mmio + 0x000f000c, 0x00002050);
-+ write32(mmio + 0x00060100, 0x00044000);
-+ mdelay(1);
-+ write32(mmio + PIPECONF(0), PIPECONF_ENABLE
-+ | PIPECONF_BPP_6 | PIPECONF_DITHER_EN);
-+
-+ write32(mmio + VGACNTRL, 0x0);
-+ write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888);
-+ mdelay(1);
-+
-+ write32(mmio + ADPA, ADPA_DAC_ENABLE
-+ | ADPA_PIPE_A_SELECT
-+ | ADPA_CRT_HOTPLUG_MONITOR_COLOR
-+ | ADPA_CRT_HOTPLUG_ENABLE
-+ | ADPA_USE_VGA_HVPOLARITY
-+ | ADPA_VSYNC_CNTL_ENABLE
-+ | ADPA_HSYNC_CNTL_ENABLE
-+ | ADPA_DPMS_ON
-+ );
-+
-+ vga_textmode_init();
-+
-+ /* Enable screen memory. */
-+ vga_sr_write(1, vga_sr_read(1) & ~0x20);
-+
-+ /* Clear interrupts. */
-+ write32(mmio + DEIIR, 0xffffffff);
-+ write32(mmio + SDEIIR, 0xffffffff);
-+}
-+
-+/* compare the header of the vga edid header */
-+/* if vga is not connected it should not have a correct header */
-+static u8 vga_connected(u8 *mmio)
-+{
-+ u8 vga_edid[128];
-+ u8 header[8] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
-+ intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, vga_edid, 128);
-+ for (int i = 0; i < 8; i++) {
-+ if (vga_edid[i] != header[i]) {
-+ printk(BIOS_DEBUG, "VGA not connected. Using LVDS display\n");
-+ return 0;
-+ }
-+ }
-+ printk(BIOS_SPEW, "VGA display connected\n");
-+ return 1;
-+}
-+
- static void gma_pm_init_post_vbios(struct device *const dev)
- {
- const struct northbridge_intel_gm45_config *const conf = dev->chip_info;
-@@ -419,8 +565,11 @@ static void gma_func0_init(struct device *dev)
- printk(BIOS_SPEW,
- "Initializing VGA without OPROM. MMIO 0x%llx\n",
- gtt_res->base);
-- intel_gma_init(conf, res2mmio(gtt_res, 0, 0), physbase,
-- pio_res->base, lfb_res->base);
-+ if (vga_connected(res2mmio(gtt_res, 0, 0)))
-+ gma_init_vga(conf, res2mmio(gtt_res, 0, 0));
-+ else
-+ gma_init_lvds(conf, res2mmio(gtt_res, 0, 0),
-+ physbase, pio_res->base, lfb_res->base);
- }
-
- /* Linux relies on VBT for panel info. */
---
-2.9.3
-
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch
deleted file mode 100644
index ef42f3e8..00000000
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0003-nb-gm45-gma.c-enable-VESA-framebuffer-mode-on-VGA-ou.patch
+++ /dev/null
@@ -1,379 +0,0 @@
-From 44423cb3e0118b04739f89409e71a0ed1622ccd2 Mon Sep 17 00:00:00 2001
-From: Arthur Heymans <arthur@aheymans.xyz>
-Date: Sat, 27 Aug 2016 01:09:19 +0200
-Subject: [PATCH 2/2] nb/gm45/gma.c: enable VESA framebuffer mode on VGA output
-
-This implements "Keep VESA framebuffer" behavior on VGA output of gm45.
-This patch reuses Linux code to compute vga divisors.
-
-Change-Id: I2db5dd9bb1a7e309ca763b1559b89f7f5c8e6d3d
-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
----
- src/northbridge/intel/gm45/gma.c | 251 ++++++++++++++++++++++++++++++++-------
- 1 file changed, 209 insertions(+), 42 deletions(-)
-
-diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
-index 74c9bc3..efaa210 100644
---- a/src/northbridge/intel/gm45/gma.c
-+++ b/src/northbridge/intel/gm45/gma.c
-@@ -25,6 +25,7 @@
- #include <cpu/x86/msr.h>
- #include <cpu/x86/mtrr.h>
- #include <kconfig.h>
-+#include <commonlib/helpers.h>
-
- #include "drivers/intel/gma/i915_reg.h"
- #include "chip.h"
-@@ -35,6 +36,8 @@
- #include <pc80/vga.h>
- #include <pc80/vga_io.h>
-
-+#define BASE_FREQUECY 96000
-+
- static struct resource *gtt_res = NULL;
-
- u32 gtt_read(u32 reg)
-@@ -345,14 +348,38 @@ static void gma_init_lvds(const struct northbridge_intel_gm45_config *info,
- }
-
- static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
-- u8 *mmio)
-+ u8 *mmio, u32 physbase, u16 piobase, u32 lfb)
- {
-
- int i;
-- u32 hactive, vactive;
-+ u8 edid_data[128];
-+ struct edid edid;
-+ struct edid_mode *mode;
-+ u32 hactive, vactive, right_border, bottom_border;
-+ int hpolarity, vpolarity;
-+ u32 vsync, hsync, vblank, hblank, hfront_porch, vfront_porch;
-+ u32 target_frequency;
-+ u32 smallest_err = 0xffffffff;
-+ u32 pixel_p1 = 1;
-+ u32 pixel_n = 1;
-+ u32 pixel_m1 = 1;
-+ u32 pixel_m2 = 1;
-+ u32 link_frequency = info->gfx.link_frequency_270_mhz ? 270000 : 162000;
-+ u32 data_m1;
-+ u32 data_n1 = 0x00800000;
-+ u32 link_m1;
-+ u32 link_n1 = 0x00040000;
-+
-
- vga_gr_write(0x18, 0);
-
-+ /* Setup GTT. */
-+ for (i = 0; i < 0x2000; i++) {
-+ outl((i << 2) | 1, piobase);
-+ outl(physbase + (i << 12) + 1, piobase + 4);
-+ }
-+
-+
- write32(mmio + VGA0, 0x31108);
- write32(mmio + VGA1, 0x31406);
-
-@@ -363,8 +390,7 @@ static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
- | ADPA_USE_VGA_HVPOLARITY
- | ADPA_VSYNC_CNTL_ENABLE
- | ADPA_HSYNC_CNTL_ENABLE
-- | ADPA_DPMS_ON
-- );
-+ | ADPA_DPMS_ON);
-
- write32(mmio + 0x7041c, 0x0);
- write32(mmio + DPLL_MD(0), 0x3);
-@@ -382,95 +408,234 @@ static void gma_init_vga(const struct northbridge_intel_gm45_config *info,
- for (i = 0; i <= 0x18; i++)
- vga_cr_write(i, cr[i]);
-
-+ udelay(1);
-+
-+ intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, edid_data, 128);
-+ intel_gmbus_stop(mmio + GMBUS0);
-+ decode_edid(edid_data,
-+ sizeof(edid_data), &edid);
-+ mode = &edid.mode;
-+
-+
- /* Disable screen memory to prevent garbage from appearing. */
- vga_sr_write(1, vga_sr_read(1) | 0x20);
-
-- hactive = 640;
-- vactive = 400;
-+ hactive = edid.x_resolution;
-+ vactive = edid.y_resolution;
-+ right_border = mode->hborder;
-+ bottom_border = mode->vborder;
-+ hpolarity = (mode->phsync == '-');
-+ vpolarity = (mode->pvsync == '-');
-+ vsync = mode->vspw;
-+ hsync = mode->hspw;
-+ vblank = mode->vbl;
-+ hblank = mode->hbl;
-+ hfront_porch = mode->hso;
-+ vfront_porch = mode->vso;
-+ target_frequency = mode->pixel_clock;
-+
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ vga_sr_write(1, 1);
-+ vga_sr_write(0x2, 0xf);
-+ vga_sr_write(0x3, 0x0);
-+ vga_sr_write(0x4, 0xe);
-+ vga_gr_write(0, 0x0);
-+ vga_gr_write(1, 0x0);
-+ vga_gr_write(2, 0x0);
-+ vga_gr_write(3, 0x0);
-+ vga_gr_write(4, 0x0);
-+ vga_gr_write(5, 0x0);
-+ vga_gr_write(6, 0x5);
-+ vga_gr_write(7, 0xf);
-+ vga_gr_write(0x10, 0x1);
-+ vga_gr_write(0x11, 0);
-+
-+ edid.bytes_per_line = (edid.bytes_per_line + 63) & ~63;
-+
-+ write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE
-+ | DISPPLANE_BGRX888);
-+ write32(mmio + DSPADDR(0), 0);
-+ write32(mmio + DSPSTRIDE(0), edid.bytes_per_line);
-+ write32(mmio + DSPSURF(0), 0);
-+ for (i = 0; i < 0x100; i++)
-+ write32(mmio + LGC_PALETTE(0) + 4 * i, i * 0x010101);
-+ } else {
-+ vga_textmode_init();
-+ }
-+
-+ u32 candn, candm1, candm2, candp1;
-+ for (candn = 1; candn <= 4; candn++) {
-+ for (candm1 = 23; candm1 >= 17; candm1--) {
-+ for (candm2 = 11; candm2 >= 5; candm2--) {
-+ for (candp1 = 8; candp1 >= 1; candp1--) {
-+ u32 m = 5 * (candm1 + 2) + (candm2 + 2);
-+ u32 p = candp1 * 10; /* 10 == p2 */
-+ u32 vco = DIV_ROUND_CLOSEST(BASE_FREQUECY * m, candn + 2);
-+ u32 dot = DIV_ROUND_CLOSEST(vco, p);
-+ u32 this_err = ABS(dot - target_frequency);
-+ if (this_err < smallest_err) {
-+ smallest_err= this_err;
-+ pixel_n = candn;
-+ pixel_m1 = candm1;
-+ pixel_m2 = candm2;
-+ pixel_p1 = candp1;
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ if (smallest_err == 0xffffffff) {
-+ printk(BIOS_ERR, "Couldn't find GFX clock divisors\n");
-+ return;
-+ }
-+
-+ link_m1 = ((uint64_t)link_n1 * mode->pixel_clock) / link_frequency;
-+ data_m1 = ((uint64_t)data_n1 * 18 * mode->pixel_clock)
-+ / (link_frequency * 8 * 4);
-+
-+ printk(BIOS_INFO, "bringing up panel at resolution %d x %d\n",
-+ hactive, vactive);
-+ printk(BIOS_DEBUG, "Borders %d x %d\n",
-+ right_border, bottom_border);
-+ printk(BIOS_DEBUG, "Blank %d x %d\n",
-+ hblank, vblank);
-+ printk(BIOS_DEBUG, "Sync %d x %d\n",
-+ hsync, vsync);
-+ printk(BIOS_DEBUG, "Front porch %d x %d\n",
-+ hfront_porch, vfront_porch);
-+ printk(BIOS_DEBUG, (info->gfx.use_spread_spectrum_clock
-+ ? "Spread spectrum clock\n" : "DREF clock\n"));
-+ printk(BIOS_DEBUG, "Polarities %d, %d\n",
-+ hpolarity, vpolarity);
-+ printk(BIOS_DEBUG, "Data M1=%d, N1=%d\n",
-+ data_m1, data_n1);
-+ printk(BIOS_DEBUG, "Link frequency %d kHz\n",
-+ link_frequency);
-+ printk(BIOS_DEBUG, "Link M1=%d, N1=%d\n",
-+ link_m1, link_n1);
-+ printk(BIOS_DEBUG, "Pixel N=%d, M1=%d, M2=%d, P1=%d\n",
-+ pixel_n, pixel_m1, pixel_m2, pixel_p1);
-+ printk(BIOS_DEBUG, "Pixel clock %d kHz\n",
-+ BASE_FREQUECY * (5 * (pixel_m1 + 2) + (pixel_m2 + 2) / (pixel_n + 2)
-+ / (pixel_p1 * 10)));
-
- mdelay(1);
-- write32(mmio + FP0(0), 0x31108);
-- write32(mmio + DPLL(0),
-- DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-- | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-- | 0x10601
-- );
-+ write32(mmio + FP0(0), (pixel_n << 16)
-+ | (pixel_m1 << 8) | pixel_m2);
-+ write32(mmio + DPLL(0), DPLL_VCO_ENABLE
-+ | DPLL_VGA_MODE_DIS | DPLLB_MODE_DAC_SERIAL
-+ | (0x10000 << (pixel_p1 - 1))
-+ | (6 << 9));
-+
- mdelay(1);
-- write32(mmio + DPLL(0),
-- DPLL_VCO_ENABLE | DPLLB_MODE_DAC_SERIAL
-- | DPLL_DAC_SERIAL_P2_CLOCK_DIV_10
-- | 0x10601
-- );
-+ write32(mmio + DPLL(0), DPLL_VCO_ENABLE
-+ | DPLL_VGA_MODE_DIS | DPLLB_MODE_DAC_SERIAL
-+ | (0x10000 << (pixel_p1 - 1))
-+ | (6 << 9));
-
- write32(mmio + ADPA, ADPA_DAC_ENABLE
- | ADPA_PIPE_A_SELECT
- | ADPA_CRT_HOTPLUG_MONITOR_COLOR
- | ADPA_CRT_HOTPLUG_ENABLE
-- | ADPA_USE_VGA_HVPOLARITY
- | ADPA_VSYNC_CNTL_ENABLE
- | ADPA_HSYNC_CNTL_ENABLE
- | ADPA_DPMS_ON
-- );
-+ | (vpolarity ? ADPA_VSYNC_ACTIVE_LOW :
-+ ADPA_VSYNC_ACTIVE_HIGH)
-+ | (hpolarity ? ADPA_HSYNC_ACTIVE_LOW :
-+ ADPA_HSYNC_ACTIVE_HIGH));
-
- write32(mmio + HTOTAL(0),
-- ((hactive - 1) << 16)
-+ ((hactive + right_border + hblank - 1) << 16)
- | (hactive - 1));
- write32(mmio + HBLANK(0),
-- ((hactive - 1) << 16)
-- | (hactive - 1));
-+ ((hactive + right_border + hblank - 1) << 16)
-+ | (hactive + right_border - 1));
- write32(mmio + HSYNC(0),
-- ((hactive - 1) << 16)
-- | (hactive - 1));
-+ ((hactive + right_border + hfront_porch + hsync - 1) << 16)
-+ | (hactive + right_border + hfront_porch - 1));
-
-- write32(mmio + VTOTAL(0), ((vactive - 1) << 16)
-- | (vactive - 1));
-- write32(mmio + VBLANK(0), ((vactive - 1) << 16)
-+ write32(mmio + VTOTAL(0), ((vactive + bottom_border + vblank - 1) << 16)
- | (vactive - 1));
-+ write32(mmio + VBLANK(0), ((vactive + bottom_border + vblank - 1) << 16)
-+ | (vactive + bottom_border - 1));
- write32(mmio + VSYNC(0),
-- ((vactive - 1) << 16)
-- | (vactive - 1));
-+ ((vactive + bottom_border + vfront_porch + vsync - 1) << 16)
-+ | (vactive + bottom_border + vfront_porch - 1));
-
- write32(mmio + PIPECONF(0), PIPECONF_DISABLE);
-
- write32(mmio + PF_WIN_POS(0), 0);
--
-- write32(mmio + PIPESRC(0), (639 << 16) | 399);
-- write32(mmio + PF_CTL(0), PF_ENABLE | PF_FILTER_MED_3x3);
-- write32(mmio + PF_WIN_SZ(0), vactive | (hactive << 16));
-- write32(mmio + PFIT_CONTROL, 0xa0000000);
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ write32(mmio + PIPESRC(0), ((hactive - 1) << 16)
-+ | (vactive - 1));
-+ write32(mmio + PF_CTL(0), 0);
-+ write32(mmio + PF_WIN_SZ(0), 0);
-+ write32(mmio + PFIT_CONTROL, 0);
-+ } else {
-+ write32(mmio + PIPESRC(0), (639 << 16) | 399);
-+ write32(mmio + PF_CTL(0), PF_ENABLE | PF_FILTER_MED_3x3);
-+ write32(mmio + PF_WIN_SZ(0), vactive | (hactive << 16));
-+ write32(mmio + PFIT_CONTROL, 0x80000000);
-+ }
-
- mdelay(1);
-
-+ write32(mmio + PIPE_DATA_M1(0), 0x7e000000 | data_m1);
-+ write32(mmio + PIPE_DATA_N1(0), data_n1);
-+ write32(mmio + PIPE_LINK_M1(0), link_m1);
-+ write32(mmio + PIPE_LINK_N1(0), link_n1);
-+
- write32(mmio + 0x000f000c, 0x00002040);
- mdelay(1);
- write32(mmio + 0x000f000c, 0x00002050);
- write32(mmio + 0x00060100, 0x00044000);
- mdelay(1);
-+ write32(mmio + PIPECONF(0), PIPECONF_BPP_6);
-+ write32(mmio + 0x000f0008, 0x00000040);
-+ write32(mmio + 0x000f000c, 0x00022050);
-+ write32(mmio + PIPECONF(0), PIPECONF_BPP_6 | PIPECONF_DITHER_EN);
- write32(mmio + PIPECONF(0), PIPECONF_ENABLE
- | PIPECONF_BPP_6 | PIPECONF_DITHER_EN);
-
-- write32(mmio + VGACNTRL, 0x0);
-- write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888);
-- mdelay(1);
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ write32(mmio + VGACNTRL, VGA_DISP_DISABLE);
-+ write32(mmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE
-+ | DISPPLANE_BGRX888);
-+ mdelay(1);
-+ } else {
-+ write32(mmio + VGACNTRL, 0xc4008e);
-+ }
-
- write32(mmio + ADPA, ADPA_DAC_ENABLE
- | ADPA_PIPE_A_SELECT
- | ADPA_CRT_HOTPLUG_MONITOR_COLOR
- | ADPA_CRT_HOTPLUG_ENABLE
-- | ADPA_USE_VGA_HVPOLARITY
- | ADPA_VSYNC_CNTL_ENABLE
- | ADPA_HSYNC_CNTL_ENABLE
- | ADPA_DPMS_ON
-- );
-+ | (vpolarity ? ADPA_VSYNC_ACTIVE_LOW :
-+ ADPA_VSYNC_ACTIVE_HIGH)
-+ | (hpolarity ? ADPA_HSYNC_ACTIVE_LOW :
-+ ADPA_HSYNC_ACTIVE_HIGH));
-
-- vga_textmode_init();
-+ write32(mmio + PP_CONTROL, PANEL_POWER_ON | PANEL_POWER_RESET);
-
-- /* Enable screen memory. */
-+ /* Enable screen memory. */
- vga_sr_write(1, vga_sr_read(1) & ~0x20);
-
- /* Clear interrupts. */
- write32(mmio + DEIIR, 0xffffffff);
- write32(mmio + SDEIIR, 0xffffffff);
-+
-+ if (IS_ENABLED(CONFIG_FRAMEBUFFER_KEEP_VESA_MODE)) {
-+ memset((void *) lfb, 0,
-+ edid.x_resolution * edid.y_resolution * 4);
-+ set_vbe_mode_info_valid(&edid, lfb);
-+ }
-+
-+
- }
-
- /* compare the header of the vga edid header */
-@@ -480,6 +645,7 @@ static u8 vga_connected(u8 *mmio)
- u8 vga_edid[128];
- u8 header[8] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
- intel_gmbus_read_edid(mmio + GMBUS0, 2, 0x50, vga_edid, 128);
-+ intel_gmbus_stop(mmio + GMBUS0);
- for (int i = 0; i < 8; i++) {
- if (vga_edid[i] != header[i]) {
- printk(BIOS_DEBUG, "VGA not connected. Using LVDS display\n");
-@@ -566,7 +732,8 @@ static void gma_func0_init(struct device *dev)
- "Initializing VGA without OPROM. MMIO 0x%llx\n",
- gtt_res->base);
- if (vga_connected(res2mmio(gtt_res, 0, 0)))
-- gma_init_vga(conf, res2mmio(gtt_res, 0, 0));
-+ gma_init_vga(conf, res2mmio(gtt_res, 0, 0),
-+ physbase, pio_res->base, lfb_res->base);
- else
- gma_init_lvds(conf, res2mmio(gtt_res, 0, 0),
- physbase, pio_res->base, lfb_res->base);
---
-2.9.3
-
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch
deleted file mode 100644
index fb30c4c2..00000000
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/0004-gm45-gma.c-use-correct-id-string-for-fake-VBT.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From d7fe366539f2a492b4a64030618506690bfbb232 Mon Sep 17 00:00:00 2001
-From: Arthur Heymans <arthur@aheymans.xyz>
-Date: Thu, 8 Sep 2016 22:21:54 +0200
-Subject: [PATCH] gm45/gma.c: use correct id string for fake VBT
-
-The correct id string for gm45 is "$VBT CANTIGA ".
-This can be found in the gm45 option rom:
-"strings vbios.bin | grep VBT".
-
-Change-Id: Icd67a87dac774b4b3c211511c784c4fb4e2ea97c
-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
----
- src/northbridge/intel/gm45/gma.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c
-index d5f6471..19bd944 100644
---- a/src/northbridge/intel/gm45/gma.c
-+++ b/src/northbridge/intel/gm45/gma.c
-@@ -425,7 +425,7 @@ static void gma_func0_init(struct device *dev)
-
- /* Linux relies on VBT for panel info. */
- generate_fake_intel_oprom(&conf->gfx, dev,
-- "$VBT IRONLAKE-MOBILE");
-+ "$VBT CANTIGA ");
- }
- }
-
---
-2.9.3
-
diff --git a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/reused.list b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/reused.list
index 59e0a36a..30301d55 100644
--- a/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/reused.list
+++ b/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/w500_8mb/reused.list
@@ -4,4 +4,3 @@
/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0002-make-256M-vram-the-default-for-gm45-laptops.patch
/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/t400_8mb/0003-hardcode-use-on-intel-integrated-graphic-device-on-t.patch
/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-gm45-gma.c-clean-up-some-registers.patch
-/resources/libreboot/patch/coreboot/d83b0e9ac4174cca92ac2c3b83a7e8491a9a1ff4/grub/x200_8mb/0001-nb-intel-gm45-Fix-IOMMU.patch
diff --git a/resources/scripts/misc/grubeditor.sh b/resources/scripts/misc/grubeditor.sh
index 025161f3..84284645 100644
--- a/resources/scripts/misc/grubeditor.sh
+++ b/resources/scripts/misc/grubeditor.sh
@@ -19,42 +19,64 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# Usage:
-# ./grubeditor.sh [options] romimage
-#
-# Supported options:
-#
-# -h | --help: show usage help
-#
-# -r | --realcfg: generate grub.cfg instead of grubtest.cfg
-#
-# -i | --inplace: do not create a .modified romfile, instead modify the
-# existing file
-#
-# -e | --editor /path/to/editor: open the cfg file with /path/to/editor instead
-# of $EDITOR
-#
-# -s | --swapcfg: swap grub.cfg and grubtest.cfg, incompatible with other
-# options besides -i
-#
-# -x | --extractcfg: extract either grub.cfg or grubtest.cfg depending on
-# whether -r is set
-#
-# -d | --diffcfg: diff grub.cfg and grubtest.cfg, incompatible with other
-# options besides -D
-#
-# -D | --differ [/path/to/]differ: use /path/to/differ instead of "diff", can
-# be an interactive program like vimdiff
+# THIS BLOCK IS EXPERIMENTAL
+# Allow debugging by running DEBUG= ${0}.
+[[ "x${DEBUG+set}" = 'xset' ]] && set -v
+# -u kills the script if any variables are unassigned
+# -e kills the script if any function returns not-zero
+#set -u
+
+##############
+# HELP COMMAND
+##############
+
+show_help() {
+ cat << HELPSCREEN
+$0 -- conveniently edit grub{test}.cfg files in Libreboot
+ROM image files by automating their extraction with cbfstool
+and the user's editor of choice.
+
+Usage:
+
+$0 [OPTIONS] [ROMFILE]
+
+Options:
+
+-h | --help: show usage help
+
+-r | --realcfg: generate grub.cfg instead of grubtest.cfg
+
+-i | --inplace: do not create a modified romfile, instead
+modify the existing file
+
+-e | --editor [/path/to/]editor: open the cfg file with
+/path/to/editor instead of the value of \$EDITOR
+
+-s | --swapcfg: swap grub.cfg and grubtest.cfg
+
+-d | --diffcfg: diff grub.cfg and grubtest.cfg
+
+-D | --differ [/path/to/]differ: use /path/to/differ instead
+of "diff", can be an interactive program like vimdiff
+
+-x | --extract: extract either grub.cfg or grubtest.cfg
+depending on -r option
+HELPSCREEN
+}
+
+# Version number of script
+geversion="0.2.0"
# Define the list of available option in both short and long form.
-shortopts="hrie:sdD:"
-longopts="help,realcfg,inplace,editor:,swapcfgs,diffcfgs,differ:"
+shortopts="hvrie:sdD:x"
+longopts="help,version,realcfg,inplace,editor:,swapcfgs,diffcfgs,differ:,extract"
# Variables for modifying the program's operation
edit_realcfg=0
edit_inplace=0
do_swapcfgs=0
do_diffcfgs=0
+do_extract=0
# Path to cbfstool, filled by detect_architecture
# (Possible to provide explicitly and disclaim warranty?)
cbfstool=""
@@ -69,7 +91,18 @@ differ_rawarg=""
# Last but not least, the rom file itself
romfile=""
-# This program works primarily from a cascade of functions. Let's define them.
+############################
+#### PRIMARY FUNCTIONS #####
+############################
+# The script effectively lives in a series of function definitions, which are
+# provided here before their calls to ensure that they have been declared.
+#
+# Please scroll to the bottom of the script to see how this cascade of
+# functions gets initiated.
+
+################
+# OPTION SCRAPER
+################
get_options() {
# Test for enhanced getopt.
@@ -80,7 +113,7 @@ get_options() {
fi
# Parse the command line options based on the previously defined values.
- parsedopts=$(getopt --options ${shortopts} --longoptions ${longopts} --name "${0}" -- "$@")
+ parsedopts=$(getopt --options $shortopts --longoptions $longopts --name "$0" -- "$@")
if [[ $? -ne 0 ]]; then # getopt didn't approve of your arguments
echo "Unrecognized options."
exit 206
@@ -94,9 +127,14 @@ get_options() {
case "$1" in
-h|--help)
show_help
- # I return non-zero here just so nobody thinks we successfully edited grub.cfg
+ # I return non-zero here just so nobody thinks we successfully edited grub{,test}.cfg
exit 200
;;
+ -v|--version)
+ show_version
+ # I return non-zero here just so nobody thinks we successfully edited grub{,test}.cfg
+ exit 201
+ ;;
-r|--realcfg)
edit_realcfg=1
shift
@@ -121,6 +159,10 @@ get_options() {
differ_rawarg="$2"
shift 2
;;
+ -x|--extract)
+ do_extract=1
+ shift
+ ;;
--)
# Stop interpreting arguments magically.
shift
@@ -128,7 +170,7 @@ get_options() {
;;
*)
echo "Something went wrong while interpreting the arguments!"
- echo "I hit \"${1}\" and don't know what to do with it."
+ echo "I hit \"$1\" and don't know what to do with it."
exit 209
;;
esac
@@ -151,13 +193,13 @@ determine_architecture() {
# is over, the variable $cbfstool gets filled with the appropriate value
# for use by the rest of the script.
arch="$(uname -m)"
- case "${arch}" in
+ case "$arch" in
armv7l|i686|x86_64)
- echo "Supported architecture \"${arch}\" detected. You may proceed."
- cbfstool="./cbfstool/${arch}/cbfstool"
+ echo "Supported architecture \"$arch\" detected. You may proceed."
+ cbfstool="${0%/*}/cbfstool/$arch/cbfstool"
;;
*)
- echo "Unsupported architecture \"${arch}\" detected! You may not proceed."
+ echo "Unsupported architecture \"$arch\" detected! You may not proceed."
exit 230
;;
esac
@@ -170,46 +212,175 @@ determine_operation() {
elif [[ $do_diffcfgs -eq 1 ]]; then
diff_configs
exit $?
+ elif [[ $do_extract -eq 1 ]]; then
+ extract_config
+ exit $?
else
edit_config
exit $?
fi
}
-# These functions are not part of the primary function cascade but are
-# referenced within them either directly or indirectly from other helper
-# functions depending on the operations requested by the user.
+################
+# VERSION SHOWER
+################
-show_help() {
- cat << HELPSCREEN
-${0} -- conveniently edit grub{test}.cfg files in Libreboot ROM image files by
-automating their extraction with cbfstool and the user's editor of choice.
+show_version() {
+ echo "$0 $geversion"
+}
--h | --help: show usage help
+##########################
+# EXTERNAL COMMAND FINDERS
+##########################
--r | --realcfg: generate grub.cfg instead of grubtest.cfg
+find_differ() {
+ found_differ=0
--i | --inplace: do not create a .modified romfile, instead modify the
-existing file
+ if [[ -n "$differ_rawarg" ]]; then
+ which "$differ_rawarg" &> /dev/null
+ if [[ $? -eq 0 ]]; then
+ echo "Using differ \"$differ_rawarg\"..."
+ use_differ="$differ_rawarg"
+ found_differ=1
+ else
+ echo "The provided \"$differ_rawarg\" is not a valid command!"
+ echo "Defaulting to $default_differ..."
+ use_differ="$default_differ"
+ fi
+ fi
+
+ if [[ $found_differ -eq 1 ]]; then
+ return
+ else
+ echo "Defaulting to $default_differ..."
+ use_differ="$default_differ"
+ fi
+}
--e | --editor [/path/to/]editor: open the cfg file with /path/to/editor instead
-of the value of \$EDITOR
+find_editor() {
+ found_editor=0
--s | --swapcfg: swap grub.cfg and grubtest.cfg
+ if [[ -n "$editor_rawarg" ]]; then
+ which "$editor_rawarg" &> /dev/null
+ if [[ $? -eq 0 ]]; then
+ echo "Using editor \"$editor_rawarg\"..."
+ use_editor="$editor_rawarg"
+ found_editor=1
+ else
+ echo "The provided \"$editor_rawarg\" is not a valid command!"
+ echo "Defaulting to $default_editor..."
+ use_editor="$default_editor"
+ fi
+ fi
+
+ if [[ $found_editor -eq 1 ]]; then
+ return
+ else
+ if [[ -n "$EDITOR" ]]; then
+ which "$EDITOR" &> /dev/null
+ if [[ $? -ne 0 ]]; then
+ echo "Your \$EDITOR is defined as $EDITOR, but is not a valid command!"
+ echo "(This is bad. I highly suggest fixing this in your ~/.bashrc.)"
+ echo "Defaulting to $default_editor..."
+ use_editor="$default_editor"
+ else
+ echo "Using your defined \$EDITOR \"$EDITOR\"..."
+ use_editor="$EDITOR"
+ fi
+ else
+ echo "\$EDITOR blank, defaulting to $default_editor..."
+ use_editor="$default_editor"
+ fi
+ fi
+}
--d | --diffcfg: diff grub.cfg and grubtest.cfg
+#######################
+# FILE NAMING FUNCTIONS
+#######################
--D | --differ [/path/to/]differ: use /path/to/differ instead of "diff", can be
-an interactive program like vimdiff
-HELPSCREEN
+random_tempcfg() {
+ # Inputs:
+ # $1 is a descriptive label for the file
+ # $2 is directory (becomes /tmp if not set)
+ [[ -n "$1" ]] && label="$1" || label="tempfile"
+ [[ -n "$2" ]] && savedir="${2%/}" || savedir="/tmp"
+
+ # Hardcoded string size for multiple good reasons (no processing weird
+ # input, prevent malicious overflows, etc.)
+ size=5
+
+ # Loop forever until a free filename is found.
+ while [[ 1 ]]; do
+ # Read data from /dev/urandom and convert into random ASCII strings.
+ rand="$(cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w $size | head -n 1)"
+
+ # Build a complete filename with a hardcoded extension.
+ possible="$savedir/${label}_${rand}.tmp.cfg"
+
+ # See if file doesn't exist and return it as string or keep going.
+ if [[ ! -f "$possible" ]]; then
+ echo "$possible"
+ break
+ fi
+ done
}
+modified_romfile() {
+ # Inputs:
+ # $1 is the path to the file, optional
+ # $2 provides an optional description of the modification
+ [[ -n "$1" ]] && fullname="$1" || fullname=""
+ [[ -n "$2" ]] && operation="$2" || operation="altered"
+
+ # Attempt to extract an extension from the file (it's probably .rom but
+ # can't assume so). $extension will not include prefixing dot, just the
+ # extension itself!
+ if [[ "$fullname" = *.* ]]; then
+ extension="${fullname##*.}"
+ else
+ extension=""
+ fi
+
+ # Break up full path into containing directory and raw filename, providing
+ # an attempt at graceful failure if they are absent.
+ if [[ -z "$fullname" ]]; then
+ dirname="/tmp"
+ filename="grubedited"
+ else
+ dirname="$(dirname "$fullname")"
+ if [[ -z "$extension" ]]; then
+ filename="$(basename "$fullname")"
+ else
+ filename="$(basename "$fullname" ".$extension")"
+ fi
+ fi
+
+ # Loop forever until a free filename is found.
+ while [[ 1 ]]; do
+ # Grab the current date.
+ now="$(date +"%Y%m%d_%H%M%S")"
+
+ # Build a complete filename with a hardcoded extension.
+ possible="$dirname/${filename}-${now}-${operation}.${extension}"
+
+ # See if file doesn't exist and return it as string or keep going.
+ if [[ ! -f "$possible" ]]; then
+ echo "$possible"
+ break
+ fi
+ done
+}
+
+###########################
+# PRIMARY PROGRAM FUNCTIONS
+###########################
+
swap_configs() {
# Procedure:
# 1. Call cbfstool twice, once each to extract grub.cfg and grubtest.cfg.
- # 2. If --inplace not specified, copy ${romfile} to ${romfile}.modified and
- # implement remaining steps on this copy. Otherwise, implement remaining
- # steps on ${romfile}.
+ # 2. If --inplace not specified, copy $romfile to a new file and implement
+ # remaining steps on this copy. Otherwise, implement remaining steps on
+ # $romfile.
# 3. Call cbfstool twice, once each to delete grub.cfg and grubtest.cfg
# from romfile.
# 4. Call cbfstool twice, once to embed grubtest.cfg as grub.cfg into
@@ -218,65 +389,83 @@ swap_configs() {
# 6. You're done!
# Extract config files from provided romfile.
- ${cbfstool} ${romfile} extract -n grub.cfg -f /tmp/real2test.cfg
- ${cbfstool} ${romfile} extract -n grubtest.cfg -f /tmp/test2real.cfg
+ real2test="$(random_tempcfg "real2test")"
+ test2real="$(random_tempcfg "test2real")"
+ "$cbfstool" "$romfile" extract -n grub.cfg -f "$real2test"
+ "$cbfstool" "$romfile" extract -n grubtest.cfg -f "$test2real"
# Determine whether to edit inplace or make a copy.
if [[ $edit_inplace -eq 1 ]]; then
- outfile="${romfile}"
+ outfile="$romfile"
else
- cp "${romfile}" "${romfile}.modified"
- outfile="${romfile}.modified"
+ outfile="$(modified_romfile "$romfile" "swapped")"
+ cp "$romfile" "$outfile"
+ echo "Saving modified romfile to $outfile"
fi
+ # Since we are swapping the configs, we must modify their "load test config"
+ # options or else they will simply reference themselves, rendering the user
+ # unable to (easily) load the other config.
+ sed -i -e 's/Load test configuration (grubtest.cfg)/Load test configuration (grub.cfg)/' "$real2test"
+ sed -i -e 's/configfile \/grubtest.cfg/configfile \/grub.cfg/' "$real2test"
+ sed -i -e 's/Load test configuration (grub.cfg)/Load test configuration (grubtest.cfg)/' "$test2real"
+ sed -i -e 's/configfile \/grub.cfg/configfile \/grubtest.cfg/' "$test2real"
+
# Remove config files from the output file.
- ${cbfstool} ${outfile} remove -n grub.cfg
- ${cbfstool} ${outfile} remove -n grubtest.cfg
+ "$cbfstool" "$outfile" remove -n grub.cfg
+ "$cbfstool" "$outfile" remove -n grubtest.cfg
# Embed new configs into the output file.
- ${cbfstool} ${outfile} add -t raw -n grub.cfg -f /tmp/test2real.cfg
- ${cbfstool} ${outfile} add -t raw -n grubtest.cfg -f /tmp/real2test.cfg
+ "$cbfstool" "$outfile" add -t raw -n grub.cfg -f "$test2real"
+ "$cbfstool" "$outfile" add -t raw -n grubtest.cfg -f "$real2test"
# Delete the tempfiles.
- rm /tmp/test2real.cfg /tmp/real2test.cfg
+ rm "$test2real" "$real2test"
}
diff_configs() {
# Procedure:
# 1. Call cbfstool twice, once to extract grub.cfg and grubtest.cfg.
- # 2. Execute ${use_differ} grub.cfg grubtest.cfg #.
+ # 2. Execute $use_differ grub.cfg grubtest.cfg #.
# 3. Delete the extracted grub.cfg and grubtest.cfg files.
# 4. You're done!
# Determine the differ command to use.
find_differ
+ grubcfg="$(random_tempcfg "grubcfg")"
+ grubtestcfg="$(random_tempcfg "grubtestcfg")"
+
# Extract config files from provided romfile.
- ${cbfstool} ${romfile} extract -n grub.cfg -f /tmp/grub_tmpdiff.cfg
- ${cbfstool} ${romfile} extract -n grubtest.cfg -f /tmp/grubtest_tmpdiff.cfg
+ "$cbfstool" "$romfile" extract -n grub.cfg -f "$grubcfg"
+ "$cbfstool" "$romfile" extract -n grubtest.cfg -f "$grubtestcfg"
# Run the differ command with real as first option, test as second option.
- ${use_differ} /tmp/grub_tmpdiff.cfg /tmp/grubtest_tmpdiff.cfg
+ "$use_differ" "$grubcfg" "$grubtestcfg"
+
+ # Delete the temporary copies of the configuration files.
+ rm "$grubcfg"
+ rm "$grubtestcfg"
}
edit_config() {
# Procedure:
- # 1. If --realcfg specified, set ${thisconfig} to "grub.cfg". Otherwise,
- # set ${thisconfig} to "grubtest.cfg".
- # 2. Call cbfstool once to extract ${thisconfig} from ${romfile}.
- # 3. Run ${use_editor} ${thisconfig}.
- # 4. If ${use_editor} returns zero, proceed with update procedure:
- # 5. Call cbfstool once to extract ${thisconfig} from ${romfile}.
+ # 1. If --realcfg specified, set $thisconfig to "grub.cfg". Otherwise,
+ # set $thisconfig to "grubtest.cfg".
+ # 2. Call cbfstool once to extract $thisconfig from $romfile.
+ # 3. Run $use_editor $thisconfig.
+ # 4. If $use_editor returns zero, proceed with update procedure:
+ # 5. Call cbfstool once to extract $thisconfig from $romfile.
# 6. Quietly diff the extracted file with the edited file. If diff returns
# zero, take no action: warn the user that the files were the same, delete
# both files, then skip the remaining steps (you're done)! Otherwise, the
# files are different and you must continue with the update procedure.
- # 7. If --inplace not specified, copy ${romfile} to ${romfile}.modified and
+ # 7. If --inplace not specified, copy $romfile to a new filename and
# implement remaining steps on this copy. Otherwise, implement remaining
- # steps on ${romfile}.
- # 8. Call cbfstool once to delete internal pre-update ${thisconfig} from
+ # steps on $romfile.
+ # 8. Call cbfstool once to delete internal pre-update $thisconfig from
# the rom file.
- # 9. Call cbfstool once to embed the updated ${thisconfig} that was just
+ # 9. Call cbfstool once to embed the updated $thisconfig that was just
# edited into the rom file.
# 10. Alert the user of success (either explicitly or by not saying
# anything, either way return zero).
@@ -293,103 +482,75 @@ edit_config() {
fi
# Extract the desired configuration file from the romfile.
- tmp_editme="/tmp/${thisconfig%.cfg}_editme.cfg"
- ${cbfstool} ${romfile} extract -n ${thisconfig} -f ${tmp_editme}
+ tmp_editme="$(random_tempcfg "${thisconfig%.cfg}")"
+ "$cbfstool" "$romfile" extract -n "$thisconfig" -f "$tmp_editme"
# Launch the editor!
- ${use_editor} ${tmp_editme}
+ "$use_editor" "$tmp_editme"
# Did the user commit the edit?
if [[ $? -eq 0 ]]; then
# See if it actually changed from what exists in the cbfs.
tmp_refcfg="/tmp/${thisconfig%.cfg}_ref.cfg"
- ${cbfstool} ${romfile} extract -n ${thisconfig} -f ${tmp_refcfg}
+ "$cbfstool" "$romfile" extract -n "$thisconfig" -f "$tmp_refcfg"
# Diff the files as quietly as possible.
- diff -q ${tmp_editme} ${tmp_refcfg} &> /dev/null
+ diff -q "$tmp_editme" "$tmp_refcfg" &> /dev/null
if [[ $? -ne 0 ]]; then
# The files differ, so it won't be frivolous to update the config.
# See if the user wants to edit the file in place.
# (This code should really be genericized and placed in a function
# to avoid repetition.)
if [[ $edit_inplace -eq 1 ]]; then
- outfile="${romfile}"
+ outfile="$romfile"
else
- cp "${romfile}" "${romfile}.modified"
- outfile="${romfile}.modified"
+ if [[ $edit_realcfg -eq 1 ]]; then
+ op="realcfg"
+ else
+ op="testcfg"
+ fi
+ outfile="$(modified_romfile "$romfile" "${op}_edited")"
+ cp "$romfile" "$outfile"
+ echo "Saving modified romfile to $outfile"
fi
# Remove the old config, add in the new one.
- ${cbfstool} ${outfile} remove -n ${thisconfig}
- ${cbfstool} ${outfile} add -t raw -n ${thisconfig} -f ${tmp_editme}
+ "$cbfstool" "$outfile" remove -n "$thisconfig"
+ "$cbfstool" "$outfile" add -t raw -n "$thisconfig" -f "$tmp_editme"
else
echo "No changes to config file. Not updating the ROM image."
fi
# We are done with the config files. Delete them.
- rm ${tmp_editme}
- rm ${tmp_refcfg}
+ rm "$tmp_editme"
+ rm "$tmp_refcfg"
fi
}
-find_differ() {
- found_differ=0
+extract_config() {
+ # This simply extracts a given config and responds to
+ # the -r flag.
- if [[ -n "${differ_rawarg}" ]]; then
- which "${differ_rawarg}" &> /dev/null
- if [[ $? -eq 0 ]]; then
- echo "Using differ \"${differ_rawarg}\"..."
- use_differ="${differ_rawarg}"
- found_differ=1
- else
- echo "The provided \"${differ_rawarg}\" is not a valid command!"
- echo "Defaulting to ${default_differ}..."
- use_differ="${default_differ}"
- fi
- fi
-
- if [[ $found_differ -eq 1 ]]; then
- return
+ # Determine whether we are extracting the real config or the test config.
+ if [[ $edit_realcfg -eq 1 ]]; then
+ thisconfig="grub.cfg"
else
- echo "Defaulting to ${default_differ}..."
- use_differ="${default_differ}"
+ thisconfig="grubtest.cfg"
fi
-}
-find_editor() {
- found_editor=0
+ # Extract to a unique filename.
+ tmp_extractme="$(random_tempcfg "${thisconfig%.cfg}" "$(dirname "$romfile")")"
+ "$cbfstool" "$romfile" extract -n "$thisconfig" -f "$tmp_extractme"
+ err=$?
- if [[ -n "${editor_rawarg}" ]]; then
- which "${editor_rawarg}" &> /dev/null
- if [[ $? -eq 0 ]]; then
- echo "Using editor \"${editor_rawarg}\"..."
- use_editor="${editor_rawarg}"
- found_editor=1
- else
- echo "The provided \"${editor_rawarg}\" is not a valid command!"
- echo "Defaulting to ${default_editor}..."
- use_editor="${default_editor}"
- fi
- fi
-
- if [[ $found_editor -eq 1 ]]; then
- return
+ # Determine if cbfstool reported success.
+ if [[ $err -ne 0 ]]; then
+ echo "cbfstool reported an error ($err). If it succeeded anyway, check $tmp_extractme."
else
- if [[ -n "${EDITOR}" ]]; then
- which "${EDITOR}" &> /dev/null
- if [[ $? -ne 0 ]]; then
- echo "Your \$EDITOR is defined as ${EDITOR}, but is not a valid command!"
- echo "(This is bad. I highly suggest fixing this in your ~/.bashrc.)"
- echo "Defaulting to ${default_editor}..."
- use_editor="${default_editor}"
- else
- echo "Using your defined \$EDITOR \"$EDITOR\"..."
- use_editor="${EDITOR}"
- fi
- else
- echo "\$EDITOR blank, defaulting to ${default_editor}..."
- use_editor="${default_editor}"
- fi
+ echo "Extracted $thisconfig from $romfile to file $tmp_extractme."
fi
}
+#################################
+#### PRIMARY EXECUTION FLOW #####
+#################################
# Run through the primary function cascade.
get_options $@
determine_architecture
diff --git a/www/contrib.md b/www/contrib.md
index 85b30ed8..b1089a39 100644
--- a/www/contrib.md
+++ b/www/contrib.md
@@ -30,7 +30,7 @@ Damien Zammit
Maintains the Gigabyte GA-G41M-ES2L coreboot port, which is integrated
in libreboot. Also works on other hardware for the benefit of the
libreboot project. Contact **damo22** on the freenode IRC network. This
-persons website is [zammit.org](http://www.zammit.org/).
+person's website is [zammit.org](http://www.zammit.org/).
Denis Carikli
-------------
@@ -133,3 +133,9 @@ Vladimir Serbinenko
Ported many of the thinkpads supported in libreboot, to coreboot, and
made many fixes in coreboot which benefited the libreboot project.
Contact **phcoder** in the \#coreboot IRC channel on freenode.
+
+Zyliwax
+-------------------
+
+Wrote the grubeditor.sh script and associated documentation. Contact
+**zyliwax** in the \#libreboot channel.
diff --git a/www/download.md b/www/download.md
index a078ef51..c6abf394 100644
--- a/www/download.md
+++ b/www/download.md
@@ -17,7 +17,7 @@ GPG signing key
Releases are signed with GPG.
- $ gpg --recv-keys
+ $ gpg --recv-keys 0x05E8C5B2
The GPG key can also be downloaded with this exported dump of the
pubkey: [lbkey.asc](lbkey.asc).
@@ -45,19 +45,10 @@ university, USA)
<https://mirrors.peers.community/mirrors/libreboot/> (Peers Community
Project, USA)
-<https://mirrors.cicku.me/libreboot/> (CICKU FOSS Mirror Service,
-Germany)
-
<https://vimuser.org/libreboot/> (vimuser.org, Netherlands)
-<https://ginette.swordarmor.fr/libreboot/> (swordarmor.fr, France)
-
-<https://mirror.se.partyvan.eu/pub/libreboot/> (partyvan.eu, Sweden)
-
<https://elgrande74.net/libreboot/> (elgrande74.net, France)
-<https://nedson.net/libreboot> (nedson.net, USA)
-
HTTP mirrors {#http}
------------
@@ -69,15 +60,14 @@ if using HTTPS.
<http://mirrors.mit.edu/libreboot/> (MIT university, USA)
-<http://tpvj6abq225m5pcf.onion/pub/libreboot/> (Tor hidden server,
-Undisclosed location)
-
<http://mirror.linux.ro/libreboot/> (linux.ro, Romania)
<http://mirror.helium.in-berlin.de/libreboot/> (in-berlin.de, Germany)
<http://libreboot.mirror.si/> (mirror.si, Slovenia)
+<http://ginette.swordarmor.fr/libreboot/> (swordarmor.fr, France)
+
FTP mirrors {#ftp}
-----------
diff --git a/www/footer.md b/www/footer.md
new file mode 100644
index 00000000..30dea43b
--- /dev/null
+++ b/www/footer.md
@@ -0,0 +1,8 @@
+
+**[Edit this page](/git.md#editing-the-website-and-documentation-wiki-style)** --
+[License](/docs/fdl-1.3.md) --
+[Template](/license.md) --
+[Authors](/contrib.md) --
+[Conduct Guidelines](/conduct.md) --
+[Governance](/management.md) --
+[Peers Community](https://peers.community/)
diff --git a/www/git.md b/www/git.md
index a1ddd993..f6ebab77 100644
--- a/www/git.md
+++ b/www/git.md
@@ -11,6 +11,28 @@ Download Libreboot from the Git repository here:
**git clone https://notabug.org/libreboot/libreboot.git**
+Editing the website and documentation, wiki-style
+-------------------------------------------------
+
+The entire website on libreboot.org, including all of the Libreboot
+documentation, is hosted in the Git repository. The pages are written in
+Markdown, which is an easy-to-use markup language similar to the one used
+when, for instance, editing pages on WikiPedia or a MediaWiki-based website.
+
+Just download Libreboot's Git repository, make changes to the website under
+the ***www*** directory. Changes to the documentation section are made under
+the ***docs*** directory. Once you've made your changes, you can submit them
+for inclusion live on libreboot.org, using the instructions on the rest of this
+page.
+
+***You can use any standard text editor to edit and improve the entire
+Libreboot website. E.g. Vim, GNU Emacs, GNU Nano, Gedit or whatever you
+prefer to use.***
+
+We currently have a shortage of people who possess the skill to write and
+maintain good documentation for Libreboot, so we welcome any and all
+contributions!
+
General guidelines for submitting patches
-----------------------------------------
diff --git a/www/global.css b/www/global.css
index 0264e4ef..b325ef31 100644
--- a/www/global.css
+++ b/www/global.css
@@ -13,11 +13,8 @@ body {
body {
line-height: 1.6;
font-family: Cantarell, sans-serif;
- font-size: 1.1em; color: #222;
-}
-
-header {
- text-align: center;
+ font-size: 1.1em;
+ color: #222;
}
#logo {
@@ -37,3 +34,11 @@ a:hover {
.date {
display: block;
}
+
+h1, h2, h3, .h:hover a {
+ display: inline;
+}
+
+.h a {
+ display: none;
+}
diff --git a/www/headercenter.css b/www/headercenter.css
new file mode 100644
index 00000000..6b8c294c
--- /dev/null
+++ b/www/headercenter.css
@@ -0,0 +1,3 @@
+header {
+ text-align: center;
+}
diff --git a/www/headerleft.css b/www/headerleft.css
deleted file mode 100644
index 645ab4ea..00000000
--- a/www/headerleft.css
+++ /dev/null
@@ -1,3 +0,0 @@
-header {
- text-align: left !important;
-}
diff --git a/www/index.md b/www/index.md
index 7e71f24e..dec3dc5e 100644
--- a/www/index.md
+++ b/www/index.md
@@ -8,24 +8,17 @@ mascot"){#logo}](faq.md#who-did-the-logo)
[FAQ](faq.md) --
[Download](download.md) --
[Install](docs/install/) --
-[Documentation](docs/) --
+[Docs](docs/) --
[News](news/) --
-[Discuss](https://webchat.freenode.net/?channels=libreboot) --
+[Chat](https://webchat.freenode.net/?channels=libreboot) --
[Bugs](https://notabug.org/libreboot/libreboot/issues) --
[Contribute](git.md) --
-[Management](management.md) --
-[Tasks](https://notabug.org/libreboot/libreboot/milestones)
+[Buy](suppliers.md)
Libreboot is a [free](https://www.gnu.org/philosophy/free-sw.html) (as in
freedom) BIOS or UEFI replacement, initialising the hardware and booting your
-operating system.
-
-**[Community feedback is needed on whether libreboot.org domain name
-ownership should be transferred to the
-Software Freedom Conservancy](news/sfc-domain-offer.md)**
-
-**[Libreboot has applied to re-join the GNU project,
-under new democratic leadership](news/formalised-structure.md)**
+operating system. It is also available preinstalled from
+[these suppliers](suppliers.md).
Why use Libreboot?
------------------
diff --git a/www/management.md b/www/management.md
index 629d5cd7..9c5f8ad0 100644
--- a/www/management.md
+++ b/www/management.md
@@ -1,5 +1,5 @@
---
-title: General management guidelines and leadership information
+title: General management guidelines
x-toc-enable: true
...
diff --git a/www/news/fsf-domain-offer.md b/www/news/fsf-domain-offer.md
deleted file mode 100644
index 486e4cfc..00000000
--- a/www/news/fsf-domain-offer.md
+++ /dev/null
@@ -1,15 +0,0 @@
-% Community feedback on whether to offer libreboot.org domain name to FSF
-% Leah Rowe
-% 26 Apr 2017
-
-I, Leah Rowe, have stepped down as leader of the Libreboot project. This means
-that I must also transfer ownership of the libreboot.org domain name to
-another entity. I have chosen to propose the FSF as that entity.
-
-This is something that could be offered to GNU as part of Libreboot's
-filed application to re-join GNU.
-
-Commenting will be taken on
-<https://www.reddit.com/r/libreboot/comments/67rd46/proposal_transfer_librebootorg_ownership_to_fsf/>
-as to whether this decision should be taken. Full reasoning is documented
-there.
diff --git a/www/news/sfc-domain-offer.md b/www/news/sfc-domain-offer.md
deleted file mode 100644
index f53ce283..00000000
--- a/www/news/sfc-domain-offer.md
+++ /dev/null
@@ -1,36 +0,0 @@
-% Community feedback on whether to offer libreboot.org domain name to SFC
-% Leah Rowe
-% 27 Apr 2017
-
-I, Leah Rowe, have stepped down as leader of the Libreboot project. This means
-that I must also transfer ownership of the libreboot.org domain name to
-another entity. I have chosen to propose the Software Freedom Conservancy (SFC)
-as that entity.
-
-Commenting will be taken on
-<https://www.reddit.com/r/libreboot/comments/67x3bs/proposal_transfer_librebootorg_domain_name/>
-as to whether this decision should be taken. Full reasoning is documented
-there.
-
-Software Freedom Conservancy is heavily affiliated with the FSF. Conservancy
-provides legal services, e.g. GPL enforcement, for those who violate the GNU
-General Public License. They generally offer legal services related to Free
-Software. Its founder, Bradley Kuhn, is also a former Executive Director of
-the FSF. (Karen Sandler, is SFC's current Executive Director).
-
-In addition to legal services, Conservancy also helps promote Free Software
-and provides certain infrastructure for Free Software projects, and does
-sometimes assist in development of projects.
-
-More information:
-<https://en.wikipedia.org/wiki/Software_Freedom_Conservancy>
-
-Conservancy website:
-<https://sfconservancy.org/>
-
-This is something that could be offered to GNU as part of Libreboot's
-filed application to re-join GNU.
-
-Previously, it was proposed that the domain name be transferred to the FSF, but
-this was vetoed by an opposing member of the core leadership, when I proposed
-it. SFC was then recommended as an alternative, hence this new proposal.
diff --git a/www/publish.sh b/www/publish.sh
index 55b6660a..606c1fc9 100755
--- a/www/publish.sh
+++ b/www/publish.sh
@@ -24,29 +24,33 @@ FILE=${1%.md}
cat $1 > temp.md
-OPTS=
+OPTS="-T Libreboot"
if [ "${FILE}" != "./index" ]; then
- if [[ $FILE == *index ]]
+ if [[ $FILE == *suppliers ]]
then
- DEST="../"
+ RETURN=""
else
- DEST="./"
- fi
+ if [[ $FILE == *index ]]
+ then
+ DEST="../"
+ else
+ DEST="./"
+ fi
- RETURN="<a href='$DEST'>Back to previous index</a>"
- OPTS="--css /headerleft.css -T Libreboot"
+ RETURN="<strong><a href='/git.html#editing-the-website-and-documentation-wiki-style'>Edit this page</a></strong> -- <a href='$DEST'>Back to previous index</a>"
+ OPTS="-T Libreboot"
+ fi
+else
+ OPTS="--css /headercenter.css"
fi
+if [[ $FILE = *suppliers ]]; then
+ printf "\n<strong><a href=\"/git.html#editing-the-website-and-documentation-wiki-style\">Edit this page</a></strong> -- <a href=\"../\">Back to previous page</a>\n" >> temp.md
+fi
if [ "${FILE}" != "./docs/fdl-1.3" ] && [ "${FILE}" != "./conduct" ]; then
- echo "" >> temp.md
- printf "[License](/docs/fdl-1.3.md) --\n" >> temp.md
- printf "[Template](/license.md) --\n" >> temp.md
- printf "[Authors](/contrib.md) --\n" >> temp.md
- printf "[Conduct Guidelines](/conduct.md) --\n" >> temp.md
- printf "[Management Guidelines](/management.md) --\n" >> temp.md
- printf "[Peers Community](https://peers.community/) \n" >> temp.md
+ cat footer.md >> temp.md
fi
# change out .md -> .html
@@ -65,3 +69,6 @@ pandoc $TOC $SMART temp.md -s --css /global.css $OPTS \
# additionally, produce bare file for RSS
pandoc $1 > $FILE.bare.html
+
+# generate section title anchors as [link]
+sed $FILE.html -i -e 's_^<h\([123]\) id="\(.*\)">\(.*\)</h\1>_<div class="h"><h\1 id="\2">\3</h\1><a aria-hidden="true" href="#\2">[link]</a></div>_'
diff --git a/www/suppliers.md b/www/suppliers.md
new file mode 100644
index 00000000..e48e0f5f
--- /dev/null
+++ b/www/suppliers.md
@@ -0,0 +1,122 @@
+---
+title: Suppliers selling or providing Libreboot pre-installed
+...
+
+Libiquity
+---------
+
+Patrick McDermott, Libiquity's founder, is a former Libreboot
+developer. **Ships to USA only**
+
+- [Taurinus X200 laptop](https://shop.libiquity.com/product/taurinus-x200) (FSF RYF certified)
+- [Libreboot chassis](https://shop.libiquity.com/product/libreboot-stickers-shaped-matte-vinyl-2x2.25-3-pack) and [Libreboot Inside stickers](https://shop.libiquity.com/product/libreboot-inside-case-badges-3-pack)
+
+Ministry of Freedom (Minifree)
+------------------------------
+
+Leah Rowe, Minifree's founder, is also Libreboot's founder and is an active
+Libreboot developer. Minifree is the first company to achieve FSF RYF
+endorsement on a computer system, and invests money directly into Libreboot.
+
+**Minifree ships worldwide, to all countries.**
+
+Laptops:
+
+- [Libreboot T400 laptop](https://minifree.org/product/libreboot-t400/) (FSF RYF certified)
+
+Desktops:
+
+- [Libreboot D16 desktop/workstation](https://minifree.org/product/libreboot-d16/)
+
+Servers:
+
+- [Libreboot D16 server](https://minifree.org/product/libreboot-d16-server/)
+
+Services:
+
+- [Libreboot installation service](https://minifree.org/product/libreboot-installation-service/)
+
+Merchendise:
+
+- [Libreboot T400 battery](https://minifree.org/product/libreboot-t400-battery/)
+- [Libreboot X200 battery](https://minifree.org/product/libreboot-x200-battery/)
+- [Libreboot X200 docking station](https://minifree.org/product/docking-station-for-libreboot-x200/)
+- [Libreboot stickers](https://minifree.org/product/libreboot-stickers/)
+
+Technoethical
+-------------
+
+Technoethical (formerly Tehnoetic) is a team of free software activists and
+developers that are selling hardware pre-installed with libreboot as a way to
+fund the activity within their nonprofit foundation.
+
+**Ships worldwide, to all countries.**
+
+Services:
+
+- [Libreboot installation service](https://tehnoetic.com/tet-lis)
+
+Laptops:
+
+- [Technoethical T500 laptop](https://tehnoetic.com/tet-t500)
+- [Technoethical T400 laptop](https://tehnoetic.com/tet-t400)
+- [Technoethical X200 Tablet laptop](https://tehnoetic.com/tet-x200t)
+- [Technoethical X200 laptop](https://tehnoetic.com/tet-x200)
+
+Vikings
+-------
+
+Vikings is the first company to offer hosting on hardware pre-installed with
+libreboot and they are also selling the hardware itself to fund the building
+of their libreboot-powered datacenter.
+
+**Ships worldwide, to all countries.**
+
+Servers:
+
+- [Vikings D16 1U server](https://store.vikings.net/libre-friendly-hardware/the-server-1u)
+
+Mainboards:
+
+- [Vikings D16 mainboard](https://store.vikings.net/libre-friendly-hardware/d16-ryf-certfied) (FSF RYF certified)
+
+Desktops:
+
+- [Vikings D16 workstation](https://store.vikings.net/libre-friendly-hardware/vikings-d16-workstation)
+
+Laptops:
+
+- [Vikings X200 laptop](https://store.vikings.net/libre-friendly-hardware/x200-ryf-certfied) (FSF RYF certified)
+
+Other suppliers
+===============
+
+Sellers on eBay
+---------------
+
+On the eBay website, in various countries, you can search for libreboot and
+you may find some individual sellers providing Libreboot-preinstalled hardware.
+
+We cannot verify the quality of these suppliers, but they do exist.
+
+Some of them also provide choice of GNU+Linux distribution, or they may provide
+services where you can ship your Libreboot-compatible device to them and they
+would install Libreboot for you.
+
+This can be useful for some people, but due to the nature of eBay, we cannot
+link to them since eBay listings are regularly deleted due to expiration (some
+sellers may choose to have longer listings, or renew expired listings).
+
+There may also be other websites similar to eBay (e.g. mercado livre, available
+for several South American countries) that might have Libreboot hardware on
+them.
+
+**If you are considering purchasing from a supplier on eBay, make sure to read
+their feedback comments for other products that they sell, and check their
+seller rating. Don't get duped by a bad seller!**
+
+Workshops/hackerspaces
+----------------------
+
+You may have a GNU+Linux User Group, free software workshop or hackerspace near
+you that can help you with installing Libreboot, for instance.