diff --git a/0001-snapd-2.67.1-add-support-for-loong64.patch b/0001-snapd-2.67.1-add-support-for-loong64.patch new file mode 100644 index 0000000000000000000000000000000000000000..a1cf571a4b0001d6f53011830839abfd0a05251e --- /dev/null +++ b/0001-snapd-2.67.1-add-support-for-loong64.patch @@ -0,0 +1,119 @@ +From de9e0f5609a5f8147f22cd4b1e3a13e44c79f40f Mon Sep 17 00:00:00 2001 +From: doupengda +Date: Fri, 14 Nov 2025 11:25:27 +0800 +Subject: [PATCH] snapd-2.67.1 add support for loong64 + +--- + arch/arch.go | 2 ++ + arch/arch_test.go | 1 + + arch/endian.go | 2 +- + arch/endian_test.go | 3 +++ + osutil/chattr_64.go | 2 +- + osutil/strace/strace.go | 2 +- + osutil/sys/sysnum_32_linux.go | 2 +- + 7 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/arch/arch.go b/arch/arch.go +index f2d6ab5..b788d7e 100644 +--- a/arch/arch.go ++++ b/arch/arch.go +@@ -66,6 +66,7 @@ func dpkgArchFromGoArch(goarch string) string { + "ppc64le": "ppc64el", + "riscv64": "riscv64", + "s390x": "s390x", ++ "loong64": "loong64", + } + + // If we are running on an ARM platform we need to have a +@@ -110,6 +111,7 @@ func dpkgArchFromKernelArch(utsMachine string) string { + "riscv64": "riscv64", + "s390x": "s390x", + "x86_64": "amd64", ++ "loongarch64": "loong64", + } + + dpkgArch := kernelArchMapping[utsMachine] +diff --git a/arch/arch_test.go b/arch/arch_test.go +index 9d38bbd..4483212 100644 +--- a/arch/arch_test.go ++++ b/arch/arch_test.go +@@ -42,6 +42,7 @@ func (ts *ArchTestSuite) TestArchDpkgArchitecture(c *C) { + c.Check(dpkgArchFromGoArch("ppc64"), Equals, "ppc64") + c.Check(dpkgArchFromGoArch("ppc64le"), Equals, "ppc64el") + c.Check(dpkgArchFromGoArch("riscv64"), Equals, "riscv64") ++ c.Check(dpkgArchFromGoArch("loong64"), Equals, "loong64") + c.Check(dpkgArchFromGoArch("s390x"), Equals, "s390x") + } + +diff --git a/arch/endian.go b/arch/endian.go +index a6c8a1a..075453c 100644 +--- a/arch/endian.go ++++ b/arch/endian.go +@@ -32,7 +32,7 @@ func Endian() binary.ByteOrder { + switch runtimeGOARCH { + case "ppc", "ppc64", "s390x": + return binary.BigEndian +- case "386", "amd64", "arm", "arm64", "ppc64le", "riscv64": ++ case "386", "amd64", "arm", "arm64", "ppc64le", "riscv64", "loong64": + return binary.LittleEndian + default: + panic(fmt.Sprintf("unknown architecture %s", runtimeGOARCH)) +diff --git a/arch/endian_test.go b/arch/endian_test.go +index c35baea..16f3deb 100644 +--- a/arch/endian_test.go ++++ b/arch/endian_test.go +@@ -61,6 +61,8 @@ var knownArch = map[string]bool{ + "ppc64le": true, + "riscv": true, + "riscv64": true, ++ "loong": true, ++ "loong64": true, + "s390": true, + "s390x": true, + "sparc": true, +@@ -100,6 +102,7 @@ func (s *endianTestSuite) TestEndian(c *C) { + {"arm64", binary.LittleEndian}, + {"ppc64le", binary.LittleEndian}, + {"riscv64", binary.LittleEndian}, ++ {"loong64", binary.LittleEndian}, + } { + restore := arch.MockRuntimeGOARCH(t.arch) + defer restore() +diff --git a/osutil/chattr_64.go b/osutil/chattr_64.go +index d6d9fc4..819ef95 100644 +--- a/osutil/chattr_64.go ++++ b/osutil/chattr_64.go +@@ -1,5 +1,5 @@ + // -*- Mode: Go; indent-tabs-mode: t -*- +-//go:build amd64 || arm64 || ppc64le || riscv64 || s390x ++//go:build amd64 || arm64 || ppc64le || riscv64 || s390x || loong64 + + /* + * Copyright (C) 2016 Canonical Ltd +diff --git a/osutil/strace/strace.go b/osutil/strace/strace.go +index c0ce8b6..c404307 100644 +--- a/osutil/strace/strace.go ++++ b/osutil/strace/strace.go +@@ -37,7 +37,7 @@ import ( + // syscalls. Thus there is no universal list of syscalls to exclude. + func getExcludedSyscalls() string { + switch runtime.GOARCH { +- case "arm", "arm64", "riscv64": ++ case "arm", "arm64", "riscv64", "loong64": + return "!pselect6,_newselect,clock_gettime,sigaltstack,gettid,gettimeofday,nanosleep" + default: + return "!select,pselect6,_newselect,clock_gettime,sigaltstack,gettid,gettimeofday,nanosleep" +diff --git a/osutil/sys/sysnum_32_linux.go b/osutil/sys/sysnum_32_linux.go +index 04f0233..ef82082 100644 +--- a/osutil/sys/sysnum_32_linux.go ++++ b/osutil/sys/sysnum_32_linux.go +@@ -1,5 +1,5 @@ + // -*- Mode: Go; indent-tabs-mode: t -*- +-//go:build amd64 || arm64 || ppc || ppc64le || riscv64 || s390x ++//go:build amd64 || arm64 || ppc || ppc64le || riscv64 || s390x || loong64 + + /* + * Copyright (C) 2017 Canonical Ltd +-- +2.43.7 + diff --git a/snapd.spec b/snapd.spec index 695c081d73611a3f31d784d03df5f8c51d30e6e1..9820fb67166cacd7f58655b6c94093b98945a337 100644 --- a/snapd.spec +++ b/snapd.spec @@ -1,4 +1,8 @@ +%ifarch loongarch64 +%bcond_without vendorized +%else %bcond_with vendorized +%endif %bcond_with testkeys @@ -8,7 +12,7 @@ %global with_unit_test 0 %global with_test_keys 0 -%ifarch x86_64 aarch64 %{power64} s390x +%ifarch x86_64 aarch64 %{power64} s390x loongarch64 %global with_multilib 1 %endif @@ -55,13 +59,15 @@ Name: snapd Version: 2.67.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A transactional software package manager License: GPLv3 URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/releases/download/%{version}/%{name}_%{version}.vendor.tar.xz +Source1: https://%{provider_prefix}/releases/download/%{version}/%{name}_%{version}.only-vendor.tar.xz +Patch1: 0001-snapd-2.67.1-add-support-for-loong64.patch -ExclusiveArch: %{?golang_arches}%{!?golang_arches:%{ix86} x86_64 %{arm} aarch64 ppc64le s390x} +ExclusiveArch: %{?golang_arches}%{!?golang_arches:%{ix86} x86_64 %{arm} aarch64 ppc64le s390x} loongarch64 BuildRequires: make BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang >= 1.9} @@ -777,6 +783,9 @@ fi %changelog +* Fri Nov 14 2025 doupengda - 2.67.1-3 +- add support for loongarch64 + * Fri Jun 13 2025 bbrucezhang - 2.67.1-2 - Rebuilt for loongarch64 diff --git a/sources b/sources index 943b4e22d55b59689912ecfd97faf5e1ce9e1921..fa4515ef76852f602c4d0da5982b9e2f93c9c958 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (snapd_2.67.1.vendor.tar.xz) = 17de4f596966a6661231ea9a4f41dcb19e588e28c1a6540f613f9dbb916afbbcf8512ff38e027b02059db02ffb13cc71e34e9dc17310626f5a35d7fc8123ee2b +SHA512 (snapd_2.67.1.only-vendor.tar.xz) = c99dc8c1ee1e3b1ea3ed7d156ebae9816d650de980f874923e6d3ab93fc34c1ff06601be44f411350841020d0af3bc3d84be8efe1cf42df71cf28e023b29c0e7