libreboot

my branch of libreboot
git clone git://git.hazbo.co.uk/libreboot.git
Log | Files | Refs | README

openbsd.md (6950B)


      1 ---
      2 title: How to install LibertyBSD or OpenBSD on a libreboot system
      3 x-toc-enable: true
      4 ...
      5 
      6 NOTE: This guide was written for OpenBSD by the person who contributed
      7 it, but the libreboot project recommends LibertyBSD. LibertyBSD is a
      8 version of OpenBSD without proprietary software in the repositories
      9 (OpenBSD distributes firmware blobs for devices inside its kernel). Go
     10 to the [LibertyBSD website](http://libertybsd.net/) -- TODO: test on
     11 LibertyBSD and prioritise that in this guide.
     12 
     13 This section relates to preparing, booting and installing OpenBSD on
     14 your libreboot system, using nothing more than a USB flash drive (and
     15 `dd`). They've only been tested on a Lenovo ThinkPad x200.
     16 
     17 *This section is only for the GRUB payload. For depthcharge (used on
     18 CrOS devices in libreboot), instructions have yet to be written in the
     19 libreboot documentation.*
     20 
     21 install61.fs is the installation image for OpenBSD 6.1. Adapt the
     22 filename accordingly, for a different OpenBSD version or LibertyBSD.
     23 
     24 Prepare the USB drive (in LibertyBSD or OpenBSD)
     25 ------------------------------------------------
     26 
     27 If you downloaded your ISO on a LibertyBSD or OpenBSD system, here is
     28 how to create the bootable LibertyBSD/OpenBSD USB drive:
     29 
     30 Connect the USB drive and check the system message buffer:
     31 
     32     $ dmesg | tail
     33 
     34 Check to confirm which drive it is, for example, if you think it's `sd3`:
     35 
     36     $ disklabel sd3
     37 
     38 Check that it wasn't automatically mounted. If it was, unmount it:
     39 
     40     $ doas umount /dev/sd3i
     41 
     42 Now write the OpenBSD installer to the drive with `dd`:
     43 
     44     $ doas dd if=install60.fs of=/dev/rsdXc bs=1M; sync
     45 
     46 You should now be able to boot the installer from your USB drive.
     47 Continue reading, for information about how to do that.
     48 
     49 Prepare the USB drive (in NetBSD)
     50 ---------------------------------
     51 
     52 [This
     53 page](https://wiki.netbsd.org/tutorials/how_to_install_netbsd_from_an_usb_memory_stick/)
     54 on the NetBSD website shows how to create a NetBSD bootable USB drive
     55 from within NetBSD itself. You should use the `dd` method documented
     56 there. This will also work with the OpenBSD image.
     57 
     58 Prepare the USB drive (in FreeBSD)
     59 ----------------------------------
     60 
     61 [This page](https://www.freebsd.org/doc/handbook/bsdinstall-pre.md) on
     62 the FreeBSD website shows how to create a bootable USB drive for
     63 installing FreeBSD. Use the `dd` on that page. You can also use the same
     64 instructions with a OpenBSD ISO image.
     65 
     66 Prepare the USB drive (in GNU+Linux)
     67 ------------------------------------
     68 
     69 If you downloaded your ISO on a GNU+Linux system, here is how to create
     70 the bootable OpenBSD USB drive:
     71 
     72 Connect the USB drive. Check dmesg:
     73 
     74     $ dmesg
     75 
     76 Check lsblk to confirm which drive it is:
     77 
     78     $ lsblk
     79 
     80 Check that it wasn't automatically mounted. If it was, unmount it. For
     81 example:
     82 
     83     $ sudo umount /dev/sdX\*
     84     # umount /dev/sdX\*
     85 
     86 dmesg told you what device it is. Overwrite the drive, writing your
     87 distro ISO to it with dd. For example:
     88 
     89     $ sudo dd if=install61.fs of=/dev/sdX bs=8M; sync
     90     # dd if=install61.fs of=/dev/sdX bs=8M; sync
     91 
     92 You should now be able to boot the installer from your USB drive.
     93 Continue reading, for information about how to do that.
     94 
     95 Installing OpenBSD without full disk encryption
     96 -----------------------------------------------
     97 
     98 Press C in GRUB to access the command line:
     99 
    100     grub> kopenbsd (usb0,openbsd1)/6.1/amd64/bsd.rd
    101     grub> boot
    102 
    103 It will start booting into the OpenBSD installer. Follow the normal
    104 process for installing OpenBSD.
    105 
    106 Installing OpenBSD with full disk encryption
    107 --------------------------------------------
    108 
    109 Not working. You can modify the above procedure (installation w/o
    110 encryption) to install OpenBSD using full disk encryption, and it
    111 appears to work, except that it's not yet clear how to actually *boot* an
    112 OpenBSD+FDE installation using libreboot+Grub2. If you get it working,
    113 please let us know.
    114 
    115 If booting in text mode (framebuffer mode might also work), it might be
    116 possible to chainload the OpenBSD or LibertyBSD bootloader from the MBR
    117 section on the internal storage device. This way, it would be possible
    118 to boot with an encrypted OpenBSD or LibertyBSD installation. Please let
    119 us know (contact details are on the libreboot homepage) if you get it
    120 working this way.
    121 
    122 Alternatively, it would be good to port OpenBSD either natively as a
    123 coreboot payload, or port it to libpayload (payload library in coreboot;
    124 it has a basic C library and a few functions for certain operations e.g.
    125 text/bitmap). *This would be ideal, because then it would be possible
    126 to boot a truly fully encrypted OpenBSD or LibertyBSD installation, by
    127 putting everything in the flash chip.*
    128 
    129 Alternatively, modifying GRUB to support booting fully encrypted OpenBSD
    130 installations would be possible, but probably not feasible; it's an
    131 alien codebase to the OpenBSD project, not tightly integrated and the
    132 OpenBSD bootloader already works.
    133 
    134 Booting
    135 -------
    136 
    137 Press C in GRUB to access the command line:
    138 
    139     grub> kopenbsd -r sd0a (ahci0,openbsd1)/bsd
    140     grub> boot
    141 
    142 OpenBSD will start booting. Yay!
    143 
    144 Configuring Grub
    145 ----------------
    146 
    147 If you don't want to drop to the GRUB command line and type in a
    148 command to boot OpenBSD every time, you can create a GRUB configuration
    149 that's aware of your OpenBSD installation and that will automatically
    150 be used by libreboot.
    151 
    152 On your OpenBSD root partition, create the `/grub` directory and add the file
    153 `libreboot_grub.cfg` to it. Inside the `libreboot_grub.cfg` add these lines:
    154 
    155     default=0
    156     timeout=3
    157 
    158     menuentry "OpenBSD" {
    159         kopenbsd -r sd0a (ahci0,openbsd1)/bsd
    160     }
    161 
    162 If your OpenBSD installation uses a GPT scheme, use the `gpt4` partition
    163 instead of `openbsd1`.
    164 
    165 The next time you boot, you'll see the old Grub menu for a few seconds,
    166 then you'll see the a new menu with only OpenBSD on the list. After 3
    167 seconds OpenBSD will boot, or you can hit enter to boot.
    168 
    169 Troubleshooting
    170 ===============
    171 
    172 Most of these issues occur when using libreboot with coreboot's 'text
    173 mode' instead of the coreboot framebuffer. This mode is useful for
    174 booting payloads like memtest86+ which expect text-mode, but for OpenBSD
    175 it can be problematic when they are trying to switch to a framebuffer
    176 because it doesn't exist.
    177 
    178 In most cases, you should use the vesafb ROM images. Example filename:
    179 libreboot\_ukdvorak\_vesafb.rom.
    180 
    181 Won't boot...something about file not found
    182 ---------------------------------------------
    183 
    184 Your device names (i.e. usb0, usb1, sd0, sd1, wd0, ahci0, hd0, etc) and
    185 numbers may differ. Use TAB completion.
    186 
    187 Copyright © 2016 Scott Bonds <scott@ggr.com>\
    188 Copyright © 2016 Leah Rowe <info@minifree.org>\
    189 
    190 Permission is granted to copy, distribute and/or modify this document
    191 under the terms of the GNU Free Documentation License Version 1.3 or any later
    192 version published by the Free Software Foundation
    193 with no Invariant Sections, no Front Cover Texts, and no Back Cover Texts.
    194 A copy of this license is found in [../fdl-1.3.md](../fdl-1.3.md)