From owner-freebsd-questions@freebsd.org Fri May 1 08:42:10 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98E0E2CEA1C for ; Fri, 1 May 2020 08:42:10 +0000 (UTC) (envelope-from bennett@sdf.org) Received: from mx.sdf.org (mx.sdf.org [205.166.94.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.sdf.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49D5N06wwSz4DyZ for ; Fri, 1 May 2020 08:42:08 +0000 (UTC) (envelope-from bennett@sdf.org) Received: from sdf.org (IDENT:bennett@miku.sdf.org [205.166.94.6]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 0418g6F6017462 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 1 May 2020 08:42:06 GMT Received: (from bennett@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 0418g6is012936; Fri, 1 May 2020 03:42:06 -0500 (CDT) From: Scott Bennett Message-Id: <202005010842.0418g6is012936@sdf.org> Date: Fri, 01 May 2020 03:42:06 -0500 To: bob@immure.com Subject: Re: Updating from 11.3-stable to 12.1-stable? Cc: freebsd-questions@freebsd.org References: <202004301346.03UDkr12006318@sdf.org> <20200430145227.GD1510@rancor.immure.com> In-Reply-To: <20200430145227.GD1510@rancor.immure.com> User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49D5N06wwSz4DyZ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bennett@sdf.org designates 205.166.94.20 as permitted sender) smtp.mailfrom=bennett@sdf.org X-Spamd-Result: default: False [-1.49 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.988,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.98)[-0.982,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[sdf.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[20.94.166.205.list.dnswl.org : 127.0.10.0]; IP_SCORE(-0.22)[ip: (-0.69), ipnet: 205.166.94.0/24(-0.35), asn: 14361(-0.01), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:14361, ipnet:205.166.94.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 May 2020 08:42:10 -0000 Bob Willcox wrote: > On Thu, Apr 30, 2020 at 08:46:52AM -0500, Scott Bennett wrote: > > On Wed, 29 Apr 2020 16:27:54 -0500 Bob Willcox wrote: > > > > > > Well, here are the steps that I took to upgrade my 11.3-STABLE system to > > > 12.1-STABLE. May not be the best/most efficient but they worked for me > > > and I thought someone else may benefit from them. > > > > > > 1) Make a backup of the current system > > > 2) Delete everything in /usr/src, making certin to remove the files and directories > > > that start with a dot ("."). > > > 3) Delete everything in /usr/obj. > > > 4) Download (via svn) the new FreeBSD release /usr/src to be updated to. > > > 5) Build the new world from the source. > > > 6) Build the new kernel from the source. > > > 7) Run "mergemaster -Fp" to update files that may be needing update prior to > > > doing the installworld. > > > 8) Run "make installworld" in /usr/src. > > > 9) Run "make installkernel" in /usr/src. > > > 10) Run "mergemaster -iU" do update any remaining files that need to be updated. > > > 11) Reboot the system. > > > 12) Run "pkg update" to update the pkg database to the new system's level. > > > 13) Run "pkg upgrade" to update all packages to reflect the new system's level. > > > 14) Reboot the system. > > > > > If you did things as you state and it worked, you got lucky. Your step 7) has > > to be run in /usr/src, just like 8) and 9) and 10). 8) and 9) appear above in > > reversed order. Also, you omitted 8.5). Steps 8) through 9) should have been: > > Yes, step was run from /usr/src. I just failed to point that out. I was still in > that directory after the builds completed. > > As for the order of installworld and installkernel. I used to run them in the > order you suggest but found that, as I recall, doing the installkernel first > didn't always work when I had the nvidia driver specified in my /etc/src.conf > file. The details are a bit hazy now, but by installing world first the nvidia > driver was successfully built from ports during the installkernel step. > When upgrading to a newer kernel, the official recommendation is not to load the nvidia-driver port and use either the console/vt mode until you complete the OS upgrade. After that is done and working, then rebuild the driver with the newer source tree. Alternatively, you could simply comment out the kldlist information in /etc/rc.conf or /etc/rc.conf.local and then uncomment it once the new kernel (and world, if installed) is working and the port has been rebuilt and installed. N.B. that some folks put PORTS_MODULES=graphics/nvidia-driver into /etc/src.conf, which is a convenient way to have your drivers rebuilt using a newer source tree and automatically installed by make installkernel when you are only rebuilding your kernel, but this method fails if you have your root on ZFS and use boot environments to install your upgrades. It does even worse in a few cases where you have built your new kernel using a newer source tree than the kernel you are trying to replace because it is possibly incompatible enough with the current kernel that it either a) won't load at boot time, which is safe, or b) will load, but cause a kernel panic. If the newer kernel doesn't actually work, then you will have an incompatible driver installed. In any of these cases, all is not lost, but you will need to tell the boot loader to unload the driver before proceeding to load whichever kernel you are trying at this point to use. If you really feel you must use X11 earlier, then let it autoconfigure to modesetting until the above has been completed successfully. When doing system administration tasks, do them as simply and methodically as possible. Step by careful step should be the rule. Your power as root to devastate your system *unintentionally* is essentially unlimited. The ABIs/APIs for FreeBSD can, and often do, change from one major release to the next. If you install the new world before you have a kernel running that can support the ABI/API for which the new world is built, you may well find that your commands, conceivably even your shells, no longer work. Even the shutdown command might not work, leaving deliberately crashing the system, which carries its own risks, and using an alternate boot device to restore from your backups. Even if some commands still work, others may well not. (Yes, this is the voice of experience here. Sigh.) In any case, in such a situation the only safe way out is still restoring from backups. OTOH, if you follow the officially stated procedure, including the reboot following installing the new kernel, if that new kernel doesn't work, it is easy to back down, find and fix whatever went wrong, and try again. The GENERIC kernels have compatibility options in their configuration files that build in the API interpreters for earlier releases. When the corresponding misc/compat*x ports have been installed, most userland programs installed under earlier releases will still work, but should be rebuilt (or reinstalled from packages for the new release) when you have time. Note that userland programs built under earlier releases are *not guaranteed* to work, although they usually do. > > > > 8) Run "make installkernel" in /usr/src. > > 8.5) Reboot. IFF this new kernel comes up correctly, then proceed to step 9). > > 9) Run "make installworld" in /usr/src. > > > > Not doing it like this runs a grave risk of needing to restore the system from > > backups to make it usable again. The last time I looked at it, the Handbook > > laid this procedure out clearly. > > Well, as I have said, perhaps I've been incredibly lucky for these past 20+ > years that I've been doing it this way as I have had no such incidents. I don't You may not get bitten often, but the probability is that you will eventually be chewed on badly if you do things in an unsafe manner long enough. > doubt that there are risks, just updating a system carries some pretty significant > risks. > > Guess I sorry I said anything about this...didn't mean to get people riled up. > AFAIK, nobody here on the list was. Your posting your procedure allowed others to fill in the gaps in your understanding and possibly do the same for other users reading the list or looking in the list archives. This has been a recurring issue on this and other lists for many years. There is so much information in the various pieces of documentation--FreeBSD is a *big* set of software--that nobody can be expected to read and notice every detail before they start using the system. Best of luck. I still don't know how I'm going to get from stable/11 to stable/12, given that stable/12 fails to build on my stable/11 system. :-( Scott Bennett, Comm. ASMELG, CFIAG ********************************************************************** * Internet: bennett at sdf.org *xor* bennett at freeshell.org * *--------------------------------------------------------------------* * "A well regulated and disciplined militia, is at all times a good * * objection to the introduction of that bane of all free governments * * -- a standing army." * * -- Gov. John Hancock, New York Journal, 28 January 1790 * **********************************************************************