Date: Sun, 1 Dec 2002 17:03:03 +0200 From: Ruslan Ermilov <ru@FreeBSD.org> To: current@FreeBSD.org, re@FreeBSD.org Cc: Warner Losh <imp@FreeBSD.org>, Doug Barton <dougb@FreeBSD.org>, Peter Wemm <peter@FreeBSD.org> Subject: [REPORT] Upgrade from 4.0-RELEASE to 5.0-CURRENT Message-ID: <20021201150303.GA6369@sunbay.com>
next in thread | raw e-mail | index | archive | help
--jho1yZJdad60DJr+ Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [ 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 = root@monster.cdrom.com:/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 <ecliptica.ww@virgin.net> for sending me one. The /etc/make.conf's contents was a mere NOPROFILE=3DYES. 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=3D-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=3Dsys/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=3Dsys/boot \ -DNO_SENDMAIL DISTDIR=3D 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, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p1 Content-Transfer-Encoding: quoted-printable Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =20 -PATH=3D /sbin:/bin:/usr/sbin:/usr/bin +MAKEOBJDIRPREFIX?=3D /usr/obj +MAKEPATH=3D ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE_ARCH} +PATH=3D ${MAKEPATH}:/sbin:/bin:/usr/sbin:/usr/bin MAKE=3D PATH=3D${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1 =20 # @@ -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=3D${PATH} make 2>/dev/null) || \ (cd ${.CURDIR} && make make) =20 # # Upgrade the installed make to the current version using the installed # headers, libraries and tools. # +MMAKEENV=3D MAKEOBJDIRPREFIX=3D${MAKEPATH} \ + DESTDIR=3D \ + INSTALL=3D"sh ${.CURDIR}/tools/install.sh" +MMAKE=3D ${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=3D${MAKEPATH} BINDIR=3D =20 # # Define the upgrade targets. These are listed here in alphabetical --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p2 Content-Transfer-Encoding: quoted-printable Index: Makefile.inc1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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=3D${INSTKERNNAME} ${.TARGET:S/kernel$//} + ${CROSSENV} PATH=3D${TMPPATH} \ + ${MAKE} KERNEL=3D${INSTKERNNAME} ${.TARGET:S/kernel$//} =20 # # update --OgqxwSJOaUobr8KG-- --jho1yZJdad60DJr+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE96iSnUkv4P6juNwoRAvKpAKCHk32N8nKtAtSRhzdaOg7AdiAoFwCbBYc4 uj1kRH1MmEuoP6SDUwRVMXQ= =SMly -----END PGP SIGNATURE----- --jho1yZJdad60DJr+-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021201150303.GA6369>