index.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <style type="text/css">
  7. @import url('../css/main.css');
  8. </style>
  9. <title>Installing libreboot</title>
  10. </head>
  11. <body>
  12. <div class="section">
  13. <h1 id="pagetop">Installing libreboot</h1>
  14. <p>
  15. This section relates to installing libreboot on supported targets.
  16. </p>
  17. <p>
  18. <a href="../index.html">Back to previous index</a>
  19. </p>
  20. </div>
  21. <div class="section">
  22. <h2>Setting up external programmers</h2>
  23. <ul>
  24. <li><a href="bbb_setup.html">Setup the BeagleBone Black as an SPI flashrom programmer</a></li>
  25. </ul>
  26. <h2>Installing libreboot (software)</h2>
  27. <ul>
  28. <li><a href="#qemu">QEMU</a></li>
  29. <li><a href="#rom">Recommended ROMs to flash</a></li>
  30. <li><a href="#flashrom_lenovobios">X60/X60S/X60T/T60: How to flash your ROM (if running Lenovo BIOS firmware)</a></li>
  31. <li><a href="#flashrom_macbook21">macbook21: How to flash your ROM (if running Apple EFI firmware)</a></li>
  32. <li><a href="#flashrom">X60/X60S/X60T/T60/X200/macbook21: How to flash your ROM (if running libreboot or coreboot already)</a></li>
  33. </ul>
  34. <h2>Installing libreboot (hardware)</h2>
  35. <ul>
  36. <li><a href="x60_unbrick.html">ThinkPad X60/X60S: How to unbrick</a></li>
  37. <li><a href="x60tablet_unbrick.html">ThinkPad X60 Tablet: How to unbrick</a></li>
  38. <li><a href="t60_unbrick.html">ThinkPad T60: How to unbrick</a></li>
  39. <li><a href="x200_external.html">ThinkPad X200: How to unbrick</a> (also the initial installation guide for this machine)</li>
  40. </ul>
  41. </div>
  42. <div class="section">
  43. <h1 id="qemu">QEMU</h1>
  44. <p>
  45. You don't really do anything here, just run (example):<br/>
  46. $ <b>qemu-system-i386 -M pc -m 512 -bios bin/qemu_i440fx_piix4/qemu_i440fx_piix4_ukdvorak_vesafb.rom -serial stdio</b><br/>
  47. $ <b>qemu-system-i386 -M q35 -m 512 -bios bin/qemu_q35_ich9/qemu_q35_ich9_ukdvorak_vesafb.rom -serial stdio</b>
  48. </p>
  49. <p>
  50. <a href="#pagetop">Back to top of page</a>.
  51. </p>
  52. </div>
  53. <div class="section">
  54. <h1 id="rom">Recommended ROMs to flash</h1>
  55. <p>
  56. List of directories corresponding to each board:
  57. </p>
  58. <ul>
  59. <li>ThinkPad X60, X60s and X60 Tablet: <b>bin/x60/</b></li>
  60. <li>ThinkPad T60: <b>bin/t60/</b> (note, see <a href="../hcl/index.html#supported_t60_list">../hcl/index.html#supported_t60_list</a>)</li>
  61. <li>ThinkPad X200: <b>bin/x200_8mb/</b> (8MiB flash chip) or <b>bin/x200_4mb</b> (4MiB flash chip) (see <a href="../hcl/x200.html">../hcl/x200.html</a>)</li>
  62. <li>Apple MacBook2,1: <b>bin/macbook21/</b></li>
  63. <li>Apple MacBook1,1: <b>bin/macbook21/</b> (it's not a typo; the same ROMs work)</li>
  64. </ul>
  65. <p>These images use coreboot text-mode graphics:</p>
  66. <ul>
  67. <li>US Qwerty keyboard: <b><i>boardname</i>_usqwerty_txtmode.rom</b></li>
  68. <li>UK Qwerty keyboard: <b><i>boardname</i>_ukqwerty_txtmode.rom</b></li>
  69. <li>US Dvorak keyboard: <b><i>boardname</i>_usdvorak_txtmode.rom</b></li>
  70. <li>UK Dvorak keyboard: <b><i>boardname</i>_ukdvorak_txtmode.rom</b></li>
  71. <li>French Azerty keyboard: <b><i>boardname</i>_frazerty_txtmode.rom</b></li>
  72. <li>French Dvorak (BEPO): <b><i>boardname</i>_frdvbepo_txtmode.rom</b></li>
  73. <li>Italian Qwerty keyboard: <b><i>boardname</i>_itqwerty_txtmode.rom</b></li>
  74. <li>Swedish Qwerty keyboard: <b><i>boardname</i>_svenska_txtmode.rom</b></li>
  75. </ul>
  76. <p>These images use coreboot framebuffer graphics:</p>
  77. <ul>
  78. <li>US Qwerty keyboard: <b><i>boardname</i>_usqwerty_vesafb.rom</b></li>
  79. <li>UK Qwerty keyboard: <b><i>boardname</i>_ukqwerty_vesafb.rom</b></li>
  80. <li>US Dvorak keyboard: <b><i>boardname</i>_usdvorak_vesafb.rom</b></li>
  81. <li>UK Dvorak keyboard: <b><i>boardname</i>_ukdvorak_vesafb.rom</b></li>
  82. <li>French Azerty keyboard: <b><i>boardname</i>_frazerty_vesafb.rom</b></li>
  83. <li>French Dvorak (BEPO): <b><i>boardname</i>_frdvbepo_vesafb.rom</b></li>
  84. <li>Italian Qwerty keyboard: <b><i>boardname</i>_itqwerty_vesafb.rom</b></li>
  85. <li>Swedish Qwerty keyboard: <b><i>boardname</i>_svenska_vesafb.rom</b></li>
  86. </ul>
  87. <p>
  88. The boards for <i>boardname</i> in the examples above can be found by the names of the directories
  89. in <b>./bin/</b> or <b>./resources/libreboot/config/</b>.
  90. </p>
  91. <p>
  92. _txtmode images come with a working MemTest86+ and GRUB Invaders, both of which require text-mode.
  93. _vesafb images are recommended in most cases.
  94. </p>
  95. <p>
  96. This will give you your native keyboard layout inside GRUB. The preferences in your OS are not affected, it just makes using
  97. the GRUB command line easier (if you ever need to do that).
  98. <a href="../grub/index.html#grub_keyboard">../grub/index.html#grub_keyboard</a> shows you how this was done. If your native keyboard layout
  99. differs, you can adapt those notes and hack the 'build' script for your needs.
  100. </p>
  101. <p><a href="#pagetop">Back to top of page.</a></p>
  102. </div>
  103. <div class="section">
  104. <h1 id="flashrom_lenovobios">X60/X60S/X60T/T60: How to flash the ROMs onto your machine (if running Lenovo BIOS firmware).</h1>
  105. <div class="important">
  106. <p>
  107. Hover over the next paragraph to make it black.
  108. </p>
  109. <p class="lenovobios">
  110. Following this guide means simply flashing a libreboot ROM. This guide will not (directly) teach you how to make a backup (dump) of the original Lenovo BIOS
  111. because to do so would be to explicitly endorse proprietary software. However, for the purposes of reverse engineering it can be useful
  112. to have a backup. Each copy of the original Lenovo BIOS is tied to the specific machine that it came from; it will not run
  113. on any other machine, even if it's the same type of machine as yours. What this means is that, effectively, you can back it up now (so that you can
  114. re-flash it later if you want to run the original Lenovo BIOS again) or lose it forever. The X60/T60 installation
  115. guide on the coreboot wiki will show you how to do this:
  116. <a href="http://www.coreboot.org/Board:lenovo/x60/Installation">http://www.coreboot.org/Board:lenovo/x60/Installation</a>.<br/>
  117. Do not make this decision lightly! This is your last and only chance.
  118. </p>
  119. <p>
  120. The following is for the libreboot image and *not* the factory bios dump:
  121. </p>
  122. <p>
  123. Check the last two 64K regions in your ROM file (libreboot.rom in this example):<br/>
  124. <b>$ dd if=libreboot.rom of=top64k.bin bs=1 skip=$[$(stat -c %s libreboot.rom) - 0x10000] count=64k</b><br/>
  125. <b>$ dd if=libreboot.rom of=lower64k.bin bs=1 skip=$[$(stat -c %s libreboot.rom) - 0x20000] count=64k</b><br/>
  126. <b>$ sha512sum lower64k.bin top64k.bin</b><br/>
  127. Make *sure* that they match before you continue. The ROMs included pre-compiled in libreboot should already match.
  128. If they don't match, then do this (based on those instructions from <a href="http://www.coreboot.org/Board:lenovo/x60/Installation">coreboot wiki</a>):<br/>
  129. <b>$ dd if=top64k.bin of=libreboot.rom bs=1 seek=$[$(stat -c %s libreboot.rom) - 0x20000] count=64k conv=notrunc</b><br/>
  130. After this, the ROM will be safe to flash. Explanation is provided in <a href="../git/index.html#build_bucts">../git/index.html#build_bucts</a>.
  131. </p>
  132. </div>
  133. <p><b>This is for the ThinkPad X60 and T60 while running Lenovo BIOS. If you already have coreboot or libreboot running,
  134. then go to <a href="#flashrom">#flashrom</a> instead!</b></p>
  135. <p><b>If you are flashing a Lenovo ThinkPad T60, be sure to read <a href="../hcl/index.html#supported_t60_list">../hcl/index.html#supported_t60_list</a></b></p>
  136. <div class="important">
  137. <p>
  138. <b>If you are using libreboot_src or git, then make sure that you built the sources first (see <a href="../git/index.html#build">../git/index.html#build</a>).</b>
  139. </p>
  140. </div>
  141. <p>&quot;YOURBOARD/YOURROM&quot; should be replaced with what is correct as per <a href="#rom">#rom</a>. Alternatively
  142. you may be using your own custom ROM. Adapt.</p>
  143. <p>
  144. Run the script:<br/>
  145. <b>$ sudo ./lenovobios_firstflash bin/<a href="#rom">YOURBOARD/YOURROM</a>.</b>
  146. </p>
  147. <div class="important">
  148. <p>
  149. You should see within the output the following:<br/>
  150. <b>&quot;Updated BUC.TS=1 - 64kb address ranges at 0xFFFE0000 and 0xFFFF0000 are swapped&quot;</b>.
  151. </p>
  152. <p>
  153. You should also see within the output the following:<br/>
  154. <b>&quot;Flash chip is in an unknown state&quot;</b>, <b>&quot;FAILED&quot;</b> and <b>&quot;DO NOT SHUTDOWN OR REBOOT&quot;</b><br/>
  155. Seeing this means that the operation was a <b>resounding</b> success! <b>DON'T PANIC</b>.
  156. </p>
  157. <p>
  158. See this link for more details:
  159. <a href="http://thread.gmane.org/gmane.linux.bios.flashrom/575">http://thread.gmane.org/gmane.linux.bios.flashrom/575</a>.
  160. </p>
  161. <p>
  162. If the above is what you see, then <b>SHUT DOWN</b>. Wait a few seconds, and then boot; libreboot is running, but there is a 2nd procedure <b>*needed*</b> (see below).
  163. </p>
  164. </div>
  165. <p>
  166. <b>
  167. If you boot and you see nothing, try turning up the backlight (Fn+Home).
  168. </b>
  169. </p>
  170. <p>
  171. When you have booted up again:<br/>
  172. <b>$ sudo ./lenovobios_secondflash bin/<a href="#rom">YOURBOARD/YOURROM</a></b>
  173. </p>
  174. <div class="important">
  175. <p>
  176. You should see within the output the following:<br/>
  177. <b>&quot;Updated BUC.TS=0 - 128kb address range 0xFFFE0000-0xFFFFFFFF is untranslated&quot;</b>
  178. </p>
  179. <p>
  180. You should also see within the output the following:<br/>
  181. <b>&quot;Verifying flash... VERIFIED.&quot;</b>
  182. </p>
  183. <p>Shut down again, wait a few seconds, and then boot.</p>
  184. </div>
  185. <p>
  186. Some thinkpads come with WWAN cards installed, along with sim cards. These use non-free firmware and should be removed.
  187. You might also want to remove bluetooth. See <a href="../security/x60_security.html">../security/x60_security.html</a> and
  188. <a href="../security/t60_security.html">../security/t60_security.html</a>.
  189. </p>
  190. <p><a href="#pagetop">Back to top of page.</a></p>
  191. </div>
  192. <div class="section">
  193. <h1 id="flashrom_macbook21">macbook21: How to flash your ROM (if running Apple EFI firmware)</h1>
  194. <div class="important">
  195. <p>
  196. Hover over the next paragraph to make it black.
  197. </p>
  198. <p class="lenovobios">
  199. Following this guide means simply flashing a libreboot ROM. This guide will not (directly) teach you how to make a backup (dump) of the original Apple EFI firmware
  200. because to do so would be to explicitly endorse proprietary software. However, for the purposes of reverse engineering it can be useful
  201. to have a backup. Each copy of the original Apple EFI is (believed, but unproven to be) tied to the specific machine that it came from; it will not (as is believed) run
  202. on any other machine, even if it's the same type of machine as yours. What this means is that, effectively, you can back it up now (so that you can
  203. re-flash it later if you want to run the original Apple EFI firmware again) or lose it forever. The macbook21 installation
  204. guide on the coreboot wiki will show you how to do this:
  205. <a href="http://www.coreboot.org/Board:apple/macbook21">http://www.coreboot.org/Board:apple/macbook21</a>.<br/>
  206. Do not make this decision lightly! This is (very likely) your last and only chance.
  207. </p>
  208. <p>
  209. (this theory is untested at the time of writing)
  210. </p>
  211. <p>
  212. Note: <b>If you have a MacBook1,1 then these instructions will not work. See <a href="../hcl/index.html#macbook11">../hcl/index.html#macbook11</a> for MacBook1,1 flashing instructions.</b>
  213. </p>
  214. </div>
  215. <p>
  216. <b>
  217. This is for the MacBook2,1 while running Apple EFI firmware. If you already have
  218. coreboot or libreboot running, then go to <a href="#flashrom">#flashrom</a> instead!
  219. </b>
  220. </p>
  221. <p>
  222. Be sure to read the information in <a href="../hcl/index.html#macbook21">../hcl/index.html#macbook21</a>.
  223. </p>
  224. <div class="important">
  225. <p>
  226. <b>If you are using libreboot_src or git, then make sure that you built the sources first (see <a href="../git/index.html#build">../git/index.html#build</a>).</b>
  227. </p>
  228. </div>
  229. <p>
  230. Look at <a href="#rom">#rom</a> to see which ROM is suitable for your machine. Alternatively you may be using your own
  231. custom ROM. Adapt.
  232. </p>
  233. <p>
  234. Flashing is actually easy (compared to X60/T60).<br/>
  235. <b>$ sudo flashrom -p internal:laptop=force_I_want_a_brick -w bin/<a href="#rom">YOURBOARD/YOURROM</a></b>
  236. </p>
  237. <p>
  238. Alternatively, a script is provided which does the same thing:<br/>
  239. <b>$ sudo ./macbook21_firstflash bin/<a href="#rom">YOURBOARD/YOURROM</a></b>
  240. </p>
  241. <div class="important">
  242. <p>
  243. You should also see within the output the following:<br/>
  244. <b>&quot;Verifying flash... VERIFIED.&quot;</b>
  245. </p>
  246. <p>
  247. If you see that, great! Shut down now (power off). Wait a few seconds and then boot!
  248. </p>
  249. <p>
  250. <b>
  251. If you boot and you see nothing, try turning up the backlight (F2 for macbook21).
  252. </b>
  253. </p>
  254. </div>
  255. <p><a href="#pagetop">Back to top of page.</a></p>
  256. </div>
  257. <div class="section">
  258. <h1 id="flashrom">X60/X60S/X60T/T60/X200/macbook21: How to flash the ROMs onto your machine (if running libreboot or coreboot already)</h1>
  259. <p>
  260. <b>
  261. These instructions work for the Lenovo ThinkPad X60/X60S/X60T/T60 and Apple MacBook2,1.
  262. </b>
  263. </p>
  264. <p>
  265. <b>
  266. This assumes that you already have coreboot or libreboot running.
  267. </b>
  268. </p>
  269. <p>
  270. <b>
  271. If you have Lenovo BIOS running (X60/X60S/X60T/T60), go to <a href="#flashrom_lenovobios">#flashrom_lenovobios</a> instead.
  272. </b>
  273. </p>
  274. <p>
  275. <b>
  276. If you have Lenovo BIOS running (X200), go to <a href="x200_external.html">x200_external.html</a> instead.
  277. </b>
  278. </p>
  279. <p>
  280. <b>
  281. If you have Apple EFI firmware running (macbook21), go to <a href="#flashrom_macbook21">#flashrom_macbook21</a> instead.
  282. </b>
  283. </p>
  284. <p>
  285. <b>
  286. If you are flashing a Lenovo ThinkPad T60, be sure to read <a href="../hcl/index.html#supported_t60_list">../hcl/index.html#supported_t60_list</a>.
  287. </b>
  288. </p>
  289. <p>
  290. <b>
  291. If you have an X200 with libreboot or coreboot already running, note that
  292. the Gbe in the boot flash contains your MAC address. You will need to change the default
  293. MAC address inside the ROM images before flashing a new libreboot image. See
  294. <a href="../hcl/x200_remove_me.html#ich9gen">ich9gen</a> for details.
  295. Another important note about the X200: even if you do already have libreboot or coreboot,
  296. it is possible for the user to write-protect regions in the flash chip, by modifying
  297. the flash descriptor. If you have locked regions, you will need an external flasher
  298. (see <a href="x200_external.html">x200_external.html</a>) to re-flash those regions. By default,
  299. the X200 ROM images in libreboot contain a descriptor+gbe with all regions unlocked.
  300. </b>
  301. </p>
  302. <p>
  303. <b>
  304. If you are flashing an Apple MacBook2,1, be sure to read the information in <a href="../hcl/index.html#macbook21">../hcl/index.html#macbook21</a>.
  305. </b>
  306. </p>
  307. <div class="important">
  308. <p>
  309. <b>If you are using libreboot_src or git, then make sure that you built the sources first (see <a href="../git/index.html#build">../git/index.html#build</a>).</b>
  310. </p>
  311. </div>
  312. <p>
  313. Look at <a href="#rom">#rom</a> to see which ROM is suitable for your machine. Alternative you may be using your own
  314. custom ROM. Adapt.
  315. </p>
  316. <p>
  317. Flash the ROM:<br/>
  318. <b>$ sudo ./flash bin/<a href="#rom">YOURBOARD/YOURROM</a></b>
  319. </p>
  320. <p>
  321. If you are sure that you are flashing the correct image but you get the error
  322. <b>This coreboot image (LENOVO:ThinkPad X60) does not appear to be correct for the detected mainboard (Lenovo:ThinkPad X60 / X60s / X60t) or
  323. similar (if it's a different board), then do</b>:
  324. <br/>
  325. <b>$ sudo ./forceflash bin/<a href="#rom">YOURBOARD/YOURROM</a></b>
  326. </p>
  327. <div class="important">
  328. <p>
  329. You should see <b>&quot;Verifying flash... VERIFIED.&quot;</b> written at the end of the flashrom output. <b>SHUT DOWN</b>
  330. after you see this, and then boot up again after a few seconds.
  331. </p>
  332. <p>
  333. <b>
  334. If you boot and you see nothing, try turning up the backlight (Fn+Home for X60/X60S/X60T/T60/X200, F2 for macbook21).
  335. </b>
  336. </p>
  337. </div>
  338. <p>
  339. Some thinkpads come with WWAN cards installed, along with sim cards. These use non-free firmware and should be removed.
  340. You might also want to remove bluetooth. See <a href="../security/x60_security.html">../security/x60_security.html</a> and
  341. <a href="../security/t60_security.html">../security/t60_security.html</a>.
  342. </p>
  343. <p><a href="#pagetop">Back to top of page</a></p>
  344. </div>
  345. <div class="section">
  346. <p>
  347. Copyright &copy; 2014, 2015 Francis Rowe &lt;info@gluglug.org.uk&gt;<br/>
  348. This document is released under the Creative Commons Attribution-ShareAlike 4.0 International Public License and all future versions.
  349. A copy of the license can be found at <a href="../license.txt">../license.txt</a>.
  350. </p>
  351. <p>
  352. This document is distributed in the hope that it will be useful,
  353. but WITHOUT ANY WARRANTY; without even the implied warranty of
  354. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See <a href="../license.txt">../license.txt</a> for more information.
  355. </p>
  356. </div>
  357. </body>
  358. </html>