# Upgrading DragonFly on an existing DragonFly system. NOTE: Since we switched to git, this document no longer applies. Please look at the following man pages which describe the process how to obtain the latest DragonFly source (read me) and how to build it.
(This howto is heavily based on /usr/src/UPDATING document. I won't cover upgrading from FreeBSD since I haven't tested the existant documentation's accuracy.) The best way to upgrade DragonFly is to maintain a copy of the DragonFly CVS repository via cvsup and to checkout the source base via this repository. The repository is stored in /home/dcvs by default and requires about 800MB of disk space. The checked out source tree (/usr/src) requires about 400MB of disk space, and the build will eat around 800MB of space out of /usr/obj. To maintain the build you should reserve at least 2.5GB of disk space, and 3.5GB if you have the space. ***Note: most people run cvsup via a root cron job to keep the repository up to date. Please limit such automatic updates to once a day and try to randomize the hour and minute in the cron job a bit to avoid pileups.*** Get the CVS repository (it is placed in /home/dcvs): cvsup /usr/share/examples/cvsup/-cvs-supfile cd /usr cvs -R -d /home/dcvs checkout -P src Note: the example supfile should be copied to another place and edited accordingly, for instance to choose the nearest mirror. Once you have the repository and broken out sources you can decide whether to update your sources from the repository automatically or manually. Since you are tracking changes made to DragonFly, it is usually a good idea to update the sources manually: cd /usr/src cvs update -dP To upgrade a DragonFly system from sources you run the following sequence: cd /usr/src make buildworld make buildkernel KERNCONF= make installkernel KERNCONF= make installworld (The source tree is make -jX safe, tested on many machines - GergoSzakal) You will also want to run the 'upgrade' target to upgrade your /etc and the rest of your system. The upgrade target is aware of stale files created by older DragonFly installations and should delete them automatically. make upgrade ***NOTE! Never do a 'make upgrade' before 'make installworld' has been run. Doing so might leave your system in an unusable state.*** If you are using 'config' manually from /usr/src/sys/config, note that the build will use the current DragonFly environment rather than the post-build environment from the last buildworld. For this reason manual configs are discouraged. The proper way to build a kernel is to use the 'buildkernel' or 'quickkernel' target in /usr/src. Once you've done a full build of the world and kernel you can do incremental upgrades of either by using the 'quickworld' and 'quickkernel' targets instead of 'buildworld' and 'buildkernel'. If you have any problems with the quick targets, try doing a cvsup, cvs update, and then a full buildworld and buildkernel as shown above, before asking for help. ## Package Management System Starting with the 1.4 release, DragonFly uses NetBSD's pkgsrc package management system. The necessary tools to build and maintain packages are provided in /usr/pkg/bin and /usr/pkg/sbin. Make sure that these directories are in your PATH variable. In order to obtain a reasonably current snapshot of the pkgsrc tree, use the tarball from NetBSD: ftp -o /tmp/pkgsrc.tar.gz cd /usr; tar -xzf /tmp/pkgsrc.tar.gz; chown -R root:wheel pkgsrc This tree can then be kept up to date with cvs update: cd /usr/pkgsrc; cvs up -dP NOTE! If you upgraded from a pre-1.4 system to 1.4 or later, you need to build and install the pkgsrc bootstrap manually: cd /usr/pkgsrc/bootstrap ./bootstrap --pkgdbdir /var/db/pkg --prefix /usr/pkg