19aab88fceae87962d16653b42370e7b0a846a29
[ikiwiki.git] / docs / newhandbook / Upgrading / index.mdwn
1 ## Updating the System 
2
3 ### Supported methods
4
5 Currently the **only supported method** of upgrading DragonFly BSD from the source code. <br><br>
6 Supported upgrade process only includes going from the *previous release* to *latest release*.<br>
7
8 For example, in our actual case, only the upgrade process involving <u>2.10.x up to 3.0.x</u> would be supported.
9
10 ### Getting the source code
11
12 There is a helper Makefile in /usr which will ease the task of retrieving the source tree; it needs to be run as root:
13
14     % cd /usr
15     % make src-create
16      [...]
17
18 And that will effectively checkout the source tree on `/usr/src` and switch to master branch. For stable branch you need to check it out with the following command (remember to replace the *DragonFly_RELEASE_3_0* with the appropriate branch name for the release needed).
19
20     % cd /usr/src
21     % git checkout DragonFly_RELEASE_3_0
22
23 ### Build and upgrade process
24
25 Build process requires some time to build all the userland programs and the DragonFly BSD kernel. Once built, 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. 
26
27     % cd /usr/src
28     % make buildworld
29     % make buildkernel
30     % make installkernel
31     % make installworld
32     % make upgrade
33     (reboot)
34
35 **Note:** You may use a concurrent build if you have a SMP (a machine with several cores or CPUs). You may specify *-j x* parameter to make where x is the number of CPUs + 1. <br>
36 If you run DragonFly 2.12 or higher the kernel will auto-detect the number of CPUs your computer has and activate them all if possible. To find out how many CPUs your computer has:
37 <br>
38
39     % sysctl hw.ncpu
40     hw.ncpu: 2
41
42 An explanation of each step follows.
43
44 * <u>*make buildworld*</u> : This command builds all userland programs and it is the most time-consuming step.<br>
45 Some programs may be discarded from the build process.<br>
46 For more details check **[make.conf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=make.conf&section=ANY)** manpage. 
47
48 * <u>*make buildkernel*</u> : This builds the kernel using the config file by default for your architecture. You may also specify a different kernel configuration file using KERNCONF=configfile. More details on **[make.conf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=make.conf&section=ANY)** manpage.
49
50 * <u>*make installkernel*</u> This installs the kernel using the config file for your architecture or KERNCONF=file can be used to specify which one to install.
51
52 * <u>*make installworld*</u> : This copies all the files built in the buildworld step (i.e. everything that is not the kernel) to the proper places in the filesystem.
53
54 * <u>*make upgrade*</u> : This cleans out any files made unnecessary by this upgrade.
55
56 * (reboot) : Reboot the computer to load the new kernel and use the new files installed as part of this process.
57
58 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.
59
60 Additional upgrading instructions can be found in */usr/src/UPDATING* in the source tree. Online it can be found **[here](http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/master:/UPDATING)**