Making your own release with FreeBSD

Check out the source you want, eg
cd /usr
cvs -d /home/ncvs co -rRELENG_4 src
    
Apply the patches and things.. You will need to apply this patch to teach 'make release' about copying the source files rather than using checkout. I also have a patches to

Delete the .orig files generate by the patches..

find /usr/src -name \*.orig -delete
    
Do a buildworld...
/usr/bin/time sh -c 'make -j 2 buildworld' |& tee /tmp/buildworld.log
    
Mount the ports tree you want distributed on /usr/ports, eg
sudo mount -o soft,intr cain:/home/doconnor/work/ros-ports /usr/ports
    
Cook the release! I build with NODOC because I don't care for the extra junk it gets you.
sudo /usr/bin/time sh -c 'make release CHROOTDIR=/tmp/release/release BUILDNAME=4.2-GENESIS CVSROOT=/usr CPNOTCVS= NODOC=' | & tee /tmp/release.log
    
OK, after that is done the packages need to be built. If you are content with just using the already built ones from a CD then you can just copy them, eg
mount /cdrom
cp -R /cdrom/packages /tmp/release/cdrom/disc1/
    
If you want to build your own set (handy for making local mods etc) then you need to setup a suitable chroot envrionment. I install X from a CD to save (lots of) time and space, also note that the nameserver used below will probably have to be changed :) I install compat22 so that the native Netscape port will build.
cp -r /cdrom/XF86336 /tmp/release/release/R/cdrom/disc1
rm -rf /tmp/release/pkg-root
chflags -R noschg /tmp/release/pkg-root
rm -rf /tmp/release/pkg-root
mkdir /tmp/release/pkg-root
linux
cd /usr/src
make installworld DESTDIR=/tmp/release/pkg-root
cd etc
make distribution DESTDIR=/tmp/release/pkg-root
cat << EOF >/tmp/release/pkg-root/etc/resolv.conf
search gsoft.com.au
nameserver 203.38.152.97
EOF

cd /tmp/release/pkg-root/usr
mkdir X11R6
cd X11R6
tar zxvf /tmp/release/release/R/cdrom/disc1/XF86336/Xbin.tgz
tar zxvf /tmp/release/release/R/cdrom/disc1/XF86336/Xcfg.tgz
tar zxvf /tmp/release/release/R/cdrom/disc1/XF86336/Xf100.tgz
tar zxvf /tmp/release/release/R/cdrom/disc1/XF86336/Xfnts.tgz
tar zxvf /tmp/release/release/R/cdrom/disc1/XF86336/Xfscl.tgz
tar zxvf /tmp/release/release/R/cdrom/disc1/XF86336/Xlib.tgz
tar zxvf /tmp/release/release/R/cdrom/disc1/XF86336/Xman.tgz
tar zxvf /tmp/release/release/R/cdrom/disc1/XF86336/Xprog.tgz
tar zxvf /tmp/release/release/R/cdrom/disc1/XF86336/Xset.tgz
cp /tmp/release/release/R/cdrom/disc1/XF86336/postinst.sh /tmp/release/pkg-root

cd /tmp/release/pkg-root/usr
tar zxf /tmp/release/release/R/cdrom/disc1/ports/ports.tgz
cd ..
cat /tmp/release/release/R/cdrom/disc1/compat22/compat22.?? | tar zxf -

chroot /tmp/release/pkg-root /bin/csh
ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib
ldconfig -aout /usr/lib/compat/aout
/postinst.sh
Now you actually build the ports..
cd /usr/ports
mkdir /packages
make index
make package PACKAGES=/packages USA_RESIDENT=NO WRKDIRPREFIX=/tmp/work MOTIF_OPEN= HAVE_MOTIF= MASTER_SITE_OVERRIDE='http://cain.gsoft.com.au/~doconnor/distfiles/${DIST_SUBDIR}/' PACKAGES=/packages
If that worked (haha..) you now have a package suite which can be put on a CD. If you
cp -r /tmp/release/pkg-root/packages /tmp/release/release/R/cdrom/disc1
cp tmp/release/pkg-root/usr/ports/INDEX /tmp/release/release/R/cdrom/disc1/packages
you will be able to create an iso which is bootable and has all of the packages easily installable. To make the iso..
mkisofs -b floppies/boot.flp -c floppies/boot.catalog -J -o /tmp/myrelease.iso -r -T /tmp/release/release/R/cdrom/disc1
A handy thing to have is a sysinstall install script which installs all of your custom packages and picks what distributions you want etc etc.. I have one here which is in the middle of being hacked on. Note the comment about package order.. I had a *very* frustrating time finding that out..
Daniel O'Connor
Last modified: Wed Dec 6 11:35:00 CST 2000