code:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>libreboot tutorials</title>

	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="author" content="glugman">
	<meta name="description" content="tutorials for libreboot, the reboot library.">
	<meta name="robots" content="all">

Development notes (old/obsolete notes)

				For current notes, see index.html.

				These are old (obsolete) notes that mare kept because they might become useful again in the future.

Table of contents

X60 native graphics initialization (backlight controls)

T60 native graphics initialization (backlight controls)

i945: 3D fix (based on 5927) for kernel 3.12+ on 5320

i945/x60: coreboot 5927 testing (3D fix for kernel 3.12+ on replay code)

X60 native graphics initialization (with backlight controls)

					This is now obsolete. A better way was found (included in libreboot): http://review.coreboot.org/#/c/6731/

				Also check #5320_kernel312fix (to fix 3D on kernel 3.12/higher)

				The fix below was done on 5320/6 (from review.coreboot.org) but should work just fine on later versions of 5320.

				Native gpu init + backlight controls! (Fn keys). Also confirmed on X60 Tablet (1024x768) and X60 Tablet (1400x1050)

				Add backlight controls: in src/mainboard/lenovo/x60/devicetree.cb, change gpu_backlight to 0x879F879E

				That's all! This has also been backported into libreboot 5th release (line 1233 in src/mainboard/lenovo/x60/i915io.c). GNUtoo (Denis Carikli)
				told me about the register BLC_PWM_CTL and that you could set it to control backlight. I read that address using devmem2 while running the VBIOS:

				# devmem2 0xe4361254 w

				The change is also included in libreboot 6.

				When doing this, it gave back that value. The same trick was used to get backlight controls for T60 (see #t60_native_notes).

Further notes

					Reading 0xe4361254 (address) in Lenovo BIOS always yields FFFFFFFF, even when writing to it (and writing to it doesn't affect brightness controls).
					'mtjm' on IRC found that the buttons (Fn keys) control /sys/class/backlight/acpi_video0 which has no affect on 61254 (BLC_PWM_CTL). He says
					intel_backlight has different values and uses the register. devmem2 works, needs checking lspci -vv for where the memory is mapped,
					which is different than on coreboot; mtjm found that it was 0xec061254 on his system (X60 Tablet), and the register value is different too.
					This is relevant, because we still don't know how backlight controls are actually handled. We got it working by accident. We need to know more..

					Intel-gpu-tools may prove useful for further debugging: http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/

					mtjm says 0xe4300000 is an MMIO region of the gpu (lspci -vv shows it), 0x61254 (BLC_PWM_CTL) is a documented register. Searching the kernel driver for backlight
					shows that in intel_panel.c this register is used (there is an XXX comment about finding the right value, where recent kernels get it from.

					What we want to do is calculate a good value, instead of setting it in devicetree.cb. mtjm says about backlight physics:
					it has a light source , uses pulse width modulation (PWM) to turn it on/off, dimming is done by spending less time on.
					Note: this may not be correct; he says his understanding is based on how the Lenote yeeloong works.

					mtjm goes on to say, that the register specifies the frequency used for PWM in its depending on the GPU core frequency, so it
					might be possible to calculate it without hardcoded laptop-specific values. Therefore, I am supposed to find out the 'display core frequency'
					(mtjm says there might be a register for it; also, it might be in 5320 or the replay code) and the PWM modulation frequency.
					https://en.wikipedia.org/wiki/Backlight#Flicker_due_to_backlight_dimming

					phcoder (Vladimir Serbinenko) who is author of 5320 (review.coreboot.org) talks about 'duty cycle limit' and 'flickering frequency'.

Back to top of page

T60 native graphics initialization (with backlight controls)

					This is now obsolete. A better way was found (included in libreboot): http://review.coreboot.org/#/c/6731/

				Also check #5320_kernel312fix (to fix 3D on kernel 3.12/higher)

				The fix below was done on an earlier version of 5345 changeset (review.coreboot.org), but should work on the current version. it is included in libreboot 6

				Add backlight controls: in src/mainboard/lenovo/t60/devicetree.cb, change gpu_backlight to 0x58BF58BE

				Hold on! Check ../misc/index.html#get_edid_panelname to know what LCD panel you have. This is important for the next step!

Supported panels

					../hcl/index.html#supported_t60_list.

				See index.html#lcd_i945_incompatibility.

Back to top of page

i945: 3D fix (based on 5927) for kernel 3.12+ on 5320

					This is now obsolete. Merged in coreboot: http://review.coreboot.org/#/c/5927/

This needs to be rewritten (or better organized, or deleted?). This is also now included in libreboot 6 (using the proper way, not the 7c0000 method which was a hack)

				This was done on 5320/6 so far. The fix below is for 5320/6 which is now obsolete. This needs to be re-done for the latest version
				of 5320. The fix below is (in practise) only for reference, therefore.

				See #x60_cb5927_testing for the original (and current) fix, for the replay code. Now we want
				to implement that on top of http://review.coreboot.org/#/c/5320
				which is the current code for native graphics initialization on i945.

				src/northbridge/intel/i945/gma.c (using the 7c0000 hack) on 5320: 5320_7c0000_gma.c (rename it to gma.c,
				replacing the current one).

				The above is a hack (as is the original). A better (more correct) method is implemented in later versions of 5927, so
				that should also be adapted for 5320. For now, you can use the above fix.

				The correct way to do it is to set gtt address to (end of stolen memory - gtt size), which is what later versions of 5927 do (successfully).

				Here is some debugging output using intel_gpu_tools v1.2-1 (from trisquel repositories) using tool "intel_gtt":

					Trisquel 6. kernel 3.14.4:

with libreboot 5th release (using the 7c0000 gtt hack from 5927/3): http://paste.debian.net/104306

with coreboot+vgarom: http://paste.debian.net/104309

					Trisquel 6. kernel 3.2.0-60 (from Trisquel repositories):

with coreboot (no vbios or native init): http://paste.debian.net/104341

Back to top of page

i945/X60: Coreboot 5927 testing (3D fix for kernel 3.12+ on replay code)

					This is now obsolete. Merged in coreboot: http://review.coreboot.org/#/c/5927/

The latest version as-is (5927/11) has not been tested by me yet. Always boot with 'drm.debug=0x06' kernel parameter when testing this.

				This is the fix for 3D on kernel 3.12 and higher on i945 (ThinkPad X60 in this case). This is for the replay code.
				Libreboot 5th release has a version of this backported already (based on 5927/3 using the '7c0000' hack).

					The replay code is obsolete (see 5320 changeset on review.coreboot.org for better version
					which supports more systems/screens, and then 5345 for T60). Information here for reference since that is where the fix was first applied.

				Read the information on http://review.coreboot.org/#/c/5927/.

				For historical purposes, here is a collection of IRC logs that once existed on this page, related to the issue:
				kernel312_irc.

				PGETBL_CTL differs between VBIOS (-) and native graphics init (+).

				-          PGETBL_CTL: 0x3ffc0001

				+          PGETBL_CTL: 0x3f800001

GTT (graphics translation table) size is PGETBL_save, max 256 KiB. BSM (Base of Stolen Memory) is given by the bios.

5927/7: 5927_7.tar.gz (GRUB graphics are correct now, and 3D still works)

5927/6: 5927_6.tar.gz (GRUB graphics still corrupt, 3D/everything still works after GRUB)

5927/5: 5927_5.tar.gz (GRUB graphics corrupt, 3D/everything still works after GRUB)

5927/3: 5927_3.tar.gz (3D still works! kernel 3.14.4) - the '7c0000' hack

5927/2: 5927_2.tar.gz (3D works! kernel 3.14.4) - the '7c0000' hack

					5927/1 (didn't fix the 3D issue):

cbmem -c

/sys/class/drm/card0/error

.config

Back to top of page

			Copyright ©  2014, 2015 Francis Rowe <info@gluglug.org.uk>

			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;
			with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
			A copy of the license can be found at ../gfdl-1.3.txt

			Updated versions of the license (when available) can be found at
			https://www.gnu.org/licenses/licenses.html

			UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
			EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
			AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
			ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
			IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
			WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
			PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
			ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
			KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
			ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.

			TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
			TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
			NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
			INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
			COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
			USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
			ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
			DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
			IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.

			The disclaimer of warranties and limitation of liability provided
			above shall be interpreted in a manner that, to the extent
			possible, most closely approximates an absolute disclaimer and
			waiver of all liability.


code:
                GNU Free Documentation License
                 Version 1.3, 3 November 2008

 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
     <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.

This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.

We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License.  Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein.  The "Document", below,
refers to any such manual or work.  Any member of the public is a
licensee, and is addressed as "you".  You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.

A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject.  (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.)  The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.

The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.  If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant.  The Document may contain zero
Invariant Sections.  If the Document does not identify any Invariant
Sections then there are none.

The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.  A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.

A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters.  A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text.  A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification.  Examples of
transparent image formats include PNG, XCF and JPG.  Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page.  For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.

The "publisher" means any person or entity that distributes copies of
the Document to the public.

A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language.  (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.

The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document.  These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no
other conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and
you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.

If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.

It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to
give them a chance to provide you with an updated version of the
Document.

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it.  In addition, you must do these things in the Modified Version:

A. Use in the Title Page (and on the covers, if any) a title distinct
   from that of the Document, and from those of previous versions
   (which should, if there were any, be listed in the History section
   of the Document).  You may use the same title as a previous version
   if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
   responsible for authorship of the modifications in the Modified
   Version, together with at least five of the principal authors of the
   Document (all of its principal authors, if it has fewer than five),
   unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
   Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
   adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
   giving the public permission to use the Modified Version under the
   terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
   and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
   to it an item stating at least the title, year, new authors, and
   publisher of the Modified Version as given on the Title Page.  If
   there is no section Entitled "History" in the Document, create one
   stating the title, year, authors, and publisher of the Document as
   given on its Title Page, then add an item describing the Modified
   Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
   public access to a Transparent copy of the Document, and likewise
   the network locations given in the Document for previous versions
   it was based on.  These may be placed in the "History" section.
   You may omit a network location for a work that was published at
   least four years before the Document itself, or if the original
   publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
   Preserve the Title of the section, and preserve in the section all
   the substance and tone of each of the contributor acknowledgements
   and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
   unaltered in their text and in their titles.  Section numbers
   or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements".  Such a section
   may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
   or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.

You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.

You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications".  You must delete all sections
Entitled "Endorsements".

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other
documents released under this License, and replace the individual
copies of this License in the various documents with a single copy
that is included in the collection, provided that you follow the rules
of this License for verbatim copying of each of the documents in all
other respects.

You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert a
copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers.  In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.

If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.

However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.

Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the
GNU Free Documentation License from time to time.  Such new versions
will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns.  See
http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.  If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy's public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.

11. RELICENSING

"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works.  A
public wiki that anybody can edit is an example of such a server.  A
"Massive Multiauthor Collaboration" (or "MMC") contained in the site
means any set of copyrightable works thus published on the MMC site.

"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.

"Incorporate" means to publish or republish a Document, in whole or in
part, as part of another Document.

An MMC is "eligible for relicensing" if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole or
in part into the MMC, (1) had no cover texts or invariant sections, and
(2) were thus incorporated prior to November 1, 2008.

The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.

ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
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;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU
    Free Documentation License".

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:

    with the Invariant Sections being LIST THEIR TITLES, with the
    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.

If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.

If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

repo_name: Amlouden/libreboot

license: mit


code:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<title>Building libreboot from source</title>

Building libreboot from source

				This section relates to building libreboot from source, and
				working with the git repository.

				Or Back to main index.

Install build dependencies

Get the full source code from metadata (git clone)

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

How to build "flashrom"

					Configuring libreboot

dmidecode

							GRUB payload

ASUS KFSN4-DRE

ThinkPad X60, X60S and X60 Tablet

ThinkPad T60

ThinkPad X200

ThinkPad R400

ThinkPad R500

ThinkPad T400

ThinkPad T500

MacBook2,1

QEMU (x86 i440fx/piix4)

QEMU (x86 q35/ich9)

How to build the ROM images

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 (binary archive) then you can ignore this, because
				ROM images and statically compiled executables for the utilities are included.

					For Trisquel 7, you can run the following command:

					$ sudo ./build dependencies trisquel7

					For Parabola, you can run the following command:

					$ sudo ./build dependencies parabola

					or:

					# ./build dependencies parabola

				For other GNU/Linux distributions, you can adapt the existing scripts.

Back to top of page

Get the full source code from metadata (git clone)

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

				You can use the scripts included to download everything.

				First, install the build dependencies.

				Since libreboot makes extensive use of git, you need to configure git properly. If you have not yet configured
				git, then the minimum 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.

				Another nice config for you (optional, but recommended):

				$ git config --global core.editor nano

				$ git config --global color.status auto

				$ git config --global color.branch auto

				$ git config --global color.interactive auto

				$ git config --global color.diff auto

				After that, run the script:

				$ ./download all

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

				To build the ROM images, see #build.

Back to top of page.

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

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

				BUC.TS isn't really specific to these laptops, but is a bit inside the a register in the chipset on some Intel systems.

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

				*Libreboot ROM images have identical data in those two 64KiB regions because dd is used to do that, by the build system.
				If you're building from upstream (coreboot), you have to do it manually.

				BUC.TS is backed up (powered) by the NVRAM battery (or CMOS battery, as some people call it). On thinkpads,
				this is typically in a yellow plastic package with the battery inside, connected via power lines to 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 before you proceed.

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

				If you have the binary release archive, you'll find executables under ./bucts/. Otherwise if you need to build from source, continue reading.

				First, install the build dependencies.

				To build bucts, do this in the main directory:

				$ ./build module bucts

				To statically compile it, do this:

				$ ./build module bucts static

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

Back to top of page.

How to build "flashrom"

				Flashrom is the utility for flashing/dumping ROM 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 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 choose the correct one for you. Otherwise
				if you wish to re-build flashrom from source, continue reading.

				First, install the build dependencies.

				To build it, do the following in the main directory:

				$ ./build module flashrom

				To statically compile it, do the following in the main directory:

				$ ./build module flashrom static

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

					flashrom

For flashing while coreboot or libreboot is running.

					flashrom_lenovobios_sst

This is patched for flashing while Lenovo BIOS is running on an X60 or T60 with the SST25VF016B (SST) flash chip.

					flashrom_lenovobios_macronix

This is patched for flashing while Lenovo BIOS is running on an X60 or T60 with the MX25L1605D (Macronix) flash chip.

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

Back to top of page.

Configuring libreboot

				Before building a ROM in libreboot (or coreboot, for that matter), you need to configure it.
				Configuration files should already be included, so you don't need to do anything. This information
				is only for reference. If you are updating or modifying coreboot-libre, and need to update the configs
				in any way, refer to ../maintain/index.html#newboard_libreboot.

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

					dmidecode

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

Local version string

SMBIOS Serial Number

SMBIOS Manufacturer

SMBIOS Version

SMBIOS Product name

						This information can be obtained using:

						$ sudo dmidecode

						# dmidecode

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

						In practise, this information is useless and you can
						just leave it on the defaults that coreboot uses (this
						is what libreboot does, on most boards).

GRUB payload

					GRUB is one of the payloads that libreboot targets.

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

						ASUS KFSN4-DRE configuration (file: resources/libreboot/config/grub/kfsn4-dre/config)

General setup / Expert mode = enable

General / Use CMOS for configuration values = enable

Mainboard / Mainboard vendor = ASUS

Mainboard / Mainboard model = KFSN4-DRE

Mainboard / ROM chip size = 1024 KB (1 MB)

Chipset / Include CPU microcode in CBFS = Do not include microcode updates

Devices / Use native graphics initialization = enable

								Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot framebuffer for a separate set of ROM images, in each system.

Generic Drivers / USB 2.0 EHCI debug dongle support = Enable

Generic Drivers / Enable early (pre-RAM) usbdebug = Enable

Generic Drivers / Type of dongle = Net20DC or compatible

Generic Drivers / Digitizer = Present

Console / USB dongle console output = enable

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Now go back into Devices:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

							The resulting .config file was saved as resources/libreboot/config/grub/kfsn4-dre/config and is used by the build
							scripts for this system.

						ThinkPad X60, X60S and X60 Tablet configuration (file: resources/libreboot/config/grub/x60/config)

General setup / Expert mode = enable

General / Use CMOS for configuration values = enable

Mainboard / Mainboard vendor = Lenovo

Mainboard / Mainboard model = ThinkPad X60 / X60s / X60t

Mainboard / ROM chip size = 2048 KB (2 MB)

Chipset / Include CPU microcode in CBFS = Do not include microcode updates

Devices / Use native graphics initialization = enable

								Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot framebuffer for a separate set of ROM images, in each system.

Generic Drivers / USB 2.0 EHCI debug dongle support = Enable

Generic Drivers / Enable early (pre-RAM) usbdebug = Enable

Generic Drivers / Type of dongle = Net20DC or compatible

Generic Drivers / Digitizer = Present

Console / USB dongle console output = enable

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Now go back into Devices:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

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

							This configuration is used on all variants: X60, X60S and X60 Tablet.

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

General setup / Expert mode = enable

General setup / Local version string = 79ETE7WW (2.27 )

General / Use CMOS for configuration values = enable

Mainboard / Mainboard vendor = Lenovo

Mainboard / Mainboard model = ThinkPad T60 / T60p

Mainboard / ROM chip size = 2048 KB (2 MB)

System tables / SMBIOS Serial Number = L3DKE06

System tables / SMBIOS Version Number = ThinkPad T60

System tables / SMBIOS Manufacturer = LENOVO

System tables / SMBIOS Product name = 1951FEG

Chipset / Include CPU microcode in CBFS = Do not include microcode updates

Devices / Use native graphics initialization = enable

								Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot framebuffer for a separate set of ROM images, in each system.

Generic Drivers / USB 2.0 EHCI debug dongle support = Enable

Generic Drivers / Enable early (pre-RAM) usbdebug = Enable

Generic Drivers / Type of dongle = Net20DC or compatible

Console / USB dongle console output = enable

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Go back into Devices:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

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

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

						ThinkPad X200 configuration (file: resources/libreboot/config/grub/x200_4mb/config and resources/libreboot/config/grub/x200_8mb/config)

							These are saved as two configs, because there are 2 size flash chips: 4MB or 8MB.

General / Expert mode = enable

General / Use CMOS for configuration values = enable

Mainboard / Mainboard vendor = Lenovo

Mainboard / Mainboard model = ThinkPad X200

Mainboard / ROM chip size = 4096 KB (4 MB) or 8192 KB (8 MB) depending on flash chip size

Chipset / Include CPU microcode in CBFS = Do not include microcode updates

Chipset / Size of CBFS filesystem in ROM = byte size 0x7FD000 (for 8MB flash chip) or 3FD000 (for 4MB flash chip)

Devices / Use native graphics initialization = enable

								Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot framebuffer for a separate set of ROM images, in each system.

Generic Drivers / USB 2.0 EHCI debug dongle support = Enable

Generic Drivers / Enable early (pre-RAM) usbdebug = Enable

Generic Drivers / Type of dongle = Net20DC or compatible

Generic Drivers / Digitizer = Present

Console / USB dongle console output = enable

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Go back and disable option ROMs:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

							The resulting .config file was saved as resources/libreboot/config/grub/x200_8mb/config and
							resources/libreboot/config/grub/x200_4mb/config and is used by the build
							scripts for this system.

						ThinkPad R400 configuration (file: resources/libreboot/config/grub/r400_4mb/config and resources/libreboot/config/grub/r400_8mb/config)

							These are saved as two configs, because there are 2 size flash chips: 4MB or 8MB.

General / Expert mode = enable

General / Use CMOS for configuration values = enable

Mainboard / Mainboard vendor = Lenovo

Mainboard / Mainboard model = ThinkPad R400

Mainboard / ROM chip size = 4096 KB (4 MB) or 8192 KB (8 MB) depending on flash chip size

Chipset / Include CPU microcode in CBFS = Do not include microcode updates

Chipset / Size of CBFS filesystem in ROM = byte size 0x7FD000 (for 8MB flash chip) or 3FD000 (for 4MB flash chip)

Devices / Use native graphics initialization = enable

								Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot framebuffer for a separate set of ROM images, in each system.

Generic Drivers / USB 2.0 EHCI debug dongle support = Enable

Generic Drivers / Enable early (pre-RAM) usbdebug = Enable

Generic Drivers / Type of dongle = Net20DC or compatible

Console / USB dongle console output = enable

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Go back and disable option ROMs:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

							The resulting .config file was saved as resources/libreboot/config/grub/r400_8mb/config and
							resources/libreboot/config/grub/r400_4mb/config and is used by the build
							scripts for this system.

						ThinkPad R500 configuration (file: resources/libreboot/config/grub/r500_4mb/config)

General / Expert mode = enable

General / Use CMOS for configuration values = enable

Mainboard / Mainboard vendor = Lenovo

Mainboard / Mainboard model = ThinkPad R500

Mainboard / ROM chip size = 4096 KB (4 MB)

Chipset / Include CPU microcode in CBFS = Do not include microcode updates

Chipset / Size of CBFS filesystem in ROM = 0x3FF000

Devices / Use native graphics initialization = enable

								Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot framebuffer for a separate set of ROM images, in each system.

Generic Drivers / USB 2.0 EHCI debug dongle support = Enable

Generic Drivers / Enable early (pre-RAM) usbdebug = Enable

Generic Drivers / Type of dongle = Net20DC or compatible

Console / USB dongle console output = enable

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Go back and disable option ROMs:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

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

						ThinkPad T400 configuration (file: resources/libreboot/config/grub/t400_4mb/config and resources/libreboot/config/grub/t400_8mb/config)

							These are saved as two configs, because there are 2 size flash chips: 4MB or 8MB.

General / Expert mode = enable

General / Use CMOS for configuration values = enable

Mainboard / Mainboard vendor = Lenovo

Mainboard / Mainboard model = ThinkPad T400

Mainboard / ROM chip size = 4096 KB (4 MB) or 8192 KB (8 MB) depending on flash chip size

Chipset / Include CPU microcode in CBFS = Do not include microcode updates

Chipset / Size of CBFS filesystem in ROM = byte size 0x7FD000 (for 8MB flash chip) or 3FD000 (for 4MB flash chip)

Devices / Use native graphics initialization = enable

								Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot framebuffer for a separate set of ROM images, in each system.

Generic Drivers / USB 2.0 EHCI debug dongle support = Enable

Generic Drivers / Enable early (pre-RAM) usbdebug = Enable

Generic Drivers / Type of dongle = Net20DC or compatible

Console / USB dongle console output = enable

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Go back and disable option ROMs:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

							The resulting .config file was saved as resources/libreboot/config/grub/t400_8mb/config and
							resources/libreboot/config/grub/t400_4mb/config and is used by the build
							scripts for this system.

						ThinkPad T500 configuration (file: resources/libreboot/config/grub/t500_4mb/config and resources/libreboot/config/grub/t500_8mb/config)

							These are saved as two configs, because there are 2 size flash chips: 4MB or 8MB.

General / Expert mode = enable

General / Use CMOS for configuration values = enable

Mainboard / Mainboard vendor = Lenovo

Mainboard / Mainboard model = ThinkPad T500

Mainboard / ROM chip size = 4096 KB (4 MB) or 8192 KB (8 MB) depending on flash chip size

Chipset / Include CPU microcode in CBFS = Do not include microcode updates

Chipset / Size of CBFS filesystem in ROM = byte size 0x7FD000 (for 8MB flash chip) or 3FD000 (for 4MB flash chip)

Devices / Use native graphics initialization = enable

								Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot framebuffer for a separate set of ROM images, in each system.

Generic Drivers / USB 2.0 EHCI debug dongle support = Enable

Generic Drivers / Enable early (pre-RAM) usbdebug = Enable

Generic Drivers / Type of dongle = Net20DC or compatible

Console / USB dongle console output = enable

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Go back and disable option ROMs:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

							The resulting .config file was saved as resources/libreboot/config/grub/t500_8mb/config and
							resources/libreboot/config/grub/t500_4mb/config and is used by the build
							scripts for this system.

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

General / Expert mode = enable

General / Local version string = "    MB21.88Z.00A5.B07.0706270922" (without the quotes)

General / Use CMOS for configuration values = enable

Mainboard / Mainboard vendor = Apple

Mainboard / Mainboard model = Macbook2,1 ICH7 TESTING

Mainboard / ROM chip size = 2048 KB (2 MB)

System tables / SMBIOS Serial Number = W8724XXXXXX

System tables / SMBIOS Version Number = 1.0

System tables / SMBIOS Manufacturer = Apple Inc.

System tables / SMBIOS Product Name = MacBook2,1

Chipset / Include CPU microcode in CBFS = Do not include microcode updates

Devices / Use native graphics initialization = enable

								Display / Keep VESA framebuffer = disable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot framebuffer for a separate set of ROM images, in each system.

Generic Drivers / USB 2.0 EHCI debug dongle support = Enable

Generic Drivers / Enable early (pre-RAM) usbdebug = Enable

Generic Drivers / Type of dongle =

Console / USB dongle console output = enable

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Go back and disable option ROMs:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

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

						QEMU (x86 i440fx/piix4) configuration (file: resources/libreboot/config/grub/qemu_i440fx_piix4/config)

General / Expert mode = enable

Mainboard / Mainboard vendor = Emulation

Mainboard / Mainboard model = QEMU x86 i440fx/piix4 (aka qemu -M pc)

Mainboard / ROM chip size = 8192 KB (8 MB)

Devices / Use native graphics initialization = enable (should already be enabled)

								Display / Keep VESA framebuffer = enable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with framebuffer enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot text-mode for a separate set of ROM images, in each system.

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Go back and disable option ROMs:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

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

						QEMU (x86 q35/ich9) configuration (file: resources/libreboot/config/grub/qemu_q35_ich9/config)

General / Expert mode = enable

Mainboard / Mainboard vendor = Emulation

Mainboard / Mainboard model = QEMU x86 q35/ich9 (aka qemu -M q35)

Mainboard / ROM chip size = 8192 KB (8 MB)

Devices / Use native graphics initialization = enable (should already be enabled)

								Display / Keep VESA framebuffer = enable (disable for text-mode graphics, enable for coreboot vesa framebuffer)

Libreboot provides this with framebuffer enabled by default, but it automatically patches a copy of the config at build time
									to enable coreboot text-mode for a separate set of ROM images, in each system.

Payload / Add a payload = An ELF executable payload

Payload / Payload path and filename = grub.elf

							Go back and disable option ROMs:

Devices / Run VGA Option ROMs = disable

Devices / Run Option ROMs on PCI devices = disable

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

Back to top of page.

How to build the ROM images

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

				You can build libreboot from source on a 32-bit (i686) or 64-bit (x86_64) system. Recommended (if possible): x86_64.
				ASUS KFSN4-DRE has 64-bit CPUs.
				On a ThinkPad T60, you can replace the CPU (Core 2 Duo T5600, T7200 or T7600. T5600 recommended) for 64-bit support.
				On an X60s, you can replace the board with one that has a Core 2 Duo L7400 (you could also use an X60 Tablet board with the same CPU).
				On an X60, you can replace the board with one that has a Core 2 Duo T5600 or T7200 (T5600 is recommended). All MacBook2,1 laptops
				are 64-bit, as are all ThinkPad X200, X200S, X200 Tablet, R400, T400 and T500 laptops. Warning: MacBook1,1 laptops are all 32-bit only.

				First, install the build dependencies.

				If you downloaded libreboot from git, refer to #build_meta.

				Build all of the components used in libreboot:

				$ ./build module all

				You can also build each modules separately, using ./build module modulename.
				To see the possible values for modulename, use:

				$ ./build module list

				NOTE: crossgcc is included in coreboot/util/crossgcc/tarballs/ in the release archives,
				but the build system for libreboot does not automatically download/build it.
				If you are using libreboot from the git repository, make sure to do the following:

				$ cd coreboot/

				$ make crossgcc-i386

				$ cd ../

				This will download coreboot's reference cross-compile toolchain,
				which is highly recommended by the coreboot project.

				After that, build the ROM images (for all boards):

				$ ./build roms withgrub

				Alternatively, you can build for a specific board or set of boards.
				For example:

				$ ./build roms withgrub x60

				$ ./build roms withgrub x200_8mb

				$ ./build roms withgrub x60 x200_8mb

				The list of board options can be found by looking at the directory
				names in resources/libreboot/config/grub/.

				To clean (reverse) everything, do the following:

				$ ./build clean all

				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 Trisquel 7. Parabola *fails* at this stage
						(for now). For all other distros, YMMV.

						This is mainly intended for use with the git repository.
						These commands will work in the release archive (_src), unless otherwise noted below.

						The archives will appear under release/${version}/;
						${version} will either be set using git describe or,
						if a version file already exists (_src release archive),
						then it will simply re-use that.

						Tag the current commit, and that version will appear in both the ${version}
						string on the directory under release/, and in the file names of the
						archives. Otherwise, whatever git uses for git describe --tags HEAD
						will be used.

						Utilities (static executables):

						$ ./build release util

						Archive containing flashrom and bucts source code:

						$ ./build release tobuild

						Documentation archive (does not work on _src release archive, only git):

						$ ./build release docs

						ROM image archives:

						$ ./build release roms

						Source code archive:

						$ ./build release src

						SHA512 sums of all other release archives that have been generated:

						$ ./build release sha512sums

						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.

						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.

						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.

						The same applies if you want to include statically linked flashrom binaries for ARM.

						armv7l binaries (tested on a BeagleBone Black) are also included in libreboot_util, for:

cbfstool

ich9gen

ich9deblob

flashrom

						If you are building binaries on a live system or chroot (for flashrom/bucts), you can use the following to statically link them:

						$ ./build module flashrom static

						$ ./build module bucts static

						The same conditions as above apply for ARM (except, building bucts on ARM is pointless, and for flashrom
						you only need the normal executable since the lenovobios_sst and _macronix executables are meant
						to run on an X60/T60 while lenovo bios is present, working around the security restrictions).

						The command that you used for generating the release archives will also run the following command:

						$ ./build release tobuild

						The archive tobuild.tar.xz will have been created under release/, 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/.

						The ROM images will be stored in separate archives for each system, under release/rom/.

Back to top of page

			Copyright ©  2014, 2015 Francis Rowe <info@gluglug.org.uk>

			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;
			with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
			A copy of the license can be found at ../gfdl-1.3.txt

			Updated versions of the license (when available) can be found at
			https://www.gnu.org/licenses/licenses.html

			UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
			EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
			AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
			ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
			IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
			WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
			PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
			ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
			KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
			ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.

			TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
			TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
			NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
			INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
			COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
			USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
			ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
			DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
			IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.

			The disclaimer of warranties and limitation of liability provided
			above shall be interpreted in a manner that, to the extent
			possible, most closely approximates an absolute disclaimer and
			waiver of all liability.


code:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<title>Configuring Parabola (post-install)</title>

Configuring Parabola (post-install)

				Post-installation configuration steps for Parabola GNU/Linux-libre. Parabola is extremely flexible; this is just an example.

				Back to previous index

Table of Contents

					Configuring pacman

Updating Parabola

							Maintaining Parabola during system updates

Clearing package cache after updating

Pacman command equivalents (compared to other package managers)

your-freedom

Add a user account

System D

Interesting repositories

					Setup a network connection in Parabola

Setting hostname

Network status

Network interface names

Network setup

System maintenance - important!

					Configuring the desktop

Install Xorg

Xorg keyboard layout

Install LXDE

LXDE - clock

LXDE - font

LXDE - screenlock

LXDE - automounting

LXDE - disable suspend

LXDE - battery monitor

LXDE - network manager

			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.

			It details configuration steps that I took after installing the base system,
			as a follow up to encrypted_parabola.html.
			This guide is 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 to be made at the present date, please get in touch
				with the libreboot 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 setup that most users will be happy with. While Parabola
			can seem daunting at first glance (especially for new GNU/Linux users), with a simple guide it can provide
			all the same usability as Trisquel, without hiding any details from the user.

			Paradoxically, as you get more advanced Parabola can actually become easier to use
			when you want to set up your system in a special way 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 have not yet installed Parabola,
				then this guide 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 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.

			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 sometimes recommend the use of proprietary software. You need to be 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

Configure pacman

				pacman (package manager) 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-based systems like Trisquel,
				this can be used to add/remove and update the software on your computer.

				Based on https://wiki.parabolagnulinux.org/Installation_Guide#Configure_pacman
				and from reading https://wiki.archlinux.org/index.php/Pacman (make sure to read and understand this,
				it's very important) and
				https://wiki.parabolagnulinux.org/Official_Repositories

				Back to top of page.

Updating Parabola

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

				Then, update the system:

				# pacman -Syu

					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 will need to perform with certain files (typically configurations)
				after the update. Also, you should check both the Parabola and Arch home pages to see if they mention any issues.
				If a new kernel is installed, you should also update to be able to use it (the currently running kernel will
				also be fine). It's generally good enough to update Parabola once every week, or maybe twice. As a
				rolling release distribution, it's a good idea never to leave your install too outdated; update regularly. This
				is simply because of the way the project works; old packages are deleted from the repositories quickly, once they are updated.
				A system that hasn't been updated for quite a while will mean potentially more reading of previous posts through the website,
				and more maintenance work.

				The Arch forum can also be useful, if others have the same issue as you (if you encounter issues, that is). The Parabola
				IRC channel (#parabola on freenode) can also help you.

				Due to this and the volatile nature of Parabola/Arch, you should only update when you have at least a couple hours of spare time
				in case of issues that need to be resolved. You should never update, for example, if you need your system for an important event,
				like a presentation or sending an email to an important person before an allocated deadline, and so on.

				Relax - packages are well-tested regularly when new updates are made to the repositories. Separate 'testing' repositories
				exist for this exact reason. Despite what many people will tell you, Parabola is fairly stable and trouble-free,
				so long as you are aware of how to check for issues, and are willing to spend some time fixing issues in
				the rare event that they do occur.

				Back to top of page.

Maintaining Parabola

				Parabola is a very simple distro, in the sense that you are in full control
				and everything is made transparent to you. One consequence is
				that you also need to know what you are doing, and what you have done before. In general, keeping notes (such as what I have done
				with this page) can be very useful as a reference in the future (if you wanted to re-install it or install the distro
				on another computer, for example).

				Back to top of page.

Cleaning the package cache

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

					To clean out all old packages that are cached:

					# pacman -Sc

					The wiki cautions that this should be used with care. For example, since older packages are deleted from the repo,
					if you encounter issues and want to revert back to an older package then it's useful to have the caches available.
					Only do this if you are sure that you won't need it.

					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.

					Back to top of page.

pacman command equivalents

					The following table lists other distro package manager commands, and their equivalent in pacman:

					https://wiki.archlinux.org/index.php/Pacman_Rosetta

					Back to top of page.

your-freedom

				your-freedom is a package specific to Parabola, and it is installed by default. What it does is conflict with packages
				from Arch that are known to be non-free (proprietary) software. When migrating from Arch (there is a guide on the Parabola
				wiki for migrating - converting - an existing Arch system to a Parabola system), installing
				your-freedom will also fail if these packages are installed, citing them as conflicts; the recommended solution
				is then to delete the offending packages, and continue installing your-freedom.

				Back to top of page.

Add a user

				Based on https://wiki.archlinux.org/index.php/Users_and_Groups.

				It is important (for security reasons) to create and use a non-root (non-admin) user account for everyday use. The default 'root' account is intended
				only for critical administrative work, since it has complete access to the entire operating system.

				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

Back to top of page

systemd

				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.

				An example of a 'service' could be a webserver (such as lighttpd), or sshd (openssh), dhcp, etc. There are countless others.

				https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530 explains
				the background behind the decision by Arch (Parabola's upstream 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 10% of the total size your / partition takes up.
				on a 60GB root this would mean 6GB. That's not exactly practical, and can have performance implications later when the
				log gets too big. Based on instructions from the wiki, I will reduce the total size of the journal to 50MiB (the wiki
				recommends 50MiB).

				Open /etc/systemd/journald.conf and find the line that says:

				#SystemMaxUse=

				Change it to say:

				SystemMaxUse=50M

				The wiki also recommended a method for forwarding journal output to TTY 12 (accessible by pressing ctrl+alt+f12,
				and you use ctrl+alt+[F1-F12] to switch between terminals). I decided not to enable it.

				Restart journald:

				# systemctl restart systemd-journald

				The wiki recommends that if the journal gets too large, you can also simply delete (rm -Rf) everything inside /var/log/journald/*
				but recommends backing it up. This shouldn't be necessary, since you already set the size limit above and systemd will automatically
				start to delete older records when the journal size reaches it's limit (according to systemd developers).

				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 perform. Therefore, it is a good idea to read what's stored in these locations
				to get a better understanding.

				I looked in /etc/tmpfiles.d/ and found that it was empty on my system. 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 the systemd-tmpfiles utility manually at all.

Back to top of page

Interesting repositories

				Parabola wiki at https://wiki.parabolagnulinux.org/Repositories#kernels
				mentions about a repository called [kernels] for custom kernels that aren't in the default base. It might be worth looking into what is available
				there, depending on your use case.

				I enabled it on my system, to see what was in it. Edit /etc/pacman.conf and below the 'extra' section add:

					[kernels]

					Include = /etc/pacman.d/mirrorlist

				Now sync with the repository:

				# pacman -Syy

				List all available packages in this repository:

				# pacman -Sl kernels

				In the end, I decided not to install anything from it but I kept the repository enabled regardless.

Back to top of page.

Setup a network connection in Parabola

				Read https://wiki.archlinux.org/index.php/Configuring_Network.

				Back to top of page.

Set the hostname

					This should be the same as the hostname that you set in /etc/hostname 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:

					# man hostname

					# info hostname

					# man hostnamectl

					Add the same hostname to /etc/hosts, on each line. Example:

						127.0.0.1	localhost.localdomain	localhost myhostname

						::1		localhost.localdomain	localhost myhostname

					You'll note that I set both lines; the 2nd line is for IPv6. More and more ISPs are providing this now (mine does)
					so it's good to be forward-thinking here.

					The hostname utility is part of the inetutils package and is in core/, installed by default (as part of base).

					Back to top of page.

Network Status

					According to the Arch wiki, udev should already detect the ethernet chipset
					and load the driver for it automatically at boot time. You can check this in the "Ethernet controller" section
					when running this command:

					# lspci -v

					Look at the remaining sections 'Kernel driver in use' and 'Kernel modules'. In my case it was as follows:

						Kernel driver in use: e1000e

						Kernel modules: e1000e

					Check that the driver was loaded by issuing dmesg | grep module_name. In my case, I did:

					# dmesg | grep e1000e

Network device names

					According to https://wiki.archlinux.org/index.php/Configuring_Network#Device_names,
					it is important to note that the old interface names like eth0, wlan0, wwan0 and so on no longer apply. Instead, systemd
					creates device names starting with en (for enternet), wl (for wifi) and ww (for wwan) with a fixed identifier that systemd automatically generates.
					An example device name for your ethernet chipset would be enp0s25, where it is never supposed to change.

					If you want to enable the old names (eth0, wlan0, wwan0, etc), the Arch wiki recommends
					adding net.ifnames=0 to your kernel parameters (in libreboot context, this would be accomplished by following the
					instructions in grub_cbfs.html).

					For background information,
					read Predictable Network Interface Names

					Show device names:

					# ls /sys/class/net

					Changing the device names is possible (I chose not to do it):

					https://wiki.archlinux.org/index.php/Configuring_Network#Change_device_name

					Back to top of page.

Network setup

					I actually chose to ignore most of Networking section on the wiki. Instead, I plan to set up LXDE desktop with the graphical
					network-manager client. Here is a list of network managers:

					https://wiki.archlinux.org/index.php/List_of_applications/Internet#Network_managers.
					If you need to, set a static IP address (temporarily) using the networking guide and the Arch wiki, or start the dhcpcd service in systemd.
					NetworkManager will be setup later, after installing LXDE.

					Back to top of page.

System Maintenance

				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!

				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.

				Back to top of page.

Configuring the desktop

				Based on steps from
				General Recommendations on the Arch wiki.
				The plan is to use LXDE and LXDM/LightDM, along with everything else that you would expect on other distributions that provide LXDE
				by default.

				Back to top of page.

Installing Xorg

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

						# pacman -S xorg-server-utils

						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:

						# pacman -Sg xorg-drivers

						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>

						Back to top of page.

Xorg keyboard layout

						Refer to https://wiki.archlinux.org/index.php/Keyboard_configuration_in_Xorg.

						Xorg uses a different configuration method for keyboard layouts, so you will notice that the layout you
						set in /etc/vconsole.conf earlier might not actually be the same in X.

						To see what layout you currently use, try this on a terminal emulator in X:

						# setxkbmap -print -verbose 10

						In my case, I wanted to use the Dvorak (UK) keyboard which is quite different from Xorg's default Qwerty (US) layout.

						I'll just say it now: XkbModel can be pc105 in this case (ThinkPad X60, with a 105-key UK keyboard).
						If you use an American keyboard (typically 104 keys) you will want to use pc104.

						XkbLayout in my case would be gb, and XkbVariant would be dvorak.

						The Arch wiki recommends two different methods for setting the keyboard layout:

						https://wiki.archlinux.org/index.php/Keyboard_configuration_in_Xorg#Using_X_configuration_files and

						https://wiki.archlinux.org/index.php/Keyboard_configuration_in_Xorg#Using_localectl.

						In my case, I chose to use the configuration file method:

						Create the file /etc/X11/xorg.conf.d/10-keyboard.conf and put this inside:

							Section "InputClass"

							        Identifier "system-keyboard"

							        MatchIsKeyboard "on"

							        Option "XkbLayout" "gb"

							        Option "XkbModel" "pc105"

							        Option "XkbVariant" "dvorak"

							EndSection

						For you, the steps above may differ if you have a different layout. If you use a US Qwerty keyboard, then
						you don't even need to do anything (though it might help, for the sake of being explicit).

						Back to top of page.

Install LXDE

						Desktop choice isn't that important to me, so for simplicity I decided to use LXDE. It's lightweight
						and does everything that I need.
						If you would like to try something different, refer to
						https://wiki.archlinux.org/index.php/Desktop_environment

						Refer to https://wiki.archlinux.org/index.php/LXDE.

						Install it, choosing 'all' when asked for the default package list:

						# pacman -S lxde obconf

						I didn't want the following, so I removed them:

						# pacman -R lxmusic lxtask

						I also lazily installed all fonts:

						# pacman -S $(pacman -Ssq ttf-)

						LXDE comes with a terminal. You probably want a browser to go with that; I choose GNU IceCat, part of the GNU project:

						# pacman -S icecat

						And a mail client:

						# pacman -S icedove

						In IceCat, go to Preferences :: Advanced and disable GNU IceCat Health Report.

						I also like to install these:

						# pacman -S xsensors stress htop

						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

						Log in with your standard (non-root) user that you created earlier.
						It is advisable to also create an xinitrc rule in case you ever want to 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

						Now make sure that it is executable:

						$ chmod +x .xinitrc

						Back to top of page.

LXDE - clock

						In Digital Clock Settings (right click the clock) I set the Clock Format to %Y/%m/%d %H:%M:%S

						Back to top of page.

LXDE - font

						NOTE TO SELF: come back to this later.

						Back to top of page.

LXDE - screenlock

						Arch wiki recommends to use xscreensaver:

						# pacman -S xscreensaver

						Under Preferences :: Screensaver in the LXDE menu, I chose Mode: Blank Screen Only,
						setting Blank After, Cycle After and Lock Screen After (checked) to 10 minutes.

						You can now lock the screen with Logout :: Lock Screen in the LXDE menu.

						Back to top of page.

LXDE - automounting

						Refer to https://wiki.archlinux.org/index.php/File_manager_functionality.

						I chose to ignore this for now. NOTE TO SELF: come back to this later.

						Back to top of page.

LXDE - disable suspend

						When closing the laptop lid, the system suspends. This is annoying at least to me.
						NOTE TO SELF: disable it, then document the steps here.

						Back to top of page.

LXDE - battery monitor

						Right click lxde panel and Add/Remove Panel Items. Click Add and select Battery Monitor, then click Add.
						Close and then right-click the applet and go to Battery Monitor Settings, check the box that says Show Extended Information.
						Now click Close. When you hover the cursor over it, it'll show information about the battery.

						Back to top of page.

LXDE - Network Manager

						Refer to https://wiki.archlinux.org/index.php/LXDE#Network_Management.
						Then I read: https://wiki.archlinux.org/index.php/NetworkManager.

						Install Network Manager:

						# pacman -S networkmanager

						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

						I want to be able to use a VPN at some point, so the wiki tells me to do:

						# pacman -S networkmanager-openvpn

						LXDE uses openbox, so I refer to:

						https://wiki.archlinux.org/index.php/NetworkManager#Openbox.

						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

						I wanted to quickly enable networkmanager:

						# systemctl stop dhcpcd

						# systemctl start NetworkManager

						Enable NetworkManager at boot time:

						# systemctl enable NetworkManager

						Restart LXDE (log out, and then log back in).

						I added the volume control applet to the panel (right click panel, and add a new applet).
						I also later changed the icons to use the gnome icon theme, in lxappearance.

						Back to top of page.

			Copyright ©  2014, 2015 Francis Rowe <info@gluglug.org.uk>

			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;
			with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
			A copy of the license can be found at ../gfdl-1.3.txt

			Updated versions of the license (when available) can be found at
			https://www.gnu.org/licenses/licenses.html

			UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
			EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
			AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
			ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
			IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
			WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
			PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
			ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
			KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
			ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.

			TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
			TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
			NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
			INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
			COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
			USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
			ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
			DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
			IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.

			The disclaimer of warranties and limitation of liability provided
			above shall be interpreted in a manner that, to the extent
			possible, most closely approximates an absolute disclaimer and
			waiver of all liability.