netbsd.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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>How to install NetBSD on a libreboot system</title>
  10. </head>
  11. <body><div class="section"><p>If you're using libreboot from git, note that only CrOS devices build at the moment. We merged a newly rewritten build system recently, and we've yet to complete re-integration of older boards into Libreboot. Use Libreboot 20160907 for the time being, unless you're involved in libreboot development</p></div>
  12. <div id="pagetop" class="section">
  13. <h1>How to install NetBSD on a libreboot system</h1>
  14. <p>
  15. This section relates to preparing, booting and installing
  16. NetBSD on your libreboot system, using nothing more than a USB flash drive (and <i>dd</i>). They've only been tested on a librebooted ThinkPad X60.
  17. </p>
  18. <p>
  19. It is expected that you use text mode in libreboot (txtmode images),
  20. for the early boot process in NetBSD.
  21. <strong>Suspend/hibernate is broken, according to at least 1 user.</strong>
  22. </p>
  23. <p>
  24. Thanks go to ioxcide in <a href="https://www.reddit.com/r/BSD/comments/53jt70/libreboot_and_bsds/">this Reddit post</a>
  25. for the initial instructions.
  26. </p>
  27. <ul>
  28. <li><a href="#prepare">Prepare the USB drive (in NetBSD)</a></li>
  29. <li><a href="#noencryption">Installing NetBSD without full disk encryption</a></li>
  30. <li><a href="#encryption">Installing NetBSD with full disk encryption</a></li>
  31. <li><a href="#booting">Booting</a></li>
  32. <li><a href="#configuring_grub">Configuring Grub</a></li>
  33. <li><a href="#troubleshooting">Troubleshooting</a></li>
  34. </ul>
  35. <p>
  36. <a href="./">Back to previous index</a>
  37. </p>
  38. </div>
  39. <div class="section">
  40. <p>
  41. <b>This section is only for the GRUB payload. For depthcharge (used on CrOS devices in libreboot), instructions
  42. have yet to be written in the libreboot documentation.</b>
  43. </p>
  44. </div>
  45. <div id="prepare" class="section">
  46. <p>
  47. netbsd.iso is the installation image for NetBSD. Adapt
  48. the filename accordingly, for your version of NetBSD.
  49. </p>
  50. <h2>Prepare the USB drive (in NetBSD)</h2>
  51. <p>
  52. <a href="https://wiki.netbsd.org/tutorials/how_to_install_netbsd_from_an_usb_memory_stick/">This page</a>
  53. on the NetBSD website shows how to create a NetBSD bootable USB drive
  54. from within NetBSD itself. You should use the <em>dd</em> method
  55. documented there.
  56. </p>
  57. <h2>Prepare the USB drive (in FreeBSD)</h2>
  58. <p>
  59. <a href="https://www.freebsd.org/doc/handbook/bsdinstall-pre.html">This page</a>
  60. on the FreeBSD website shows how to create a bootable USB drive
  61. for installing FreeBSD. Use the <em>dd</em> on that page. You can
  62. also use the same instructions with a NetBSD ISO image.
  63. </p>
  64. <h2>Prepare the USB drive (in LibertyBSD or NetBSD)</h2>
  65. <p>
  66. If you downloaded your ISO on a LibertyBSD or NetBSD system,
  67. here is how to create the bootable NetBSD USB drive:
  68. </p>
  69. <p>
  70. Connect the USB drive. Check dmesg:<br/>
  71. <b>$ dmesg | tail</b><br/>
  72. Check to confirm which drive it is, for example, if you think its sd3:<br/>
  73. <b>$ disklabel sd3</b>
  74. </p>
  75. <p>
  76. Check that it wasn't automatically mounted. If it was, unmount it. For example:<br/>
  77. <b>$ doas umount /dev/sd3i</b><br/>
  78. </p>
  79. <p>
  80. dmesg told you what device it is. Overwrite the drive, writing the NetBSD installer to it with dd. For example:<br/>
  81. <b>$ doas netbsd.iso of=/dev/rsdXc bs=1M; sync</b><br/>
  82. </p>
  83. <p>
  84. You should now be able to boot the installer from your USB drive. Continue reading, for
  85. information about how to do that.
  86. </p>
  87. <p>
  88. <a href="#pagetop">Back to top of page</a>.
  89. </p>
  90. <h2>Prepare the USB drive (in GNU+Linux)</h2>
  91. <p>
  92. If you downloaded your ISO on a GNU+Linux system,
  93. here is how to create the bootable NetBSD USB drive:
  94. </p>
  95. <p>
  96. Connect the USB drive. Check dmesg:<br/>
  97. <b>$ dmesg</b><br/>
  98. Check lsblk to confirm which drive it is:<br/>
  99. <b>$ lsblk</b>
  100. </p>
  101. <p>
  102. Check that it wasn't automatically mounted. If it was, unmount it. For example:<br/>
  103. <b>$ sudo umount /dev/sdX*</b><br/>
  104. <b># umount /dev/sdX*</b>
  105. </p>
  106. <p>
  107. dmesg told you what device it is. Overwrite the drive, writing your distro ISO to it with dd. For example:<br/>
  108. <b>$ sudo dd if=install60.fs of=/dev/sdX bs=8M; sync</b><br/>
  109. <b># dd if=netbsd.iso of=/dev/sdX bs=8M; sync</b>
  110. </p>
  111. <p>
  112. You should now be able to boot the installer from your USB drive. Continue reading, for
  113. information about how to do that.
  114. </p>
  115. <p>
  116. <a href="#pagetop">Back to top of page</a>.
  117. </p>
  118. </div>
  119. <div id="noencryption" class="section">
  120. <h2>Installing NetBSD without full disk encryption</h2>
  121. <p>
  122. You might have to use an external USB keyboard during the installation.
  123. Press C to access the GRUB terminal.
  124. </p>
  125. <p>
  126. grub&gt; <b>knetbsd -r sd0a (usb0,netbsd1)/netbsd</b><br/>
  127. grub&gt; <b>boot</b>
  128. </p>
  129. <p>
  130. It will start booting into the NetBSD installer. Follow the normal process for installing NetBSD.
  131. </p>
  132. <p>
  133. <a href="#pagetop">Back to top of page</a>.
  134. </p>
  135. </div>
  136. <div id="encryption" class="section">
  137. <h2>Installing NetBSD with full disk encryption</h2>
  138. <p>
  139. TODO
  140. </p>
  141. <p>
  142. <a href="#pagetop">Back to top of page</a>.
  143. </p>
  144. </div>
  145. <div id="booting" class="section">
  146. <h2 id="booting">Booting</h2>
  147. <p>
  148. Press C in GRUB to access the command line:
  149. </p>
  150. <p>
  151. grub&gt; <b>knetbsd -r wd0a (ahci0,netbsd1)/netbsd</b><br/>
  152. grub&gt; <b>boot</b>
  153. </p>
  154. <p>
  155. NetBSD will start booting. Yay!
  156. </p>
  157. <p>
  158. <a href="#pagetop">Back to top of page</a>.
  159. </p>
  160. </div>
  161. <div id="configuring_grub" class="section">
  162. <h2>Configuring Grub</h2>
  163. <p>
  164. If you don't want to drop to the GRUB command line and type in a command to boot NetBSD every time, you can create a GRUB configuration that's aware of your NetBSD installation and that will automatically be used by libreboot.
  165. </p>
  166. <p>
  167. On your NetBSD root partition, create the <b>/grub</b> directory and add the file <b>libreboot_grub.cfg</b> to it. Inside the <b>libreboot_grub.cfg</b> add these lines:
  168. <p><b>
  169. default=0
  170. timeout=3
  171. menuentry "NetBSD" {<br>
  172. &nbsp;&nbsp;&nbsp;&nbsp;knetbsd -r wd0a (ahci0,netbsd1)/netbsd<br>
  173. }<br>
  174. </b></p>
  175. <p>The next time you boot, you'll see the old Grub menu for a few seconds, then you'll see the a new menu with only NetBSD on the list. After 3 seconds NetBSD will boot, or you can hit enter to boot.
  176. <p>
  177. <a href="#pagetop">Back to top of page</a>.
  178. </p>
  179. </div>
  180. <div id="troubleshooting" class="section">
  181. <h1>Troubleshooting</h1>
  182. <p>
  183. Most of these issues occur when using libreboot with coreboot's 'text mode' instead of the coreboot framebuffer.
  184. This mode is useful for booting payloads like memtest86+ which expect text-mode, but for NetBSD
  185. it can be problematic when they are trying to switch to a framebuffer because it doesn't exist.
  186. </p>
  187. <p>
  188. In most cases, you should use the vesafb ROM images. Example filename: libreboot_ukdvorak_vesafb.rom.
  189. </p>
  190. <h2>won't boot...something about file not found</h2>
  191. <p>
  192. Your device names (i.e. usb0, usb1, sd0, sd1, wd0, ahci0, hd0, etc) and numbers may differ. Use TAB completion.
  193. </p>
  194. <p>
  195. <a href="#pagetop">Back to top of page</a>.
  196. </p>
  197. </div>
  198. <div class="section">
  199. <p>
  200. Copyright &copy; 2016 Leah Rowe &lt;info@minifree.org&gt;<br/>
  201. Copyright &copy; 2016 Scott Bonds &lt;scott@ggr.com&gt;<br/>
  202. Permission is granted to copy, distribute and/or modify this document
  203. under the terms of the Creative Commons Attribution-ShareAlike 4.0 International license
  204. or any later version published by Creative Commons;
  205. A copy of the license can be found at <a href="../cc-by-sa-4.0.txt">../cc-by-sa-4.0.txt</a>
  206. </p>
  207. <p>
  208. Updated versions of the license (when available) can be found at
  209. <a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode">https://creativecommons.org/licenses/by-sa/4.0/legalcode</a>
  210. </p>
  211. <p>
  212. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
  213. EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
  214. AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
  215. ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
  216. IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
  217. WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
  218. PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
  219. ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
  220. KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
  221. ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
  222. </p>
  223. <p>
  224. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
  225. TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
  226. NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
  227. INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
  228. COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
  229. USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
  230. ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
  231. DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
  232. IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
  233. </p>
  234. <p>
  235. The disclaimer of warranties and limitation of liability provided
  236. above shall be interpreted in a manner that, to the extent
  237. possible, most closely approximates an absolute disclaimer and
  238. waiver of all liability.
  239. </p>
  240. </div>
  241. </body>
  242. </html>