[ current@ Cc:'ed because it'll be useful to a number of upgraders. dougb@ Cc:'ed to be aware of possible mergemaster(8) problems. imp@ Cc:'ed to be aware of incorrect UPDATING instruction. peter@ Cc:'ed to LOL about foot-shooting with anti-foot-shooting. re@ Cc:'ed to consider approving the attached patches. ]
Hi! Following is the report from my attempt to upgrade 4.0-RELEASE system to 5.0-CURRENT. First, I'd like to say that I succedded in it: FreeBSD 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Mon Mar 20 22:50:22 GMT 2000 [EMAIL PROTECTED]:/usr/src/sys/compile/GENERIC i386 FreeBSD 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Sun Dec 1 13:52:37 GMT 2002 ru@:/usr/obj/ru/mnt/usr/src/sys/GENERIC i386 4.0-RELEASE system was installed on a spare disk by newfs'ing the `a' partition and extracting the `bin' distribution on top of it from the 4.0-RELEASE 1st CD, thanks again to Charlie Brewster <[EMAIL PROTECTED]> for sending me one. The /etc/make.conf's contents was a mere NOPROFILE=YES. Buildworld was attempted under a non-root account. The installed make(1) did not pass the regression tests, and this required a patch to src/Makefile (attach #1) to survive; the patch allows one to build and use the new make(1) under non-root, without the need to overwrite /usr/bin/make. (This patch, with Warner's suggestion incorporated, is currently considered by re@ for approval.) Other than that, both buildworld and buildkernel of the GENERIC kernel went just fine. The next step was to install the new kernel and modules, as outlined in UPDATING. As a prerequisite step (following the instructions from UPDATING) I've created the /boot/device.hints file, and attempted to installkernel. This failed with ``You must activate /boot/device.hints in loader.conf.'' from kern.post.mk because 4.0 does not have /boot/defaults/loader.conf. (Rather than creating it by hands, I took another approach, see below.) As was documented in rev. 1.219 of UPDATING, after installing a kernel (which I did not yet succeded in), it is highly recommended to install new loader(8), and generally, upgrade /boot. WARNING! The relevant instruction from UPDATING, cd src/sys/boot ; make install will NOT work as is on most of old systems -- if run as is, make(1) will use stuff from /usr/share/mk which may be incompatible with sys/boot/ makefiles. Adding the -m `pwd`/../../share/mk did not help either because now make(1) was attempting to run 4.0's install(1) which does not understand the new -b option (INSTALLFLAGS=-b in sys/boot/i386/loader/Makefile), in particular. Another problem with 4.0 install(1) is that it removes source files by default, while new versions of install(1) (4.3-STABLE and onwards) copy it by default, so if you attempted to run it as is, it will wipe out some already built stuff from /usr/obj, making the next installworld attempt to fail. To overcome this, I needed to use the installworld environment [with an up-to-date src/share/mk/ and install(1)] to install sys/boot/. Fortunately, we have the SUBDIR_OVERRIDE knob in Makefile.inc1 that was helpful here. So, my next attempt was to run, from src/, the following command: make installworld SUBDIR_OVERRIDE=sys/boot This would upgrade /boot, and (as part of the upgrade) install /boot/defaults/loader.conf that is needed for installkernel to proceed (see above). Unfortunately, this has failed to pass the `installcheck' anti-foot-shooting check from Makefile.inc1, which installworld depends on: 1. smmsp user was missing from /etc/passwd and /etc/group 2. installed 4.0 kernel did not have the sigaction(2) syscall I've attempted to overcome 1) as suggested by UPDATING, by running the ``mergemaster -p'' (from src/usr.sbin/mergemaster/). This did not work well because mergemaster(8) attempted to use stat(1) which is not present in 4.0. OK, it was trivial (in my case) to update /etc/master.passwd and /etc/group by hands and run ``pwd_mkdb -p /etc/master.passwd'' afterwards. I couldn't overcome 2) for obvious reason -- I was in the middle of attempting to install a new kernel! Isn't this itself a sort of foot-shooting? :-) The solution was to make the `installcheck' a no-op by: make installworld SUBDIR_OVERRIDE=sys/boot \ -DNO_SENDMAIL DISTDIR= After this, ``make installkernel'' succeeded, but I noticed another glitch. installkernel, as coded in Makefile.inc1, uses user's PATH and hence /usr/bin/install (4.0 version) that deletes source files by default. So, if you attempt to installkernel for the second time, it will fail. The tiny patch to fix this is in attach #2. After rebooting with the new kernel in single user mode, ``make installworld'' went fine and finally, I've merged the rest of etc/ and just proceeded into multi-user mode by pressing ^D. Thanks for listening so far! :-) re@'s (or anyone else with re@'s permission), feel free to commit these patches if you see any profit here, as I won't be able to in the next 17 hours. Cheers, -- Ruslan Ermilov Sysadmin and DBA, [EMAIL PROTECTED] Sunbay Software AG, [EMAIL PROTECTED] FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age
Index: Makefile =================================================================== RCS file: /home/ncvs/src/Makefile,v retrieving revision 1.269 diff -u -r1.269 Makefile --- Makefile 28 Nov 2002 13:08:09 -0000 1.269 +++ Makefile 1 Dec 2002 14:34:37 -0000 @@ -102,7 +102,9 @@ .ORDER: buildkernel installkernel .ORDER: buildkernel reinstallkernel -PATH= /sbin:/bin:/usr/sbin:/usr/bin +MAKEOBJDIRPREFIX?= /usr/obj +MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE_ARCH} +PATH= ${MAKEPATH}:/sbin:/bin:/usr/sbin:/usr/bin MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1 # @@ -159,21 +161,32 @@ # for building the world. # upgrade_checks: - @(cd ${.CURDIR}/tools/regression/usr.bin/make && make 2>/dev/null) || \ + @(cd ${.CURDIR}/tools/regression/usr.bin/make && \ + PATH=${PATH} make 2>/dev/null) || \ (cd ${.CURDIR} && make make) # # Upgrade the installed make to the current version using the installed # headers, libraries and tools. # +MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \ + DESTDIR= \ + INSTALL="sh ${.CURDIR}/tools/install.sh" +MMAKE= ${MMAKEENV} make \ + -D_UPGRADING \ + -DNOMAN -DNOSHARED \ + -DNO_CPU_CFLAGS -DNO_WERROR + make: @echo @echo "--------------------------------------------------------------" @echo " Upgrading the installed make" @echo "--------------------------------------------------------------" @cd ${.CURDIR}/usr.bin/make; \ - make obj && make -D_UPGRADING depend && \ - make -D_UPGRADING all && make install + ${MMAKE} obj && \ + ${MMAKE} depend && \ + ${MMAKE} all && \ + ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= # # Define the upgrade targets. These are listed here in alphabetical
Index: Makefile.inc1 =================================================================== RCS file: /home/ncvs/src/Makefile.inc1,v retrieving revision 1.312 diff -u -r1.312 Makefile.inc1 --- Makefile.inc1 14 Nov 2002 19:24:50 -0000 1.312 +++ Makefile.inc1 1 Dec 2002 14:34:40 -0000 @@ -521,7 +521,8 @@ # installkernel reinstallkernel: cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ - ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//} + ${CROSSENV} PATH=${TMPPATH} \ + ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//} # # update
msg47875/pgp00000.pgp
Description: PGP signature