Custom Kernel in OpenBSD bsd.rd


The bsd.rd file is a kernel and compressed ramdisk of a file system including the goodies required to install/upgrade OpenBSD. I have a system with a block device that isn't included in the default bsd.rd. I needed to create a custom bsd.rd to install OpenBSD.

Customize the Kernel

There are a few different RAMDISK kernels, and I chose to work with RAMDISK_CD. Go to /usr/src/sys/arch/i386/conf. Copy RAMDISK_CD to RAMDISK_CD.bak. Edit RAMDISK_CD to include your changes.

Install crunchgen

Go to /usr/src/distrib/crunch. Run "make" and "make install".

Install distrib/special

Go to /usr/src/distrib/special. Run "make" and "make install".

Add custom stuff

Edit /usr/src/distrib/i386/ramdisk_cd/list.local and add the path to the program you wish to add. For instance, to add rsh to the ram disk and a auto_install.conf, add the following to the lines like this:

COPY /home/renaud/auto_install.conf ./auto_install.conf

LINK instbin bin/rsh

Build bsd.rd

Go to /usr/src/distrib/i386/ramdisk_cd. Type "make". You'll find bsd.rd, cd??.iso and a few more friends in the directory with you.