Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Jan 2001 11:40:23 GMT
From:      fpassera@freesurf.fr
To:        freebsd-questions@FreeBSD.ORG
Subject:   An upgrade from FreeBSD-4.0-RELEASE to FreeBSD-4.2-RELEASE
Message-ID:  <20010105114024.12DF19B02@mail.freesurf.fr>

next in thread | raw e-mail | index | archive | help

Hello,

I have just finished my first upgrade on FreeBSD and wish to share this
experience as this is not a trivial task (from my point of view). The
procedure used comes from the Handbook but is not applied to upgrade to
-STABLE but to -RELEASE. The upgrade takes about 1,5 day : 1/2 day to
download the source, 1/2 day to compile the sources and 1/2 day to identify
and check manually which files must be overwritten / unmodified / merged. 
May be there is a faster way to upgrade from one RELEASE to another RELEASE
(download time appart).

Any comment would be appreciated.

Here are the steps :

Step 1) Upgrade the source
I used CVSup to get the source from Internet. As I did that for the 1st
time, I had to download all the files, which lasted about 5 hours on a
64kpbs link. I have never used CVSup client before and it is simple to
configure for a basic usage. I have appreciated the test mode.

My supfile is :

*default host=cvsup.de.FreeBSD.org
*default prefix=/usr
*default base=/usr/local/etc/cvsup
*default release=cvs delete use-rel-suffix compress
src-all tag=RELENG_4_2_0_RELEASE
doc-all tag=RELENG_4_2_0_RELEASE 

Step 2) Check /etc/make.conf

Step 3) Check /etc/group against /usr/src/etc/group
# diff /etc/group /usr/src/etc/group

Step 4) Drop to single user mode
# shutdown now

Step 5) Remove /usr/obj
#cd /usr/obj
#chflags -R noschg
#rm -rf *

Step 6) Recompile the source
This step lasted almost 3 hours.

# cd /usr/scr

# script /var/tmp/mw.out
# time make buildworld
real : 135m
user : 90m
sys : 38m
# exit

# script /var/tmp/mw2.out
# time make installworld
... install ...install
real: 11m20
user: 1m22
sys: 2m14
# exit

Ths script command records output in the specified file. This may be
useful.

Step 7) Update /etc (but actually I check from the /)
This is longest and hardest manual task I encountered during the upgrade.

You must upgrade your current /etc with the content of /usr/src/etc. The
problem is you must not simply overwritte the content of /etc. The complete
procedure id described in the handbook but the process is manual : you have
to check manually each file and decide what to do : overwrite, keep or
merge. Here are the steps (from the handbook) and my comments :

step a. backup /etc
# cp -Rp /etc ~/etc/old

step b. Build a dummy set of directories
# mkdir /var/tmp/root
# cd /usr/src/etc
# make DESTDIR=/var/tmp/root distrib-dirs distribution

The make lasts about 1 minute.

step c. Delete empty directories
# cd /var/tmp/root
# find -d . -type d | .... => see in the handbook the end of this long line

step d. Identify the differences between your current system and the new
one
# diff -r --brief / /var/tmp/root | wc -l
1359

1359 files are different from my current system ! As I cannot check
manually all of them, it was necessary to find what files are important. By
reading the diff, I have identified 3 categories of differences :
* the "Only in"
* the "differ"
* the "while"

# diff -r --brief / /var/tmp/root | grep "Only in" | wc -l
471
# diff -r --brief / /var/tmp/root | grep "differ" | wc -l
108
# diff -r --brief / /var/tmp/root | grep "while" | wc -l
780

471 + 108 + 780 = 1359. They are all here.

* the "while" (780)
From the content of the diff, you see that is concerns only devices.
MAKEDEV will recreate that latter so I forget them.

* the "Only in" (471)
The "Only in" files can be only in /etc (current system) or only in
/var/tmp/root/etc (new system). The files that are only in /etc do not harm
I guess. I let them. I will only consider the files only in the new system.

# diff -r --brief / /var/tmp/root | grep "Only in"  | grep "/var/tmp" | wc
-l
100

Among the 100 files, 93 are devices and 7 are various files. I do not
consider the 93 devices (MAKEDEV will recreate them latter). The 7 new
files are :
1. Only in /var/tmp/root/etc/defaults		: pccard.conf
2. Only in /var/tmp/root/etc/defaults		: periodic.conf
3. Only in /var/tmp/root/etc/mail			: aliases
4. Only in /var/tmp/root/etc/mtree			: BSD.x11-4.dist
5. Only in /var/tmp/root/etc/periodic/weelkly	: 400.status.pkg
6. Only in /var/tmp/root/etc/				: rc-firewall6
7. Only in /var/tmp/root/etc/ssl			: openssl.conf

# cp -p /var/tmp/root/etc/defaults/pccard.conf /etc/defaults
... repeated for the 6 remaining files

Then I checked I did not forgot anyone :

# diff -r --brief  / /var/tmp/root | grep "Only in" | grep "/var/tmp" |
grep -v "/var/tmp/root/dev"
=> no file.

* the "differ" (108)
The first thing I checked is how many "differ" files are in / and in /etc :
# diff -r --brief / /var/tmp/root | grep "differ" | wc -l
108
# diff -r --brief / /var/tmp/root | grep "differ" | grep "/etc" | wc -l
93

15 files (108 - 93) differ and are not in /etc. These files are :

1. /.cshrc
2. /dev/MAKEDEV
3. /root/.cshrc
4. /root/.login
5. /usr/share/man/whatis
6. /usr/share/perl/man/whatis
7. /var/db/locate.database
8. /var/log/cron
9 -> 14. others various log files in /var/log
15. /var/tmp/utmp

I have chosen to overwrite the file # 2, 5 and 6. I did not touch the
others.

# mv /dev/MAKEDEV /dev/MAKEDEV.old
# cp -p /var/tmp/root/dev/MAKEDEV /dev
and the same for share/man/whatis and perl/man/whatis.

Remains 93 "differ" files concerning /etc :
First I created a list :
# diff -r --brief / /var/tmp/root | grep "differ" | grep "/etc" | cat -b >
~/diffetc

To give an idea, here is the beginning and the end of the file :

#cat diffetc
1	Files /etc/aliases and /var/tmp/root/etc/aliases differ
2	Files /etc/crontab and /var/tmp/root/etc/crontab differ
3	Files /etc/csh.login and /var/tmp/root/etc/csh.login differ
4	Files /etc/defaults/make.conf and /var/tmp/root/etc/defaults/make.conf
differ
5	Files /etc/defaults/rc.conf and /var/tmp/root/etc/defaults/rc.conf differ
6	Files /etc/gettytab and /var/tmp/root/etc/gettytab differ
.
.
.
90	Files /etc/ssh/sshd_config and /var/tmp/root/etc/ssh/sshd_config differ
91	Files /etc/syslog.conf and /var/tmp/root/etc/syslog.conf differ
92	Files /etc/ttys and /var/tmp/root/etc/ttys differ
93	Files /etc/usbd.conf and /var/tmp/root/etc/usbd.conf differ
#

Then, for each file, I have checked the differences :
# diff /var/tmp/root/etc/crontab /etc/crontab

Usually, I overwrite the file :
# cp -p /var/tmp/root/etc/crontab /etc/crontab

I spent about 2 hours on this job.

Some important files that I have overwritten :
/etc/rc
/etc/rc.firewall
/etc/services

Here are the files that I did not modified :
1. /etc/group
2. /etc/hosts.equiv
3. /etc/master.passwd
4. /etc/motd
6. /etc/passwd
7. /etc/printcap
8. /etc/pwd.db (what is this file ???)
10. /etc/spwd.db (what is this file ???)
11. /etc/syslog.conf

Here are the files that I merged :
5. /etc/namedb/named.conf
9. /etc/shells

Then I check that no file where forgotten :

#diff -r --brief /etc /var/tmp/root/etc | grep "differ" | cat -b
List of the 11 files overwritten or merged
#

Step 8) Update /dev

# cp -p /var/tmp/root /dev/MAKEDEV /dev (but this should have already been
done in step 7)
# cd /dev
# ls -l | awk '{print $1, $2, $3, $4, $5, $6, $NF}' > ~/dev.out
# sh MAKEDEV all
This last about 30 secondes and nothing is printed.
# ls -l | awk '{print $1, $2, $3, $4, $5, $6, $NF}' > ~/dev2.out
# diff ~/dev2.out ~/dev.out
... a lot of things

I decided to focus on the most important devices :
# cat /etc/fstab
/dev/da0s1b	none	swap
/dev/da0s1a	/	ufs
/dev/cd0c	/cdrom
/proc
#

I have just checked that those devices were existing in /dev. They were.

Step 9) Compile and install new kernel
You must recompile your kernel before the reboot (see Handbook).

# cd /usr/src/sys/i386/conf
# /usr/sbin/config -g MYKERNEL
...
# cd ../../compile/MYKERNEL
# make depend
...
...
./aicasm: Stopped at file ../../aic7xxx/aic7xxx.seq line 81 - syntax error
#

That is very frustrating. From the newsgroup, I found 2 answers :

Answer #1 :
# cd /usr/src
# make includes

I did that and it changed nothing. This is not a surprise. I expect the
'make includes' has been done during the 'make buildworld' or the 'make
buildinstall'

Answer #2 :
# cd ../../compile
# rm *
# rm -rf .depend

Yes : this has solved the problem (thanks to Todd Backman 
http://www.freebsd.org/cgi/getmsg.cgi?fetch=9249021+9251943+/usr/local/www/db/text/1999/freebsd-questions/19990607.freebsd-questions)

Then the kernel was compiled without error :

# cd /usr/src/sys/i386/conf
# /usr/sbin/config -g MYKERNEL
...
# cd ../../compile/MYKERNEL
# make depend
...
about 2 minutes
# make
...
about 30 minutes
# make install
... a lot of things that are not printed usually

Step 10) Reboot and enjoy the new version

# shutdown -r now

And everything is working fine, except one device (ttyd4). I'll check that
latter. dmesg and all.log give nothing strange.

And just to be sure and to enjoy :
# uname -a
... 4.2-RELEASE #0 ..
# 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010105114024.12DF19B02>