Index | Thread | Search

From:
Stuart Henderson <stu@spacehopper.org>
Subject:
Re: sysupgrade(8) says incompatible versions yet works
To:
Andrew Hewus Fresh <andrew@afresh1.com>, <tech@openbsd.org>
Date:
Wed, 11 Nov 2026 20:46:12 +0000

Download raw body.

Thread
I think we can remove that check. ok. The situations where it would warn 
_may_ need extra work from the admin, but that's what you let yourself in 
for with a "force" flag.

-- 
  Sent from a phone, apologies for poor formatting.

On 11 November 2026 20:12:59 Andrew Hewus Fresh <andrew@afresh1.com> wrote:

> I was having an issue after installing a VM where /usr wasn't big enough
> and my kernel relinking failed.  I cleaned up some space and thought the
> easiest fix would be to run through the upgrade to the version I'm
> running.
>
> However, when doing that it said "incompatible options" but yet did what
> I was hoping and "upgraded" to the running release.
>
> I'm not entirely sure why the `set -e` at the top doesn't stop the
> script, something to do with the `!` confusing it I guess.
>
>    $ sh -c 'set -e; f() { return 3; }; ! false && f; echo $?'
>    3
>    $ sh -c 'set -e; f() { return 3; }; (! false) && f; echo $?'
>    $ echo $?
>    3
>
> So, while we could wrap that `! $SNAP` in parens, is there a reson to
> keep that check?
>
>
> $ doas sysupgrade -f
> sysupgrade: incompatible options: -f without -s
> Fetching from https://cdn.openbsd.org/pub/OpenBSD/8.1/amd64/
> sysupgrade: Error retrieving 
> https://cdn.openbsd.org/pub/OpenBSD/8.1/amd64/SHA256.sig: 404 Not Found
> Fetching from https://cdn.openbsd.org/pub/OpenBSD/8.0/amd64/
> SHA256.sig   100% |*************************************|  2144 00:00
> Signature Verified
> ...
>
> Index: sysupgrade.sh
> ===================================================================
> RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.sh,v
> diff -u -p -r1.64 sysupgrade.sh
> --- sysupgrade.sh	2 Nov 2026 15:31:39 -0000	1.64
> +++ sysupgrade.sh	11 Nov 2026 19:50:04 -0000
> @@ -120,8 +120,6 @@ esac
> 	FILE=true
> $FORCE_VERSION && $SNAP &&
> 	err "incompatible options: -s -R $NEXT_VERSION"
> -$FORCE && ! $SNAP &&
> -	err "incompatible options: -f without -s"
>
> USED_USR=$(df -P /usr | awk 'NR==2 {print substr($5, 1, length($5)-1)}')
> if (( ${USED_USR} >= 90 )) && ! $FORCE; then