Looking for instructions to upgrade from source/base.txz on non-build machine

I have two servers, call them MAXI and MINI.

I used MAXI to compile a custom base.txz of 13.1-RELEASE, which I installed on MINI. I chose this procedure because MINI (and old laptop) is not fit to compile FreeBSD itself, but I wanted it to run my custom build.

Now I'm wondering how to upgrade MINI to 13.2-RELEASE without a clean reinstall. Could I build a custom base.txz of 13.2-RELEASE on MAXI, transfer it to MINI and somehow use it to upgrade the running system?

Alternatively, I seem to remember that there's another, harder way to do it: by running my own freebsd-update server to serve my custom build (instead of the stock build). I would then use the freebsd-update script on MINI to connect to it and upgrade from my custom 13.1 to my custom 13.2. Are there instructions out there on how to achieve that?
 
There's also a very simple way, share your /usr/src and /usr/obj via NFS (read-only will do) and mount them on "MINI", then just do the installkernel and installworld steps there.
 
There's also a very simple way, share your /usr/src and /usr/obj via NFS (read-only will do) and mount them on "MINI", then just do the installkernel and installworld steps there.
I see, that should work, yes. Can make installworld take a destination variable, to install to some (e.g. mounted) subtree as well?
 
I see, that should work, yes. Can make installworld take a destination variable, to install to some (e.g. mounted) subtree as well?
That would be DESTDIR. But beware, this won't work via NFS because it must also set file "flags" which is not supported by NFS. It's a standard way to install into a jail, or a mounted (but not active) boot environment.
 
That would be DESTDIR. But beware, this won't work via NFS because it must also set file "flags" which is not supported by NFS. It's a standard way to install into a jail, or a mounted (but not active) boot environment.
All right, thanks!

Let's see if I understand correctly: NFS wouldn't work for a destination, because of unsupported filesystem flags. But it does work when used as a source for mounting a remote /usr/src and a pre-filled /usr/obj in order to run an install/upgrade on a non-building machine. Right? :)
 
Let's see if I understand correctly: NFS wouldn't work for a destination, because of unsupported filesystem flags. But it does work when used as a source for mounting a remote /usr/src and a pre-filled /usr/obj in order to run an install/upgrade on a non-building machine. Right? :)
Exactly. Neither the source tree nor the built object files and binaries need any special flags, but the installation target needs them.
 
  • Thanks
Reactions: mtu
For the record: This is working well. I'm still refining the process, but it works along this general plan:
  1. Build from source on the build machine. Just have the sources in /usr/src, put the right parameters in /etc/src.conf (or supply one via make SRCCONF=/somewhere/src.conf) and make buildworld (in my case, where I'm building just the userspace and no kernel for reasons beyond this discussion).
  2. On any remote client machine, mount /usr/src and /usr/obj from the build machine. I use NFSv4, which spouts some Permission denied errors when calling make, but it seems these errors can be safely ignored.
  3. Important: Have the same src.conf on the client as you did on the build machine. I found it easiest to just copy it to /etc/src.conf on the client, since it will never really be used for building anyway. Alternatively, you can specify make SRCCONF=/somewhere/src.conf on the client machine in the following steps.
  4. Run make installworld on the client machine. Again, I'm not dealing with the kernel, and I also supply a DESTDIR=/somewhere local installation target directory, which is specific to my setup.
  5. Use mergemaster(8) or etcupdate(8) the way you normally would for an update from source.
  6. On the client machine, run make check-old. It might show lots of empty directories, especially if (as in my case) the src.conf excludes lots of components of the base system. In order to delete these unneeded directories (and possibly leftover files), run make delete-old delete-old-libs. If you're feeling confident, you may speed this up with make BATCH_DELETE_OLD_FILES=yes delete-old delete-old-libs.
  7. Unmount /usr/src and /usr/obj on the client machine if you wish.
 
Back
Top