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. 10 11NOTE TO PEOPLE WHO THINK THAT FreeBSD 7.x IS SLOW: 12 FreeBSD 7.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 2420051231: 25 The page coloring algorithm in the VM subsystem was converted 26 from tuning with kernel options to autotuning. Please remove 27 any PQ_* option except PQ_NOOPT from your kernel config. 28 2920051211: 30 The net80211-related tools in the tools/tools/ath directory 31 have been moved to tools/tools/net80211 and renamed with a 32 "wlan" prefix. Scripts that use them should be adjusted 33 accordingly. 34 3520051202: 36 Scripts in the local_startup directories (as defined in 37 /etc/defaults/rc.conf) that have the new rc.d semantics will 38 now be run as part of the base system rcorder. If there are 39 errors or problems with one of these local scripts, it could 40 cause boot problems. If you encounter such problems, boot in 41 single user mode, remove that script from the */rc.d directory. 42 Please report the problem to the port's maintainer, and the 43 freebsd-ports@freebsd.org mailing list. 44 4520051129: 46 The nodev mount option was deprecated in RELENG_6 (where it 47 was a no-op), and is now unsupported. If you have nodev or dev listed 48 in /etc/fstab, remove it, otherwise it will result in a mount error. 49 5020051129: 51 ABI between ipfw(4) and ipfw(8) has been changed. You need 52 to rebuild ipfw(8) when rebuilding kernel. 53 5420051108: 55 rp(4)'s device files now contain the unit number. 56 Uses of {cua,tty}R[0-9a-f] should be replaced by {cua,tty}R0[0-9a-f]. 57 5820051029: 59 /etc/rc.d/ppp-user has been renamed to /etc/rc.d/ppp. 60 Its /etc/rc.conf.d configuration file has been `ppp' from 61 the beginning, and hence there is no need to touch it. 62 6320051001: 64 kern.polling.enable sysctl MIB is now deprecated. Use ifconfig(8) 65 to turn polling(4) on your interfaces. 66 6720050927: 68 The old bridge(4) implementation was retired. The new 69 if_bridge(4) serves as a full functional replacement. 70 7120050722: 72 The ai_addrlen of a struct addrinfo was changed to a socklen_t 73 to conform to POSIX-2001. This change broke an ABI 74 compatibility on 64 bit architecture. You have to recompile 75 userland programs that use getaddrinfo(3) on 64 bit 76 architecture. 77 7820050711: 79 RELENG_6 branched here. 80 8120050629: 82 The pccard_ifconfig rc.conf variable has been removed and a new 83 variable, ifconfig_DEFAULT has been introduced. Unlike 84 pccard_ifconfig, ifconfig_DEFAULT applies to ALL interfaces that 85 do not have ifconfig_ifn entries rather than just those in 86 removable_interfaces. 87 8820050616: 89 Some previous versions of PAM have permitted the use of 90 non-absolute paths in /etc/pam.conf or /etc/pam.d/* when referring 91 to third party PAM modules in /usr/local/lib. A change has been 92 made to require the use of absolute paths in order to avoid 93 ambiguity and dependence on library path configuration, which may 94 affect existing configurations. 95 9620050610: 97 Major changes to network interface API. All drivers must be 98 recompiled. Drivers not in the base system will need to be 99 updated to the new APIs. 100 10120050609: 102 Changes were made to kinfo_proc in sys/user.h. Please recompile 103 userland, or commands like `fstat', `pkill', `ps', `top' and `w' 104 will not behave correctly. 105 106 The API and ABI for hwpmc(4) have changed with the addition 107 of sampling support. Please recompile lib/libpmc(3) and 108 usr.sbin/{pmcstat,pmccontrol}. 109 11020050606: 111 The OpenBSD dhclient was imported in place of the ISC dhclient 112 and the network interface configuration scripts were updated 113 accordingly. If you use DHCP to configure your interfaces, you 114 must now run devd. Also, DNS updating was lost so you will need 115 to find a workaround if you use this feature. 116 11720050605: 118 if_bridge was added to the tree. This has changed struct ifnet. 119 Please recompile userland and all network related modules. 120 12120050603: 122 The n_net of a struct netent was changed to an uint32_t, and 123 1st argument of getnetbyaddr() was changed to an uint32_t, to 124 conform to POSIX-2001. These changes broke an ABI 125 compatibility on 64 bit architecture. With these changes, 126 shlib major of libpcap was bumped. You have to recompile 127 userland programs that use getnetbyaddr(3), getnetbyname(3), 128 getnetent(3) and/or libpcap on 64 bit architecture. 129 13020050528: 131 Kernel parsing of extra options on '#!' first lines of shell 132 scripts has changed. Lines with multiple options likely will 133 fail after this date. For full details, please see 134 http://people.freebsd.org/~gad/Updating-20050528.txt 135 13620050503: 137 The packet filter (pf) code has been updated to OpenBSD 3.7 138 Please note the changed anchor syntax and the fact that 139 authpf(8) now needs a mounted fdescfs(5) to function. 140 14120050415: 142 The NO_MIXED_MODE kernel option has been removed from the i386 143 amd64 platforms as its use has been superceded by the new local 144 APIC timer code. Any kernel config files containing this option 145 should be updated. 146 14720050227: 148 The on-disk format of LC_CTYPE files was changed to be machine 149 independent. Please make sure NOT to use NO_CLEAN buildworld 150 when crossing this point. Crossing this point also requires 151 recompile or reinstall of all locale depended packages. 152 15320050225: 154 The ifi_epoch member of struct if_data has been changed to 155 contain the uptime at which the interface was created or the 156 statistics zeroed rather then the wall clock time because 157 wallclock time may go backwards. This should have no impact 158 unless an snmp implementation is using this value (I know of 159 none at this point.) 160 16120050224: 162 The acpi_perf and acpi_throttle drivers are now part of the 163 acpi(4) main module. They are no longer built separately. 164 16520050223: 166 The layout of struct image_params has changed. You have to 167 recompile all compatibility modules (linux, svr4, etc) for use 168 with the new kernel. 169 17020050223: 171 The p4tcc driver has been merged into cpufreq(4). This makes 172 "options CPU_ENABLE_TCC" obsolete. Please load cpufreq.ko or 173 compile in "device cpufreq" to restore this functionality. 174 17520050220: 176 The responsibility of recomputing the file system summary of 177 a SoftUpdates-enabled dirty volume has been transferred to the 178 background fsck. A rebuild of fsck(8) utility is recommended 179 if you have updated the kernel. 180 181 To get the old behavior (recompute file system summary at mount 182 time), you can set vfs.ffs.compute_summary_at_mount=1 before 183 mounting the new volume. 184 18520050206: 186 The cpufreq import is complete. As part of this, the sysctls for 187 acpi(4) throttling have been removed. The power_profile script 188 has been updated, so you can use performance/economy_cpu_freq in 189 rc.conf(5) to set AC on/offline cpu frequencies. 190 19120050206: 192 NG_VERSION has been increased. Recompiling kernel (or ng_socket.ko) 193 requires recompiling libnetgraph and userland netgraph utilities. 194 19520050114: 196 Support for abbreviated forms of a number of ipfw options is 197 now deprecated. Warnings are printed to stderr indicating the 198 correct full form when a match occurs. Some abbreviations may 199 be supported at a later date based on user feedback. To be 200 considered for support, abbreviations must be in use prior to 201 this commit and unlikely to be confused with current key words. 202 20320041221: 204 By a popular demand, a lot of NOFOO options were renamed 205 to NO_FOO (see bsd.compat.mk for a full list). The old 206 spellings are still supported, but will cause annoying 207 warnings on stderr. Make sure you upgrade properly (see 208 the COMMON ITEMS: section later in this file). 209 21020041219: 211 Auto-loading of ancillary wlan modules such as wlan_wep has 212 been temporarily disabled; you need to statically configure 213 the modules you need into your kernel or explicitly load them 214 prior to use. Specifically, if you intend to use WEP encryption 215 with an 802.11 device load/configure wlan_wep; if you want to 216 use WPA with the ath driver load/configure wlan_tkip, wlan_ccmp, 217 and wlan_xauth as required. 218 21920041213: 220 The behaviour of ppp(8) has changed slightly. If lqr is enabled 221 (``enable lqr''), older versions would revert to LCP ECHO mode on 222 negotiation failure. Now, ``enable echo'' is required for this 223 behaviour. The ppp version number has been bumped to 3.4.2 to 224 reflect the change. 225 22620041201: 227 The wlan support has been updated to split the crypto support 228 into separate modules. For static WEP you must configure the 229 wlan_wep module in your system or build and install the module 230 in place where it can be loaded (the kernel will auto-load 231 the module when a wep key is configured). 232 23320041201: 234 The ath driver has been updated to split the tx rate control 235 algorithm into a separate module. You need to include either 236 ath_rate_onoe or ath_rate_amrr when configuring the kernel. 237 23820041116: 239 Support for systems with an 80386 CPU has been removed. Please 240 use FreeBSD 5.x or earlier on systems with an 80386. 241 24220041110: 243 We have had a hack which would mount the root filesystem 244 R/W if the device were named 'md*'. As part of the vnode 245 work I'm doing I have had to remove this hack. People 246 building systems which use preloaded MD root filesystems 247 may need to insert a "/sbin/mount -u -o rw /dev/md0 /" in 248 their /etc/rc scripts. 249 25020041104: 251 FreeBSD 5.3 shipped here. 252 25320041102: 254 The size of struct tcpcb has changed again due to the removal 255 of RFC1644 T/TCP. You have to recompile userland programs that 256 read kmem for tcp sockets directly (netstat, sockstat, etc.) 257 25820041022: 259 The size of struct tcpcb has changed. You have to recompile 260 userland programs that read kmem for tcp sockets directly 261 (netstat, sockstat, etc.) 262 26320041016: 264 RELENG_5 branched here. For older entries, please see updating 265 in the RELENG_5 branch. 266 267COMMON ITEMS: 268 269 General Notes 270 ------------- 271 Avoid using make -j when upgrading. From time to time in the 272 past there have been problems using -j with buildworld and/or 273 installworld. This is especially true when upgrading between 274 "distant" versions (eg one that cross a major release boundary 275 or several minor releases, or when several months have passed 276 on the -current branch). 277 278 Sometimes, obscure build problems are the result of environment 279 poisoning. This can happen because the make utility reads its 280 environment when searching for values for global variables. 281 To run your build attempts in an "environmental clean room", 282 prefix all make commands with 'env -i '. See the env(1) manual 283 page for more details. 284 285 When upgrading from one major version to another it is generally 286 best to upgrade to the latest code in the currently installed branch 287 first, then do an upgrade to the new branch. This is the best-tested 288 upgrade path, and has the highest probability of being successful. 289 Please try this approach before reporting problems with a major 290 version upgrade. 291 292 To build a kernel 293 ----------------- 294 If you are updating from a prior version of FreeBSD (even one just 295 a few days old), you should follow this procedure. It is the most 296 failsafe as it uses a /usr/obj tree with a fresh mini-buildworld, 297 298 make kernel-toolchain 299 make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=YOUR_KERNEL_HERE 300 make -DALWAYS_CHECK_MAKE installkernel KERNCONF=YOUR_KERNEL_HERE 301 302 To test a kernel once 303 --------------------- 304 If you just want to boot a kernel once (because you are not sure 305 if it works, or if you want to boot a known bad kernel to provide 306 debugging information) run 307 make installkernel KERNCONF=YOUR_KERNEL_HERE KODIR=/boot/testkernel 308 nextboot -k testkernel 309 310 To just build a kernel when you know that it won't mess you up 311 -------------------------------------------------------------- 312 This assumes you are already running a 5.X system. Replace 313 ${arch} with the architecture of your machine (e.g. "i386", 314 "alpha", "amd64", "ia64", "pc98", "sparc64", etc). 315 316 cd src/sys/${arch}/conf 317 config KERNEL_NAME_HERE 318 cd ../compile/KERNEL_NAME_HERE 319 make depend 320 make 321 make install 322 323 If this fails, go to the "To build a kernel" section. 324 325 To rebuild everything and install it on the current system. 326 ----------------------------------------------------------- 327 # Note: sometimes if you are running current you gotta do more than 328 # is listed here if you are upgrading from a really old current. 329 330 <make sure you have good level 0 dumps> 331 make buildworld 332 make kernel KERNCONF=YOUR_KERNEL_HERE 333 [1] 334 <reboot in single user> [3] 335 mergemaster -p [5] 336 make installworld 337 make delete-old 338 mergemaster [4] 339 <reboot> 340 341 342 To cross-install current onto a separate partition 343 -------------------------------------------------- 344 # In this approach we use a separate partition to hold 345 # current's root, 'usr', and 'var' directories. A partition 346 # holding "/", "/usr" and "/var" should be about 2GB in 347 # size. 348 349 <make sure you have good level 0 dumps> 350 <boot into -stable> 351 make buildworld 352 make buildkernel KERNCONF=YOUR_KERNEL_HERE 353 <maybe newfs current's root partition> 354 <mount current's root partition on directory ${CURRENT_ROOT}> 355 make installworld DESTDIR=${CURRENT_ROOT} 356 cd src/etc; make distribution DESTDIR=${CURRENT_ROOT} # if newfs'd 357 make installkernel KERNCONF=YOUR_KERNEL_HERE DESTDIR=${CURRENT_ROOT} 358 cp /etc/fstab ${CURRENT_ROOT}/etc/fstab # if newfs'd 359 <edit ${CURRENT_ROOT}/etc/fstab to mount "/" from the correct partition> 360 <reboot into current> 361 <do a "native" rebuild/install as described in the previous section> 362 <maybe install compatibility libraries from src/lib/compat> 363 <reboot> 364 365 366 To upgrade in-place from 5.x-stable to current 367 ---------------------------------------------- 368 <make sure you have good level 0 dumps> 369 make buildworld [9] 370 make kernel KERNCONF=YOUR_KERNEL_HERE [8] 371 [1] 372 <reboot in single user> [3] 373 mergemaster -p [5] 374 make installworld 375 make delete-old 376 mergemaster -i [4] 377 <reboot> 378 379 Make sure that you've read the UPDATING file to understand the 380 tweaks to various things you need. At this point in the life 381 cycle of current, things change often and you are on your own 382 to cope. The defaults can also change, so please read ALL of 383 the UPDATING entries. 384 385 Also, if you are tracking -current, you must be subscribed to 386 freebsd-current@freebsd.org. Make sure that before you update 387 your sources that you have read and understood all the recent 388 messages there. If in doubt, please track -stable which has 389 much fewer pitfalls. 390 391 [1] If you have third party modules, such as vmware, you 392 should disable them at this point so they don't crash your 393 system on reboot. 394 395 [3] From the bootblocks, boot -s, and then do 396 fsck -p 397 mount -u / 398 mount -a 399 cd src 400 adjkerntz -i # if CMOS is wall time 401 Also, when doing a major release upgrade, it is required that 402 you boot into single user mode to do the installworld. 403 404 [4] Note: This step is non-optional. Failure to do this step 405 can result in a significant reduction in the functionality of the 406 system. Attempting to do it by hand is not recommended and those 407 that pursue this avenue should read this file carefully, as well 408 as the archives of freebsd-current and freebsd-hackers mailing lists 409 for potential gotchas. 410 411 [5] Usually this step is a noop. However, from time to time 412 you may need to do this if you get unknown user in the following 413 step. It never hurts to do it all the time. You may need to 414 install a new mergemaster (cd src/usr.sbin/mergemaster && make 415 install) after the buildworld before this step if you last updated 416 from current before 20020224 or from -stable before 20020408. 417 418 [8] In order to have a kernel that can run the 4.x binaries 419 needed to do an installworld, you must include the COMPAT_FREEBSD4 420 option in your kernel. Failure to do so may leave you with a system 421 that is hard to boot to recover. A similar kernel option COMPAT_FREEBSD5 422 is required to run the 5.x binaries on more recent kernels. 423 424 Make sure that you merge any new devices from GENERIC since the 425 last time you updated your kernel config file. 426 427 [9] When checking out sources, you must include the -P flag to have 428 cvs prune empty directories. 429 430 If CPUTYPE is defined in your /etc/make.conf, make sure to use the 431 "?=" instead of the "=" assignment operator, so that buildworld can 432 override the CPUTYPE if it needs to. 433 434 MAKEOBJDIRPREFIX must be defined in an environment variable, and 435 not on the command line, or in /etc/make.conf. buildworld will 436 warn if it is improperly defined. 437FORMAT: 438 439This file contains a list, in reverse chronological order, of major 440breakages in tracking -current. Not all things will be listed here, 441and it only starts on October 16, 2004. Updating files can found in 442previous releases if your system is older than this. 443 444Copyright information: 445 446Copyright 1998-2005 M. Warner Losh. All Rights Reserved. 447 448Redistribution, publication, translation and use, with or without 449modification, in full or in part, in any form or format of this 450document are permitted without further permission from the author. 451 452THIS DOCUMENT IS PROVIDED BY WARNER LOSH ``AS IS'' AND ANY EXPRESS OR 453IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 454WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 455DISCLAIMED. IN NO EVENT SHALL WARNER LOSH BE LIABLE FOR ANY DIRECT, 456INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 457(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 458SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 459HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 460STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 461IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 462POSSIBILITY OF SUCH DAMAGE. 463 464If you find this document useful, and you want to, you may buy the 465author a beer. 466 467Contact Warner Losh if you have any questions about your use of 468this document. 469 470$FreeBSD$ 471