Package: autopkgtest
Version: 5.31.2
Severity: normal
X-Debbugs-Cc: zhan...@loongson.cn

Dear Maintainer,

  Add loongarch64 support, thanks!




-- System Information:
Debian Release: trixie/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: loong64 (loongarch64)

Kernel: Linux 5.10.0-60.96.0.126.oe2203.loongarch64 (SMP w/32 CPU threads)
Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=ANSI_X3.4-1968) 
(ignored: LC_ALL set to C), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages autopkgtest depends on:
ii  apt-utils       2.7.7
ii  libdpkg-perl    1.22.1
ii  mawk            1.3.4.20231126-1
ii  procps          2:4.0.4-2
ii  python3         3.11.6-1
ii  python3-debian  0.1.49

Versions of packages autopkgtest recommends:
ii  autodep8  0.28
ii  fakeroot  1.32.2-1

Versions of packages autopkgtest suggests:
pn  docker.io            <none>
pn  fakemachine          <none>
pn  genisoimage          <none>
pn  lxc                  <none>
pn  lxd                  <none>
pn  ovmf                 <none>
pn  ovmf-ia32            <none>
pn  podman               <none>
pn  python3-distro-info  <none>
pn  qemu-efi-aarch64     <none>
pn  qemu-efi-arm         <none>
pn  qemu-system          <none>
pn  qemu-utils           <none>
ii  schroot              1.6.13-3+b3
ii  util-linux           2.39.3-2
pn  vmdb2                <none>
pn  zerofree             <none>

-- no debconf information
>From 588a76ea2f332ae68f204ed658b54216e136f10a Mon Sep 17 00:00:00 2001
From: Zhang Na <zhan...@loongson.cn>
Date: Tue, 30 Jan 2024 07:37:07 +0000
Subject: [PATCH] add loongarch64 support

---
 lib/autopkgtest_qemu.py | 5 ++++-
 tests/qemu              | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/autopkgtest_qemu.py b/lib/autopkgtest_qemu.py
index df24970..c3b45ff 100644
--- a/lib/autopkgtest_qemu.py
+++ b/lib/autopkgtest_qemu.py
@@ -374,7 +374,7 @@ class Qemu:
                     argv.extend(['-machine', 'type=virt,gic-version=max'])
                 else:
                     argv.extend(['-machine', 'virt'])
-            elif self.qemu_architecture in ('arm', 'riscv64'):
+            elif self.qemu_architecture in ('arm', 'riscv64', 'loongarch64'):
                 argv.extend(['-machine', 'virt'])
             elif (
                 self.qemu_architecture in ('i386', 'x86_64') and
@@ -531,6 +531,7 @@ class Qemu:
             # cris not in dpkg-architecture -L
             # hppa
             # i386
+            'loongarch64': 'loong64',
             # m68k
             # microblaze not in dpkg-architecture -L
             # microblazeel not in dpkg-architecture -L
@@ -569,6 +570,7 @@ class Qemu:
             'cris',
             'hppa',
             'i386',
+            'loongarch64',
             'm68k',
             'microblaze',
             'microblazeel',
@@ -623,6 +625,7 @@ class Qemu:
             # hppa
             # i386
             # ia64?
+            'loong64': 'loongarch64',
             # m32r?
             # m68k
             # mips
diff --git a/tests/qemu b/tests/qemu
index bbc92b5..6876478 100755
--- a/tests/qemu
+++ b/tests/qemu
@@ -58,6 +58,7 @@ class QemuTestCase(unittest.TestCase):
         self.assertEqual(get('armel'), 'arm')
         self.assertEqual(get('armhf'), 'arm')
         self.assertEqual(get('i386'), 'i386')
+        self.assertEqual(get('loong64'), 'loongarch64')
         self.assertEqual(get('m68k'), 'm68k')
         self.assertEqual(get('mips'), 'mips')
         self.assertEqual(get('mips64'), 'mips64')
@@ -77,6 +78,7 @@ class QemuTestCase(unittest.TestCase):
         self.assertEqual(get('aarch64'), 'arm64')
         self.assertEqual(get('arm'), 'armhf')
         self.assertEqual(get('i386'), 'i386')
+        self.assertEqual(get('loongarch64'), 'loong64')
         self.assertEqual(get('m68k'), 'm68k')
         self.assertEqual(get('mips'), 'mips')
         self.assertEqual(get('mips64'), 'mips64')
-- 
2.43.0

Reply via email to