Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Aug 2001 11:14:29 -0700 (PDT)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        freebsd-current@FreeBSD.ORG
Subject:   My Recommended Development/Testing environment for -current
Message-ID:  <200108281814.f7SIETX34454@earth.backplane.com>

next in thread | raw e-mail | index | archive | help
    I'm posting this as an aid to everyone doing freebsd-current development
    and testing and may not realize how easy it is to setup a development
    environment.

    The number one thing is:  Don't put the CVS tree or source code on the
    -current box itself, except for testing purposes.  This is what I do:

    * On my -STABLE box I cvsup the CVS tree nightly (/home/ncvs) from cron:

	stable> /usr/local/bin/cvsup -g -r 20 -L 2 -h cvsupXXX.freebsd.org /usr/share/examples/cvsup/cvs-supfile

    * On my -STABLE box I use 'cvs checkout' and 'cvs update' as appropriate
      to keep a -current source hierarchy up to date.  In my case:

	stable> cd /FreeBSD
	stable> mkdir FreeBSD-current
	stable> cd FreeBSD-current
	stable> cvs -d /home/ncvs checkout src

      I do the cvs updates manually, depending on what I am testing:

	stable> cd /FreeBSD/FreeBSD-current/src
	stable> cvs update

    * On my -STABLE box I build the -current world.  I usually
      try to build it -DNOCLEAN but if that fails I just rebuild it from
      scratch.  NOTE!!! DO NOT ACCIDENTLY TRY TO INSTALL THE -CURRENT WORLD
      ON YOUR STABLE BOX!!!

	stable> cd /FreeBSD/FreeBSD-current/src
	stable> make -DNOCLEAN -j 10 buildworld

    * On my -STABLE box I build the -current kernel.  Again I try to use
      -DNOCLEAN to reduce [re]compilation times, but just build it from
      scratch too some times.  NOTE!!! DO NOT ACCIDENTLY TRY TO INSTALL
      THE -CURRENT KERNEL ON YOUR STABLE BOX!!!

	stable> cd /FreeBSD/FreeBSD-current/src
	stable> make [-DNOCLEAN] buildkernel KERNCONF=BLAHBLAH

    * On my -CURRENT box I install via *** READ ONLY *** NFS mounts.  The
      setup for this is typically:

	current> mount stable:/FreeBSD /FreeBSD
	current> mount stable:/usr/obj /usr/obj
	current> rm -rf /usr/src
	current> ln -s /FreeBSD/FreeBSD-current/src /usr/src

      Actual installation of world:

	current> cd /usr/src
	current> make installworld

      Actual installation of kernel:
	
	current> cd /usr/src
	current> make installkernel KERNCONF=BLAHBLAH

      Note that the development environment is on your -stable machine... that
      is where you are doing the builds.  The only thing you need to do on 
      your -current box is to install them via NFS.

    * To test the -CURRENT box, i.e. running buildworld on the -current box
      as a test, I simply unmount /usr/obj and do a buildworld.  The source
      is still NFS mounted from the -STABLE box, but the actual compile runs
      on the -current box and the results are 'throw away' (meaning that it
      doesn't screw up the development environment sitting on my -stable
      machine).

	current> umount /usr/obj
	current> cd /usr/src
	current> /usr/bin/time make -j 30 buildworld


				    -----
		    KEEPING AN EMERGENCY BACKUP KERNEL

    When you have a -current kernel that is able to successully installworld
    and installkernel, and seems to be relatively crash free, you should
    make a backup of it so you can boot from it.  I usually do this:

	current> cp /kernel /kernel.bak

    I do not rely on 'kernel.old' since multiple installkernel's will 
    overwrite it.  Also, don't rely on KLD's since the backup kernel may
    not be compatible with the most recently installed module directory.

				    ----
	    FIREWALL SHOULD BE OPEN BY DEFAULT ON THE CURRENT MACHINE 

    If your -current kernel config is turning on firewall support, aka
    IPFIREWALL, you should also make the filter permissive by default,
    aka IPFIREWALL_DEFAULT_TO_ACCEPT.  If you don't do this and your
    (backup) kernel and the ipfw binary get out of sync, you won't be
    able to use ipfw to open up holes for NFS and such and your backup
    kernel will be S.O.L.

				    ----
		NFS-BASED SOURCE AND NFS-BASED /USR/PORTS ENVIRONMENT

    STABLE MACHINE "/etc/exports":  The export contains non-proprietary data
    and is read-only, so it is fairly safe to export it generally.  If you
    do not have anything proprietary installed in /usr (e.g. in /usr/local),
    you can export /usr -alldirs to allow clients to pickup /usr/obj and
    /usr/ports.

	/FreeBSD -ro -maproot=root: -network 10.0.0.0 -mask 255.0.0.0
	/usr -ro -alldirs -maproot=root: -network 10.0.0.0 -mask 255.0.0.0
	# if /usr/obj a separate mount pt on your box
	#/usr/obj -ro -maproot=root: -network 10.0.0.0 -mask 255.0.0.0

    STABLE MACHINE "/usr/ports" topology.  This allows you to export
    /usr/ports read-only via NFS and still allow each client to build and
    install its own ports:

	stable> cd /usr/ports
	stable> rm -rf distfiles
	stable> ln /usr/ports.distfiles distfiles
	stable> mkdir /usr/ports.distfiles

    CURRENT MACHINE "/etc/fstab" entries (note that /usr itself is local disk)

	stable:/FreeBSD         /FreeBSD        nfs     ro	0       0
	stable:/usr/ports       /usr/ports      nfs     ro	0       0
	stable:/usr/obj         /usr/obj        nfs     ro	0       0

    CURRENT MACHINE "/etc/make.conf" entries:

	# location for ports temporary files, since /usr/ports is mounted
	# read-only.
	WRKDIRPREFIX=/usr/ports.tmp

    CURRENT MACHINE "/usr/ports" topology.  Mounting /usr/ports read-only
    from the -stable box, you need only create two directories:

	current> mkdir /usr/ports.distfiles
	current> mkdir /usr/ports.tmp

						-Matt


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108281814.f7SIETX34454>