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