freebsd-dev/UPDATING
2005-02-07 09:15:52 +00:00

347 lines
14 KiB
Plaintext

Updating Information for FreeBSD current users
This file is maintained and copyrighted by M. Warner Losh
<imp@village.org>. See end of file for further details. For commonly
done items, please see the COMMON ITEMS: section later in the file.
Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running
portupgrade. Important recent entries: 20040724 (default X changes).
NOTE TO PEOPLE WHO THINK THAT FreeBSD 6.x IS SLOW:
FreeBSD 6.x has many debugging features turned on, in
both the kernel and userland. These features attempt to detect
incorrect use of system primitives, and encourage loud failure
through extra sanity checking and fail stop semantics. They
also substantially impact system performance. If you want to
do performance measurement, benchmarking, and optimization,
you'll want to turn them off. This includes various WITNESS-
related kernel options, INVARIANTS, malloc debugging flags
in userland, and various verbose features in the kernel. Many
developers choose to disable these features on build machines
to maximize performance.
20050206:
The cpufreq import is complete. As part of this, the sysctls for
acpi(4) throttling have been removed. The power_profile(8) script
has been updated, so you can use performance/economy_cpu_freq in
rc.conf(5) to set AC on/offline cpu frequencies. The acpi
throttling support has been merged into acpi_perf(4).
20050206:
NG_VERSION has been increased. Recompiling kernel (or ng_socket.ko)
requires recompiling libnetgraph and userland netgraph utilities.
20050114:
Support for abbreviated forms of a number of ipfw options is
now deprecated. Warnings are printed to stderr indicating the
correct full form when a match occurs. Some abbreviations may
be supported at a later date based on user feedback. To be
considered for support, abbreviations must be in use prior to
this commit and unlikely to be confused with current key words.
20041221:
By a popular demand, a lot of NOFOO options were renamed
to NO_FOO (see bsd.compat.mk for a full list). The old
spellings are still supported, but will cause annoying
warnings on stderr. Make sure you upgrade properly (see
the COMMON ITEMS: section later in this file).
20041219:
Auto-loading of ancillary wlan modules such as wlan_wep has
been temporarily disabled; you need to statically configure
the modules you need into your kernel or explicitly load them
prior to use. Specifically, if you intend to use WEP encryption
with an 802.11 device load/configure wlan_wep; if you want to
use WPA with the ath driver load/configure wlan_tkip, wlan_ccmp,
and wlan_xauth as required.
20041213:
The behaviour of ppp(8) has changed slightly. If lqr is enabled
(``enable lqr''), older versions would revert to LCP ECHO mode on
negotiation failure. Now, ``enable echo'' is required for this
behaviour. The ppp version number has been bumped to 3.4.2 to
reflect the change.
20041201:
The wlan support has been updated to split the crypto support
into separate modules. For static WEP you must configure the
wlan_wep module in your system or build and install the module
in place where it can be loaded (the kernel will auto-load
the module when a wep key is configured).
20041201:
The ath driver has been updated to split the tx rate control
algorithm into a separate module. You need to include either
ath_rate_onoe or ath_rate_amrr when configuring the kernel.
20041116:
Support for systems with an 80386 CPU has been removed. Please
use FreeBSD 5.x or earlier on systems with an 80386.
20041110:
We have had a hack which would mount the root filesystem
R/W if the device were named 'md*'. As part of the vnode
work I'm doing I have had to remove this hack. People
building systems which use preloaded MD root filesystems
may need to insert a "/sbin/mount -u -o rw /dev/md0 /" in
their /etc/rc scripts.
20041104:
FreeBSD 5.3 shipped here.
20041102:
The size of struct tcpcb has changed again due to the removal
of RFC1644 T/TCP. You have to recompile userland programs that
read kmem for tcp sockets directly (netstat, sockstat, etc.)
20041022:
The size of struct tcpcb has changed. You have to recompile
userland programs that read kmem for tcp sockets directly
(netstat, sockstat, etc.)
20041016:
RELENG_5 branched here. For older entries, please see updating
in the RELENG_5 branch.
COMMON ITEMS:
# NOTE: 5.x below applies to 6.0-current as well, for the
# moment. 4.any -> 5.any upgrade support will remain in
# place for 6.0 current, but after 5.3 RELEASE, the 4.any ->
# 6.0-current upgrade path will require moving through 5.3
# RELEASE or newer.
General Notes
-------------
Avoid using make -j when upgrading. From time to time in the
past there have been problems using -j with buildworld and/or
installworld. This is especially true when upgrading between
"distant" versions (eg one that cross a major release boundary
or several minor releases, or when several months have passed
on the -current branch).
Sometimes, obscure build problems are the result of environment
poisoning. This can happen because the make utility reads its
environment when searching for values for global variables.
To run your build attempts in an "environmental clean room",
prefix all make commands with 'env -i '. See the env(1) manual
page for more details.
To build a kernel
-----------------
If you are updating from a prior version of FreeBSD (even one just
a few days old), you should follow this procedure. With a
/usr/obj tree with a fresh buildworld,
make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=YOUR_KERNEL_HERE
make -DALWAYS_CHECK_MAKE installkernel KERNCONF=YOUR_KERNEL_HERE
To just build a kernel when you know that it won't mess you up
--------------------------------------------------------------
This assumes you are already running a 5.X system. Replace
${arch} with the architecture of your machine (e.g. "i386",
"alpha", "amd64", "ia64", "pc98", "sparc64", etc).
cd src/sys/${arch}/conf
config KERNEL_NAME_HERE
cd ../compile/KERNEL_NAME_HERE
make depend
make
make install
If this fails, go to the "To build a kernel" section.
To rebuild everything and install it on the current system.
-----------------------------------------------------------
# Note: sometimes if you are running current you gotta do more than
# is listed here if you are upgrading from a really old current.
<make sure you have good level 0 dumps>
<maybe fix /etc/fstab> [7]
make buildworld
make kernel KERNCONF=YOUR_KERNEL_HERE
[1]
<reboot in single user> [3]
src/etc/rc.d/preseedrandom [10]
mergemaster -p [5]
make installworld
mergemaster [4]
<reboot>
To cross-install current onto a separate partition
--------------------------------------------------
# In this approach we use a separate partition to hold
# current's root, 'usr', and 'var' directories. A partition
# holding "/", "/usr" and "/var" should be about 2GB in
# size.
<make sure you have good level 0 dumps>
<boot into -stable>
make buildworld
<maybe newfs current's root partition>
<mount current's root partition on directory ${CURRENT_ROOT}>
make installworld DESTDIR=${CURRENT_ROOT}
make buildkernel KERNCONF=YOUR_KERNEL_HERE
cp src/sys/${ARCH}/conf/GENERIC.hints \
${CURRENT_ROOT}/boot/device.hints # as needed
make installkernel KERNCONF=YOUR_KERNEL_HERE DESTDIR=${CURRENT_ROOT}
cd src/etc; make distribution DESTDIR=${CURRENT_ROOT} # if newfs'd
cp /etc/fstab ${CURRENT_ROOT}/etc/fstab # if newfs'd
<edit ${CURRENT_ROOT}/etc/fstab to mount "/" from the correct partition>
<reboot into current>
<do a "native" rebuild/install as described in the previous section>
<maybe install compatibility libraries from src/lib/compat>
<reboot>
To upgrade in-place from 4.x-stable to current
----------------------------------------------
# 5.x uses more space than 4.x. Also, the location of kernel
# modules has changed. If you are installing 5.x onto a 4.x
# system, you'll need about 30MB of free disk space on your /
# partition. If you have less than this, you may encounter difficult
# to back out of problems with this procedure. If /tmp is on
# the / partition, you may want to completely remove all its content
# before upgrading, as this can be a common source of shortage of
# space on /.
<make sure you have good level 0 dumps>
<maybe fix /etc/fstab> [7]
make buildworld [9]
cp sys/${MACHINE}/conf/GENERIC.hints /boot/device.hints [2]
make kernel KERNCONF=YOUR_KERNEL_HERE [8]
cd sys/boot ; make STRIP="" install [6]
[1]
<reboot in single user> [3]
src/etc/rc.d/preseedrandom [10]
mergemaster -p [5]
rm -rf /usr/include/g++
make installworld
mergemaster -i [4]
<reboot>
Make sure that you've read the UPDATING file to understand the
tweaks to various things you need. At this point in the life
cycle of current, things change often and you are on your own
to cope. The defaults can also change, so please read ALL of
the UPDATING entries.
Also, if you are tracking -current, you must be subscribed to
freebsd-current@freebsd.org. Make sure that before you update
your sources that you have read and understood all the recent
messages there. If in doubt, please track -stable which has
much fewer pitfalls.
[1] If you have third party modules, such as vmware, you
should disable them at this point so they don't crash your
system on reboot.
[2] If you have legacy ISA devices, you may need to create
your own device.hints to reflect your unique hardware
configuration.
[3] From the bootblocks, boot -s, and then do
fsck -p
mount -u /
mount -a
cd src
adjkerntz -i # if CMOS is wall time
Also, when doing a major release upgrade, it is required that
you boot into single user mode to do the installworld.
For the 4.x -> 5.x upgrade, you will also see many messages about
needing to recompile your userland. These are harmless and can
be ignored while you proceed to the next step.
[4] Note: This step is non-optional. Failure to do this step
can result in a significant reduction in the functionality of the
system. Attempting to do it by hand is not recommended and those
that pursue this avenue should read this file carefully, as well
as the archives of freebsd-current and freebsd-hackers mailing lists
for potential gotchas.
[5] Usually this step is a noop. However, from time to time
you may need to do this if you get unknown user in the following
step. It never hurts to do it all the time. You may need to
install a new mergemaster (cd src/usr.sbin/mergemaster && make
install) after the buildworld before this step if you last updated
from current before 20020224 or from -stable before 20020408.
[6] 4.x boot loader can be used to boot a 5.x system, however
it is difficult to do that at best. If you wish to try, then
you should interrupt the boot and at the ok prompt type:
ok unload
ok boot /boot/kernel/kernel
If this fails to work, you must install a new boot loader as
described here.
[7] Before you upgrade, please make sure that you are not using
compatibility slices. These are device names of the form /dev/ad0a
without the actual slice name. These will break with 5.x and newer.
You generally must update these entries to use the post FreeBSD
2.x form of /dev/ad0s1a. i386 and pc98 are affected, while alpha
is not.
[8] In order to have a kernel that can run the 4.x binaries
needed to do an installworld, you must include the COMPAT_FREEBSD4
option in your kernel. Failure to do so may leave you with a system
that is hard to boot to recover.
Make sure that you merge any new devices from GENERIC since the
last time you updated your kernel config file.
[9] When checking out sources, you must include the -P flag to have
cvs prune empty directories.
If CPUTYPE is defined in your /etc/make.conf, make sure to use the
"?=" instead of the "=" assignment operator, so that buildworld can
override the CPUTYPE if it needs to.
MAKEOBJDIRPREFIX must be defined in an environment variable, and
not on the command line, or in /etc/make.conf. buildworld will
warn if it is improperly defined.
In case you would like to avoid installing new packages of everything,
you might want to uncomment the "COMPAT4X= YES" entry, so that 4.x
compatibility libraries are built which should allow you to continue
using your existing software for a while. Alternatively, you can
install the misc/compat4x port.
[10] In order to create temporary files, /dev/random must be
initialized by feeding data into it. src/etc/rc.d/preseedrandom
takes care of this.
FORMAT:
This file contains a list, in reverse chronological order, of major
breakages in tracking -current. Not all things will be listed here,
and it only starts on March 15, 2000. Updating files can found in
previous releases if your system is older than this.
Copyright information:
Copyright 1998-2004 M. Warner Losh. All Rights Reserved.
Redistribution, publication, translation and use, with or without
modification, in full or in part, in any form or format of this
document are permitted without further permission from the author.
THIS DOCUMENT IS PROVIDED BY WARNER LOSH ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL WARNER LOSH BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
If you find this document useful, and you want to, you may buy the
author a beer.
Contact Warner Losh if you have any questions about your use of
this document.
$FreeBSD$