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