index.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  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>Maintaining libreboot</title>
  10. </head>
  11. <body>
  12. <div class="section">
  13. <h1 id="pagetop">Maintaining libreboot</h1>
  14. <p>
  15. This section relates to maintaining libreboot.
  16. </p>
  17. <p>
  18. Do not follow anything here to the letter; is it only a rough guide
  19. representing how libreboot is maintained (for reference).
  20. </p>
  21. <p>
  22. This section of the documentation applies mainly to the
  23. development version of libreboot, which is hosted in a git
  24. repository. It is not intended for the release versions of
  25. libreboot.
  26. </p>
  27. <ul>
  28. <li><a href="#overview">Overview</a></li>
  29. <li>
  30. <a href="#updating_coreboot">Updating coreboot-libre</a>
  31. <ul>
  32. <li><a href="#newboard_libreboot">Adding a new board to libreboot</a></li>
  33. <li><a href="#newpatch_libreboot">Add/remove/modify patches in coreboot-libre</a></li>
  34. </ul>
  35. </li>
  36. <li>
  37. <a href="#updating_grub">Updating GRUB</a>
  38. <ul>
  39. <li><a href="#altbuild_grub_payload">Change how the GRUB payload (grub.elf) is built (utility: grub-assemble)</a></li>
  40. <li><a href="#newconfig_grub">Modify the configuration used in GRUB</a></li>
  41. <li><a href="../grub/index.html">Other maintenance-related tasks in GRUB</a></li>
  42. </ul>
  43. </li>
  44. <li>
  45. <a href="#updating_flashrom">Updating flashrom</a>
  46. </li>
  47. <li>
  48. <a href="#updating_bucts">Updating bucts</a>
  49. </li>
  50. <li>
  51. <a href="#updating_memtest86plus">Updating MemTest86+</a>
  52. </li>
  53. </ul>
  54. <p>
  55. Or <a href="../index.html">Back to main index</a>.
  56. </p>
  57. </div>
  58. <div class="section">
  59. <h1 id="overview">Overview</h1>
  60. <p>
  61. The way the libreboot project is run is very similar to how
  62. a GNU/Linux distribution project is run (but for the boot
  63. firmware, not your operating system). Thus, libreboot is
  64. a <i>coreboot distribution</i>.
  65. </p>
  66. <p>
  67. This page demonstrates on a high level how
  68. libreboot is maintained, how the project is run, how everything
  69. goes together, etc. For a more detailed guide, refer to each
  70. subsection for the various components/modules used in libreboot.
  71. </p>
  72. <p>
  73. <a href="#pagetop">Back to top of page</a>.
  74. </p>
  75. </div>
  76. <div class="section">
  77. <h1 id="updating_coreboot">Updating coreboot-libre</h1>
  78. <p>
  79. NOTE: it helps to own all libreboot-compatible systems here,
  80. or have reliable (and fast) access to a team of testers.
  81. </p>
  82. <p>
  83. Coreboot-libre is the name of the deblobbed coreboot sources
  84. used in libreboot. It is also the name of the collection
  85. of scripts used for deblobbing coreboot, on each new update.
  86. </p>
  87. <p>
  88. This section shows an example of how to update (re-base) to
  89. the latest version of coreboot, how to update the deblobbing
  90. scripts, and so on. <b>This does not teach you how to
  91. change what custom patches are used, nor does it tell
  92. you how to add new boards to libreboot. It assumes that you
  93. simply want to re-base to the latest version (for instance,
  94. there could be bug fixes that you want). For those things
  95. not listed in this section, you can refer to other sections
  96. on this page instead.</b>
  97. </p>
  98. <p>
  99. Open these files in your editor (you will most likely be editing them):
  100. </p>
  101. <ul>
  102. <li>resources/scripts/helpers/download/coreboot</li>
  103. <li>resources/scripts/helpers/build/module/coreboot</li>
  104. <li>resources/utilities/coreboot-libre/deblob</li>
  105. <li>resources/utilities/coreboot-libre/nonblobs</li>
  106. <li>resources/utilities/coreboot-libre/nonblobs_notes</li>
  107. <li>resources/scripts/helpers/build/roms/helper</li>
  108. <li>resources/scripts/helpers/build/roms/withgrub</li>
  109. </ul>
  110. <p>
  111. If you already had a coreboot/ directory in your libreboot
  112. tree, delete it:<br/>
  113. $ <b>rm -Rf coreboot/</b>
  114. </p>
  115. <p>
  116. Firstly, download coreboot. Do <b>not</b> use <b>./download coreboot</b>
  117. for this, just clone coreboot, as it does in that script, like so:<br/>
  118. $ <b>git clone http://review.coreboot.org/coreboot</b>
  119. </p>
  120. <p>
  121. $ <b>cd coreboot/</b><br/>
  122. Get the ID of the latest commit in this clone, by reading the commit ID using
  123. e.g.:<br/>
  124. $ <b>git log</b><br/>
  125. In <i>resources/scripts/helpers/download/coreboot</i> you will
  126. find a line that says <i><b>git reset --hard</b></i> and then
  127. a commit ID next to it. Replace this with the commit ID of the latest
  128. commit from the coreboot version that you just downloaded.
  129. </p>
  130. <p>
  131. Delete the .git* resources. For example:<br/>
  132. $ <b>rm -Rf .git*</b><br/>
  133. ...this is to avoid the deblobbing script from picking up files
  134. in there as blobs, which would be only false positives and
  135. increase the amount of time taken. Now come out of coreboot:<br/>
  136. $ <b>cd ../</b>
  137. </p>
  138. <p>
  139. Check all coreboot file names/paths in <i>deblob</i>; if any
  140. of them no longer exist at that name/path in the coreboot tree that you downloaded,
  141. delete the reference(s) in <i>deblob</i>.
  142. </p>
  143. <p>
  144. Check all coreboot file names/paths in <i>nonblobs</i>; if
  145. any of them no longer exist at that name/path in the coreboot tree that you downloaded,
  146. delete the reference in <i>nonblobs</i>.
  147. </p>
  148. <p>
  149. Now, back in the main root directory of libreboot (git repository),
  150. run the deblob script. This is to prevent the <i>findblobs</i>
  151. scripts from finding the blobs that are already deleted
  152. when running the <i>deblob</i> script. Like so:<br/>
  153. $ <b>./resources/utilities/coreboot-libre/deblob</b>
  154. </p>
  155. <p>
  156. Now search for new blobs:<br/>
  157. $ <b>cd resources/utilities/coreboot-libre/</b><br/>
  158. $ <b>./findblobs</b><br/>
  159. WARNING: this will take a <b>*long*</b> time. Be patient!
  160. What this will do is look through the coreboot source directory,
  161. looking for blobs. It will not find the blobs that you deleted
  162. before (because they no longer exist), and it will ignore any
  163. files listed in <i>nonblobs</i>.
  164. </p>
  165. <p>
  166. Once the <i>findblobs</i> script has finished, check the file
  167. <i>tocheck</i> (from the root, this will be <i>resources/utilities/coreboot-libre/tocheck</i>).
  168. These are the files detected as blobs; some might be blobs, some not.
  169. The <i>findblobs</i> script doesn't know how to determine between blobs
  170. and non-blobs, it only knows patterns. Distinguishing between blobs and
  171. non-blobs must be performed by you, the human being.
  172. </p>
  173. <ul>
  174. <li>
  175. Files in <i>tocheck</i> that you identify as blobs,
  176. should be added appropriately to <i>resources/utilities/coreboot-libre/deblob</i>
  177. </li>
  178. <li>
  179. Files in <i>tocheck</i> that you identify as non-blobs,
  180. should be added appropriately to <i>resources/utilities/coreboot-libre/nonblobs</i> -
  181. also, if you feel it necessary, add an explanation of it in
  182. <i>resources/utilities/coreboot-libre/nonblobs_notes</i>
  183. </li>
  184. </ul>
  185. <p>
  186. Now come back to the main libreboot root directory (root
  187. of the git clone). If you are still in resources/utilities/coreboot-libre/
  188. for instance, you would do something like:<br/>
  189. $ <b>cd ../../../</b>
  190. </p>
  191. <p>
  192. Now delete the coreboot directory:<br/>
  193. $ <b>rm -Rf coreboot/</b>
  194. </p>
  195. <p>
  196. Download coreboot again, only this time, using the download
  197. script. The download script also applies custom patches
  198. to coreboot (see resources/scripts/helpers/download/coreboot);
  199. if they do not apply anymore, you will have to re-base them
  200. and then update <i>resources/scripts/helpers/download/coreboot</i>
  201. accordingly. Anyway, download coreboot like so:<br/>
  202. $ <b>./download coreboot</b>
  203. </p>
  204. <p>
  205. If the custom patches no longer apply, and you have to re-base
  206. (or replace?) some patches, please do this in coreboot upstream,
  207. not in libreboot. Then re-include new patches from upstream,
  208. into libreboot. Here is coreboot's guide for contributing
  209. patches:<br/>
  210. <a href="http://www.coreboot.org/Git">http://www.coreboot.org/Git</a>.
  211. </p>
  212. <p>
  213. Update all configs:<br/>
  214. $ <b>./build config corebootupdate</b><br/>
  215. This simply takes all of the coreboot <b>.config</b> files from
  216. <i>resources/libreboot/config/</i> and does <b>make oldconfig</b>
  217. on them. It usually works. If it doesn't, you'll need to recreate
  218. those configs from scratch using <b>./build config corebootreplace</b> (optionally
  219. add a config name), or <b>./build config corebootmodify</b> (ditto)
  220. (see <a href="../git/index.html#config">../git/index.html#config</a>)
  221. </p>
  222. <p>
  223. Finally, build *all* ROM images using the instructions at
  224. <a href="../git/index.html">../git/index.html</a>, to verify
  225. that everything still builds.
  226. </p>
  227. <p>
  228. Once you've verified that building isn't broken, test *all*
  229. boards (you don't need to test all ROM images, only one
  230. vesafb and one txtmode image for each configuration). If you
  231. do not have all systems supported in libreboot, then you will
  232. need to get other testers for those boards.
  233. </p>
  234. <p>
  235. If you have established a build issue, or a board no longer
  236. works (booting issues, bugs during/after boot, etc), you'll
  237. need to fix it upstream:
  238. <a href="http://www.coreboot.org/Git">http://www.coreboot.org/Git</a>
  239. and then re-update coreboot (or apply patches from upstream).
  240. </p>
  241. <p>
  242. You should also test the resulting ROM images from building
  243. with the new or modified coreboot revision.
  244. </p>
  245. <p>
  246. <a href="#pagetop">Back to top of page</a>.
  247. </p>
  248. </div>
  249. <div class="section">
  250. <h1 id="newboard_libreboot">Adding a new board to libreboot</h1>
  251. <p>
  252. Make sure that the board is supported, and that the patches
  253. are included (if there are custom patches that you need).
  254. Add configs for it like so:<br/>
  255. $ <b>./build config corebootreplace <i>payload</i>/<i>boardname</i></b>
  256. </p>
  257. <p>
  258. This can also be used for replacing an existing config.
  259. </p>
  260. <p>
  261. Configure the board. Make sure to add the steps to the config section
  262. in <a href="../git/index.html">../git/index.html</a>.
  263. </p>
  264. <p>
  265. When you're done, the config will be stored in <i>resources/libreboot/config/</i>.
  266. Now build-test it and then check that it actually works.
  267. </p>
  268. <p>
  269. The following scripts may also need to be modified before building:
  270. <i>resources/scripts/helpers/build/roms/withgrub</i> and
  271. <i>resources/scripts/helpers/build/roms/helper</i>
  272. </p>
  273. <p>
  274. The following can be used when updating coreboot-libre:<br/>
  275. $ <b>./build config corebootupdate</b> (adding a board name on the end is optional)
  276. </p>
  277. <p>
  278. The following can be used if you want to modify an existing
  279. configuration:<br/>
  280. $ <b>./build config corebootmodify</b> (adding a board name on the end is optional)
  281. </p>
  282. <p>
  283. Examples (GRUB payload):<br/>
  284. $ <b>./build config corebootmodify x60</b><br/>
  285. $ <b>./build config corebootreplace x60</b><br/>
  286. $ <b>./build config corebootupdate x60</b><br/>
  287. $ <b>./build config corebootmodify kfsn4-dre</b><br/>
  288. $ <b>./build config corebootreplace kfsn4-dre</b><br/>
  289. $ <b>./build config corebootupdate kfsn4-dre</b><br/>
  290. </p>
  291. <p>
  292. <a href="#pagetop">Back to top of page</a>.
  293. </p>
  294. </div>
  295. <div class="section">
  296. <h1 id="newpatch_libreboot">Add/remove/modify patches in coreboot-libre</h1>
  297. <p>
  298. Under <b>resources/scripts/helpers/download/coreboot</b> you can find
  299. the instructions used for patching coreboot.
  300. </p>
  301. <p>
  302. Modify the commit ID on the <i>git reset --hard</i> line accordingly,
  303. and update the list of patches used accordingly. Do not cherry-pick
  304. from review.coreboot.org directly; instead, include the diff in
  305. resources/libreboot/patch/ and use <i>git am</i>
  306. (you can get the diff by using git-format-patch).
  307. </p>
  308. <p>
  309. When you're done, simply download coreboot again:<br/>
  310. $ <b>./download coreboot</b>
  311. </p>
  312. <p>
  313. Finally, re-build the parts from coreboot that are used
  314. by the build system:<br/>
  315. $ <b>./build module coreboot</b>
  316. </p>
  317. <p>
  318. You also need to build crossgcc:<br/>
  319. $ <b>cd coreboot/</b><br/>
  320. $ <b>make crossgcc-i386</b><br/>
  321. $ <b>cd ../</b>
  322. </p>
  323. <p>
  324. Instead of running the above command, you can save time
  325. by copying out the crossgcc that you compiled before
  326. (from coreboot/util/crossgcc/) and then putting it back.
  327. After you've done that, run everything in
  328. <i>resources/scripts/helpers/build/module/coreboot</i>
  329. except for the part that builds GCC.
  330. </p>
  331. <p>
  332. You should also test the resulting ROM images from building
  333. with the new or modified coreboot revision.
  334. </p>
  335. <p>
  336. <a href="#pagetop">Back to top of page</a>.
  337. </p>
  338. </div>
  339. <div class="section">
  340. <h1 id="updating_grub">Updating GRUB</h1>
  341. <p>
  342. $ <b>rm -Rf grub/</b><br/>
  343. $ <b>git clone git://git.savannah.gnu.org/grub.git</b><br/>
  344. $ <b>cd grub/</b><br/>
  345. $ <b>git log</b>
  346. </p>
  347. <p>
  348. Open the file <i>resources/scripts/helpers/download/grub</i> and
  349. replace the commit ID on the line that performs <i>git reset --hard</i>
  350. with the commit ID of the GRUB revision that you just downloaded.
  351. </p>
  352. <p>
  353. $ <b>cd ../</b><br/>
  354. $ <b>./download grub</b>
  355. </p>
  356. <p>
  357. If it fails because of merge conflicts, you'll need to re-base
  358. or (as appropriate) remove the offending patch(es) in
  359. <i>resources/scripts/helpers/download/grub</i>.
  360. </p>
  361. <p>
  362. Finally, verify that it will build:<br/>
  363. $ <b>./build module grub</b>
  364. </p>
  365. <p>
  366. Since GRUB is the payload in libreboot, you should also
  367. build the ROM images and test them, with this different
  368. GRUB version that you have prepared.
  369. </p>
  370. <p>
  371. <a href="#pagetop">Back to top of page</a>.
  372. </p>
  373. </div>
  374. <div class="section">
  375. <h1 id="altbuild_grub_payload">Change how the GRUB payload (grub.elf) is built (utility: grub-assemble)</h1>
  376. <p>
  377. Look in <i>resources/utilities/grub-assemble/</i>.
  378. </p>
  379. <p>
  380. <i>gen.sh</i> creates ELF executables of GRUB with different configurations:
  381. text-mode or framebuffer mode in coreboot. Essentially,
  382. the text-mode version has no background nor any custom fonts,
  383. and contains MemTest86+. You probably don't need to modify these
  384. files at all.
  385. </p>
  386. <p>
  387. <i>modules.conf</i> defines which modules will be included in the GRUB
  388. ELF executable.
  389. </p>
  390. <p>
  391. Since GRUB is the payload in libreboot, you should also
  392. build the ROM images and test them, with this different
  393. GRUB version that you have prepared.
  394. </p>
  395. <p>
  396. <a href="#pagetop">Back to top of page</a>.
  397. </p>
  398. </div>
  399. <div class="section">
  400. <h1 id="newconfig_grub">Modify the configuration used in GRUB</h1>
  401. <p>
  402. Look in <i>resources/scripts/helpers/build/roms/withgrub</i> to
  403. see how the GRUB configuration files are generated.
  404. </p>
  405. <p>
  406. You might need to modify this. You can also modify the
  407. default configuration by making changes to the files
  408. under <i>resources/grub/config/</i>
  409. </p>
  410. <p>
  411. Since GRUB is the payload in libreboot, you should also
  412. build the ROM images and test them, with this different
  413. GRUB version that you have prepared.
  414. </p>
  415. <p>
  416. <a href="#pagetop">Back to top of page</a>.
  417. </p>
  418. </div>
  419. <div class="section">
  420. <h1 id="updating_flashrom">Updating flashrom</h1>
  421. <p>
  422. Modify these files: <i>resources/scripts/helpers/download/flashrom</i>
  423. and <i>resources/scripts/helpers/build/module/flashrom</i>.
  424. </p>
  425. <p>
  426. Patches are in <i>resources/flashrom/patch/</i>
  427. </p>
  428. <p>
  429. <a href="#pagetop">Back to top of page</a>.
  430. </p>
  431. </div>
  432. <div class="section">
  433. <h1 id="updating_bucts">Updating bucts</h1>
  434. <p>
  435. bucts doesn't really need updating, but the patches are
  436. in <i>resources/bucts/patch</i>, the download script
  437. is <i>resources/scripts/helpers/download/bucts</i> and
  438. the build script is <i>resources/scripts/helpers/build/module/bucts</i>.
  439. </p>
  440. <p>
  441. <a href="#pagetop">Back to top of page</a>.
  442. </p>
  443. </div>
  444. <div class="section">
  445. <h1 id="updating_memtest86plus">Updating MemTest86+</h1>
  446. <p>
  447. MemTest86+ doesn't really need updating, but the patches are
  448. in <i>resources/memtest86plus/patch</i>, the download script
  449. is <i>resources/scripts/helpers/download/memtest86plus</i> and
  450. the build script is <i>resources/scripts/helpers/build/module/memtest86plus</i>.
  451. </p>
  452. <p>
  453. In the download script for memtest86plus, make sure to update the checksum that it matches
  454. for the downloaded source tarball.
  455. </p>
  456. <p>
  457. <a href="#pagetop">Back to top of page</a>.
  458. </p>
  459. </div>
  460. <div class="section">
  461. <p>
  462. Copyright &copy; 2015 Francis Rowe &lt;info@gluglug.org.uk&gt;<br/>
  463. Permission is granted to copy, distribute and/or modify this document
  464. under the terms of the GNU Free Documentation License, Version 1.3
  465. or any later version published by the Free Software Foundation;
  466. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
  467. A copy of the license can be found at <a href="../gfdl-1.3.txt">../gfdl-1.3.txt</a>
  468. </p>
  469. <p>
  470. Updated versions of the license (when available) can be found at
  471. <a href="https://www.gnu.org/licenses/licenses.html">https://www.gnu.org/licenses/licenses.html</a>
  472. </p>
  473. <p>
  474. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
  475. EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
  476. AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
  477. ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
  478. IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
  479. WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
  480. PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
  481. ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
  482. KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
  483. ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
  484. </p>
  485. <p>
  486. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
  487. TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
  488. NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
  489. INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
  490. COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
  491. USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
  492. ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
  493. DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
  494. IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
  495. </p>
  496. <p>
  497. The disclaimer of warranties and limitation of liability provided
  498. above shall be interpreted in a manner that, to the extent
  499. possible, most closely approximates an absolute disclaimer and
  500. waiver of all liability.
  501. </p>
  502. </div>
  503. </body>
  504. </html>