From: Stuart Henderson Subject: Re: sysupgrade with relink filling disk To: Renaud Allard Cc: tech@openbsd.org Date: Fri, 31 Oct 2025 10:30:39 +0000 On 2025/10/31 07:58, Renaud Allard wrote: > Hello, > > I noticed that some people reported having issues using > sysupgrade as the /usr filesystem was full due to > /usr/share/relink. > Wouldn't it be a good idea to cleanup that directory before > doing the upgrade to avoid the issue? > What about this kind of patch? It cleans the relink directory > within sysupgrade. It would probably be cleaner if it's cleaned > within the upgrade process, but that's way more intrusive. I did > it with a flag mainly for testing purposes. Hiding behind a flag is a bit pointless, if somebody knows to use the flag than they could rm anyway. Not ideal doing it there as if you've run sysupgrade -n and then decide to back-out of the upgrade, you're left with no /usr/share/relink so you can no longer reorder the kernel (i.e. can't apply kernel syspatches). Also the problem doesn't just affect people using sysupgrade - same would apply for normal bsd.rd upgrades. So if wider cleaning of the relink dir is needed (some is already done), it should be done in the installer instead. (I think I would support rm'ing kernel relink files there; the relink files are extracted relatively late, and removing them before upgrade reduces the chance of more important files getting truncated due to running out of space during extract). Also, should this use .so.* instead of the version for libLLVM? Or if not, then the version number bumped. /usr/src/distrib/miniroot/install.sub: 1791 if [[ $MODE == upgrade ]]; then 1792 # We are committed to installing new files. Attempt to cope 1793 # with potential space shortage in /usr by deleting a few 1794 # versioned areas which will be replaced from the new sets 1795 if isin base$VERSION.tgz $_get_sets; then 1796 rm -f /mnt/usr/share/relink/usr/lib/* 1797 rm -rf /mnt/usr/lib/libLLVM.so.[0-7].0 1798 rm -rf /mnt/usr/libdata/perl5 1799 fi 1800 if isin comp$VERSION.tgz $_get_sets; then 1801 rm -rf /mnt/usr/lib/{gcc-lib,clang} 1802 rm -rf /mnt/usr/bin/{gcc,g++} 1803 rm -rf /mnt/usr/include/g++ 1804 # file changed to dir in libc++ 1805 rm -rf /mnt/usr/include/c++/v1 1806 fi