UPDATING revision 142315
1Updating Information for FreeBSD current users
2
3This file is maintained and copyrighted by M. Warner Losh
4<imp@village.org>.  See end of file for further details.  For commonly
5done items, please see the COMMON ITEMS: section later in the file.
6
7Items affecting the ports and packages system can be found in
8/usr/ports/UPDATING.  Please read that file before running
9portupgrade.  Important recent entries: 20040724 (default X changes).
10
11NOTE TO PEOPLE WHO THINK THAT FreeBSD 6.x IS SLOW:
12	FreeBSD 6.x has many debugging features turned on, in
13	both the kernel and userland.  These features attempt to detect
14	incorrect use of system primitives, and encourage loud failure
15	through extra sanity checking and fail stop semantics.  They
16	also substantially impact system performance.  If you want to
17	do performance measurement, benchmarking, and optimization,
18	you'll want to turn them off.  This includes various WITNESS-
19	related kernel options, INVARIANTS, malloc debugging flags
20	in userland, and various verbose features in the kernel.  Many
21	developers choose to disable these features on build machines
22	to maximize performance.
23
2420050223:
25	The p4tcc driver has been merged into cpufreq(4).  This makes
26	"options CPU_ENABLE_TCC" obsolete.  Please load cpufreq.ko or
27	compile in "device cpufreq" to restore this functionality.
28
2920050206:
30	The cpufreq import is complete.  As part of this, the sysctls for
31	acpi(4) throttling have been removed.  The power_profile(8) script
32	has been updated, so you can use performance/economy_cpu_freq in
33	rc.conf(5) to set AC on/offline cpu frequencies.  The acpi
34	throttling support has been merged into acpi_perf(4).
35
3620050206:
37	NG_VERSION has been increased. Recompiling kernel (or ng_socket.ko)
38	requires recompiling libnetgraph and userland netgraph utilities.
39
4020050114:
41	Support for abbreviated forms of a number of ipfw options is
42	now deprecated.  Warnings are printed to stderr indicating the
43	correct full form when a match occurs.  Some abbreviations may
44	be supported at a later date based on user feedback.  To be
45	considered for support, abbreviations must be in use prior to
46	this commit and unlikely to be confused with current key words.
47
4820041221:
49	By a popular demand, a lot of NOFOO options were renamed
50	to NO_FOO (see bsd.compat.mk for a full list).  The old
51	spellings are still supported, but will cause annoying
52	warnings on stderr.  Make sure you upgrade properly (see
53	the COMMON ITEMS: section later in this file).
54
5520041219:
56	Auto-loading of ancillary wlan modules such as wlan_wep has
57	been temporarily disabled; you need to statically configure
58	the modules you need into your kernel or explicitly load them
59	prior to use.  Specifically, if you intend to use WEP encryption
60	with an 802.11 device load/configure wlan_wep; if you want to
61	use WPA with the ath driver load/configure wlan_tkip, wlan_ccmp,
62	and wlan_xauth as required.
63
6420041213:
65	The behaviour of ppp(8) has changed slightly.  If lqr is enabled
66	(``enable lqr''), older versions would revert to LCP ECHO mode on
67	negotiation failure.  Now, ``enable echo'' is required for this
68	behaviour.  The ppp version number has been bumped to 3.4.2 to
69	reflect the change.
70
7120041201:
72	The wlan support has been updated to split the crypto support
73	into separate modules.  For static WEP you must configure the
74	wlan_wep module in your system or build and install the module
75	in place where it can be loaded (the kernel will auto-load
76	the module when a wep key is configured).
77
7820041201:
79	The ath driver has been updated to split the tx rate control
80	algorithm into a separate module.  You need to include either
81	ath_rate_onoe or ath_rate_amrr when configuring the kernel.
82
8320041116:
84	Support for systems with an 80386 CPU has been removed.  Please
85	use FreeBSD 5.x or earlier on systems with an 80386.
86
8720041110:
88	We have had a hack which would mount the root filesystem
89	R/W if the device were named 'md*'.  As part of the vnode
90	work I'm doing I have had to remove this hack.  People
91	building systems which use preloaded MD root filesystems
92	may need to insert a "/sbin/mount -u -o rw /dev/md0 /" in
93	their /etc/rc scripts.
94
9520041104:
96	FreeBSD 5.3 shipped here.
97
9820041102:
99	The size of struct tcpcb has changed again due to the removal
100	of RFC1644 T/TCP.  You have to recompile userland programs that
101	read kmem for tcp sockets directly (netstat, sockstat, etc.)
102
10320041022:
104	The size of struct tcpcb has changed.  You have to recompile
105	userland programs that read kmem for tcp sockets directly
106	(netstat, sockstat, etc.)
107
10820041016:
109	RELENG_5 branched here.  For older entries, please see updating
110	in the RELENG_5 branch.
111
112COMMON ITEMS:
113
114	# NOTE: 5.x below applies to 6.0-current as well, for the
115	# moment.  4.any -> 5.any upgrade support will remain in
116	# place for 6.0 current, but after 5.3 RELEASE, the 4.any ->
117	# 6.0-current upgrade path will require moving through 5.3
118	# RELEASE or newer.
119
120	General Notes
121	-------------
122	Avoid using make -j when upgrading.  From time to time in the
123	past there have been problems using -j with buildworld and/or
124	installworld.  This is especially true when upgrading between
125	"distant" versions (eg one that cross a major release boundary
126	or several minor releases, or when several months have passed
127	on the -current branch).
128
129	Sometimes, obscure build problems are the result of environment
130	poisoning.  This can happen because the make utility reads its
131	environment when searching for values for global variables.
132	To run your build attempts in an "environmental clean room",
133	prefix all make commands with 'env -i '.  See the env(1) manual
134	page for more details.
135
136	To build a kernel
137	-----------------
138	If you are updating from a prior version of FreeBSD (even one just
139	a few days old), you should follow this procedure. With a
140	/usr/obj tree with a fresh buildworld,
141	make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=YOUR_KERNEL_HERE
142	make -DALWAYS_CHECK_MAKE installkernel KERNCONF=YOUR_KERNEL_HERE
143
144	To just build a kernel when you know that it won't mess you up
145	--------------------------------------------------------------
146	This assumes you are already running a 5.X system.  Replace
147	${arch} with the architecture of your machine (e.g. "i386",
148	"alpha", "amd64", "ia64", "pc98", "sparc64", etc).
149
150	cd src/sys/${arch}/conf
151	config KERNEL_NAME_HERE
152	cd ../compile/KERNEL_NAME_HERE
153	make depend
154	make
155	make install
156
157	If this fails, go to the "To build a kernel" section.
158
159	To rebuild everything and install it on the current system.
160	-----------------------------------------------------------
161	# Note: sometimes if you are running current you gotta do more than
162	# is listed here if you are upgrading from a really old current.
163
164	<make sure you have good level 0 dumps>
165	<maybe fix /etc/fstab>				[7]
166	make buildworld
167	make kernel KERNCONF=YOUR_KERNEL_HERE
168							[1]
169	<reboot in single user>				[3]
170	src/etc/rc.d/preseedrandom			[10]
171	mergemaster -p					[5]
172	make installworld
173	mergemaster					[4]
174	<reboot>
175
176
177	To cross-install current onto a separate partition
178	--------------------------------------------------
179	# In this approach we use a separate partition to hold
180	# current's root, 'usr', and 'var' directories.   A partition
181	# holding "/", "/usr" and "/var" should be about 2GB in
182	# size.
183
184	<make sure you have good level 0 dumps>
185	<boot into -stable>
186	make buildworld
187	<maybe newfs current's root partition>
188	<mount current's root partition on directory ${CURRENT_ROOT}>
189	make installworld DESTDIR=${CURRENT_ROOT}
190	make buildkernel KERNCONF=YOUR_KERNEL_HERE
191	cp src/sys/${ARCH}/conf/GENERIC.hints \
192		${CURRENT_ROOT}/boot/device.hints	# as needed
193	make installkernel KERNCONF=YOUR_KERNEL_HERE DESTDIR=${CURRENT_ROOT}
194	cd src/etc; make distribution DESTDIR=${CURRENT_ROOT} # if newfs'd
195	cp /etc/fstab ${CURRENT_ROOT}/etc/fstab 		   # if newfs'd
196	<edit ${CURRENT_ROOT}/etc/fstab to mount "/" from the correct partition>
197	<reboot into current>
198	<do a "native" rebuild/install as described in the previous section>
199	<maybe install compatibility libraries from src/lib/compat>
200 	<reboot>
201
202
203	To upgrade in-place from 4.x-stable to current
204	----------------------------------------------
205	# 5.x uses more space than 4.x.  Also, the location of kernel
206	# modules has changed.  If you are installing 5.x onto a 4.x
207	# system, you'll need about 30MB of free disk space on your /
208	# partition.  If you have less than this, you may encounter difficult
209	# to back out of problems with this procedure.  If /tmp is on
210	# the / partition, you may want to completely remove all its content
211	# before upgrading, as this can be a common source of shortage of
212	# space on /.
213
214	<make sure you have good level 0 dumps>
215	<maybe fix /etc/fstab>				[7]
216	make buildworld					[9]
217	cp sys/${MACHINE}/conf/GENERIC.hints /boot/device.hints [2]
218	make kernel KERNCONF=YOUR_KERNEL_HERE		[8]
219	cd sys/boot ; make STRIP="" install		[6]
220							[1]
221	<reboot in single user>				[3]
222	src/etc/rc.d/preseedrandom			[10]
223	mergemaster -p					[5]
224	rm -rf /usr/include/g++
225	make installworld
226	mergemaster -i					[4]
227	<reboot>
228
229	Make sure that you've read the UPDATING file to understand the
230	tweaks to various things you need.  At this point in the life
231	cycle of current, things change often and you are on your own
232	to cope.  The defaults can also change, so please read ALL of
233	the UPDATING entries.
234
235	Also, if you are tracking -current, you must be subscribed to
236	freebsd-current@freebsd.org.  Make sure that before you update
237	your sources that you have read and understood all the recent
238	messages there.  If in doubt, please track -stable which has
239	much fewer pitfalls.
240
241	[1] If you have third party modules, such as vmware, you
242	should disable them at this point so they don't crash your
243	system on reboot.
244
245	[2] If you have legacy ISA devices, you may need to create
246	your own device.hints to reflect your unique hardware
247	configuration.
248
249	[3] From the bootblocks, boot -s, and then do
250		fsck -p
251		mount -u /
252		mount -a
253		cd src
254		adjkerntz -i		# if CMOS is wall time
255	Also, when doing a major release upgrade, it is required that
256	you boot into single user mode to do the installworld.
257	For the 4.x -> 5.x upgrade, you will also see many messages about
258	needing to recompile your userland.  These are harmless and can
259	be ignored while you proceed to the next step.
260
261	[4] Note: This step is non-optional.  Failure to do this step
262	can result in a significant reduction in the functionality of the
263	system.  Attempting to do it by hand is not recommended and those
264	that pursue this avenue should read this file carefully, as well
265	as the archives of freebsd-current and freebsd-hackers mailing lists
266	for potential gotchas.
267
268	[5] Usually this step is a noop.  However, from time to time
269	you may need to do this if you get unknown user in the following
270	step.  It never hurts to do it all the time.  You may need to
271	install a new mergemaster (cd src/usr.sbin/mergemaster && make
272	install) after the buildworld before this step if you last updated
273	from current before 20020224 or from -stable before 20020408.
274
275	[6] 4.x boot loader can be used to boot a 5.x system, however
276	it is difficult to do that at best.  If you wish to try, then
277	you should interrupt the boot and at the ok prompt type:
278		ok unload
279		ok boot /boot/kernel/kernel
280	If this fails to work, you must install a new boot loader as
281	described here.
282
283	[7] Before you upgrade, please make sure that you are not using
284	compatibility slices.  These are device names of the form /dev/ad0a
285	without the actual slice name.  These will break with 5.x and newer.
286	You generally must update these entries to use the post FreeBSD
287	2.x form of /dev/ad0s1a. i386 and pc98 are affected, while alpha
288	is not.
289
290	[8] In order to have a kernel that can run the 4.x binaries
291	needed to do an installworld, you must include the COMPAT_FREEBSD4
292	option in your kernel.  Failure to do so may leave you with a system
293	that is hard to boot to recover.
294
295	Make sure that you merge any new devices from GENERIC since the
296	last time you updated your kernel config file.
297
298	[9] When checking out sources, you must include the -P flag to have
299	cvs prune empty directories.
300
301	If CPUTYPE is defined in your /etc/make.conf, make sure to use the
302	"?=" instead of the "=" assignment operator, so that buildworld can
303	override the CPUTYPE if it needs to.
304
305	MAKEOBJDIRPREFIX must be defined in an environment variable, and
306	not on the command line, or in /etc/make.conf.  buildworld will
307	warn if it is improperly defined.
308
309	In case you would like to avoid installing new packages of everything,
310	you might want to uncomment the "COMPAT4X=	YES" entry, so that 4.x
311	compatibility libraries are built which should allow you to continue
312	using your existing software for a while.  Alternatively, you can
313	install the misc/compat4x port.
314
315	[10] In order to create temporary files, /dev/random must be
316	initialized by feeding data into it.  src/etc/rc.d/preseedrandom
317	takes care of this.
318FORMAT:
319
320This file contains a list, in reverse chronological order, of major
321breakages in tracking -current.  Not all things will be listed here,
322and it only starts on March 15, 2000.  Updating files can found in
323previous releases if your system is older than this.
324
325Copyright information:
326
327Copyright 1998-2004 M. Warner Losh.  All Rights Reserved.
328
329Redistribution, publication, translation and use, with or without
330modification, in full or in part, in any form or format of this
331document are permitted without further permission from the author.
332
333THIS DOCUMENT IS PROVIDED BY WARNER LOSH ``AS IS'' AND ANY EXPRESS OR
334IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
335WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
336DISCLAIMED.  IN NO EVENT SHALL WARNER LOSH BE LIABLE FOR ANY DIRECT,
337INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
338(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
339SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
340HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
341STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
342IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
343POSSIBILITY OF SUCH DAMAGE.
344
345If you find this document useful, and you want to, you may buy the
346author a beer.
347
348Contact Warner Losh if you have any questions about your use of
349this document.
350
351$FreeBSD: head/UPDATING 142315 2005-02-23 16:52:55Z njl $
352