Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

My Recommended Development/Testing environment for -current

0 views
Skip to first unread message

dil...@earth.backplane.com

unread,
Aug 28, 2001, 2:15:07 PM8/28/01
to
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 majo...@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message

ban...@looksharp.net

unread,
Aug 28, 2001, 2:36:13 PM8/28/01
to
On Tue, 28 Aug 2001, Matt Dillon wrote:

> 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.

I found this very helpful Matt, thank you. I would only add one thing
that I do in addition to some of these NFS tricks. The only machines at
home which I presently keep hard drives in are my file server, firewall,
and desktop. Everything else netboots off of the file server. This is
very convenient because I can keep multiple NFS roots around and simply
edit a text file, HUP a daemon, and power cycle a machine to alter which
OS and/or OS revision it's running. Switched fast ethernet is more than
enough to keep up with this on the 10 or so machines I have up and
running at any given time. It works quite well.

I will say though, on the subject of NFS, that one of the things that
I'm almost annoyed enough with to start hacking on is the BSDs lack of
autofs support. Linux now has a kickass autofs automounter. The BSDs
are, to the best of my knowledge, the only OS left without one.
Am-utils (the contrib source for our amd) has been kicking around autofs
support for a while now but still does not appear to have anything
release quality. It's a nuisance to have to run special scripts to
parse your auto.* maps into stuff amd can understand in an NIS
environment.

--
"Never put off until tomorrow what you can do today. There might be a
law against it by that time." -- /usr/games/fortune, 07/30/2001

Brandon D. Valentine <bandix at looksharp.net>

ana...@anarcat.dyndns.org

unread,
Aug 28, 2001, 3:52:40 PM8/28/01
to

--H1spWtNR+x+ondvy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, 28 Aug 2001, Brandon D. Valentine wrote:

> On Tue, 28 Aug 2001, Matt Dillon wrote:

>=20
[snip of diskless comments]

You wouldn't happen to have sample configs around, wouldn't you? :)
=20


> I will say though, on the subject of NFS, that one of the things that
> I'm almost annoyed enough with to start hacking on is the BSDs lack of
> autofs support. Linux now has a kickass autofs automounter. The BSDs
> are, to the best of my knowledge, the only OS left without one.

Wrong.

> Am-utils (the contrib source for our amd) has been kicking around autofs
> support for a while now but still does not appear to have anything

> release quality.=20

Am-utils, while being a quite complex piece of software, does fullfil
the task of "autofs". It does need extra configuration compared to
Linux's autofs though. For the record, I automount my cdr, cdrom, zip
and floppy drives (both in ufs and msdos mode) using this configuration
files:

---8<--- Cut here [amd.mnt] -----8<--------
cdr type:=3Dcdfs;fs:=3D/cdr;dev:=3D/dev/cd0c;opts:=3Dro,nodev,nosuid
cdrom type:=3Dcdfs;fs:=3D/cdrom;dev:=3D/dev/acd0c;opts:=3Dro,node=
v,nosuid
fat type:=3Dpcfs;fs:=3D/fat;dev:=3D/dev/fd0;opts:=3Dnosuid,nodev=20
flp type:=3Dufs;fs:=3D/flp;dev:=3D/dev/fd0;opts:=3Dnosuid,nodev
zip type:=3Dufs;fs:=3D/zip;dev:=3D/dev/afd0;opts:=3Dnosuid,nodev
zap type:=3Dpcfs;fs:=3D/zap;dev:=3D/dev/afd0s4;opts:=3Dnosuid,nodev
---8<--- Cut here [amd.mnt] -----8<--------

---8<--- Cut here [amd.conf] -----8<--------
[ global ] =20
normalize_hostnames =3D no
print_pid =3D no
restart_mounts =3D yes
#auto_dir =3D /n
log_file =3D /var/log/amd
log_options =3D all
#debug_options =3D all
plock =3D no=20
cache_duration =3D 6 =20
dismount_interval =3D 20=20
selectors_on_default =3D yes
# config.guess picks up "sunos5" and I don't want to edit my maps yet
os =3D sos5
# if you print_version after setting up "os", it will show it.
print_version =3D no =20
map_type =3D file
search_path =3D
/etc/amdmaps:/usr/lib/amd:/usr/local/AMD/lib:/etc
browsable_dirs =3D yes

[ /mnt ]
map_name =3D amd.mnt
---8<--- Cut here [amd.conf] -----8<--------

I think I will dare opening a pr making this default config files. :)

> It's a nuisance to have to run special scripts to
> parse your auto.* maps into stuff amd can understand in an NIS
> environment.

I am not sure I completely understand that, but you must expect having
to reconfigure stuff to accomodate new software... I guess you want to
port autofs to fbsd, eh? :)

A.

--H1spWtNR+x+ondvy
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: Pour information voir http://www.gnupg.org

iEYEARECAAYFAjuL9mIACgkQttcWHAnWiGdZxgCfVHTvWXqU+qQWMBl68Y/ki9Pm
XCYAoIyDv6oLSbSxO4J7eAMnc86a2yeT
=yDdc
-----END PGP SIGNATURE-----

--H1spWtNR+x+ondvy--

ban...@looksharp.net

unread,
Aug 28, 2001, 6:07:31 PM8/28/01
to
On Tue, 28 Aug 2001, The Anarcat wrote:

>On Tue, 28 Aug 2001, Brandon D. Valentine wrote:
>
>> On Tue, 28 Aug 2001, Matt Dillon wrote:
>>
>[snip of diskless comments]
>
>You wouldn't happen to have sample configs around, wouldn't you? :)

>> Am-utils (the contrib source for our amd) has been kicking around autofs


>> support for a while now but still does not appear to have anything
>> release quality.
>

>Am-utils, while being a quite complex piece of software, does fullfil
>the task of "autofs". It does need extra configuration compared to
>Linux's autofs though. For the record, I automount my cdr, cdrom, zip
>and floppy drives (both in ufs and msdos mode) using this configuration
>files:

I do believe you have misunderstood. My complaint is that am-utils
requires the type of config files you pasted here. Most every other
unix operating system, Linux and the commercial unices, now comes with
an autofsd/automountd which uses the auto.master/auto.* config file
format which requires far less configuration and is *interoperable* in a
heterogenous environment. On each of the SGIs and the Linux box here I
have an /etc/auto.master that does little more than +auto.master which
includes a NIS map that works everywhere. This is not nearly as easy
with the standard BSD amd.

--
"Never put off until tomorrow what you can do today. There might be a
law against it by that time." -- /usr/games/fortune, 07/30/2001

Brandon D. Valentine <bandix at looksharp.net>

To Unsubscribe: send mail to majo...@FreeBSD.org

j...@freebsd.org

unread,
Aug 28, 2001, 6:09:28 PM8/28/01
to

On 28-Aug-01 Matt Dillon wrote:
> 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.

Nice stuff and close to what I do (I just share a development sys tree over NFS
now). One thing I do in regards to kernels is this, /boot/kernel/kernel is a
clean kernel, i.e. from a clean current source, not any of my development
trees. Kernels in development trees use stuff like this:

makeoptions KERNEL=smpng

in their kernel config files so I have /boot/smpng/kernel, /boot/test/kernel,
/boot/preempt/kernel, etc. for my development tree kernels. This avoids
needing to keep a kernel.good around, as /boot/kernel/kernel is always ok.

--

John Baldwin <j...@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/

vo...@express.ru

unread,
Sep 7, 2001, 5:28:14 AM9/7/01
to
Matt Dillon writes:

> * 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!!!
>

One problem - in such testing you newer see problems building world on
-CURRENT, so without below patch world not builds on my -CURRENT

--- src/gnu/usr.bin/perl/Makefile.inc.orig Thu May 31 15:04:52 2001
+++ src/gnu/usr.bin/perl/Makefile.inc Fri Sep 7 13:22:09 2001
@@ -41,7 +41,7 @@
done ;\
for i in `cd ${PERL5SRC}; find $${d} -type f | grep -v CVS` ;\
do \
- ln -s ${PERL5SRC}/$${i} $${i} ;\
+ ln -sf ${PERL5SRC}/$${i} $${i} ;\
done ;\
done
@ln -sf ${PERL5SRC}/ext/File/Glob/Glob.pm lib/File/Glob.pm


Sometime I am use a bit different scheme, on my -STABLE box I have cvsup and
source tree, it mounted through NFS to -CURRENT box read-only, and above it
mounted unionfs tree for building and changing sources.

> -Matt

--
TSB Russian Express, Moscow
Vladimir B. Grebenschikov, vo...@express.ru

0 new messages