[BACK]Return to upgrade45.html CVS log [TXT][DIR] Up to [local] / www / faq

File: [local] / www / faq / upgrade45.html (download) (as text)

Revision 1.35, Mon Mar 15 10:18:43 2021 UTC (3 years, 2 months ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.34: +2 -2 lines

spelling

<!doctype html>
<html lang=en id=faq>

<title>OpenBSD Upgrade Guide: 4.4 to 4.5</title>
<meta charset=utf-8>
<meta name="description"   content="OpenBSD Upgrade Process for 4.4 -> 4.5">
<meta name="viewport"      content="width=device-width, initial-scale=1">
<link rel="stylesheet"     type="text/css" href="../openbsd.css">
<link rel="canonical"      href="https://www.openbsd.org/faq/upgrade45.html">

<h2 id=OpenBSD>
<a href="../index.html">
<i>Open</i><b>BSD</b></a>
Upgrade Guide: 4.4 to 4.5
</h2>
<hr>
<p>
<a href="index.html">[FAQ Index]</a> |
<a href="upgrade44.html">[4.3 -> 4.4]</a> |
<a href="upgrade46.html">[4.5 -> 4.6]</a>

<p>

<i>Note: Upgrades are only supported from one release to the release
immediately following it.
Do not skip releases.</i>

<p><i>
It is highly recommended that you read through and fully understand
this process before attempting it.
If you are doing it on a critical or physically remote machine, it is
recommended that you test this process on an identical, local system to
verify its success before attempting on a critical or remote computer.
</i>

<p>
Upgrading is a convenient way to bring your OpenBSD system up to the most
recent version.
However, the results are not intended to precisely match the results of
a wipe-and-reload installation.
Old library files in particular are not removed in the upgrade process,
as they may be required by older applications that may or may not be
upgraded at this time.
If you REALLY wish to get rid of all these old files, you are probably
better off reinstalling from scratch.

<p>
Table of Contents:
<ul>
<li><a href="#before">Before upgrading</a>
  <ul>
  <li><a href="#newInstReboot">New install/reboot sequence</a>
  <li><a href="#newPerl">Upgrade to Perl 5.10</a>
  <li><a href="#ifconfig">ifconfig(8) options changes</a>
  <li><a href="#Xchanges">X changes</a>
  <li><a href="#mixerctl">mixerctl(1) name changes</a>
  <li><a href="#pfsync">pfsync version number change</a>
  <li><a href="#newsysmerge">New sysmerge tool</a>
  <li><a href="#rc.conf">rc.conf</a>
  <li><a href="#kern">Modified kernel</a>
  </ul>
<li><a href="#upgrade">The upgrade process</a>
<li><a href="#final">Final steps</a>
  <ul>
  <li><a href="#UsersGroups">New and changed Users and Groups</a>
  <li><a href="#etcUpgrade">Upgrading <code>/etc</code></a>
  <li><a href="#patchfile">Merging locally changed files via patch file</a>
  <li><a href="#sysmerge">Merging locally changed files via sysmerge(8)</a>
  <li><a href="#Kernchk">Checking the kernel</a>
  <li><a href="#Pkgup">Upgrading packages</a>
  </ul>
</ul>

<hr>
<p>
<h2 id="before">Before upgrading: things to think about and be aware of</h2>
This is <i>not</i> a complete list of the changes that took place
between 4.4 and 4.5, but rather some of the important things that will
impact a large number of users in the upgrade process.
For a more complete list of changes, see
<a href="../plus45.html">plus45.html</a> and the CVS change logs.

<ul>
<li id="newInstReboot"><b>New file install/reboot sequence (non-install kernel
process)</b><br>
Previous upgrade processes used a process of install kernel,
reboot, install userland.
For OpenBSD 4.5, we suggest a different process -- install
everything, THEN reboot.
This must be done very carefully, otherwise one could end up with a
system where the
<a href="https://man.openbsd.org/reboot.1">reboot(1)</a>
command is inoperable.
Understand and follow the directions below before doing your upgrade
remotely

<p>
<li id="newPerl"><b>Upgrade to Perl 5.10.0</b><br>
The new Perl 5.10.0 includes a number of modules that were packages in
the past.
You will need to remove these packages, we'll cover that with the other
package updates <a href="#Pkgup">below</a>.

<p>
<b id="ifconfig">Some
<a href="https://man.openbsd.org/ifconfig.8">ifconfig(8)</a>
options have changed.</b><br>
To scan for wireless networks, you should now use:
<blockquote><pre>
ifconfig <i>interface</i> scan
</pre></blockquote>

To list supported media types, you should now use:
<blockquote><pre>
ifconfig <i>interface</i> media
</pre></blockquote>

<p>
<li id="Xchanges"><b>X changes</b><br>
<code>RgbPath</code> is no longer a valid keyword in the <b>Files</b>
section of the
<a href="https://man.openbsd.org/xorg.conf.5">xorg.conf</a>
file, and should be removed from existing configuration files.

<p>
The i810(4) driver has been completely replaced by the
<a href="https://man.openbsd.org/intel.4">intel(4)</a>
driver, so your xorg.conf(5) file should be updated accordingly.

<p>
Several existing xserver modules and drivers have been depreciated.
To make sure <code>X -configure</code> doesn't try to configure the obsolete
modules, we'll have you remove the contents of <code>/usr/X11R6/lib/modules/</code>
before upgrading.

<p>
<li id="mixerctl"><b>mixerctl(1) name changes</b><br>
<a href="https://man.openbsd.org/mixerctl.1">mixerctl(1)</a>
item name <code>headphones</code> has been shorted to <code>hp</code> and
<code>speaker</code> was shortened to <code>spkr</code>.
You may need to update your
<a href="https://man.openbsd.org/mixerctl.5">mixerctl.conf(5)</a>
with the new names.

<p>
<li id="pfsync"><b>pfsync(4) version number incremented</b><br>
Due to protocol and implementation changes to the pfsync(4) interface,
the pfsync(4) protocol number has been incremented.
Firewalls with differing versions will be unable to synchronise state
tables, and existing connections will be terminated on failover.


<p>
<li id="newsysmerge"><b><a href="https://man.openbsd.org/sysmerge.8">sysmerge(8)</a>
utility:</b><br>
OpenBSD 4.5 includes the
<a href="https://man.openbsd.org/sysmerge.8">sysmerge(8)</a>
utility, which helps administrators update configuration files after
upgrading their system.
Sysmerge(8) compares the current files on your system with the files
that would have been installed with a new install, and gives you the
option of keeping the old file, installing the new file, or assisting
you in the manual merging of the old and new files, using
<a href="https://man.openbsd.org/sdiff.1">sdiff</a>.
For past upgrades, we've presented a list of files that are usually
copied over "as-is", and a list of files which should be changed, and a
patch file that applies those changes to what might be in those files on
your system.
For the 4.4 to 4.5 upgrade, instead of using the patch file, you may
opt to use sysmerge to make the changes, or you may wish to use the
patch file first, and then follow up with a sysmerge session to clean
up any loose ends.

<p>
<b>Who should use sysmerge(8):</b><br>
People running highly modified systems or systems that didn't start out
at the previous release (for example, a snapshot partway between
releases), who are upgrading to a snapshot or who have not carefully
upgraded their system in the past will find sysmerge vastly superior to
using the patches, as it works with what is actually on your system,
instead of what we expected was on your system.
It will also give you much greater control over your upgrade process,
and will involve you in it more closely.

<p>
<b>Who may wish to NOT use sysmerge(8):</b><br>
People who have a lot of machines to upgrade that were kept fairly
simple and at the previous release/stable point will probably find the
old patch file system much faster.

<p>
Note that while sysmerge can handle ALL the changes of <code>/etc</code>,
<code>/dev</code>, <code>/root</code> and <code>/var</code>, we highly recommend
that you do some steps manually before hand, as it will save time and
reduce the possibility of user error.
In particular, it is highly recommended that you do not use sysmerge to
update your user and group accounts, as it is very easy to chose the
wrong option leading to erasing your entire user base and setting the
root password to an empty value, preventing remote login to fix the
problem.

<p>
<li id="rc.conf"><b>rc.conf:</b><br>
It is assumed that
<code>/etc/rc.conf</code> is not a user-altered file.
If you have made changes to your <code>/etc/rc.conf</code> file, merge those
changes into <code>/etc/rc.conf.local</code>.
If you have NO <code>/etc/rc.conf.local</code>, simply copy your existing
<code>/etc/rc.conf</code> file to <code>/etc/rc.conf.local</code> and
<i>delete the last line of the script!</i>
Otherwise, pull your existing <code>rc.conf</code> into the top of your
existing <code>rc.conf.local</code> file <i>and remove the last line</i>
before doing the rest of this process.

<p>
<li id="kern"><b>Modified kernel:</b><br>
Check whether you have made any modifications to your kernel.
For example, you might have modified your network device to use a
non-default setting using config(8).
Note your changes, so you can repeat them for the new 4.5 kernel.

</ul>

<p>
<hr>
<h2 id="upgrade">The upgrade process</h2>

<h3>Upgrading by install kernel</h3>
If you have access to the system's console, the easiest and safest way
to upgrade is to boot from install media or
<a href="faq4.html#bsd.rd">bsd.rd</a> and follow the upgrade steps,
which are very similar to the <a href="faq4.html">install process</a>.

<p>
BEFORE upgrading, however, do the following if you have X installed:

<blockquote><pre>
<b>rm -rf /usr/X11R6/lib/modules/*</b>
</pre></blockquote>

Afterwards, complete the upgrade by following the <a href="#final">final
steps</a> as detailed below.

<p>
One easy way to boot from the install kernel is to place the 4.5 version
of <i>bsd.rd</i> in the root of your boot drive, then instruct the boot loader
to boot using this new <i>bsd.rd</i> file.
On amd64 and i386, you do this by entering "<code>boot bsd.rd</code>" at the
initial <code>boot&gt;</code> prompt.

<h3>Upgrading without install kernel</h3>
<i>This is NOT the recommended process.  Use the install kernel method
if at all possible!</i>

<p>
Sometimes, one needs to do an upgrade of a machine when one can't easily
use the normal upgrade process.
The most common case is when the machine is in a remote location and you
don't have easy access to the system console.
One can usually do this by carefully following this process:

<ul>
<li><b>Place install files in a "good" location</b>.
Make sure you have sufficient space!

<p>
<li><b>Stop any appropriate applications:</b>
During this process, all the userland applications will be replaced but
may not be runnable, and strange things may happen as a result.
If this is a concern to you, shut down any applications that may
be impacted.
There may be other applications which you wish to keep from running
immediately after the upgrade, stop and disable them as well.

<p>
<li><b>Check the kernel:</b>
Although <b>most people can skip this step</b>, if you had a modified kernel
in 4.4, it is likely you will need to modify the stock kernel of 4.5.
Especially when you are performing the upgrade process remotely, now is
the time to make sure the new kernel will work upon rebooting the machine.
If any changes must be made to the kernel, the safest thing to do is to
make those changes on a local 4.5 system.
This can be as simple as modifying a specific device using config(8),
or it can involve a recompilation if the option you need is not included
in the GENERIC kernel.
Please consult <a href="faq5.html">FAQ 5 - Building the system from source</a>
before deciding to recompile your kernel.

<p>
<li><b>Install new kernel(s)</b>
<blockquote><pre>
<b>export RELEASEPATH=</b><i>/usr/rel</i>   <i># where you put the files</i>
<b>cd ${RELEASEPATH}</b>
<b>rm /obsd ; ln /bsd /obsd && cp bsd /nbsd && mv /nbsd /bsd</b>
<b>cp bsd.rd bsd.mp /</b>
</pre></blockquote>

(if you are using the multiprocessor kernel, use<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>rm /obsd ;
ln /bsd /obsd && cp bsd.mp /nbsd && mv /nbsd /bsd</b></code><br>
instead)

<p>
Note the extra steps for copying over the primary kernel: those are done
to ensure that there is always a valid copy of the kernel on the disk
that the system can boot from should there be a really badly timed power
outage or system crash.

<p>
<li><b>Remove old X modules:</b>  These will be replaced with new
ones shortly:
<blockquote><pre>
<b>rm -rf /usr/X11R6/lib/modules/*</b>
</pre></blockquote>


<p>
<li><b>Save yourself a copy of the old reboot(1) command:</b>
You are still running the old kernel, it is possible the new reboot
command will not run on the old kernel.

<blockquote><pre>
<b>cp /sbin/reboot /sbin/oreboot</b>
</pre></blockquote>

<p>
<li><b>Install new userland applications.</b>
<i>Do NOT install <code>etc45.tgz</code> and <code>xetc45.tgz</code> now, because
that will overwrite your current configuration files!</i>
Note that we are installing base45.tgz LAST, because it will include a new
<a href="https://man.openbsd.org/tar.1">tar(1)</a>
utility, which may or may not run on the old kernel.
We reboot immediately, as the system is probably barely runnable now.

<blockquote><pre>
<b>tar -C / -xzphf xserv45.tgz</b>
<b>tar -C / -xzphf xfont45.tgz</b>
<b>tar -C / -xzphf xshare45.tgz</b>
<b>tar -C / -xzphf xbase45.tgz</b>
<b>tar -C / -xzphf game45.tgz</b>
<b>tar -C / -xzphf misc45.tgz</b>
<b>tar -C / -xzphf comp45.tgz</b>
<b>tar -C / -xzphf man45.tgz</b>
<b>tar -C / -xzphf base45.tgz</b> # Install last!
<b>/sbin/oreboot</b>
</pre></blockquote>

Not all file sets will need to be installed for all applications,
however if you installed a file set originally, you should certainly
upgrade it with the new file set now.

<p>
Again, the files in <code>/etc</code> are handled separately below, so
<code>etc45.tgz</code> and <code>xetc45.tgz</code> are NOT unpacked here.


<p>
<li><b>After reboot completes, upgrade <code>/dev</code>.</b>
The new
<a href="https://man.openbsd.org/OpenBSD-4.5/i386/MAKEDEV">MAKEDEV</a>
file was copied to /dev by the installation of
<code>base45.tgz</code>, so you simply need to do the following:
<blockquote><pre>
<b>cd /dev</b>
<b>./MAKEDEV all</b>
</pre></blockquote>

</ul>

<hr>
<h2 id="final">Final steps</h2>

Whether you upgrade by using an install kernel and doing a formal
"upgrade" process, or do a "in-place" binary upgrade, there are certain
manual steps that have to be performed.

<h3 id="UsersGroups">1. New Users and Groups</h3>
A new user is needed for
<a href="https://man.openbsd.org/bluetooth.4">Bluetooth</a>.
Create the users and groups using
<a href="https://man.openbsd.org/useradd.8">useradd(8)</a>
<blockquote><pre>
<b>useradd -u94 -g=uid -c"Bluetooth Daemon" -d/var/empty -s/sbin/nologin _btd</b>
</pre></blockquote>

<h3 id="etcUpgrade">2. Upgrading <code>/etc</code></h3>
<p>
You will want to extract the <code>etc45.tgz</code> files to a temporary
location:
<blockquote><pre>
<b>export RELEASEPATH=/usr/rel</b>
<b>tar -C /tmp -xzphf ${RELEASEPATH}/etc45.tgz</b>
</pre></blockquote>


Files that can probably be copied from <code>etc45.tgz</code> "as is":

<blockquote><pre>
netstart
rc
rc.conf
services
afs/CellServDB
mail/README
mail/submit.cf
mtree/4.4BSD.dist
mtree/special
/var/named/etc/root.hint
/var/named/etc/named*
</pre></blockquote>

Note that it IS possible to locally modify these files, if this has been
done, do NOT copy over those files, and use the
<a href="#sysmerge">sysmerge(8) process</a> instead.
<!-- Pay special attention to <code>mail/*</code> if you are using something
other than the default Sendmail(8) configuration. -->
Here are copy/paste lines for copying these files, assuming you unpacked
<code>etc45.tgz</code> in the above recommended place:

<blockquote><pre>
<b>cd /tmp/etc
cp netstart rc rc.conf services /etc
cp afs/CellServDB /etc/afs
cp mtree/* /etc/mtree
cp mail/README mail/submit.cf /etc/mail
cp ../var/named/etc/root.hint ../var/named/etc/named-*.conf /var/named/etc
cp ../var/named/etc/named.conf /var/named/etc/</b>  # IF no local changes!
</pre></blockquote>

<p>
<h3 id="patchfile">3a.  Merging locally changed files via a patch file</h3>

<p>
These files likely have local changes, but should be updated for
4.5.  IF you have not altered these files, you can copy over the
new version, otherwise the changes should be merged with your files:

<blockquote><pre>
/etc/changelist
/etc/ftpusers
/etc/ksh.kshrc
/etc/lynx.cfg
/etc/mail/aliases
/etc/mail/trusted-users
/etc/shells
/etc/ssh/ssh_config
</pre></blockquote>

The changes to these files are in <a href="upgrade45.patch">this
patch file</a>.
You can attempt to use this by executing the following as root:
<blockquote><pre>
<b>cd /</b>
<b>patch -C -p0 &lt; upgrade45.patch</b>
</pre></blockquote>

This will test the patch to see how well it will apply to YOUR system;
to actually apply it, leave off the "<code>-C</code>" option.
Note that it is likely that if you have customized files or not kept
them closely updated, or are upgrading from a snapshot of 4.4, they may
not accept the patch cleanly.
In those cases, you will need to manually apply the changes.
Please test this process before relying on it for a machine you can not
easily get to.

<p>
The following files have had changes which should be looked at, but it
is unlikely they should be directly copied or merged (i.e., if you are
using pf.conf, look at the suggested change of strategy, and decide if
it is appropriate for your use).

<blockquote><pre>
etc/dhcpd.conf
etc/ntpd.conf
etc/pf.conf
</pre></blockquote>

<p>

Finally, use
<a href="https://man.openbsd.org/newaliases.8">newaliases(8)</a>
to update the aliases database,
<a href="https://man.openbsd.org/mtree.8">mtree(8)</a>
create any new directories:

<blockquote><pre>
<b>newaliases</b>
<b>mtree -qdef /etc/mtree/4.4BSD.dist -p / -u</b>
</pre></blockquote>

<h3 id="sysmerge">3b. Merging locally changed files via sysmerge(8)</h3>

<p>
The new
<a href="https://man.openbsd.org/sysmerge.8">sysmerge(8)</a>
utility will compare the files that are actually on your system with
those that would be installed to a fresh install, and assist you in
merging the changes into your system.
Note that unlike the patch file, there are no assumptions made about
what is actually on your system, so you can use sysmerge(8) to move
between more arbitrary <a href="faq5.html#Flavors">points in the
development process</a>, such as from an earlier <i>-current</i> to
<i>4.5-release</i> or from one <i>-current</i> to a later one.

<p>
Please read the
<a href="https://man.openbsd.org/sysmerge.8">sysmerge(8)</a>
manual page before using it on your system.
You are also advised to read the
<a href="https://man.openbsd.org/diff.1">diff(1)</a>,
<a href="https://man.openbsd.org/sdiff.1">sdiff(1)</a>
and even review
<a href="https://man.openbsd.org/more.1">more(1)</a>
manual pages before continuing.

<p>
Assuming the <code>etc45.tgz</code> and <code>xetc45.tgz</code> files exists in
your $RELEASEPATH, run it with:

<blockquote><pre>
# <b>sudo sysmerge -as $RELEASEPATH/etc45.tgz -x $RELEASEPATH/xetc45.tgz</b>
</pre></blockquote>

Sysmerge(8) will show you a unified
<a href="https://man.openbsd.org/diff.1">diff(1)</a>,
run through your favorite $PAGER (i.e.,
<a href="https://man.openbsd.org/more.1">more(1)</a>)
and ask you, for most changed files, if you wish to:
<blockquote><pre>
  Use 'd' to delete the temporary ./var/www/htdocs/index.html
  Use 'i' to install the temporary ./var/www/htdocs/index.html
  Use 'm' to merge the temporary and installed versions
  Use 'v' to view the diff results again

  Default is to leave the temporary file to deal with by hand
</pre></blockquote>

<p>
If you wish to retain your existing file, delete the temporary file, if
you wish to replace your existing file with the new version, install the
temporary file.
If you wish to merge the two together, choosing 'm' will put you into
<a href="https://man.openbsd.org/sdiff.1">sdiff(1)</a>,
where you can manually merge the file.
The default is to come back and deal with the file later, manually.

<p>
While it can work, we do not recommend you use sysmerge to integrate new
users into the system, but rather use the useradd(8) line
<a href="#UsersGroups">above</a>.
We believe it is much less error prone.
(hint: do <i>not</i> <b>i</b>nstall the temporary master.passwd file
over your existing one!).

<p>
Sysmerge(8) saves all your replaced files into a temporary directory,
similar to <code>/var/tmp/sysmerge.24959/backups</code>, so if you accidentally
clobber something that was probably not such a good idea, you have a chance
to recover it. Note that
<a href="https://man.openbsd.org/daily.8">daily(8)</a>
cleans old files from this directory.

<h3 id="Kernchk">4. Checking the kernel</h3>
Note: <b>most people can skip this step!</b>
<p>
If you followed the instructions for the upgrade process without install
kernel, you have already completed this step.
However, if you used the install kernel, and if you had a modified kernel
in 4.4, it is likely you will need to modify the stock kernel of 4.5.
This can be as simple as modifying a specific device using config(8),
or it can involve a recompilation if the option you need is not included
in the GENERIC kernel.
Please consult <a href="faq5.html">FAQ 5 - Building the system from source</a>
before considering to recompile your kernel.

<h3 id="Pkgup">5. Upgrading packages</h3>
If you installed any packages on your system, you should upgrade them
after completing the upgrade of the base system.
Be aware, however, many packages will require further setup before
and/or after upgrading the package.
Check with the application's upgrade guide for details.

<p>
The following packages are known to have significant upgrade issues that
will impact a large number of users.
The fact that a package is not on this list doesn't mean it will have a
trivial upgrade.
You must do some homework on the applications YOU use.

<ul>
<li><b>subversion:</b> New features (e.g. merge-tracking) require the
repository to be upgraded manually by using the 'svnadmin upgrade'
command. See the
<a href="http://subversion.tigris.org/svn_1.5_releasenotes.html#repos-upgrades">release
notes</a>.

<li><b>kqemu:</b> Must be kept in sync with the kernel. pkg_delete prior
to the upgrade, then pkg_add the new package once the upgrade has been
completed.

</ul>

<p>
The package tools support in-place updating using <code>pkg_add -u</code>.
For instance, to update all your packages, make sure <code>PKG_PATH</code> is
pointing to the 4.5 packages directory on your CD or nearest FTP mirror,
and use something like

<blockquote><pre>
#<b> pkg_add -ui -F update -F updatedepends</b>
</pre></blockquote>

where the <code>-u</code> indicates update mode, and <code>-i</code> specifies
interactive mode, so pkg_add will prompt you for input when it encounters
some ambiguity. Read the
<a href="https://man.openbsd.org/OpenBSD-4.5/pkg_add">pkg_add(1)</a>
manual page and the <a href="faq15.html">package management</a>
chapter of the FAQ for more information.

<p>
A number of Perl modules which used to be separate packages are now
included with Perl 5.10.0 in the base system, so <b>after</b> updating
the other packages, their packages must now be removed.
In addition,
<a href="https://man.openbsd.org/xcompmgr.1">xcompmgr(1)</a>
is now part of xbase45.tgz, and no longer a package, so it must also
be removed.

<blockquote><pre>
<b>pkg_delete p5-Archive-Tar p5-Compress-Raw-Zlib p5-Compress-Zlib \
p5-IO-Compress-Base p5-IO-Compress-Zlib p5-IO-Zlib p5-Module-Build \
p5-Module-CoreList p5-Module-Load p5-version p5-Digest-SHA \
p5-Locale-Maketext-Simple p5-Pod-Escapes p5-Pod-Simple \
p5-ExtUtils-ParseXS p5-ExtUtils-CBuilder p5-Module-Pluggable \
p5-Time-Piece p5-Module-Loaded xcompmgr</b>
</pre></blockquote>

Note that if you copy and paste this command into your system, you will
probably get a lot of error messages from packages you don't have
installed.
That's ok.

<p>
<a href="index.html">[FAQ Index]</a> |
<a href="upgrade44.html">[4.3 -> 4.4]</a> |
<a href="upgrade46.html">[4.5 -> 4.6]</a>

<hr>
<small>$OpenBSD: upgrade45.html,v 1.35 2021/03/15 10:18:43 jsg Exp $</small>