From 8aa14d77a9ab536227bb1337f8e1b26eb1793fa8 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sat, 21 Mar 2026 01:34:25 +0000 Subject: [PATCH] The percentage heuristic has failed for me on 40% of the machines I run, so it is clear it is going to fail for many more people when the next release comes out. It is wrong, back it out. --- usr.sbin/sysupgrade/sysupgrade.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/sysupgrade/sysupgrade.sh b/usr.sbin/sysupgrade/sysupgrade.sh index de1b2703b88..6d893e5f9e2 100644 --- a/usr.sbin/sysupgrade/sysupgrade.sh +++ b/usr.sbin/sysupgrade/sysupgrade.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: sysupgrade.sh,v 1.61 2026/01/17 21:20:44 kn Exp $ +# $OpenBSD: sysupgrade.sh,v 1.62 2026/03/21 01:34:25 deraadt Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015 Robert Peichaer @@ -118,8 +118,9 @@ $FORCE_VERSION && $SNAP && $FORCE && ! $SNAP && err "incompatible options: -f without -s" -if df -kP /usr | ! awk 'NR == 2 && $4 < 1*1024^2 { exit(1) }' && ! $FORCE; then - err "/usr appears too small. See sysupgrade(8) manpage about PRUNING." +USED_USR=$(df -P /usr | awk 'NR==2 {print substr($5, 1, length($5)-1)}') +if (( ${USED_USR} >= 90 )) && ! $FORCE; then + err "/usr appears too small. See sysupgrade(8) manpage about PRUNING." fi if $SNAP; then