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