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
>Last-Modified:  Fri Jul 24 21:10:02 +0000 2026
>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.

>Audit-Trail:
From: Steve Rikli <sr@genyosha.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/59686: sysupgrade picks wrong sets filetype for some
 architectures (sparc64, evbarm-aarch64)
Date: Fri, 24 Jul 2026 13:42:53 -0700

 I don't know if this is the entirely proper way to submit diffs for
 pkgsrc files, hopefully it is at least a bit helpful towards a fix.

 PR pkg/59686: use correct ARCHIVE_EXTENSION for sparc64, evbarm-aarch64

 changes:
 1. remove override to ARCHIVE_EXTENSION for sparc64; the default tgz file
    extension matches the current default builds

 2. add override to ARCHIVE_EXTENSION for evbarm-aarch64 to tar.xz which
    matches the current default builds
 ----

 Index: patch-sysupgrade.sh
 ===================================================================
 RCS file: /cvsroot/pkgsrc/sysutils/sysupgrade/patches/patch-sysupgrade.sh,v
 retrieving revision 1.8
 diff -u -r1.8 patch-sysupgrade.sh
 --- patch-sysupgrade.sh	15 Apr 2022 09:10:56 -0000	1.8
 +++ patch-sysupgrade.sh	24 Jul 2026 20:14:42 -0000
 @@ -4,6 +4,8 @@
  * Add ARCHIVE_EXTENSION variable (Fix PR pkg/53697)
  * Use direct paths to etcupdate and postinstall
    (protect against user misconfiguration).
 +* Don't overide default tgz extension for sparc64 (PR pkg/59686)
 +* Use tar.xz for evbarm-aarch64 to match default builds (PR pkg/59686)

  --- sysupgrade.sh.orig	2013-07-28 21:27:57.000000000 +0000
  +++ sysupgrade.sh
 @@ -21,7 +23,7 @@
       shtk_config_set ETCUPDATE "yes"
       shtk_config_set KERNEL "AUTO"
       shtk_config_set SETS "AUTO"
 -+    if [ "$(uname -p)" = 'x86_64' ] || [ "$(uname -p)" = 'sparc64' ]; then
 ++    if [ "$(uname -p)" = 'x86_64' ] || [ "$(uname -m)-$(uname -p)" = 'evbarm-aarch64' ]; then
  +        shtk_config_set ARCHIVE_EXTENSION "tar.xz"
  +    else
  +        shtk_config_set ARCHIVE_EXTENSION "tgz"

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.