1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
@import url('../css/main.css');
</style>
<title>How to install LibertyBSD or OpenBSD on a libreboot system</title>
</head>
<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>
<div id="pagetop" class="section">
<h1>How to install LibertyBSD or OpenBSD on a libreboot system</h1>
<p>
NOTE: This guide was written for OpenBSD by the person who contributed
it, but the libreboot project recommends LibertyBSD.
LibertyBSD is a version of OpenBSD without proprietary software
in the repositories (OpenBSD distributes firmware blobs for
devices inside its kernel).
Go to the <a href="http://libertybsd.net/">LibertyBSD website</a>
-- TODO: test on LibertyBSD and prioritise that in this guide.
</p>
<p>
This section relates to preparing, booting and installing
OpenBSD on your libreboot system, using nothing more than a USB flash drive (and <i>dd</i>). They've only been tested on a Lenovo ThinkPad x200.
</p>
<ul>
<li><a href="#prepare">Prepare the USB drive (in OpenBSD)</a></li>
<li><a href="#noencryption">Installing OpenBSD without full disk encryption</a></li>
<li><a href="#encryption">Installing OpenBSD with full disk encryption</a></li>
<li><a href="#booting">Booting</a></li>
<li><a href="#configuring_grub">Configuring Grub</a></li>
<li><a href="#troubleshooting">Troubleshooting</a></li>
</ul>
<p>
<a href="./">Back to previous index</a>
</p>
</div>
<div class="section">
<p>
<b>This section is only for the GRUB payload. For depthcharge (used on CrOS devices in libreboot), instructions
have yet to be written in the libreboot documentation.</b>
</p>
</div>
<div id="prepare" class="section">
<p>
install60.fs is the installation image for OpenBSD 6.0. Adapt
the filename accordingly, for a different OpenBSD version or
LibertyBSD.
</p>
<h2>Prepare the USB drive (in LibertyBSD or OpenBSD)</h2>
<p>
If you downloaded your ISO on a LibertyBSD or OpenBSD system,
here is how to create the bootable LibertyBSD/OpenBSD USB drive:
</p>
<p>
Connect the USB drive. Check dmesg:<br/>
<b>$ dmesg | tail</b><br/>
Check to confirm which drive it is, for example, if you think its sd3:<br/>
<b>$ disklabel sd3</b>
</p>
<p>
Check that it wasn't automatically mounted. If it was, unmount it. For example:<br/>
<b>$ doas umount /dev/sd3i</b><br/>
</p>
<p>
dmesg told you what device it is. Overwrite the drive, writing the OpenBSD installer to it with dd. For example:<br/>
<b>$ doas dd if=install60.fs of=/dev/rsdXc bs=1M; sync</b><br/>
</p>
<p>
You should now be able to boot the installer from your USB drive. Continue reading, for
information about how to do that.
</p>
<p>
<a href="#pagetop">Back to top of page</a>.
</p>
<h2>Prepare the USB drive (in NetBSD)</h2>
<p>
<a href="https://wiki.netbsd.org/tutorials/how_to_install_netbsd_from_an_usb_memory_stick/">This page</a>
on the NetBSD website shows how to create a NetBSD bootable USB drive
from within NetBSD itself. You should use the <em>dd</em> method
documented there. This will also work with the OpenBSD image.
</p>
<h2>Prepare the USB drive (in FreeBSD)</h2>
<p>
<a href="https://www.freebsd.org/doc/handbook/bsdinstall-pre.html">This page</a>
on the FreeBSD website shows how to create a bootable USB drive
for installing FreeBSD. Use the <em>dd</em> on that page. You can
also use the same instructions with a OpenBSD ISO image.
</p>
<h2>Prepare the USB drive (in GNU+Linux)</h2>
<p>
If you downloaded your ISO on a GNU+Linux system,
here is how to create the bootable OpenBSD USB drive:
</p>
<p>
Connect the USB drive. Check dmesg:<br/>
<b>$ dmesg</b><br/>
Check lsblk to confirm which drive it is:<br/>
<b>$ lsblk</b>
</p>
<p>
Check that it wasn't automatically mounted. If it was, unmount it. For example:<br/>
<b>$ sudo umount /dev/sdX*</b><br/>
<b># umount /dev/sdX*</b>
</p>
<p>
dmesg told you what device it is. Overwrite the drive, writing your distro ISO to it with dd. For example:<br/>
<b>$ sudo dd if=install60.fs of=/dev/sdX bs=8M; sync</b><br/>
<b># dd if=install60.fs of=/dev/sdX bs=8M; sync</b>
</p>
<p>
You should now be able to boot the installer from your USB drive. Continue reading, for
information about how to do that.
</p>
<p>
<a href="#pagetop">Back to top of page</a>.
</p>
</div>
<div id="noencryption" class="section">
<h2>Installing OpenBSD without full disk encryption</h2>
<p>
Press C in GRUB to access the command line:
</p>
<p>
grub> <b>kopenbsd (usb0,openbsd1)/6.0/amd64/bsd.rd</b><br/>
grub> <b>boot</b>
</p>
<p>
It will start booting into the OpenBSD installer. Follow the normal process for installing OpenBSD.
</p>
<p>
<a href="#pagetop">Back to top of page</a>.
</p>
</div>
<div id="encryption" class="section">
<h2>Installing OpenBSD with full disk encryption</h2>
<p>
Not working. You can modify the above procedure (installation w/o encryption) to install OpenBSD using full disk encryption, and it appears to work, except that its not yet clear how to actually <i>boot</i> an OpenBSD+FDE installation using libreboot+Grub2. If you get it working, please let us know.
</p>
<p>
If booting in text mode (framebuffer mode might also work), it
might be possible to chainload the OpenBSD or LibertyBSD bootloader
from the MBR section on the internal storage device. This way,
it would be possible to boot with an encrypted OpenBSD or
LibertyBSD installation. Please let us know (contact details
are on the libreboot homepage) if you get it working this way.
</p>
<p>
Alternatively, it would be good to port OpenBSD either natively
as a coreboot payload, or port it to libpayload (payload library
in coreboot; it has a basic C library and a few functions for
certain operations e.g. text/bitmap). <strong>This would be ideal,
because then it would be possible to boot a truly fully encrypted
OpenBSD or LibertyBSD installation, by putting everything in
the flash chip.</strong>
</p>
<p>
Alternatively, modifying GRUB to support booting fully encrypted
OpenBSD installations would be possible, but probably not feasible;
it's an alien codebase to the OpenBSD project, not tightly integrated
and the OpenBSD bootloader already works.
</p>
<p>
<a href="#pagetop">Back to top of page</a>.
</p>
</div>
<div id="booting" class="section">
<h2 id="booting">Booting</h2>
<p>
Press C in GRUB to access the command line:
</p>
<p>
grub> <b>kopenbsd -r sd0a (ahci0,openbsd1)/bsd</b><br/>
grub> <b>boot</b>
</p>
<p>
OpenBSD will start booting. Yay!
</p>
<p>
<a href="#pagetop">Back to top of page</a>.
</p>
</div>
<div id="configuring_grub" class="section">
<h2>Configuring Grub</h2>
<p>
If you don't want to drop to the GRUB command line and type in a command to boot OpenBSD every time, you can create a GRUB configuration that's aware of your OpenBSD installation and that will automatically be used by libreboot.
</p>
<p>
On your OpenBSD 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:
<p><b>
default=0
timeout=3
menuentry "OpenBSD" {<br>
kopenbsd -r sd0a (ahci0,openbsd1)/bsd<br>
}<br>
</b></p>
<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 OpenBSD on the list. After 3 seconds OpenBSD will boot, or you can hit enter to boot.
<p>
<a href="#pagetop">Back to top of page</a>.
</p>
</div>
<div id="troubleshooting" class="section">
<h1>Troubleshooting</h1>
<p>
Most of these issues occur when using libreboot with coreboot's 'text mode' instead of the coreboot framebuffer.
This mode is useful for booting payloads like memtest86+ which expect text-mode, but for OpenBSD
it can be problematic when they are trying to switch to a framebuffer because it doesn't exist.
</p>
<p>
In most cases, you should use the vesafb ROM images. Example filename: libreboot_ukdvorak_vesafb.rom.
</p>
<h2>won't boot...something about file not found</h2>
<p>
Your device names (i.e. usb0, usb1, sd0, sd1, wd0, ahci0, hd0, etc) and numbers may differ. Use TAB completion.
</p>
<p>
<a href="#pagetop">Back to top of page</a>.
</p>
</div>
<div class="section">
<p>
Copyright © 2016 Scott Bonds <scott@ggr.com><br/>
Copyright © 2016 Leah Rowe <info@minifree.org><br/>
Permission is granted to copy, distribute and/or modify this document
under the terms of the Creative Commons Attribution-ShareAlike 4.0 International license
or any later version published by Creative Commons;
A copy of the license can be found at <a href="../cc-by-sa-4.0.txt">../cc-by-sa-4.0.txt</a>
</p>
<p>
Updated versions of the license (when available) can be found at
<a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode">https://creativecommons.org/licenses/by-sa/4.0/legalcode</a>
</p>
<p>
UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
</p>
<p>
TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
</p>
<p>
The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
</p>
</div>
</body>
</html>
|