Re: src upgrade locally vs nfs from RELENG_12 to RELENG_13

From: Marek Zarychta <>
Date: Mon, 12 Feb 2024 22:11:07 UTC
W dniu 12.02.2024 o 22:04, mike tancsa pisze:

> Hi All,
> Starting to plan to upgrade a few remaining RELENG_12 servers to 13.  
> Was hoping I could just do an nfs mount of /usr/src and /usr/obj of a 
> 13 build server, but it does not seem to work when going from 
> RELENG_12 to RELENG_13.
> root@proxytest:/usr/src # make installkernel
> --------------------------------------------------------------
> >>> Install check kernel
> --------------------------------------------------------------
> --------------------------------------------------------------
> >>> Installing kernel GENERIC on Mon Feb 12 20:58:06 UTC 2024
> --------------------------------------------------------------
> cd /usr/obj/usr/src/amd64.amd64/sys/GENERIC;  MACHINE_ARCH=amd64 
> MACHINE=amd64  CPUTYPE= CC="cc -target x86_64-unknown-freebsd13.3 
> --sysroot=/usr/obj/usr/src/amd64.amd64/tmp 
> -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin" CXX="c++  -target 
> x86_64-unknown-freebsd13.3 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp 
> -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin"  CPP="cpp -target 
> x86_64-unknown-freebsd13.3 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp 
> -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin"  AS="as" AR="ar" 
> ELFCTL="elfctl" LD="ld"  LLVM_LINK="" NM=nm OBJCOPY="objcopy" 
> RANLIB=ranlib STRINGS=  SIZE="size" STRIPBIN="strip" 
> PATH=/usr/obj/usr/src/amd64.amd64/tmp/bin:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin 
> make  KERNEL=kernel install
> /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: 
> Undefined symbol "regcomp@FBSD_1.6"
> *** Error code 1
> Stop.
> make[1]: stopped in /usr/src
> *** Error code 1
> root@proxytest:/usr/src #
> But if I clone the releng13 source locally and then do a make 
> buildworld/buildkernel, doing a make installkernel works.  Is there a 
> way to get it to work over nfs ? What do I need to build on the 
> buildserver so I dont have to build locally each time on the RELENG_12 
> boxes I want to upgrade ?
>     ---Mike
Dear Mike and ,

This tutorial is completely inconsistent with the handbook, violating 
all the good upgrade practices,  designated for quick major version 
upgrades, but only for systems where you have / on ZFS and boot 
environments working. If it's fulfilled, you can do a major version 
upgrade in an expedited way easily as described below step by step:

1. Create a new BE on the target system and mount new BE under /mnt

2. Mount /usr/{src,obj} read only over NFS

3. On the build server hide toolchain (cd /usr/obj/usr/src/amd64.amd64/ 
&& mv  tmp tmp.hidden)

4. Install kernel and world into DESTDIR=/mnt, sometimes make -i 
installworld could help

5. Unmount /usr/obj and update /mnt/etc (mergemaster, etcupdate), if 
something fails you have figure out how to update /mnt/etc or eventually 
skip this step if failure is not critical.

6. Activate temporary only new BE

7. Reboot into new BE

8. Expose the hidden toolchain directory on the builder again

9. If there were any errors during phase 4 or 5, especially when make -i 
installword was used, repeat 4 and 5.

10. Upgrade packages

11. Delete old files and libraries (make delete...)

12. Update boot loader

13. Activate new BE (make it default BE)

14. Reboot into new BE

15. Evaluate the new version for some time and if you are satisfied 
upgrade jails, upgrade zpool, and optionally delete the old BE

The tutorial from the above is only for people who want to save 
resources like energy, time and CPU cycles but it's definitely _not_ 
_recommended_ to follow it.


Marek Zarychta