byron
January 26th, 2006, 12:48
Here are my notes on creating an OpenBSD STABLE install CD. I hope someone finds it the least bit useful. Please let me know if you find any errors in this doc.
It's important to note that there are no official full CD install ISO's of OpenBSD available for download, which is on purpose (http://openbsd.org/faq/faq3.html#ISO). Please respect Theo's wishes and his copyright to the filesystem layout and be sure to order your Official install CDs from (http://openbsd.org/orders.html) and support the project.
This howto assumes that you already have OpenBSD Installed with the needed development tools. It also assumes that all of the commands below are run as root. Not all commands need to be run as root, but in the interest of simplifying this howto I assume you either know when to use sudo or you've su'ed to root before any of the steps below.
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 (seems faster to me).
# ftp ftp.crimelabs.net
# 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
# export CVSROOT=anoncvs@anoncvs.nyc.openbsd.org:/cvs
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 on this box.
# 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
# unset DESTDIR RELEASEDIR
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 use:
# cdrecord -v speed=24 dev=/dev/rcd0c -data /releasedir/OpenBSD38.iso
byron
It's important to note that there are no official full CD install ISO's of OpenBSD available for download, which is on purpose (http://openbsd.org/faq/faq3.html#ISO). Please respect Theo's wishes and his copyright to the filesystem layout and be sure to order your Official install CDs from (http://openbsd.org/orders.html) and support the project.
This howto assumes that you already have OpenBSD Installed with the needed development tools. It also assumes that all of the commands below are run as root. Not all commands need to be run as root, but in the interest of simplifying this howto I assume you either know when to use sudo or you've su'ed to root before any of the steps below.
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 (seems faster to me).
# ftp ftp.crimelabs.net
# 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
# export CVSROOT=anoncvs@anoncvs.nyc.openbsd.org:/cvs
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 on this box.
# 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
# unset DESTDIR RELEASEDIR
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 use:
# cdrecord -v speed=24 dev=/dev/rcd0c -data /releasedir/OpenBSD38.iso
byron