[Libreboot] OpenBSD 5.9 on libreboot without VGA BIOS: detailed instruct

From: silent_wanderer Subject: [Libreboot] OpenBSD 5.9 on libreboot without VGA BIOS: detailed instructions. Date: Tue, 05 Apr 2016 14:48:34 +0800 User-agent: Roundcube Webmail/1.0.6

All tests were performed with Thinkpad X200, but it will probably work for most or all libreboot and autoboot (libreboot fork with blobs for machines which do not work without them) boxes Since 5.9, OpenBSD supports EFI boot mode, which means that it also have had to support framebuffer out of the box, so lack of proprietary VGA BIOS blob is no longer a problem and you can boot it with unmodified Libreboot binary release 20150518. Earlier releases won't probably work because of lack of some GRUB modules. In order to install OpenBSD on such a machine you will need some additional preparations, since regular install59.fs won't work because bsd.rd doesn't have a framebuffer console. I can't tell what happens exactly, but the device reboots by itself if I try to load it. However, bsd and bsd.mp kernels work just fine (I do not mean /bsd, it's some gzip archive, I mean /5.9/$arch/bsd) So if you want to install OpenBSD, you have to either a) build bsd.rd kernel with framebuffer support, or b) use regular kernel in conjunction with bsd.rd content, or c) put the hard drive into another machine and install from there. I describe the option b: 1) Find another computer with regular BIOS or UEFI, which can boot from OpenBSD installation media. QEMU or other virtual machine will be fine too. 2) Boot it from OpenBSD 5.9 install59.iso or install59.fs or miniroot.fs You can use anything with a valid bsd.rd kernel. 3) Make a new partition for OpenBSD installation rootfs on a removable drive, or use an existing one. It should be at least 100 megabytes if you plan to use cp or something around 10m if you use something else, and preserve hardlinks. You can try using existing partition from install59.fs, removing files outside of 5.9 directory if necessary, or make a new partition on same removable media, or even prepare another one. You might need to issue something like "cd /dev; sh MAKEDEV sd1" to access your removable drive from the shell and maybe you'd have to run fdisk and/or disklabel to prepare the partition. 4) Make new OpenBSD UFS on this partition (refer to newfs docs). Then mount it under /mnt2 or make a new directory for it. 5) Copy everything from / to newly mounted /mnt2 partition.

It's a tricky part: according to OpenBSD man cp, it cannot preserve

hardlinks.

It also doesn't seem to have guards against copying a directory into subdirectory of itself, unlike GNU cp, thus use grep -v to prevent it. Since all executables on the ram disk are hardlinked, it will take around 89MiB of disk space instead of just 2-3 like it is supposed to: cp -Rpi `ls -A / | grep -v mnt2` /mnt2 You can also use tar (or pax or cpio or...), and it should preserve hardlinks. Untested, correct the command if it doesn't work for you: tar cXpvf - / | tar -f - -C /mnt2 6) Make sure that you have copied everything, including /.profile and make an empty directory for mnt2: ls -la /mnt2 mkdir /mnt2/mnt2 7) If you are using a separate media, you might want to copy entire 5.9/$ARCH/ directory onto your partition too. If you are using the same media, you can leave it on their own partition. Make sure you have bsd or bsd.mp in a known location, accessible to libreboot. 8) umount /mnt2. Now you are ready to install it on a libreboot laptop. Don't forget the name of partition where it was (something like sd1k), you will need it later. The digit could change between different machines, but the only flash drive is sd1 on x200 9) There is a kopenbsd command in GRUB2, which can load OpenBSD kernels directly. It might some disadvantages compared to native OpenBSD bootloader, but they do not affect user experience, as far as I can see. Go to GRUB2 console and issue commands like this: kopenbsd -r sd1a (usb0,openbsd1)/5.9/amd64/bsd.mp boot -r option gives the name of partition which you prepared earlier, the second option has full path to the kernel you want to load, including partition name. The system should load. If you have set -r option correctly, you will get to regular OpenBSD installer prompt.

If you need help with OpenBSD command line, refer to

or other OpenBSD documentation. Installation media has no man pages and some options are different from GNU. For example: cp needs -R, not -r and ls dir -l won't work, but ls -l dir will Perhaps, there is a way to extract disk image from bsd.rd and put it onto a partition directly, but I do not know whenever it has valid ufs format and what is its offset. If you want, you can boot NetBSD from libreboot GRUB prompt too. In this case, regular NetBSD install media works fine without changes. I do not mind if you integrate this text in modified or unmodified form into a wiki or other documentation source, with or without mentioning the source and use and share it however you like.

reply via email to

