Create FreeBSD bootable media

Table of Contents

Create sup file and fetch CVS
Make your release (FreeBSD 9.0)
Make your release (FreeBSD before 9.0)

Make your release (FreeBSD 9.0)

by ross at 08:15:36 on June 18, 2012

Release process of FreeBSD has been rewritten completely. Refer to release(7) on FreeBSD 9.0 system.

All the work is done by /usr/src/release/generate-release.sh script. No need for prebuilt world now. Just run the script and it will do all the work.

It uses svn to checkout src from the web into chroot environment and at the same time uses cvs to checkout ports and docs from local repository.

Personally I don't like this behavior because I already have src in the local repository created as described on the previous page. I wrote a patch for myself:

--- generate-release.sh.orig    2011-10-20 13:51:51.746330735 +0300
+++ generate-release.sh 2011-10-20 13:53:09.441330746 +0300
@@ -23,7 +23,6 @@
 mkdir -p $2/usr/src
 set -e # Everything must succeed
 
-svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src
 if [ ! -z $CVSUP_HOST ]; then
        cat > $2/docports-supfile << EOF
        *default host=$CVSUP_HOST
@@ -37,6 +36,7 @@
 EOF
 elif [ ! -z $CVSROOT ]; then
        cd $2/usr
+       cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r $1 src
        cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} ports
        cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} doc
 fi

Prepare

The script uses mkisofs(8) so make sure sysutils/dvd+rw-tools port in installed prior to making release.

# cd /usr
# rm -rf src/*
# cvs -R -d /share/freebsd/ncvs co -P -r RELENG_9 src
# cd src/release
# fetch http://daemon-notes.com/downloads/assets/patches/generate-release.patch
# patch -i generate-release.patch

Generate release

If your shell is sh-compatible (bash):
# export CVSROOT=/share/freebsd/ncvs
# export MAKE_FLAGS="__MAKE_CONF=/dev/null SRCCONF=/dev/null"

If your shell is csh-compatible (tcsh):
# setenv CVSROOT /share/freebsd/ncvs
# setenv MAKE_FLAGS "__MAKE_CONF=/dev/null SRCCONF=/dev/null"

# sh generate-release.sh RELENG_9 /home/release

When it's done there will be /home/release/R/release.iso (DVD image) and /home/release/R/memstick (flash image).

Of course you can build release in other place than /home/release and use any tag you want, not just RELENG_9.

Burn the image

# cd /home/release/R
# growisofs -dvd-compat -Z /dev/cd0=release.iso
Comments
Hi, can you make one post with FreeBSD 11 ?
Thanks
-- Ozyart
Monday, October 24, 2016, 13:14:36