Source: cpu-checker
Version: 0.7-1.3
Severity: wishlist
Tags: ftbfs
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling the cpu-checker failed on my local loong64 rootfs environment.
We need to add build support for loong64 in debian/control.
At the same time, we also need to add the loongarch64 support in kvm-ok for the LoongArch architecture.

Please consider the patch I have attached.
Referring to other architectures, I have submitted a bug to the Ubuntu launchpad, plesase see https://bugs.launchpad.net/cpu-checker/+bug/2047347
Your opinions are welcome.

thanks,
Dandan Zhang

diff -Nru cpu-checker-0.7/debian/control cpu-checker-0.7/debian/control
--- cpu-checker-0.7/debian/control      2021-08-02 13:30:02.000000000 +0000
+++ cpu-checker-0.7/debian/control      2021-09-14 06:45:39.000000000 +0000
@@ -9,7 +9,7 @@
 Vcs-Bzr: lp:~cpu-checker-dev/cpu-checker/trunk
 
 Package: cpu-checker
-Architecture: amd64 arm64 armhf i386 ppc64el powerpc riscv64 s390x
+Architecture: amd64 arm64 armhf i386 loong64 ppc64el powerpc riscv64 s390x
 Depends: msr-tools [amd64 i386], ${shlibs:Depends}, ${misc:Depends}
 Conflicts: qemu-kvm (<< 0.12.3-0ubuntu13)
 Replaces: qemu-kvm (<< 0.12.3-0ubuntu13)
diff -Nru 
cpu-checker-0.7/debian/patches/cpu-checker-add-loongarch64-support.patch 
cpu-checker-0.7/debian/patches/cpu-checker-add-loongarch64-support.patch
--- cpu-checker-0.7/debian/patches/cpu-checker-add-loongarch64-support.patch    
1970-01-01 00:00:00.000000000 +0000
+++ cpu-checker-0.7/debian/patches/cpu-checker-add-loongarch64-support.patch    
2021-09-14 06:45:39.000000000 +0000
@@ -0,0 +1,26 @@
+Description: Add loongarch64 support 
+Last-Update: 2023-12-25
+
+--- cpu-checker-0.7.orig/kvm-ok
++++ cpu-checker-0.7/kvm-ok
+@@ -63,6 +63,10 @@ case "$(uname -m)" in
+       virt="RISCV"
+       kvm_mod="kvm"
+       ;;
++    loongarch64)
++      virt="LOONGARCH"
++      kvm_mod="kvm"
++      ;;
+     *)
+       virt=$(egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo 
'(vmx|svm)') || true
+       [ "$virt" = "vmx" ] && kvm_mod="kvm_intel"
+@@ -122,6 +126,9 @@ elif [ "$virt" = "ARM" ]; then
+ elif [ "$virt" = "RISCV" ]; then
+     # Should also test that we booted in HS mode, if detectable
+     :
++elif [ "$virt" = "LOONGARCH" ]; then
++    # Should also test that we booted in LVZ mode, if detectable
++    :
+ elif [ "$virt" = "generic" ]; then
+     :
+ else
diff -Nru cpu-checker-0.7/debian/patches/series 
cpu-checker-0.7/debian/patches/series
--- cpu-checker-0.7/debian/patches/series       2021-08-02 13:30:02.000000000 
+0000
+++ cpu-checker-0.7/debian/patches/series       2021-09-14 06:45:39.000000000 
+0000
@@ -3,3 +3,4 @@
 powerpc-dummy.patch
 cpu-checker-s390x.patch
 riscv64-dummy.patch
+cpu-checker-add-loongarch64-support.patch

Reply via email to