Fix buildkernel when pfsync(4) is compiled into an x86_64 kernel.
[dragonfly.git] / UPDATING
CommitLineData
d2a0decc
MD
1# Updating Information for DragonFly users.
2#
3#
4# This file should warn you of any pitfalls which you might need to work around
5# when trying to update your DragonFly system. The information below is
6# in reverse-time order, with the latest information at the top.
7#
8# If you discover any problem, please contact the bugs@lists.dragonflybsd.org
9# mailing list with the details.
d2a0decc 10
b79f66dd 11+-----------------------------------------------------------------------+
1bb1cc14
MS
12+ 20100924 +
13+ UPGRADING DRAGONFLY FROM 2.6 to 2.8 or HEAD +
b79f66dd
JT
14+-----------------------------------------------------------------------+
15
8eb0b612
JS
16Loader
17=======
18
b79f66dd
JT
19A new loader (dloader) has been added which better handles booting from
20multiple kernel/module versions.
21
22To upgrade (Only for this upgrade, for post 2.8 upgrades see GENERAL below)
23
24 cd /usr/src
25 make buildworld
26 make installworld
27 make upgrade
28 make buildkernel KERNCONF=<KERNELNAME>
29 make installkernel KERNCONF=<KERNELNAME>
30
31Note that you must installworld and run the 'upgrade' target before
32installing the new kernel.
33
8eb0b612
JS
34BIND
35=====
36
37BIND has been removed from the base system. The ldns and drill tools have
38been added for basic functionality. Use 'drill' where you would normally
39use nslookup or dig, or install BIND from pkgsrc. It's available as
40net/bind95, net/bind96, or net/bind97 as of this writing.
41
42This only affects older systems upgrading to 2.8. New 2.8+ installs
43include BIND as a pkgsrc package.
44
d2a0decc
MD
45+-----------------------------------------------------------------------+
46+ UPGRADING DRAGONFLY ON AN EXISTING DRAGONFLY SYSTEM +
47+ GENERAL +
48+-----------------------------------------------------------------------+
984263bc 49
a700883c
SW
50Instructions on how to obtain and maintain DragonFly source code using git
51are in the development(7) manual page.
d2a0decc
MD
52
53To upgrade a DragonFly system from sources you run the following sequence:
54
55 cd /usr/src
56 make buildworld
57 make buildkernel KERNCONF=<KERNELNAME>
58 make installkernel KERNCONF=<KERNELNAME>
59 make installworld
60
61You will also want to run the 'upgrade' target to upgrade your /etc and the
62rest of your system. The upgrade target is aware of stale files created by
63older DragonFly installations and should delete them automatically.
64
65 make upgrade
66
a700883c
SW
67See the build(7) manual page for further information.
68
d2a0decc
MD
69Once you've done a full build of the world and kernel you can do incremental
70upgrades of either by using the 'quickworld' and 'quickkernel' targets
71instead of 'buildworld' and 'buildkernel'. If you have any problems with
a700883c 72the quick targets, try updating your repo first, and then a full buildworld
d2a0decc 73and buildkernel as shown above, before asking for help.
4523a2c0
TN
74
75+-----------------------------------------------------------------------+
76+ UPGRADING FROM DRAGONFLY <= 2.0 TO DRAGONFLY >= 2.1 +
77+-----------------------------------------------------------------------+
78
79In 2.1 kernel and modules has moved to boot directory. For most cases
80this is handled automatically by 'make upgrade'. A few cases needs manual
81intervention:
82
83 * When installing a kernel without first doing a make buildworld,
84 installworld and upgrade to the same DESTDIR as kernel:
85 make DESTDIR/boot directory and move kernel and modules into this boot
86 directory; also move kernel.old and modules.old.
87 Typical example is vkernel(7), use (no modules used):
88
89 cd /var/vkernel
90 mkdir boot
91 chflags noschg kernel
92 mv kernel kernel.old boot
93 chflags schg boot/kernel
94
95 * When using a boot-only partition, /boot/loader.rc needs to be edited:
96 delete occurrences of '/boot/'.
97 These occurences can normally be deleted in any case, see loader(8).
d2a0decc
MD
98
99+-----------------------------------------------------------------------+
100+ UPGRADING FROM DRAGONFLY <= 1.8 TO DRAGONFLY >= 1.9 +
101+-----------------------------------------------------------------------+
102
103In 1.9 major changes to the disk management infrastructure have taken
104place. make upgrade may not catch all of your disk devices in /dev,
105so after upgrading be sure to cd /dev; ./MAKEDEV <blah> where <blah>
45e80934
MD
106are all of your disk devices. HOWEVER, from late 2.3 on we run devfs
107and MAKEDEV no longer exists.
d2a0decc
MD
108
109The biggest changes in 1.9 are:
110
111(1) That whole-slice devices such as da0s1 no longer share the same device
112 id as partition c devices such as da0s1c.
113
114(2) The whole-disk device (e.g. da0) is full raw access to the disk,
115 with no snooping or reserved sectors. Consequently you cannot run
116 disklabel on this device. Instead you must run disklabel on a
117 whole-slice device.
118
119(3) The 'compatibility' partitions now use slice 0 in the device name,
120 so instead of da0a you must specify da0s0a. Also, as per (1) above,
121 accessing the disklabel for the compatibility partitions must be
122 done via slice 0 (da0s0).
123
124(4) Many device drivers that used to fake up labels, such as CD, ACD, VN,
125 and CCD now run through the disk management layer and are assigned
126 real disk management devices. VN and CCD in particular do not usually
127 use a MBR and disklabels must be accessed through the compatibility
128 slice 0. Your /etc/ccd.conf file still specifies 'ccd0', though, you
129 don't name it 'ccd0s0' in the config file.
130
131Generally speaking, you have to get used to running fdisk and disklabel on
132the correctly specified device names. A lot of the wiggle, such as running
133disklabel on a partition, has been removed.
134
135+-----------------------------------------------------------------------+
136+ UPGRADING FROM OLDER VERSIONS OF DRAGONFLY OR FREEBSD +
137+-----------------------------------------------------------------------+
138
139> Kerberos IV
140-------------
141
142Kerberos IV (eBones) was removed from the tree, please consider moving to
143Kerberos 5 (Heimdal).
144
145> Package Management System
146---------------------------
147
148Starting with the 1.4 release, DragonFly uses NetBSD's pkgsrc package
149management system. The necessary tools to build and maintain packages
150are provided in /usr/pkg/bin and /usr/pkg/sbin. Make sure that these
151directories are in your PATH variable.
152
153In order to obtain a reasonably current snapshot of the pkgsrc tree, use
154the tarball from NetBSD:
155
156 fetch -o /tmp/pkgsrc.tar.gz ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc.tar.gz
157 cd /usr; tar -xzf /tmp/pkgsrc.tar.gz; chown -R root:wheel pkgsrc
158
159This tree can then be kept up to date with cvs update:
160
161 cd /usr/pkgsrc; cvs up
162
163NOTE! If you upgraded from a pre-1.4 system to 1.4 or later, you need to
164build and install the pkgsrc bootstrap manually:
165
166 cd /usr/pkgsrc/bootstrap
167 ./bootstrap --pkgdbdir /var/db/pkg --prefix /usr/pkg
168
169+-----------------------------------------------------------------------+
170+ UPGRADING DRAGONFLY ON AN EXISTING DRAGONFLY SYSTEM +
171+ UPDATING FROM PRE-1.2 SYSTEMS OR FreeBSD 4.x TO +
172+ DRAGONFLY 1.3+ (EITHER PREVIEW or HEAD) +
173+-----------------------------------------------------------------------+
58116288 174
114580ac 175The compatibility shims for the build environment have been removed, you
58116288
JS
176have to update to DragonFly 1.2 release branch first.
177
1fcc7462
JS
178The default PAM configuration has moved from /etc/pam.conf to /etc/pam.d/.
179The existing configuration can be converted using /etc/pam.d/convert.sh.
180Entries in /etc/pam.d/ override entries in /etc/pam.conf. In addition
181the pam_skey.so module was retired, you have to remove it manually from
182your configuration, when you convert it.
58116288 183
a3107071
MD
184> Required user and group IDs when upgrading from either FreeBSD or DragonFly
185---------------------
186
187The following users may be missing from your password file. Use vipw and
188add any that are missing:
189
190smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/sbin/nologin
dcf85892 191_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/sbin/nologin
a3107071
MD
192
193The following groups may be missing from your group file. Use vi /etc/group
194and add any that are missing:
195
196smmsp:*:25:
197authpf:*:63:
dcf85892 198_pflogd:*:64:
a3107071
MD
199
200
f419daca 201> Upgrading to DragonFly from FreeBSD
5e0ae0d4 202---------------------
984263bc 203
f419daca
MD
204You can build the DragonFly world and DragonFly kernels on a FreeBSD-4.x or
205FreeBSD-5.x machine and then install DragonFly over FreeBSD, replacing
206FreeBSD. Note that the DragonFly buildworld target does not try to reuse
207make depend information, it starts from scratch, so no pre-cleaning of the
208object hierarchy is necessary.
209
466bbc10 210 # get the CVS repository (it is placed in /home/dcvs, 500MB).
f419daca
MD
211 # Please use the -h option and a mirror site to pull the
212 # initial repository, but feel free to use the main repository
213 # machine to pull updates.
5010eeb3 214 cvsup /usr/share/examples/cvsup/DragonFly-cvs-supfile
f419daca
MD
215 # install the source from the CVS hierarchy (remove preexisting
216 # FreeBSD src first) (500MB)
217 cd /usr
218 rm -rf src
50172b1c 219 cvs -R -d /home/dcvs checkout -P src
f419daca
MD
220
221 # build it (500MB used in /usr/obj)
222 #
223 cd /usr/src
224 make buildworld
225 make buildkernel KERNCONF=<KERNELNAME>
984263bc 226
f419daca
MD
227Once you have built DragonFly you have to install it over FreeBSD. Since
228DragonFly does not track changes made by FreeBSD to its include file
229hierarchy and include file pollution can cause all sorts of unexpected
230compilation issues to come up, it is best to wipe your include hierarchy
231prior to installing DragonFly. Note that you should not wipe any installed
232FreeBSD header files or binaries until after you have successfully completed
233the build steps above.
fb12f484 234
f419daca
MD
235 rm -rf /usr/include
236 mkdir /usr/include
237 make installkernel KERNCONF=<KERNELNAME>
238 make installworld
fb12f484 239
b8cbf045 240Then you need to upgrade your system. DragonFly's 'make upgrade' target
f419daca 241will unconditionally upgrade the /etc files that sysops do not usually
b8cbf045
SW
242mess around with, such as the files in /etc/rc.d. It will also remove any
243obsolete files such as utilities and manpages that have been removed from
244the system since the version you're coming from. If you are unsure we
245recommend that you make a backup of at least your /etc before applying
246this step. Note that DragonFly's RC system is basically RCNG from
247FreeBSD-5, but there are some differences in the contents of the RC files.
f419daca
MD
248
249 make upgrade
250
b8cbf045
SW
251NOTE! Never do a 'make upgrade' before 'make installworld' has been run.
252Doing so might leave your system in an unusable state.
253
f419daca 254Finally we recommend that you do an 'ls -lta BLAH' for /bin, /sbin, /usr/bin,
b8cbf045
SW
255/usr/bin, and /usr/lib, and remove any stale files that you find. Please
256report these files to the DragonFly developers so that they can be added to
257the 'upgrade' target.
f419daca 258