nutznboltz
June 23rd, 2004, 21:39
If I was going to sum up my experience it is that a source code upgrade from FreeBSD-4 to FreeBSD-5.2.1 has only minimal support for removing files that are in FreeBSD-4 but not FreeBSD-5. The part that does have any intelligence now is mergemaster but it only works on /etc and even that's incomplete. There are some instructions near the bottom of /usr/src/UPDATING (search on "in-place" to jump to them) but they aren't as complete as they could be about this issue. Mostly you should try to follow the instructions in UPDATING plus:

remove all of /usr/include just prior to "make installworld" (not sooner)

after "make installworld" clean up old binaries by looking at their modification timestamps and picking off the ones that didn't get re-written by the "make installworld." Find a program that sorts a directory by modification timestamps and deletes files safely. In /bin, /sbin, /libexec, /usr/bin, /usr/sbin, /usr/games sort the directories by modification time and remove the old files. Just using ls -lt and typing the rm commands is tedious and could induce painful typos. I used GNU emacs dired mode to do this.

also clean up old shared libraries but don't remove them, instead in single user mode move old .so.# (where # is a number) from /usr/lib to /usr/lib/compat and remove the old .a and .so (no digit) files. You will need to run "chflags noschg" on libc.so.4 and others in order for mv to work.

after booting the FreeBSD-5 kernel remove /kernel* and /modules* since they are now under /boot

remove /etc/pam.conf (transfer any custom contents to files under /etc/pam.d)

Also stick with the GENERIC kernel at first. Once you have GENERIC up you can fall back on it if a custom kernel flops.

The ports tree is a real mess because you want to recompile everything and "portupgrade -raf" just ralfed on me. You could try saving the output of "pkg_info" and running "pkg_delete -a" to remove all ports and then "cd /usr/X11R6; rm -r *" and remove files from under /usr/local. This is complicated if you have non-ports-tree software installed under /usr/local. Then reinstall ports from the list you saved. Make sure that you don't pkg_delete your account's shell--switch to a shell from the core OS temporarily first. Reinstall the portupgrade port first and use it to re-install the other ports.