update for rename of docs/ipfw3/index.mdwn to docs/ipfw2/index.mdwn
[ikiwiki.git] / docs / newhandbook / Upgrading / index.mdwn
1 ## Updating the System 
2
3 ### Supported methods
4
5 The only **supported** method of upgrading DragonFly BSD is by building from source code. The supported upgrade process includes going from the *previous release* to *latest release*.
6
7 ### Getting the source code
8
9 There is a Makefile in /usr which will ease the task of retrieving the source tree; it needs to be run as root:
10
11     # cd /usr
12     # make src-create
13      [...]
14
15 This will check out (download) the source tree to `/usr/src` and switch to the master branch. For the stable branch, you need to check it out with the following command (remember to replace the *DragonFly_RELEASE_4_2* with the appropriate branch name for the release needed).
16
17     % cd /usr/src
18     % git checkout DragonFly_RELEASE_4_2
19
20 To see the available remote branches:
21
22     # cd /usr/src 
23     # git pull
24     # git branch -r
25
26 The leading edge (development trunk) version of the system will be the "master".
27
28 ### Build and upgrade process
29
30 The build process requires some time to build all the userland programs and the DragonFly BSD kernel. Once built, the next step is to install everything and make the upgrade target. No configuration files in */etc* are changed by this process. More details can be found in **[build(7)](http://leaf.dragonflybsd.org/cgi/web-man?command=build&section=ANY)** manpage. 
31
32 **Note:** You may use a concurrent build with `make -j <number>` if you have a SMP (a machine with several cores or CPUs). The number of CPUs + 1 is a good value to start with. To find out how many CPUs your computer has:
33
34     % sysctl hw.ncpu
35     hw.ncpu: 2
36
37     % cd /usr/src
38     % make -j3 buildworld
39     % make -j3 buildkernel
40     % make installkernel
41     % make installworld
42     % make upgrade
43     (reboot)
44
45
46
47
48 An explanation of each step follows.
49
50 * <u>*make buildworld*</u> : This command builds all userland programs; it is the most time-consuming step of the process.  Some programs may be discarded from the build process.  For more information, see **[make.conf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=make.conf&section=ANY)** manpage. 
51
52 * <u>*make buildkernel*</u> : This builds the kernel by default, it uses the config file for your architecture. You may also specify a different kernel configuration file using `KERNCONF=<configfile>`. For more information, see **[make.conf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=make.conf&section=ANY)** manpage.
53
54 * <u>*make installkernel*</u> This installs the kernel using the config file for your architecture; again, `KERNCONF=<configfile>` can be used to specify which one to install.
55
56 * <u>*make installworld*</u> : This copies all the files built in the buildworld step (i.e. everything that is not the kernel) to their proper places in the file system.
57
58 * <u>*make upgrade*</u> : This cleans out any files made unnecessary by this upgrade.
59
60 * (reboot) : Reboot the computer to load the new kernel and use the new files installed as part of this process.
61
62 If your computer fails to boot the new kernel, you can always select 'Boot DragonFly using kernel.old' in the loader menu, so that the old kernel is loaded instead of the new one.
63
64 Additional upgrading instructions can be found in */usr/src/UPDATING* in the source tree. They can also be found online, **[here](http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/master:/UPDATING)**