Overview

Here is the big-animal picture:

Other Links


Applying the CAM patch to an existing 2.2.8 src distribution

Starting with a machine where we have 2.2.8-RELEASE installed, this is what needs to be done to apply the CAM patch:
  1. cp ftp2.FreeBSD.org/pub/FreeBSD/cam/2.2CAM-19980716-SNAP.diffs.gz to /usr
  2. cd /usr
  3. gunzip 2.2CAM-19980716-SNAP.diffs.gz
  4. patch -p0 < 2.2CAM-19980716-SNAP.diffs |& tee /tmp/rejects
  5. Inspect /tmp/rejects and if there are any rejects , apply the patch manually. Another way to find if there are any rejects is :
     cd /usr/src/sys; find . -name \*.rej 
    In this case there were 4 rejects:
  6. cd src
  7. make buildworld
  8. make includes
  9. cd usr.sbin/config
  10. make install
  11. cd ../../sys/i386/conf
  12. config GENERIC
  13. cd ../../compile/GENERIC
  14. make all
  15. make install
  16. cp /usr/src/etc/etc.i386/MAKEDEV /dev
  17. sh MAKEDEV da2s1a
  18. sh MAKEDEV xpt1
  19. sh MAKEDEV pass5
  20. reboot to single user mode (shutdown -r now. Option "-s" when kernel boots up -- at "boot:")
  21. mount -a
  22. cd /usr/src
  23. make installworld Reference: ftp://ftp2.freebsd.org/pub/FreeBSD/cam/README

    Making a boot floppy

    (can be used to generate a boot floppy on any machine that has 2.2.8 installed)

Making a 2.2.8-CAM release server

The starting point for this step is a CAM machine having a non-CAM 2.2.8 src distribution. If this is not the case, you need to:
  1. First get the doc and ports part of the CVS tree.
  2. Now for the feature presentation: actually building the release. In theory, "make release" should do it all. Reality is quite different. For one thing, we dont know how to use CVS to create a branch and merge out src changes into it. Easy way out: in the Makefile where cvs checkouts are done, replace by a "cp -Rp" command. In other words, If you make a change to the src and want that to be a part of the release you build, then you must check out a copy of the src from CVSROOT, make changes, and check it back in (what you check in gets checked out as part of "make release"). If you do not want to play around with CVS you can instead edit /usr/src/release/Makefile and replace the part where it checks out src code with a cp -Rp from the directory where you have the latest and greatest src (probably in /usr/src/sys).
  3. Set CHROOTDIR, BUILDNAME, RR. CHROOTDIR is where the make process will chroot to and create a virtual "/" directory. BUILDNAME can be what you want - 2.2.8-CAM-DIRT-19981221 is what I used. RR can be set to any directory. Both the arguments for CHROOTDIR and RR should ideally be dirs that have a lot of space available (O(1G) totally).
  4. run "make release CHROOTDIR=/some-big-filesystem |& tee /tmp/make-release-op"
    This will probably fail after a point. The actual steps of the make process is attached at the end of this file. See where the make failed and manually do the rest of it. Not much fun, but it gets the job done.
    Note: Use "make -n" to print out what gets done as part of the make process without actually doing the make. For example, while building the release on tyagi, i had to do the following by hand:
    or i in archivers/unzip textproc/jade textproc/iso8879  textproc/linuxdoc textp
    roc/docbook textproc/sgmlformat; do  cd /usr/ports/$i && make all install clean 
    FORCE_PKG_REGISTER=yes;  done
    cd /usr/doc && make all distribute DISTDIR=/usr/R/stage/trees
    rm -f /usr/R/stage/kernels/GENERIC
    rm -rf /usr/release/usr/src/release/../sys/compile/GENERIC /* non-existent*/
    cd /usr/src/release && make doKERNEL KERNEL=GENERIC
    rm -rf /usr/src/release/../sys/compile/GENERIC
    ln -f /usr/R/stage/kernels/GENERIC /usr/R/stage/trees/bin/kernel.GENERIC
    for i in sbin/init bin/ed usr.sbin/ppp ; do  ( cd usr/src/release/../$i;  make -DNOCRYPT clean all distribute DISTDIR=/usr/R/stage/trees ) ;  done
    for i in bin manpages catpages games proflibs dict info doc compat1x compat20 compat21 krb des; do  if [ -f /usr/src/release/scripts/${i}-make.sh ];then  echo -n "Running $i dist creation script... ";  env RD=/usr/R/stage sh /usr/src/release/scripts/${i}-make.sh || echo "$i distribution script returned bad status.";  echo "Done.";  fi  done
     for i in /usr/R/stage/trees/bin/usr/lib/libscrypt* ; do  c=`echo $i | sed -e 's/libscrypt/libcrypt/'` ;  rm -f $c ;  ln -s `basename $i` $c ;  done
     cd /usr/R/stage/trees &&  find manpages catpages games proflibs dict info doc compat1x compat20 compat21 krb des -depth -type d -print | xargs rmdir
    touch release.5
    rm -rf /usr/R/stage/dists
    mkdir -p /usr/R/stage/dists
    for i in bin manpages catpages games proflibs dict info doc compat1x compat20 compat21 krb des ;  do  if [ -d /usr/R/stage/trees/${i} ] ; then  cd /usr/src/release && make doTARBALL  SD=/usr/R/stage/trees/${i}  TN=$i TD=$i ARG="." &&  echo "${i} distribution is finished.";  fi ;  done
    ( cd /usr/R/stage/dists &&  if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ;fi )
    touch release.6
     cd /usr/src/release && make doTARBALL SD=/usr/src  TD=src TN=sbase ARG="[A-Z]*"
    for i in `cd /usr/src && echo [a-z]*` ; do  if [ -d /usr/src/$i ] ; then  cd /usr/src/release && make doTARBALL  TN=`echo s$i | tr -d '.' | sed 's/usr/u/'`  SD=/usr/src TD=src ARG="$i" ;  fi ;  done
     set usr.sbin/sendmail/cf smailcf &&  while [ $# -ge 2 ] ; do  if [ -d /usr/src/$1 ] ; then  cd /usr/src/release && make doTARBALL  SD=/usr/src TN="s$2" TD=src ARG="$1" ;  fi && shift && shift ;  done
    ( cd /usr/R/stage/dists/src &&  if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi&&  if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi &&  if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; )
    echo "src distribution is finished."
    touch release.7
    rm -rf /usr/R/stage/fixitfd
    mkdir /usr/R/stage/fixitfd
    cd /usr/R/stage/fixitfd &&  mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp  usr/share/misc usr/mdec
    
    ////////////////I omitted the part in /* - */ because it was making
    the fixit floppy and I was running into big errors while make-ing///////////
    /*
    cd /usr/src/release && make installCRUNCH CRUNCH=fixit  DIR=/usr/R/stage/fixitfd/stand ZIP=false
    ( cd /usr/R/stage/fixitfd/dev &&  sed -e '/^PATH/s/^/#/' /usr/R/stage/trees/bin/dev/MAKE
    DEV > MAKEDEV &&  chmod 755 MAKEDEV &&  sh MAKEDEV all )
    cp /usr/R/stage/trees/bin/etc/spwd.db /usr/R/stage/trees/bin/etc/group  /usr/R/stage/trees/b
    in/etc/protocols /usr/R/stage/fixitfd/etc
    cp /usr/R/stage/trees/bin/usr/share/misc/scsi_modes  /usr/R/stage/fixitfd/usr/share/misc
    cp /usr/R/stage/trees/bin/usr/mdec/boot[12] /usr/R/stage/fixitfd/usr/mdec
    for type in fd od sd wd ; do  ( cd /usr/R/stage/fixitfd/usr/mdec && ln -s boot1 ${ty
    pe}boot &&  ln -s boot2 boot${type} ) ;  done
    cp /usr/src/release/fixit.profile /usr/R/stage/fixitfd/.profile
    cp /usr/src/release/fixit.services /usr/R/stage/fixitfd/etc/services
    cp /usr/src/release/tar.sh /usr/R/stage/fixitfd/stand/tar
    chmod 555 /usr/R/stage/fixitfd/stand/tar
    sh -e /usr/src/release/doFS.sh /usr/R/stage /mnt 1440  /usr/R/stage/fixitfd 
    6000 fd1440
    mv fs-image /usr/R/stage/floppies/fixit.flp
    cp /usr/src/release/texts/FLOPPIES.TXT /usr/R/stage/floppies/usr/README.TXT
    (cd /usr/R/stage/floppies; md5 * > CHECKSUM.MD5)
    */
    
    touch release.9
    cd /usr/src/release && make cdrom.1 ftp.1
    echo "Release done"