User documentation and guides for products sold on the Libre Tech Shop. https://docs.libretech.shop
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

318 lines
10 KiB

  1. # (LC230) User Guide
  2. ## The Coreboot Boot Process
  3. Here is what the boot process looks like with Coreboot installed:
  4. <figure>
  5. <img src="/images/coreboot-diagram.png" width="420" />
  6. <figcaption>Coreboot Sequence Diagram</figcaption>
  7. </figure>
  8. The first part of the boot process (labelled as "Coreboot Internal" in the diagram above) is
  9. largely hidden from the user. The boot process is illustrated below:
  10. <figure>
  11. <img src="/images/lc230-boot.gif" width="420" />
  12. <figcaption>LC230 Boot Process</figcaption>
  13. </figure>
  14. ## Installing an OS
  15. To install any GNU/Linux OS, here is a sequence of steps:
  16. ### Build USB Installer
  17. Any GNU/Linux OS would work very well on your LC230 laptop. (Some owners have
  18. also installed and used FreeBSD on it.)
  19. LC230 is configured to run without any proprietary firmware and hence, any of
  20. the following operating systems would work well by default:
  21. * [Debian GNU/Linux (main)](https://debian.org)
  22. * [PureOS](https://pureos.net/)
  23. * [Triquel](https://trisquel.info/)
  24. !!! tip
  25. The [Rasperrby Pi Imager](https://www.raspberrypi.org/software/) is a good
  26. tool to use to write an OS image to a USB disk. [Balena Etcher](https://www.balena.io/etcher/) is another
  27. one.
  28. ### Plug-in USB Disk
  29. The USB needs to be plugged in before you reboot the laptop - or else SeaBIOS
  30. will not detect it and show it as a boot option.
  31. !!! info
  32. The blue USB ports on the left side of the laptop are USB3 ports. If you
  33. have a USB disk that works with USB3, then using these ports will give you
  34. much better USB disk performance.
  35. The USB port on the right side (yellow in colour) is a USB2 port.
  36. ### Choose the boot device
  37. Press ++escape++ on boot and choose the USB disk as the boot device
  38. <figure>
  39. <img src="/images/lc230-boot-logo.jpg" width="400" />
  40. <figcaption>LC230 Boot Image</figcaption>
  41. </figure>
  42. By default, the first boot option is chosen to boot off. This is usually the
  43. 2.5" SATA disk if it is plugged in to the laptop. To choose another boot
  44. device, you need to press ++escape++ and then choose the desired boot device
  45. from the SeaBIOS menu.
  46. If you have a 2.5" SATA disk, then a USB disk would be the second boot device.
  47. If you have a 2.5" SATA disk **and** a mSATA disk, then the USB disk would be
  48. the third boot device.
  49. <figure>
  50. <img src="/images/lc230-usb3.jpg"/>
  51. <figcaption>LC230 USB3 Ports</figcaption>
  52. </figure>
  53. ### Install the OS
  54. You can now proceed with the OS installation as normal.
  55. The LC230 does not provide a UEFI BIOS (like the default Lenovo BIOS firmware).
  56. SeaBIOS is a pc-bios payload and most GNU/Linux OS installers will detect that
  57. and install the correct bootloader. This would be `grub-pc` if you choose to
  58. use Grub and Debian.
  59. ## Coreboot Internal Flashing
  60. To flash Coreboot to the x230 motherboard, the first step is to flash the BIOS
  61. externally - ie. using a SIOC-8 flashing clip connecting to the BIOS chips:
  62. <figure>
  63. <img src="/images/x230-flashing.png"/>
  64. <figcaption>Liberating the LC230 via External Flashing</figcaption>
  65. </figure>
  66. However, as a part of the external flashing process, the BIOS is unlocked. This
  67. means that you can update / modify the BIOS on the SPI Flash internally - from
  68. within the operating system. Here are some reasons to do that and the steps
  69. involved.
  70. ### Configure the kernel
  71. The first things to do before you can flash Coreboot internally, is to boot the
  72. kernel with an additional option:
  73. iomem=relaxed
  74. On Debian (and derived operating systems such as Ubuntu), you can make this a
  75. permanent setting:
  76. 1. Edit the file: `/etc/default/grub`
  77. 2. Update the line `GRUB_CMDLINE_LINUX` to read:
  78. `GRUB_CMDLINE_LINUX="iomem=relaxed"`
  79. 3. Run: `update-grub` to update the Grub configuration.
  80. ### Query Coreboot details
  81. You can verify the coreboot version (as well as the fact that you're running
  82. coreboot) by using the `dmidecode` utility as follows:
  83. #### BIOS version
  84. ``` console
  85. $ sudo dmidecode -t bios
  86. # dmidecode 3.3
  87. Getting SMBIOS data from sysfs.
  88. SMBIOS 2.8 present.
  89. Handle 0x0000, DMI type 0, 26 bytes
  90. BIOS Information
  91. Vendor: coreboot
  92. Version: CBET4000 4.10-1082-g4357a82076-dirty
  93. Release Date: 10/20/2019
  94. ROM Size: 12 MB
  95. Characteristics:
  96. PCI is supported
  97. PC Card (PCMCIA) is supported
  98. BIOS is upgradeable
  99. Selectable boot is supported
  100. ACPI is supported
  101. Targeted content distribution is supported
  102. BIOS Revision: 4.10
  103. Firmware Revision: 0.0
  104. ```
  105. #### System type & name
  106. ``` shell-session
  107. $ sudo dmidecode -t system
  108. # dmidecode 3.3
  109. Getting SMBIOS data from sysfs.
  110. SMBIOS 2.8 present.
  111. Handle 0x0001, DMI type 1, 27 bytes
  112. System Information
  113. Manufacturer: LENOVO
  114. Product Name: 2325BU3
  115. Version: ThinkPad X230
  116. Serial Number: PK1HM8E
  117. UUID: ce136601-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  118. Wake-up Type: Reserved
  119. SKU Number: Not Specified
  120. Family: ThinkPad X230
  121. Handle 0x000B, DMI type 32, 11 bytes
  122. System Boot Information
  123. Status: No errors detected
  124. ```
  125. ### Install: `flashrom`
  126. The primary tool for operating on your BIOS is called `flashrom`. The Debian
  127. package is also called by the same name and can be installed as:
  128. apt-get install flashrom
  129. If the kernel is booted correctly with `iomem=relaxed`, you can run `flashrom`:
  130. flashrom -pinternal
  131. Ouput:
  132. ``` shell-session
  133. $ sudo flashrom -pinternal
  134. flashrom v1.2 on Linux 5.10.9-gnu (x86_64)
  135. flashrom is free software, get the source code at https://flashrom.org
  136. Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
  137. coreboot table found at 0xbff51000.
  138. Found chipset "Intel QM77".
  139. Enabling flash write... SPI Configuration is locked down.
  140. Enabling hardware sequencing due to multiple flash chips detected.
  141. OK.
  142. Found Programmer flash chip "Opaque flash chip" (12288 kB, Programmer-specific) mapped at physical address 0x0000000000000000.
  143. No operations were specified.
  144. ```
  145. !!! tip
  146. Sometimes `flashrom` will not detect the internal flash chip, though it
  147. might very well be able to confirm the BIOS type and machine name. In such
  148. cases, you can try to run `flashrom` as: `flashrom
  149. -pinternal:laptop=force_I_want_a_brick`. This is not completely safe
  150. ### Read BIOS Image
  151. You can dump the BIOS to a file:
  152. ``` console
  153. $ flashrom -pinternal -r lc230-coreboot.rom
  154. ```
  155. This will read the BIOS to a file: `lc230-coreboot.rom`. This file will be 12 MB in size.
  156. ``` console
  157. $ sudo flashrom -pinternal -r lc230.rom
  158. flashrom v1.2 on Linux 5.10.9-gnu (x86_64)
  159. flashrom is free software, get the source code at https://flashrom.org
  160. Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
  161. coreboot table found at 0xbff51000.
  162. Found chipset "Intel QM77".
  163. Enabling flash write... SPI Configuration is locked down.
  164. Enabling hardware sequencing due to multiple flash chips detected.
  165. OK.
  166. Found Programmer flash chip "Opaque flash chip" (12288 kB, Programmer-specific) mapped at physical address 0x0000000000000000.
  167. Reading flash... done.
  168. $ ls -lh lc230-coreboot.rom
  169. -rw-r--r-- 1 root root 12M Feb 8 04:46 lc230-coreboot.rom
  170. ```
  171. ### Write BIOS Image
  172. You can now write back to the BIOS chips as follows:
  173. ``` console
  174. $ sudo flashrom -pinternal -w lc230-coreboot.rom
  175. flashrom v1.2 on Linux 5.10.9-gnu (x86_64)
  176. flashrom is free software, get the source code at https://flashrom.org
  177. Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
  178. coreboot table found at 0xbff51000.
  179. Found chipset "Intel QM77".
  180. Enabling flash write... SPI Configuration is locked down.
  181. Enabling hardware sequencing due to multiple flash chips detected.
  182. OK.
  183. Found Programmer flash chip "Opaque flash chip" (12288 kB, Programmer-specific) mapped at physical address 0x0000000000000000.
  184. Reading old flash chip contents... done.
  185. Erasing and writing flash chip...
  186. Warning: Chip content is identical to the requested image.
  187. Erase/write done
  188. ```
  189. ### Flash: Skulls
  190. The Skulls Coreboot distribution provides built in scripts to upgrade the BIOS.
  191. The update procedure is [detailed
  192. here](https://github.com/merge/skulls/blob/master/x230/README.md#updating).
  193. Your LC230 ships with the latest release of Skull available at the time of
  194. shipping the laptop to you. You can upgrade skulls using the instructions above.
  195. ### Flash: Heads
  196. If you want to experiment with the [Heads firmware](https://osresearch.net/),
  197. instructions are available on the [Heads website](https://osresearch.net/) as
  198. well as in the [Skulls documentation](https://github.com/merge/skulls/blob/master/x230/README.md#moving-to-heads).
  199. ## Configuring Coreboot
  200. Your LC230 ships with a SeaBIOS payload called `nvramcui` that allows you to
  201. configure coreboot behaviour and save the settings to nvram.
  202. <div style="text-align: center">
  203. <figure style="display: inline-block" >
  204. <img src="/images/nvramcui-1.jpg" width="250" />
  205. <figcaption> nvramcui options (1) </figcaption>
  206. </figure>
  207. <figure style="display: inline-block" >
  208. <img src="/images/nvramcui-2.jpg" width="235" />
  209. <figcaption> nvramcui options (2) </figcaption>
  210. </figure>
  211. <figure style="display: inline-block" >
  212. <img src="/images/nvramcui-3.jpg" width="235" />
  213. <figcaption> nvramcui options (3) </figcaption>
  214. </figure>
  215. </div>
  216. ### Swapping ++fn++ and ++control++
  217. The `fn_ctrl_swap` on the 2nd page of the `nvramcui` settings page enables you
  218. to toggle the ++fn++ and ++control++ swap. If you like to have the control key
  219. on the bottom left corner of the keyboard, then you can set this option to `Enable`.
  220. ### Increasing Graphics Memory
  221. The x230 GPU does not have dedication RAM. Instead it shares its memory with
  222. the main system memory. You can configure how much RAM is dedicated to the GPU
  223. via the `gfx_uma_size` option on the 3rd page of the `nvramcui` settings.
  224. Pressing the ++left++ and ++right++ arrow keys you can iterate over all the
  225. available settings for this option.
  226. ### Other settings
  227. You can also configure the following behaviour via nvramcui:
  228. * **Always On USB**: By enabling this option, you can configure the USB ports
  229. to be *always on* - even when the laptop is suspended.
  230. * **Enable/Disable Trackpoing, Touchpad**: You can toggle the `touchpad` and
  231. `trackpoint` options to enable or disable the the touchpad and trackpoint
  232. respectively.