Building A OpenBSD-4.2-current (patched) CD

Posted by face on November 04, 2007

I have to update several OpenBSD systems so I find it easiest to make a 4.2-current (patched) distribution. This can also be burned to a cd so new installs or upgrades via cd are also patched.

So, I have just upgraded to 4.2 OpenBSD. I am now going to build a patched distribution, patching the system in the process.

Let’s do it:

sudo su
# setenv CVSROOT "" 
export CVSROOT="" 
cd /usr
mv src src-4.1
# rm -rf src-4.1 &
mkdir src
cd /usr/src
tar xpfz /tmp/src.tar.gz
tar xpfz /tmp/sys.tar.gz 

cd /usr
cvs -q up -P -rOPENBSD_4_2 src 
cd src/sys/arch/i386/conf

#use GENERIC for non MP or HT servers
/usr/sbin/config GENERIC.MP
cd ../compile/GENERIC.MP
make clean && make depend && make

# if you did not do the 'set image' step above, then just 'make install'
rm -f /
ln / /
cp bsd /nbsd
mv /nbsd /


Log back in as root after reboot, you should see the kernel now has a name like “OpenBSD 4.2-stable (GENERIC.MP) #0”. The -stable means the eratta patches where applied.

cd /usr/src
rm -rf /usr/obj/*
cd /usr/src
make obj
cd /usr/src/etc && env DESTDIR=/ make distrib-dirs
cd /usr/src
make build
# This will take a while


When the build completes, your system is up to date. If you have only 1 machine, you are done. However, I need patched distribution sets for my other boxes:

export DESTDIR=/usr/dest
export RELEASEDIR=/usr/rel
# setenv DESTDIR /usr/dest
# setenv RELEASEDIR /usr/rel
cd /usr/src/distrib/crunch && make obj depend all install
test -d ${DESTDIR} && mv ${DESTDIR} ${DESTDIR}.old && rm -rf ${DESTDIR}.old &
cd /usr/src/etc
make release
cd /usr/src/distrib/sets/
sh checkflist

We now have a release in /usr/rel. I combine this with an official distribution to get the x-windows sets as I am not building them here. Basically, I copy everything except MD5 from /usr/rel into the 4.2/i386 dist dir that has everything from the ftp server except install42.iso. Then I edit the MD5 to include the new checksums. Now put everthing under a directory structure OpenBSD/4.2/i386. For this example, say it is all in /tmp/OpenBSD/4.2/i386 we can now make the iso cd image:

cd /tmp
mkhybrid -A "OpenBSD-4.2-stable-i386" -P "Me" -V  "OpenBSD-4.2-stable-i386" -r -b 4.2/i386/cdbr -c 4.2/i386/boot.catalog -o OpenBSD-4.2-Stable-i386.iso OpenBSD


Digg! Delicious! Technorati Blinklist Furl Reddit

Leave a response


Hint: Comments now accept textile.