Download raw body.
sysupgrade with relink filling disk
On 10/31/25 11:30 AM, Stuart Henderson wrote:
> 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.
Yes, I also thought about that. But the flag was there for testing.
>
> 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.
>
You mean something like the attached patch? Or we should be selective
with LLVM?
> /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
>
Index: distrib/miniroot/install.sub
===================================================================
RCS file: /cvs/src/distrib/miniroot/install.sub,v
diff -u -r1.1279 install.sub
--- distrib/miniroot/install.sub 22 Oct 2025 19:26:13 -0000 1.1279
+++ distrib/miniroot/install.sub 31 Oct 2025 12:32:45 -0000
@@ -1794,7 +1794,8 @@
# versioned areas which will be replaced from the new sets
if isin base$VERSION.tgz $_get_sets; then
rm -f /mnt/usr/share/relink/usr/lib/*
- rm -rf /mnt/usr/lib/libLLVM.so.[0-7].0
+ rm -rf /mnt/usr/share/relink/kernel
+ rm -f /mnt/usr/lib/libLLVM.so.*
rm -rf /mnt/usr/libdata/perl5
fi
if isin comp$VERSION.tgz $_get_sets; then
sysupgrade with relink filling disk