Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Oct 2003 20:31:41 +0200
From:      Alexander Portnoy <my-subs@mail.ru>
To:        freebsd-stable@freebsd.org
Subject:   Re: upgrading 4.0 to stable
Message-ID:  <20031005203141.0db8f2ca.my-subs@mail.ru>
In-Reply-To: <3F7F4AC9.8030701@ixswr.org>
References:  <3F7F4AC9.8030701@ixswr.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 04 Oct 2003 18:33:45 -0400
Kristen Doyle <colk@ixswr.org> wrote:

> I have done one from 4.5 to stable the easiet way is to use screen if 
> you dont have a stable connection
> in this order (make sure nothing else is running ie shutdown services 
> except sshd ) and append the KERNCONF=blah
> make buildworld
> make buildkernel
> make installworld
> make installkernel
> mergemaster -p
> reboot
> cross your fingers and hope:)
> Ive had it fail only once
> 

'make installkernel && reboot' must be done _BEFORE_ 'make installworld'.
If the new kernel is not able to boot - You can revert to the _OLD_ kernel and the _OLD_ world
before 'make installworld' was done.

'mergemaster -p' intended for use _BEFORE_ 'make installworld'.
>From mergemaster(8):

    -p          Pre-buildworld mode.  Compares only files known to be essen-
                 tial to the success of {build|install}world, including
                 /etc/make.conf.

You may need to install mergemaster before this will work. This can be done with:
cd /usr/src/usr.sbin/mergemaster; make -m /usr/src/share/mk all install


According to /usr/src/UPDATING:
---------------------------------------------------------------------------------------------

        To update from 4.0-RELEASE or later to the most current
        4.x-STABLE
        ----------
        make buildworld
        make buildkernel KERNCONF=YOUR_KERNEL_HERE
        make installkernel KERNCONF=YOUR_KERNEL_HERE
        reboot  (in single user) [1]
	mergemaster -p
        make installworld
        mergemaster             [2]
        reboot

        [1] You can often get away without doing this step as the
        system will be properly updated.  During the running of the
        installworld, however, system components may break and other
        oddities may happen.  Don't do this on systems that aren't
        otherwise quiet as unpredictable results may happen.  If in
        doubt, reboot into single user.  For remote installs, keep
        a separate kernel around and use a serial console if at all
        possible.  See also note [6].
        [2] If you do not run mergemaster, you will likely hit a
        number of show stopper problems.  The biggest one is that
        your /etc/pam.conf won't let you log in using ssh.
        [6] From the bootblocks, boot -s, and then do
                fsck -p
                mount -u /
                mount -a
                cd /usr/src
                adjkerntz -i            # if CMOS is wall time
---------------------------------------------------------------------------------------------

Of course, You can not perform any commands in single-user mode.
So, You need at least be shure, that the new kernel will boot successfully
before You will install the world. If it fails to boot - You stay with the old
but non-broken system and can try again. The problem is to revert to the previous
kernel if the new one fails to boot. You can try to use the command 'nextboot'.
Another way is to patch the loader. Gordon Tetlow <gordont@gnf.org> did it for FreeBSD-5.x
in 2002. If You familiar with Forth, You can adopt his patch to the loader of FreeBSD-4.x. Read about the patch here:
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=415425+0+archive/2002/freebsd-hackers/20020512.freebsd-hackers

Don't forget to include to kernel config the option relevant to compatibility with older versions of FreeBSD-4.x
(options COMPAT_43) because the new kernel must be able to run the sshd daemon, that compiled with FreeBSD-4.0.
(COMPAT4X=yes in /etc/make.conf will not harm too). Check the option PANIC_REBOOT_WAIT_TIME - it must not be (-1).
But this will not help You if the kernel will hang and not panic 8-(

Be careful with the firewall.

Before You will reboot to the new kernel, disable all daemons running on the box excluding sshd
(in /etc/rc.conf and /usr/local/rc.d/*). Disable logins for everybody excluding root.

Test all this steps at some local available box with same configuration (FreeBSD-4.0, sshd, ... ) and document the 
sequence of your actons step by step.


As always, You must do a full backup before performing so dangerous changes.

I hope this will help You.
Good Luck!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031005203141.0db8f2ca.my-subs>