NetBSD Problem Report #59686

From www@netbsd.org  Sat Oct  4 01:59:08 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EEF1F1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  4 Oct 2025 01:59:07 +0000 (UTC)
Message-Id: <20251004015906.9FFE01A923C@mollari.NetBSD.org>
Date: Sat,  4 Oct 2025 01:59:06 +0000 (UTC)
From: sr@genyosha.net
Reply-To: sr@genyosha.net
To: gnats-bugs@NetBSD.org
Subject: sysupgrade picks wrong sets filetype for some architectures (sparc64, evbarm-aarch64)
X-Send-Pr-Version: www-1.0

>Number:         59686
>Category:       pkg
>Synopsis:       sysupgrade picks wrong sets filetype for some architectures (sparc64, evbarm-aarch64)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 04 02:00:00 +0000 2025
>Originator:     Steve Rikli
>Release:        sysupgrade-1.5nb11
>Organization:
>Environment:
NetBSD rpi4.home.genyosha.net 10.1_STABLE NetBSD 10.1_STABLE (GENERIC64) #0: Wed Oct  1 15:21:11 UTC 2025  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm

>Description:
sysupgrade(8) selects the wrong compression method file extension for some
system types from the NetBSD daily binary sets builds.

Many NetBSD-daily binary sets are tgz, but not all. For reference:
  https://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-11/latest/

and spot-checking a few architectures' binary/sets/ directories, I found:
  tgz     : alpha i386 macppc sgimips sparc sparc64
  tar.xz  : amd64 evbarm-aarch64

The sysupgrade(8) script has this code:

    if [ "$(uname -p)" = 'x86_64' ] || [ "$(uname -p)" = 'sparc64' ]; then
        shtk_config_set ARCHIVE_EXTENSION "tar.xz"
    else
        shtk_config_set ARCHIVE_EXTENSION "tgz"
    fi

along with the (commented) value in default /usr/pkg/etc/sysupgrade.conf :

  # Archive file extension of the sets. For now it can be either 'tgz' or
  # 'tar.xz'.
  #ARCHIVE_EXTENSION=tar.xz

It looks like the code for sparc64 chooses the wrong (tgz) compression method
file extension used by NetBSD project builds; whereas evbarm-aarch64 (et al?)
could make use of the "tar.xz" if-then code but isn't included.

The default config requires changing sysupgrade.conf for sparc64 and
evbarm-aarch64 systems, possibly others; whereas other system types work okay
out of the box, providing a better upgrade experience for sysupgrade users.

>How-To-Repeat:
Run sysupgrade on e.g. Raspberry Pi4b or other evbarm-aarch64 system; it will
attempt to download binary sets with .tgz extension by default.

I don't have a sparc64 system to confirm, but based on the code and the binary
sets directories, I expect it will also choose the wrong binary sets filename
extension, again requiring manual override in sysupgrade.conf .
>Fix:
Suggestions:

1) remove sparc64 from the if-then so it will default to tgz sets

2) add a check for something like '$(uname -m)-$(uname -p)' to match
  "evbarm-aarch64" but not other evbarm-* system types, to get tar.xz sets

Another suggestion from Greg Troxel on the mailing list discussion:
  https://mail-index.netbsd.org/netbsd-users/2025/10/02/msg033218.html

> Perhaps sysupgrade should just look at the place where sets are supposed
> to be and figure out which variant is there and use it.  These are the
> current defaults, but any user can choose to change them.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.