index.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904
  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>Building libreboot from source</title>
  10. </head>
  11. <body>
  12. <div class="section">
  13. <h1 id="pagetop">Building libreboot from source</h1>
  14. <p>
  15. This section relates to building libreboot from source, and
  16. working with the git repository.
  17. </p>
  18. <p>
  19. Or <a href="../index.html">Back to main index</a>.
  20. </p>
  21. <ul>
  22. <li><a href="#build_dependencies">Install build dependencies</a></li>
  23. <li><a href="#build_meta">Get the full source code from metadata (git clone)</a></li>
  24. <li><a href="#build_bucts">How to build &quot;bucts&quot; (for LenovoBIOS X60/X60S/X60T/T60)</a></li>
  25. <li><a href="#build_flashrom">How to build &quot;flashrom&quot;</a></li>
  26. <li>
  27. <a href="#config">Configuring libreboot</a>
  28. <ul>
  29. <li><a href="#config_dmidecode">dmidecode</a></li>
  30. <li><a href="#config_x60">ThinkPad X60, X60S and X60 Tablet</a></li>
  31. <li><a href="#config_t60">ThinkPad T60</a></li>
  32. <li><a href="#config_x200">ThinkPad X200</a></li>
  33. <li><a href="#config_r400">ThinkPad R400</a></li>
  34. <li><a href="#config_t400">ThinkPad T400</a></li>
  35. <li><a href="#config_t500">ThinkPad T500</a></li>
  36. <li><a href="#config_macbook21">MacBook2,1</a></li>
  37. <li><a href="#config_qemu_i440fx_piix4">QEMU (x86 i440fx/piix4)</a></li>
  38. <li><a href="#config_qemu_q35_ich9">QEMU (x86 q35/ich9)</a></li>
  39. </ul>
  40. </li>
  41. <li><a href="#build">How to build the ROM images</a></li>
  42. </ul>
  43. </div>
  44. <div class="section">
  45. <h1 id="build_dependencies">Install build dependencies</h1>
  46. <p>
  47. Before doing anything, you need the dependencies first. This is true if
  48. you want to build libreboot from source, with either libreboot_src.tar.xz or git.
  49. <b>If you are using libreboot_util.tar.xz (binary archive) then you can ignore this, because
  50. ROM images and statically compiled executables for the utilities are included.</b>
  51. </p>
  52. <div class="important">
  53. <p>
  54. For Trisquel 7, you can run the following command:<br/>
  55. $ <b>sudo ./build dependencies trisquel7</b>
  56. </p>
  57. <p>
  58. For Parabola, you can run the following command:<br/>
  59. $ <b>sudo ./build dependencies parabola</b><br/>
  60. or:<br/>
  61. # <b>./build dependencies parabola</b>
  62. </p>
  63. </div>
  64. <p>
  65. For other GNU/Linux distributions, you can adapt the existing scripts.
  66. </p>
  67. <p><a href="#pagetop">Back to top of page</a></p>
  68. </div>
  69. <div class="section">
  70. <h1 id="build_meta">Get the full source code from metadata (git clone)</h1>
  71. <p>
  72. If you downloaded libreboot from git, then there are some steps to download and patch
  73. the source code for all relevant dependencies. The archive in the git repository used to be
  74. available as a tarball called 'libreboot_meta.tar.gz'. It contains 'metadata' (scripts)
  75. which define how the source was created (where it came from).
  76. </p>
  77. <p>
  78. You can use the scripts included to download everything.
  79. </p>
  80. <p>
  81. First, <a href="#build_dependencies">install the build dependencies</a>.
  82. </p>
  83. <p>
  84. Since libreboot makes extensive use of git, you need to configure git properly. If you have not yet configured
  85. git, then the minimum requirement is:<br/>
  86. $ <b>git config --global user.name "Your Name"</b><br/>
  87. $ <b>git config --global user.email your@emailaddress.com</b><br/>
  88. This is what will also appear in git logs if you ever commit your own changes to a given repository. For
  89. more information, see <a href="http://git-scm.com/doc">http://git-scm.com/doc</a>.
  90. </p>
  91. <p>
  92. Another nice config for you (optional, but recommended):<br/>
  93. $ <b>git config --global core.editor nano</b><br/>
  94. $ <b>git config --global color.status auto</b><br/>
  95. $ <b>git config --global color.branch auto</b><br/>
  96. $ <b>git config --global color.interactive auto</b><br/>
  97. $ <b>git config --global color.diff auto</b>
  98. </p>
  99. <p>
  100. After that, run the script:<br/>
  101. $ <b>./download all</b>
  102. </p>
  103. <p>
  104. What this did was download everything (grub, coreboot, memtest86+, bucts, flashrom)
  105. at the versions last tested for this release, and patch them. Read the script
  106. in a text editor to learn more.
  107. </p>
  108. <p>
  109. To build the ROM images, see <a href="#build">#build</a>.
  110. </p>
  111. <p><a href="#pagetop">Back to top of page.</a></p>
  112. </div>
  113. <div class="section">
  114. <h1 id="build_bucts">How to build &quot;bucts&quot; (for LenovoBIOS X60/X60S/X60T/T60)</h1>
  115. <p>
  116. <b>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.</b>
  117. </p>
  118. <p>
  119. BUC.TS isn't really specific to these laptops, but is a bit inside the a register in the chipset on some Intel systems.
  120. </p>
  121. <p>
  122. Bucts is needed when flashing in software the X60/X60S/X60T/T60 ROM while Lenovo BIOS is running;
  123. external flashing will be safe regardless.
  124. Each ROM contains identical data inside the two final 64K region in the file*.
  125. This corresponds to the final two 64K regions in the flash chip. Lenovo BIOS will prevent you from writing the
  126. final one, so running &quot;<b>bucts 1</b>&quot; will set the machine to boot from the other block instead (which
  127. is writeable along with everything beneath it when using a patched flashrom. see <a href="#build_flashrom">#build_flashrom</a>).
  128. After shutting down and booting up after the first flash of libreboot,
  129. the final 64K block is writeable so you flash the ROM again with an unpatched flashrom and run "<b>bucts 0</b>" to
  130. make the machine boot from the normal (highest) block again.
  131. </p>
  132. <p>
  133. *Libreboot ROM images have identical data in those two 64KiB regions because dd is used to do that, by the build system.
  134. If you're building from upstream (coreboot), you have to do it manually.
  135. </p>
  136. <p>
  137. BUC.TS is backed up (powered) by the NVRAM battery (or CMOS battery, as some people call it). On thinkpads,
  138. this is typically in a yellow plastic package with the battery inside, connected via power lines to the
  139. mainboard. Removing that battery removes power to BUC.TS, resetting the bit back to 0 (if you previously set
  140. it to 1).
  141. </p>
  142. <p>
  143. BUC.TS utility is included in libreboot_src.tar.xz and libreboot_util.tar.xz.<br/>
  144. <b>If you downloaded from git, follow <a href="#build_meta">#build_meta</a> before you proceed.</b>
  145. </p>
  146. <p>
  147. &quot;BUC&quot; means &quot;<b>B</b>ack<b>u</b>p <b>C</b>ontrol&quot; (it's a register) and &quot;TS&quot; means &quot;<b>T</b>op <b>S</b>wap&quot;
  148. (it's a status bit). Hence &quot;bucts&quot; (BUC.TS). TS 1 and TS 0 corresponds to bucts 1 and bucts 0.
  149. </p>
  150. <p>
  151. If you have the binary release archive, you'll find executables under ./bucts/. Otherwise if you need to build from source, continue reading.
  152. </p>
  153. <p>
  154. First, <a href="#build_dependencies">install the build dependencies</a>.
  155. </p>
  156. <p>
  157. To build bucts, do this in the main directory:<br/>
  158. $ <b>./build module bucts</b>
  159. </p>
  160. <p>
  161. To statically compile it, do this:<br/>
  162. $ <b>./build module bucts static</b>
  163. </p>
  164. <p>
  165. The &quot;builddeps&quot; script in libreboot_src also makes use of builddeps-bucts.
  166. </p>
  167. <p><a href="#pagetop">Back to top of page.</a></p>
  168. </div>
  169. <div class="section">
  170. <h1 id="build_flashrom">How to build &quot;flashrom&quot;</h1>
  171. <p>
  172. Flashrom is the utility for flashing/dumping ROM images. This is what you will use to install libreboot.
  173. </p>
  174. <p>
  175. Flashrom source code is included in libreboot_src.tar.xz and libreboot_util.tar.xz.<br/>
  176. <b>If you downloaded from git, follow <a href="#build_meta">#build_meta</a> before you proceed.</b>
  177. </p>
  178. <p>
  179. If you are using the binary release archive, then there are already binaries included
  180. under ./flashrom/. The flashing scripts will try to choose the correct one for you. Otherwise
  181. if you wish to re-build flashrom from source, continue reading.
  182. </p>
  183. <p>
  184. First, <a href="#build_dependencies">install the build dependencies</a>.
  185. </p>
  186. <p>
  187. To build it, do the following in the main directory:<br/>
  188. $ <b>./build module flashrom</b>
  189. </p>
  190. <p>
  191. To statically compile it, do the following in the main directory:<br/>
  192. $ <b>./build module flashrom static</b>
  193. </p>
  194. <p>
  195. After you've done that, under ./flashrom/ you will find the following executables:
  196. </p>
  197. <ul>
  198. <li>
  199. <b>flashrom</b>
  200. <ul>
  201. <li>For flashing while coreboot or libreboot is running.</li>
  202. </ul>
  203. </li>
  204. <li>
  205. <b>flashrom_lenovobios_sst</b>
  206. <ul>
  207. <li>This is patched for flashing while Lenovo BIOS is running on an X60 or T60 with the SST25VF016B (SST) flash chip.</li>
  208. </ul>
  209. </li>
  210. <li>
  211. <b>flashrom_lenovobios_macronix</b>
  212. <ul>
  213. <li>This is patched for flashing while Lenovo BIOS is running on an X60 or T60 with the MX25L1605D (Macronix) flash chip.</li>
  214. </ul>
  215. </li>
  216. </ul>
  217. <p>
  218. The &quot;builddeps&quot; script in libreboot_src also makes use of builddeps-flashrom.
  219. </p>
  220. <p><a href="#pagetop">Back to top of page.</a></p>
  221. </div>
  222. <div class="section">
  223. <h1 id="config">Configuring libreboot</h1>
  224. <p>
  225. Before building a ROM in libreboot (or coreboot, for that matter), you need to configure it.
  226. This is done using the following inside the source tree:<br/>
  227. $ <b>cd coreboot/</b><br/>
  228. $ <b>make menuconfig</b>
  229. </p>
  230. <p>
  231. If you've already built a kernel before, you know how to use this interface.
  232. </p>
  233. <p>
  234. Configurations are then saved as files called <b>&quot;.config&quot;</b>. Copies of each configuration used
  235. for each machine type by the libreboot build scripts are stored in resources/libreboot/config/
  236. </p>
  237. <div class="subsection">
  238. <h2 id="config_dmidecode">
  239. dmidecode
  240. </h2>
  241. <p>
  242. There is certain information that can be useful to enter in particular:
  243. </p>
  244. <ul>
  245. <li>Local version string</li>
  246. <li>SMBIOS Serial Number</li>
  247. <li>SMBIOS Manufacturer</li>
  248. <li>SMBIOS Version</li>
  249. <li>SMBIOS Product name</li>
  250. </ul>
  251. <p>
  252. This information can be obtained using:<br/>
  253. <b>$ sudo dmidecode</b><br/>
  254. <b># dmidecode</b>
  255. </p>
  256. <p>
  257. Specifically, it's good practise to enter the same information for libreboot that you found when running this
  258. with the original BIOS or firmware. <b>libreboot has already done this for you. This information is for reference,
  259. in the hope that it will be useful.</b>
  260. </p>
  261. </div>
  262. <div class="subsection">
  263. <h2 id="config_x60">
  264. ThinkPad X60, X60S and X60 Tablet configuration (file: resources/libreboot/config/x60/config)
  265. </h2>
  266. <ul>
  267. <li>General setup / Expert mode = <i>enable</i></li>
  268. <li>General / Use CMOS for configuration values = <i>enable</i></li>
  269. <li>General / Load default configuration values into CMOS on each boot = <i>enable</i></li>
  270. <li>Mainboard / Mainboard vendor = <i>Lenovo</i></li>
  271. <li>Mainboard / Mainboard model = <i>ThinkPad X60 / X60s / X60t</i></li>
  272. <li>Mainboard / ROM chip size = <i>2048 KB (2 MB)</i></li>
  273. <li>Chipset / Include CPU microcode in CBFS = <i>Do not include microcode updates</i></li>
  274. <li>Devices / Use native graphics initialization = <i>enable</i></li>
  275. <li>
  276. Display / Keep VESA framebuffer = <i>disable</i> (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  277. <ul>
  278. <li>Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
  279. to enable coreboot framebuffer for a separate set of ROM images, in each machine.</li>
  280. </ul>
  281. </li>
  282. <li>Generic Drivers / USB 2.0 EHCI debug dongle support = <i>Enable</i></li>
  283. <li>Generic Drivers / Enable early (pre-RAM) usbdebug = <i>Enable</i></li>
  284. <li>Generic Drivers / Type of dongle = <i>Net20DC or compatible</i></li>
  285. <li>Generic Drivers / Digitizer = <i>Present</i></li>
  286. <li>Console / USB dongle console output = <i>enable</i></li>
  287. <li>Payload / Add a payload = <i>An ELF executable payload</i></li>
  288. <li>Payload / Payload path and filename = <i>grub.elf</i></li>
  289. </ul>
  290. <p>
  291. Now go back into Devices:
  292. </p>
  293. <ul>
  294. <li>Devices / Run VGA Option ROMs = <i>disable</i></li>
  295. <li>Devices / Run Option ROMs on PCI devices = <i>disable</i></li>
  296. </ul>
  297. <p>
  298. The resulting .config file was saved as resources/libreboot/config/<b>x60/config</b> and is used by the build
  299. scripts for this machine.
  300. </p>
  301. <p>
  302. This configuration is used on all variants: X60, X60S and X60 Tablet.
  303. </p>
  304. </div>
  305. <div class="subsection">
  306. <h2 id="config_t60">
  307. ThinkPad T60 configuration (file: resources/libreboot/config/t60/config)
  308. </h2>
  309. <ul>
  310. <li>General setup / Expert mode = <i>enable</i></li>
  311. <li>General setup / Local version string = <i>79ETE7WW (2.27 )</i></li>
  312. <li>General / Use CMOS for configuration values = <i>enable</i></li>
  313. <li>General / Load default configuration values into CMOS on each boot = <i>enable</i></li>
  314. <li>Mainboard / Mainboard vendor = <i>Lenovo</i></li>
  315. <li>Mainboard / Mainboard model = <i>ThinkPad T60 / T60p</i></li>
  316. <li>Mainboard / ROM chip size = <i>2048 KB (2 MB)</i></li>
  317. <li>System tables / SMBIOS Serial Number = <i>L3DKE06</i></li>
  318. <li>System tables / SMBIOS Version Number = <i>ThinkPad T60</i></li>
  319. <li>System tables / SMBIOS Manufacturer = <i>LENOVO</i></li>
  320. <li>System tables / SMBIOS Product name = <i>1951FEG</i></li>
  321. <li>Chipset / Include CPU microcode in CBFS = <i>Do not include microcode updates</i></li>
  322. <li>Devices / Use native graphics initialization = <i>enable</i></li>
  323. <li>
  324. Display / Keep VESA framebuffer = <i>disable</i> (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  325. <ul>
  326. <li>Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
  327. to enable coreboot framebuffer for a separate set of ROM images, in each machine.</li>
  328. </ul>
  329. </li>
  330. <li>Generic Drivers / USB 2.0 EHCI debug dongle support = <i>Enable</i></li>
  331. <li>Generic Drivers / Enable early (pre-RAM) usbdebug = <i>Enable</i></li>
  332. <li>Generic Drivers / Type of dongle = <i>Net20DC or compatible</i></li>
  333. <li>Console / USB dongle console output = <i>enable</i></li>
  334. <li>Payload / Add a payload = <i>An ELF executable payload</i></li>
  335. <li>Payload / Payload path and filename = <i>grub.elf</i></li>
  336. </ul>
  337. <p>
  338. Go back into Devices:
  339. </p>
  340. <ul>
  341. <li>Devices / Run VGA Option ROMs = <i>disable</i></li>
  342. <li>Devices / Run Option ROMs on PCI devices = <i>disable</i></li>
  343. </ul>
  344. <p>
  345. The resulting .config file was saved as resources/libreboot/config/<b>t60/config</b> and is used by the build
  346. scripts for this machine.
  347. </p>
  348. <p>
  349. It is believed that the motherboards on 14.1&quot; and 15.1&quot; T60s are the same, so the same configuration is used
  350. on both the 14.1&quot; and 15.1&quot; T60s.
  351. </p>
  352. </div>
  353. <div class="subsection">
  354. <h2 id="config_x200">
  355. ThinkPad X200 configuration (file: resources/libreboot/config/x200_4mb/config and resources/libreboot/config/x200_8mb/config)
  356. </h2>
  357. <p>
  358. These are saved as two configs, because there are 2 size flash chips: 4MB or 8MB.
  359. </p>
  360. <ul>
  361. <li>General / Expert mode = <i>enable</i></li>
  362. <li>General / Use CMOS for configuration values = <i>enable</i></li>
  363. <li>General / Load default configuration values into CMOS on each boot = <i>enable</i></li>
  364. <li>Mainboard / Mainboard vendor = <i>Lenovo</i></li>
  365. <li>Mainboard / Mainboard model = <i>ThinkPad X200</i></li>
  366. <li>Mainboard / ROM chip size = <i>4096 KB (4 MB)</i> or <i>8192 KB (8 MB)</i> depending on flash chip size</li>
  367. <li>Chipset / Include CPU microcode in CBFS = <i>Do not include microcode updates</i></li>
  368. <li>Chipset / Size of CBFS filesystem in ROM = byte size <i>0x7FD000</i> (for 8MB flash chip) or <i>3FD000</i> (for 4MB flash chip)</li>
  369. <li>Devices / Use native graphics initialization = <i>enable</i></li>
  370. <li>
  371. Display / Keep VESA framebuffer = <i>disable</i> (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  372. <ul>
  373. <li>Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
  374. to enable coreboot framebuffer for a separate set of ROM images, in each machine.</li>
  375. </ul>
  376. </li>
  377. <li>Generic Drivers / USB 2.0 EHCI debug dongle support = <i>Enable</i></li>
  378. <li>Generic Drivers / Enable early (pre-RAM) usbdebug = <i>Enable</i></li>
  379. <li>Generic Drivers / Type of dongle = <i>Net20DC or compatible</i></li>
  380. <li>Generic Drivers / Digitizer = <i>Present</i></li>
  381. <li>Console / USB dongle console output = <i>enable</i></li>
  382. <li>Payload / Add a payload = <i>An ELF executable payload</i></li>
  383. <li>Payload / Payload path and filename = <i>grub.elf</i></li>
  384. </ul>
  385. <p>
  386. Go back and disable option ROMs:
  387. </p>
  388. <ul>
  389. <li>Devices / Run VGA Option ROMs = <i>disable</i></li>
  390. <li>Devices / Run Option ROMs on PCI devices = <i>disable</i></li>
  391. </ul>
  392. <p>
  393. The resulting .config file was saved as resources/libreboot/config/<b>x200_8mb/config</b> and
  394. resources/libreboot/config/<b>x200_4mb/config</b> and is used by the build
  395. scripts for this machine.
  396. </p>
  397. </div>
  398. <div class="subsection">
  399. <h2 id="config_r400">
  400. ThinkPad R400 configuration (file: resources/libreboot/config/r400_4mb/config and resources/libreboot/config/r400_8mb/config)
  401. </h2>
  402. <p>
  403. These are saved as two configs, because there are 2 size flash chips: 4MB or 8MB.
  404. </p>
  405. <ul>
  406. <li>General / Expert mode = <i>enable</i></li>
  407. <li>General / Use CMOS for configuration values = <i>enable</i></li>
  408. <li>General / Load default configuration values into CMOS on each boot = <i>enable</i></li>
  409. <li>Mainboard / Mainboard vendor = <i>Lenovo</i></li>
  410. <li>Mainboard / Mainboard model = <i>ThinkPad R400</i></li>
  411. <li>Mainboard / ROM chip size = <i>4096 KB (4 MB)</i> or <i>8192 KB (8 MB)</i> depending on flash chip size</li>
  412. <li>Chipset / Include CPU microcode in CBFS = <i>Do not include microcode updates</i></li>
  413. <li>Chipset / Size of CBFS filesystem in ROM = byte size <i>0x7FD000</i> (for 8MB flash chip) or <i>3FD000</i> (for 4MB flash chip)</li>
  414. <li>Devices / Use native graphics initialization = <i>enable</i></li>
  415. <li>
  416. Display / Keep VESA framebuffer = <i>disable</i> (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  417. <ul>
  418. <li>Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
  419. to enable coreboot framebuffer for a separate set of ROM images, in each machine.</li>
  420. </ul>
  421. </li>
  422. <li>Generic Drivers / USB 2.0 EHCI debug dongle support = <i>Enable</i></li>
  423. <li>Generic Drivers / Enable early (pre-RAM) usbdebug = <i>Enable</i></li>
  424. <li>Generic Drivers / Type of dongle = <i>Net20DC or compatible</i></li>
  425. <li>Console / USB dongle console output = <i>enable</i></li>
  426. <li>Payload / Add a payload = <i>An ELF executable payload</i></li>
  427. <li>Payload / Payload path and filename = <i>grub.elf</i></li>
  428. </ul>
  429. <p>
  430. Go back and disable option ROMs:
  431. </p>
  432. <ul>
  433. <li>Devices / Run VGA Option ROMs = <i>disable</i></li>
  434. <li>Devices / Run Option ROMs on PCI devices = <i>disable</i></li>
  435. </ul>
  436. <p>
  437. The resulting .config file was saved as resources/libreboot/config/<b>r400_8mb/config</b> and
  438. resources/libreboot/config/<b>r400_4mb/config</b> and is used by the build
  439. scripts for this machine.
  440. </p>
  441. </div>
  442. <div class="subsection">
  443. <h2 id="config_t400">
  444. ThinkPad T400 configuration (file: resources/libreboot/config/t400_4mb/config and resources/libreboot/config/t400_8mb/config)
  445. </h2>
  446. <p>
  447. These are saved as two configs, because there are 2 size flash chips: 4MB or 8MB.
  448. </p>
  449. <ul>
  450. <li>General / Expert mode = <i>enable</i></li>
  451. <li>General / Use CMOS for configuration values = <i>enable</i></li>
  452. <li>General / Load default configuration values into CMOS on each boot = <i>enable</i></li>
  453. <li>Mainboard / Mainboard vendor = <i>Lenovo</i></li>
  454. <li>Mainboard / Mainboard model = <i>ThinkPad T400</i></li>
  455. <li>Mainboard / ROM chip size = <i>4096 KB (4 MB)</i> or <i>8192 KB (8 MB)</i> depending on flash chip size</li>
  456. <li>Chipset / Include CPU microcode in CBFS = <i>Do not include microcode updates</i></li>
  457. <li>Chipset / Size of CBFS filesystem in ROM = byte size <i>0x7FD000</i> (for 8MB flash chip) or <i>3FD000</i> (for 4MB flash chip)</li>
  458. <li>Devices / Use native graphics initialization = <i>enable</i></li>
  459. <li>
  460. Display / Keep VESA framebuffer = <i>disable</i> (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  461. <ul>
  462. <li>Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
  463. to enable coreboot framebuffer for a separate set of ROM images, in each machine.</li>
  464. </ul>
  465. </li>
  466. <li>Generic Drivers / USB 2.0 EHCI debug dongle support = <i>Enable</i></li>
  467. <li>Generic Drivers / Enable early (pre-RAM) usbdebug = <i>Enable</i></li>
  468. <li>Generic Drivers / Type of dongle = <i>Net20DC or compatible</i></li>
  469. <li>Console / USB dongle console output = <i>enable</i></li>
  470. <li>Payload / Add a payload = <i>An ELF executable payload</i></li>
  471. <li>Payload / Payload path and filename = <i>grub.elf</i></li>
  472. </ul>
  473. <p>
  474. Go back and disable option ROMs:
  475. </p>
  476. <ul>
  477. <li>Devices / Run VGA Option ROMs = <i>disable</i></li>
  478. <li>Devices / Run Option ROMs on PCI devices = <i>disable</i></li>
  479. </ul>
  480. <p>
  481. The resulting .config file was saved as resources/libreboot/config/<b>t400_8mb/config</b> and
  482. resources/libreboot/config/<b>t400_4mb/config</b> and is used by the build
  483. scripts for this machine.
  484. </p>
  485. </div>
  486. <div class="subsection">
  487. <h2 id="config_t500">
  488. ThinkPad T500 configuration (file: resources/libreboot/config/t500_4mb/config and resources/libreboot/config/t500_8mb/config)
  489. </h2>
  490. <p>
  491. These are saved as two configs, because there are 2 size flash chips: 4MB or 8MB.
  492. </p>
  493. <ul>
  494. <li>General / Expert mode = <i>enable</i></li>
  495. <li>General / Use CMOS for configuration values = <i>enable</i></li>
  496. <li>General / Load default configuration values into CMOS on each boot = <i>enable</i></li>
  497. <li>Mainboard / Mainboard vendor = <i>Lenovo</i></li>
  498. <li>Mainboard / Mainboard model = <i>ThinkPad T500</i></li>
  499. <li>Mainboard / ROM chip size = <i>4096 KB (4 MB)</i> or <i>8192 KB (8 MB)</i> depending on flash chip size</li>
  500. <li>Chipset / Include CPU microcode in CBFS = <i>Do not include microcode updates</i></li>
  501. <li>Chipset / Size of CBFS filesystem in ROM = byte size <i>0x7FD000</i> (for 8MB flash chip) or <i>3FD000</i> (for 4MB flash chip)</li>
  502. <li>Devices / Use native graphics initialization = <i>enable</i></li>
  503. <li>
  504. Display / Keep VESA framebuffer = <i>disable</i> (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  505. <ul>
  506. <li>Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
  507. to enable coreboot framebuffer for a separate set of ROM images, in each machine.</li>
  508. </ul>
  509. </li>
  510. <li>Generic Drivers / USB 2.0 EHCI debug dongle support = <i>Enable</i></li>
  511. <li>Generic Drivers / Enable early (pre-RAM) usbdebug = <i>Enable</i></li>
  512. <li>Generic Drivers / Type of dongle = <i>Net20DC or compatible</i></li>
  513. <li>Console / USB dongle console output = <i>enable</i></li>
  514. <li>Payload / Add a payload = <i>An ELF executable payload</i></li>
  515. <li>Payload / Payload path and filename = <i>grub.elf</i></li>
  516. </ul>
  517. <p>
  518. Go back and disable option ROMs:
  519. </p>
  520. <ul>
  521. <li>Devices / Run VGA Option ROMs = <i>disable</i></li>
  522. <li>Devices / Run Option ROMs on PCI devices = <i>disable</i></li>
  523. </ul>
  524. <p>
  525. The resulting .config file was saved as resources/libreboot/config/<b>t500_8mb/config</b> and
  526. resources/libreboot/config/<b>t500_4mb/config</b> and is used by the build
  527. scripts for this machine.
  528. </p>
  529. </div>
  530. <div class="subsection">
  531. <h2 id="config_macbook21">
  532. MacBook2,1 configuration (file: resources/libreboot/config/macbook21/config)
  533. </h2>
  534. <ul>
  535. <li>General / Expert mode = <i>enable</i></li>
  536. <li>General / Local version string = <i>&quot;&nbsp;&nbsp;&nbsp;&nbsp;MB21.88Z.00A5.B07.0706270922&quot;</i> (without the quotes)</li>
  537. <li>General / Use CMOS for configuration values = <i>enable</i></li>
  538. <li>General / Load default configuration values into CMOS on each boot = <i>enable</i></li>
  539. <li>Mainboard / Mainboard vendor = <i>Apple</i></li>
  540. <li>Mainboard / Mainboard model = <i>Macbook2,1 ICH7 TESTING</i></li>
  541. <li>Mainboard / ROM chip size = <i>2048 KB (2 MB)</i></li>
  542. <li>System tables / SMBIOS Serial Number = <i>W8724XXXXXX</i></li>
  543. <li>System tables / SMBIOS Version Number = <i>1.0</i></li>
  544. <li>System tables / SMBIOS Manufacturer = <i>Apple Inc.</i></li>
  545. <li>System tables / SMBIOS Product Name = <i>MacBook2,1</i></li>
  546. <li>Chipset / Include CPU microcode in CBFS = <i>Do not include microcode updates</i></li>
  547. <li>Devices / Use native graphics initialization = <i>enable</i></li>
  548. <li>
  549. Display / Keep VESA framebuffer = <i>disable</i> (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  550. <ul>
  551. <li>Libreboot provides this with text-mode enabled by default, but it automatically patches a copy of the config at build time
  552. to enable coreboot framebuffer for a separate set of ROM images, in each machine.</li>
  553. </ul>
  554. </li>
  555. <li>Generic Drivers / USB 2.0 EHCI debug dongle support = <i>Enable</i></li>
  556. <li>Generic Drivers / Enable early (pre-RAM) usbdebug = <i>Enable</i></li>
  557. <li>Generic Drivers / Type of dongle = <i></i></li>
  558. <li>Console / USB dongle console output = <i>enable</i></li>
  559. <li>Payload / Add a payload = <i>An ELF executable payload</i></li>
  560. <li>Payload / Payload path and filename = <i>grub.elf</i></li>
  561. </ul>
  562. <p>
  563. Go back and disable option ROMs:
  564. </p>
  565. <ul>
  566. <li>Devices / Run VGA Option ROMs = <i>disable</i></li>
  567. <li>Devices / Run Option ROMs on PCI devices = <i>disable</i></li>
  568. </ul>
  569. <p>
  570. The resulting .config file was saved as resources/libreboot/config/<b>macbook21/config</b> and is used by the build
  571. scripts for this machine. <b>This config is also used for the MacBook1,1</b>.
  572. </p>
  573. </div>
  574. <div class="subsection">
  575. <h2 id="config_qemu_i440fx_piix4">
  576. QEMU (x86 i440fx/piix4) configuration (file: resources/libreboot/config/qemu_i440fx_piix4/config)
  577. </h2>
  578. <ul>
  579. <li>General / Expert mode = <i>enable</i></li>
  580. <li>Mainboard / Mainboard vendor = <i>Emulation</i></li>
  581. <li>Mainboard / Mainboard model = <i>QEMU x86 i440fx/piix4 (aka qemu -M pc)</i></li>
  582. <li>Mainboard / ROM chip size = <i>8192 KB (8 MB)</i></li>
  583. <li>Devices / Use native graphics initialization = <i>enable</i> (should already be enabled)</li>
  584. <li>
  585. Display / Keep VESA framebuffer = <i>enable</i> (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  586. <ul>
  587. <li>Libreboot provides this with framebuffer enabled by default, but it automatically patches a copy of the config at build time
  588. to enable coreboot text-mode for a separate set of ROM images, in each machine.</li>
  589. </ul>
  590. </li>
  591. <li>Payload / Add a payload = <i>An ELF executable payload</i></li>
  592. <li>Payload / Payload path and filename = <i>grub.elf</i></li>
  593. </ul>
  594. <p>
  595. Go back and disable option ROMs:
  596. </p>
  597. <ul>
  598. <li>Devices / Run VGA Option ROMs = <i>disable</i></li>
  599. <li>Devices / Run Option ROMs on PCI devices = <i>disable</i></li>
  600. </ul>
  601. <p>
  602. The resulting .config file was saved as resources/libreboot/config/<b>qemu_i440fx_piix4/config</b> and is used by the build
  603. scripts for this machine.
  604. </p>
  605. </div>
  606. <div class="subsection">
  607. <h2 id="config_qemu_q35_ich9">
  608. QEMU (x86 q35/ich9) configuration (file: resources/libreboot/config/qemu_q35_ich9/config)
  609. </h2>
  610. <ul>
  611. <li>General / Expert mode = <i>enable</i></li>
  612. <li>Mainboard / Mainboard vendor = <i>Emulation</i></li>
  613. <li>Mainboard / Mainboard model = <i>QEMU x86 q35/ich9 (aka qemu -M q35)</i></li>
  614. <li>Mainboard / ROM chip size = <i>8192 KB (8 MB)</i></li>
  615. <li>Devices / Use native graphics initialization = <i>enable</i> (should already be enabled)</li>
  616. <li>
  617. Display / Keep VESA framebuffer = <i>enable</i> (disable for text-mode graphics, enable for coreboot vesa framebuffer)
  618. <ul>
  619. <li>Libreboot provides this with framebuffer enabled by default, but it automatically patches a copy of the config at build time
  620. to enable coreboot text-mode for a separate set of ROM images, in each machine.</li>
  621. </ul>
  622. </li>
  623. <li>Payload / Add a payload = <i>An ELF executable payload</i></li>
  624. <li>Payload / Payload path and filename = <i>grub.elf</i></li>
  625. </ul>
  626. <p>
  627. Go back and disable option ROMs:
  628. </p>
  629. <ul>
  630. <li>Devices / Run VGA Option ROMs = <i>disable</i></li>
  631. <li>Devices / Run Option ROMs on PCI devices = <i>disable</i></li>
  632. </ul>
  633. <p>
  634. The resulting .config file was saved as resources/libreboot/config/<b>qemu_q35_ich9/config</b> and is used by the build
  635. scripts for this machine.
  636. </p>
  637. </div>
  638. <p><a href="#pagetop">Back to top of page.</a></p>
  639. </div>
  640. <div class="section">
  641. <h1 id="build">How to build the ROM images</h1>
  642. <p>You don't need to do much, as there are scripts already written for you that can build everything automatically.</p>
  643. <p>
  644. You can build libreboot from source on a 32-bit (i686) or 64-bit (x86_64) system. Recommended (if possible): x86_64.
  645. On a ThinkPad T60, you can replace the CPU (Core 2 Duo T5600, T7200 or T7600. T5600 recommended) for 64-bit support.
  646. 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).
  647. 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
  648. 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.
  649. </p>
  650. <p>
  651. First, <a href="#build_dependencies">install the build dependencies</a>.
  652. </p>
  653. <p>
  654. If you downloaded libreboot from git, refer to <a href="#build_meta">#build_meta</a>.
  655. </p>
  656. <p>
  657. Build all of the components used in libreboot:<br/>
  658. $ <b>./build module all</b>
  659. </p>
  660. <p>
  661. After that, build the ROM images (for all boards):<br/>
  662. $ <b>./build roms withgrub</b><br/>
  663. Alternatively, you can build for a specific board or set of boards.
  664. For example:<br/>
  665. $ <b>./build roms withgrub x60</b><br/>
  666. $ <b>./build roms withgrub x200_8mb</b><br/>
  667. $ <b>./build roms withgrub x60 x200_8mb</b><br/>
  668. The list of board options can be found by looking at the directory
  669. names in <b>resources/libreboot/config/</b>.
  670. </p>
  671. <p>
  672. To clean (reverse) everything, do the following:<br/>
  673. $ <b>./build clean all</b>
  674. </p>
  675. <p>
  676. The ROM images will be stored under <b>bin/</b>.
  677. </p>
  678. <div class="subsection">
  679. <h2>Preparing release archives (optional)</h2>
  680. <p>
  681. <b>This is only confirmed to work (tested) in Trisquel 7. Parabola *fails* at this stage
  682. (for now). For all other distros, YMMV.</b>
  683. </p>
  684. <p>
  685. This is mainly intended for use with the git repository.
  686. These commands will work in the release archive (_src), unless otherwise noted below.
  687. </p>
  688. <p>
  689. The archives will appear under <i>release/${version}/</i>;
  690. ${version} will either be set using <i>git describe</i> or,
  691. if a <i>version</i> file already exists (_src release archive),
  692. then it will simply re-use that.
  693. </p>
  694. <p>
  695. Tag the current commit, and that version will appear in both the ${version}
  696. string on the directory under <i>release/</i>, and in the file names of the
  697. archives. Otherwise, whatever git uses for <i>git describe --tags HEAD</i>
  698. will be used.
  699. </p>
  700. <p>
  701. Utilities (static executables):<br/>
  702. $ <b>./build release util</b>
  703. </p>
  704. <p>
  705. Archive containing flashrom and bucts source code:<br/>
  706. $ <b>./build release tobuild</b>
  707. </p>
  708. <p>
  709. crossgcc archives:<br/>
  710. $ <b>./build release crossgcc</b>
  711. </p>
  712. <p>
  713. Documentation archive (<b>does not work on _src release archive, only git</b>):<br/>
  714. $ <b>./build release docs</b>
  715. </p>
  716. <p>
  717. ROM image archives:<br/>
  718. $ <b>./build release roms</b>
  719. </p>
  720. <p>
  721. Source code archive:<br/>
  722. $ <b>./build release src</b>
  723. </p>
  724. <p>
  725. SHA512 sums of all other release archives that have been generated:<br/>
  726. $ <b>./build release sha512sums</b>
  727. </p>
  728. <p>
  729. If you are building on an i686 host, this will build statically linked 32-bit binaries in
  730. the binary release archive that you created,
  731. for: <b>nvramtool, cbfstool, ich9deblob, cbmem</b>.
  732. </p>
  733. <p>
  734. If you are building on an x86_64 host, this will build statically linked 32- *and* 64-bit binaries for
  735. <b>cbmem</b>, <b>ich9deblob</b>, <b>cbfstool</b> and <b>nvramtool</b>.
  736. </p>
  737. <p>
  738. <b>To include statically linked i686 and x86_64 binaries for bucts and flashrom,
  739. you will need to build them on a chroot, a virtual machine or a real
  740. system where the host uses each given architecture. These packages are difficult
  741. to cross-compile, and the libreboot project is still figuring out how to deal
  742. with them.</b>
  743. </p>
  744. <p>
  745. The same applies if you want to include statically linked flashrom binaries for ARM.
  746. </p>
  747. <p>
  748. armv7l binaries (tested on a BeagleBone Black) are also included in libreboot_util, for:
  749. </p>
  750. <ul>
  751. <li>cbfstool</li>
  752. <li>ich9gen</li>
  753. <li>ich9deblob</li>
  754. <li>flashrom</li>
  755. </ul>
  756. <p>
  757. If you are building binaries on a live system or chroot (for flashrom/bucts), you can use the following to statically link them:<br/>
  758. $ <b>./build module flashrom static</b><br/>
  759. $ <b>./build module bucts static</b>
  760. </p>
  761. <p>
  762. The same conditions as above apply for ARM (except, building bucts on ARM is pointless, and for flashrom
  763. you only need the normal executable since the lenovobios_sst and _macronix executables are meant
  764. to run on an X60/T60 while lenovo bios is present, working around the security restrictions).
  765. </p>
  766. <p>
  767. The command that you used for generating the release archives will also run the following command:<br/>
  768. $ <b>./build release tobuild</b><br/>
  769. The archive <b>tobuild.tar.xz</b> will have been created under <b>release/</b>, containing bucts, flashrom and all other required
  770. resources for building them.
  771. </p>
  772. <p>
  773. You'll find that the files libreboot_util.tar.xz and libreboot_src.tar.xz have been created, under <b>release/</b>.
  774. </p>
  775. <p>
  776. The ROM images will be stored in separate archives for each machine, under <b>release/rom/</b>.
  777. </p>
  778. </div>
  779. <p><a href="#pagetop">Back to top of page</a></p>
  780. </div>
  781. <div class="section">
  782. <p>
  783. Copyright &copy; 2014, 2015 Francis Rowe &lt;info@gluglug.org.uk&gt;<br/>
  784. This document is released under the Creative Commons Attribution-ShareAlike 4.0 International Public License and all future versions.
  785. A copy of the license can be found at <a href="../cc-by-sa-4.txt">../cc-by-sa-4.txt</a>.
  786. </p>
  787. <p>
  788. This document is distributed in the hope that it will be useful,
  789. but WITHOUT ANY WARRANTY; without even the implied warranty of
  790. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See <a href="../cc-by-sa-4.txt">../cc-by-sa-4.txt</a> for more information.
  791. </p>
  792. </div>
  793. </body>
  794. </html>