Build a stable OpenBSD Install CD from source

puffysince there are no official full CD install ISO’s of OpenBSD available for download, i am gonna walk you through on building a openbsd iso. If you respect Theo’s wishes and his copyright to the filesystem layout, please order your official install CDs and support the project – cause this will help them move forward 🙂

i guess that you already have OpenBSD Installed with the right tools. The following commands below are run as root. so lets get started…

First we need to get the release sources before we update them. I prefer to ftp down the release sources and update to stable via CVS.

# ftp
# cd pub
# cd OpenBSD
# cd 3.8
# mget *.gz

Say yes to all the prompts except sys.tar.gz since it is contained within src.tar.gz
You will end up with ports.tar.gz, src.tar.gz and XF4.tar.gz

Untar the sources to their correct locations

# tar zxvf ports.tar.gz -C /usr/
# tar zxvf XF4.tar.gz -C /usr/
# tar zxvf src.tar.gz -C /usr/src/

Now that we have the release sources on our system it’s time to update them via cvs (not an easy job)
# export

To update ports

# cd /usr/ports/
# cvs -d$CVSROOT up -rOPENBSD_3_8 -Pd

To update the X sources

# cd /usr/XF4/
# cvs -d$CVSROOT up -rOPENBSD_3_8 -Pd

To update the system sources

# cd /usr/src/
# cvs -d$CVSROOT up -rOPENBSD_3_8 -Pd

To build the X sources you’ll need a specific version of TCL and TK (8.4)

# cd /usr/ports/lang/tcl/8.4/
# make install clean

# cd /usr/ports/x11/tk/8.4/
# make install clean

You will also need cdrtools if you plan on making the ISOs.

# cd /usr/ports/sysutils/cdrtools/
# make install clean

Now it’s time to basically follow man release(8)

Build and install a new kernel

# cd /sys/arch/i386/conf
# config GENERIC
# cd ../compile/GENERIC
# make clean depend bsd
# mv /bsd /bsd.old && mv bsd / && chown root:wheel /bsd

Reboot into the new kernel

# reboot

If you have troubles booting into the new kernel you can boot bsd.old

Now it’s time to build the system

The release(8) man page goes through how to make sure your object directories are clean but since this is a new install we won’t worry about it

# cd /usr/src
# make obj
# make build

Once this is done you should be running on stable code

Now we’ll basically create new install files from the stable code by making and validating the system release.

# mkdir /destdir-src
# mkdir -p /releasedir/3.8/i386

The /destdir-src directory will contain a full system install minus X when we’re done with this process

The /releasedir/3.8/i386 directory will contain a generic kernel and the install tarballs made from stable code.

We need the crunch tool to create the ramdisk images

# cd /usr/src/distrib/crunch
# make obj depend all install

Now to make the release

# export DESTDIR=/destdir-src
# export RELEASEDIR=/releasedir/3.8/i386

The DESTDIR should be empty if your following this howto from the beginning but if you aren’t make sure that it is.

# cd /usr/src/etc
# make release

Once that’s done we’ll validate the release

# cd /usr/src/distrib/sets
# sh checkflist
# unset DESTDIR

Now let’s build and install X

First we need an X build directory since building X doesn’t work the same as building the system it should be empty but if it isn’t it needs to be.

# mkdir /xf4-bld
# cd /xf4-bld
# lndir /usr/XF4
# make build

We need a DESTDIR to make the X release it also needs to be empty so don’t try to use the same DESTDIR from earlier.

# mkdir /destdir-xf4
# export DESTDIR=/destdir-xf4
# make release

You should now have all the install files needed in /releasedir/3.8/i386 for a stable install. Now you simply need to rip an ISO of /releasedir

# cd /releasedir
# mkisofs -vrTJV "OpenBSD38" -b 3.8/i386/cdrom38.fs -c boot.catalog -o OpenBSD38.iso /releasedir/

Your ISO is built and just needs to be burned to CD via whatever method you prefer. I used:

# cdrecord -v speed=24 dev=/dev/rcd0c -data /releasedir/OpenBSD38.iso

well thats all folks, see ya next time :]

source |


About this entry