Thursday, June 13, 2013

Tips and Tricks for OpenBSD - Custom Kernel

.: Custom Kernel on OpenBSD :.

If you want to discuss more about the BSD kernel implementation, sorry, but this is meant to be a quick guide for those who want to make simple adjustments and build a custom kernel. Feel free to go further.

Just follow the steps bellow:

  1. cd /usr/src 
  2. wget http://mirror/openbsd/4.9/sys.tar.gz 
  3. tar zxvf sys.tar.gz -C /usr/src 
  4. cd /usr/src/sys/arch/i386/conf 
  5. cp GENERIC  MYKERNEL (and edit MYKERNEL as you need ;-P)
  6. config MYKERNEL 
  7. cd ../compile/MYKERNEL 
  8. make depend && make && mv /bsd /bsd.original 
  9. cp bsd / 
  10. reboot
Hum! That was fast and easy, wasn't it? :)
Keep practicing with different configurations!

Patches Application

If you want to apply security/fixes patches, just go to and take a look at the erratas page for your chosen version of OpenBSD.

At the time of writing this post, 5.6 was the current version, so I'd point to

There you can grab more info about patches and the proper ways of applying them.

For a quick and easy tip, you basically can get all patches from a single tarball and extract them.

Then you'll find a structure of directories whose files are named as follows:

For each file inside that dir, just use ``signify'', but keep in mind that some patches are for kernel and some are for system-wide programs. The example below uses signify to patch ``pipex''. Then you just recompile the patched kernel/program.

signify -Vep /etc/signify/ -x 010_pipex.patch.sig \
        -m - | (cd /usr/src && patch -p0 
See ya!

No comments:

Post a Comment