Bug#1066023: libdebian-installer: Add subarch detection for loongarch64

2024-03-11 Thread John Paul Adrian Glaubitz
Hi,

On Mon, 2024-03-11 at 16:36 +0800, zhangdandan wrote:
> I have added subarch detection for loongarch64 in libdebian-installer 
> source package.
> Please consider the patch I have attached.
> 
> The libdebian-installer source package was compiled successfully on my 
> local loong64 rootfs environment.
> If you have any questions, you can contact me at any time.

I have just added subarch detection for 64-bit LoongArch [1].

However, the proper filename is "subarch-loong64-linux.c" as the filename
has to match the Debian architecture name, not the GNU triplet name (see
the configure.ac).

Adrian

> [1] 
> https://salsa.debian.org/installer-team/libdebian-installer/-/commit/4ca769d4ba26ca4fa2e35f6932ee2a123cdf5312

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#1066023: libdebian-installer: Add subarch detection for loongarch64

2024-03-11 Thread zhangdandan

Source: libdebian-installer
Version: 0.124
Severity: wishlist
Tags: patch
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

I have added subarch detection for loongarch64 in libdebian-installer 
source package.

Please consider the patch I have attached.

The libdebian-installer source package was compiled successfully on my 
local loong64 rootfs environment.

If you have any questions, you can contact me at any time.

thanks,
Dandan Zhang

diff -Nru libdebian-installer-0.124/src/system/Makefile.am 
libdebian-installer-0.124/src/system/Makefile.am
--- libdebian-installer-0.124/src/system/Makefile.am2021-02-08 
12:52:58.0 +
+++ libdebian-installer-0.124/src/system/Makefile.am2022-10-02 
02:14:09.0 +
@@ -22,6 +22,7 @@
subarch-armeb-linux.c \
subarch-armel-linux.c \
subarch-armhf-linux.c \
+   subarch-loongarch64-linux.c \
subarch-m68k-linux.c \
subarch-mips-linux.c \
subarch-mipsel-linux.c \
diff -Nru libdebian-installer-0.124/src/system/subarch-loongarch64-linux.c 
libdebian-installer-0.124/src/system/subarch-loongarch64-linux.c
--- libdebian-installer-0.124/src/system/subarch-loongarch64-linux.c
1970-01-01 00:00:00.0 +
+++ libdebian-installer-0.124/src/system/subarch-loongarch64-linux.c
2022-10-02 02:14:09.0 +
@@ -0,0 +1,29 @@
+/*
+ * subarch-loongarch64-linux.c
+ *
+ * Copyright (C) 2023
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see .
+ */
+
+#include 
+#include 
+
+const char *di_system_subarch_analyze(void)
+{
+   if (di_system_is_efi())
+   return "efi";
+   else
+   return "generic";
+}