“Unlike other operating systems, patches for the OpenBSD base system are distributed as source code patches. These patches are usually applied by compiling and installing them onto the target system. While that upgrade procedure is well-documented, it is not always suitable for certain systems that do not have the OpenBSD compiler set installed for various reasons such as disk space constraints. To fill this gap, open source projects like binpatch were started to allow administrators to create binary patches using the BSD make system. This article proposes an alternative method to build binary patches using a chroot environment in an attempt to more closely mirror the instructions given in the OpenBSD patch files.”
Of course, you could just do this:
1)Create a patch dir (say /usr/patches)
2) patch src and build for each affected system
3) env DESTDIR=/usr/patches make install
4) tar up the files and apply to other system
much easier, IMHO.
Thanks for your feedback. I thought about that as well, but the OpenBSD Makefile system may not always obey the DESTDIR approach, especially for those programs using the Makefile.bsd-wrapper file, like Apache.
Yes, I have experienced that as well. In order to get around that you must play with other env variables. It’s only a few and you can do it on a case by case basis. Some of them also panic if the file system is not laid out properly so I usually use mtree to rebuild the structure and then after installing patches remove empty directories.
My intent was to avoid Makefile environment variables and be as clean and consistent as possible with each patch — hence, chroot. Thanks again for your insight.