[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1057713: debian-installer: add loongarch64 support to build cdrom image



Source: debian-installer
Version: 20230607+deb12u2
Severity: wishlist
Tags: patch
User: debian-loongarch@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling the debian-installer package failed for loong64 in the Debian Package Auto-Building environment. The full compilation log can be found at https://buildd.debian.org/status/logs.php?pkg=debian-installer&ver=20230607%2Bdeb12u2&arch=loong64

Please consider the patch I have attached.
The debian-installer source package was compiled successfully on my local loong64 rootfs environment. Since the loong64's merge-request in Debian kernel repository is still open[1], I compiled with a local kernel (via build/localudebs/ local sources).
The binary files compiled by debian-installer are as follows,
```
debian-installer-images_20230607+deb12u2_loong64.tar.gz
debian-installer_20230607+deb12u2_loong64.buildinfo
debian-installer_20230607+deb12u2_loong64.changes
debian-installer_20230607+deb12u2_loong64.deb
```

The support for loongarch64 architecture in debian-installer source code package will be a gradual development process. We are happy to perform local testing and verification work based on maintainers suggestions.
If you have any questions, you can contact me at any time.

Also, for a patch to add loong64 support to debian-installer (I don't have permission to submit a pull request), please visit the debian git personal repository[2].
If there are other suggestions, we can continue to discuss.

[1]: https://salsa.debian.org/kernel-team/linux/-/merge_requests/879
[2]: https://salsa.debian.org/zhangdandan/debian-installer

thanks,
Dandan Zhang
diff -Nru debian-installer-20230607+deb12u2/build/boot/loong64/grub/grub-efi.cfg debian-installer-20230607+deb12u2/build/boot/loong64/grub/grub-efi.cfg
--- debian-installer-20230607+deb12u2/build/boot/loong64/grub/grub-efi.cfg	1970-01-01 00:00:00.000000000 +0000
+++ debian-installer-20230607+deb12u2/build/boot/loong64/grub/grub-efi.cfg	2023-10-01 22:16:20.000000000 +0000
@@ -0,0 +1,5 @@
+set menu_color_normal=cyan/blue
+set menu_color_highlight=white/blue
+
+insmod gzio
+
diff -Nru debian-installer-20230607+deb12u2/build/config/common debian-installer-20230607+deb12u2/build/config/common
--- debian-installer-20230607+deb12u2/build/config/common	2023-10-01 22:16:20.000000000 +0000
+++ debian-installer-20230607+deb12u2/build/config/common	2023-10-01 22:16:20.000000000 +0000
@@ -11,7 +11,8 @@
 
 # Default kernel ABI version to use. Append a kernel flavour to
 # produce KERNELVERSION.
-LINUX_KERNEL_ABI ?= 6.1.0-13
+#LINUX_KERNEL_ABI ?= 6.1.0-13
+LINUX_KERNEL_ABI ?= 6.5.0-3
 
 # Make sure the mirror is sufficiently up-to-date, by checking minimal
 # version (list of package_version):
diff -Nru debian-installer-20230607+deb12u2/build/config/loong64/cdrom/grub.cfg debian-installer-20230607+deb12u2/build/config/loong64/cdrom/grub.cfg
--- debian-installer-20230607+deb12u2/build/config/loong64/cdrom/grub.cfg	1970-01-01 00:00:00.000000000 +0000
+++ debian-installer-20230607+deb12u2/build/config/loong64/cdrom/grub.cfg	2023-10-01 22:16:20.000000000 +0000
@@ -0,0 +1,8 @@
+MEDIA_TYPE = CD-ROM
+TARGET = $(INITRD) $(KERNEL) $(DEBIAN_CD_INFO)
+
+MANIFEST-KERNEL = "kernel for use with EFI to build a CD"
+MANIFEST-INITRD = "initrd for use with EFI to build a CD"
+MANIFEST-DEBIAN_CD_INFO = "EFI config files for CD"
+
+TYPE = cdrom/grub
diff -Nru debian-installer-20230607+deb12u2/build/config/loong64/cdrom.cfg debian-installer-20230607+deb12u2/build/config/loong64/cdrom.cfg
--- debian-installer-20230607+deb12u2/build/config/loong64/cdrom.cfg	1970-01-01 00:00:00.000000000 +0000
+++ debian-installer-20230607+deb12u2/build/config/loong64/cdrom.cfg	2023-10-01 22:16:20.000000000 +0000
@@ -0,0 +1,3 @@
+FLAVOUR_SUPPORTED = grub gtk
+
+MEDIA_TYPE = CD-ROM
diff -Nru debian-installer-20230607+deb12u2/build/config/loong64.cfg debian-installer-20230607+deb12u2/build/config/loong64.cfg
--- debian-installer-20230607+deb12u2/build/config/loong64.cfg	1970-01-01 00:00:00.000000000 +0000
+++ debian-installer-20230607+deb12u2/build/config/loong64.cfg	2023-10-01 22:16:20.000000000 +0000
@@ -0,0 +1,26 @@
+MEDIUM_SUPPORTED = cdrom 
+
+DEBIAN_RELEASE = unstable
+
+KEYRING = /usr/share/keyrings/debian-ports-archive-keyring.gpg
+
+USE_UNRELEASED = 1
+
+KERNELMAJOR = 2.6
+# The version of the kernel to use.
+KERNELVERSION = $(LINUX_KERNEL_ABI)-loongson-3
+KERNELNAME = vmlinuz
+
+# Configuration for generating EFI images
+GRUB_EFI=y
+GRUB_EFI_PLATFORM=loongarch64-efi
+GRUB_EFI_NAME=loongarch64
+
+# We build a gtk installer for this arch
+GRAPHICAL_INSTALLER=y
+
+arch_boot_screens:
+arch_tree:
+
+include config/loongarch.cfg
+
diff -Nru debian-installer-20230607+deb12u2/build/config/loongarch.cfg debian-installer-20230607+deb12u2/build/config/loongarch.cfg
--- debian-installer-20230607+deb12u2/build/config/loongarch.cfg	1970-01-01 00:00:00.000000000 +0000
+++ debian-installer-20230607+deb12u2/build/config/loongarch.cfg	2023-10-01 22:16:20.000000000 +0000
@@ -0,0 +1,44 @@
+# Common configuration and targets for loong64 systems.
+
+# The font to load in GRUB
+GRUB_FONT = /usr/share/grub/ascii.pf2
+
+# Extract GRUB EFI files.
+.PHONY: loong64_grub_efi
+loong64_grub_efi: $(TREE)/lib 
+ifeq ($(GRUB_EFI),y)
+	efi-image -o $(TEMP_GRUB_EFI) -g $(GRUB_EFI_PLATFORM) \
+                -e $(GRUB_EFI_NAME) -n $(NETBOOT_PATH) \
+                -s $(EFI_SIGNED) -d $(TREE)/lib 
+endif
+
+# Supply GRUB EFI configuration.
+.PHONY: arch_cd_info_dir
+arch_cd_info_dir: loong64_grub_efi
+	-rm -f $(TEMP_CD_INFO_DIR)/*
+	mkdir -p $(TEMP_CD_INFO_DIR)
+
+	if [ "$(GRUB_EFI)" = y ]; then \
+		set -e; \
+		mkdir -p $(TEMP_CD_INFO_DIR)/grub/$(GRUB_EFI_PLATFORM); \
+		cp -a $(TEMP_GRUB_EFI)/efi.img $(TEMP_CD_INFO_DIR)/grub/; \
+		if [ "$(GRAPHICAL_INSTALLER)" = y ]; then \
+			grub-gencfg \
+				KERNEL /%install%/vmlinuz \
+				INITRD /%install%/initrd.gz \
+				INITRD_GTK /%install%/gtk/initrd.gz \
+				HEADER boot/$(ARCH)/grub/grub-efi.cfg \
+				IS_PURE_GTK "$(IS_PURE_GTK)" \
+			> $(TEMP_CD_INFO_DIR)/grub/grub.cfg; \
+		else \
+			grub-gencfg \
+				KERNEL /%install%/vmlinuz \
+				INITRD /%install%/initrd.gz \
+				HEADER boot/$(ARCH)/grub/grub-efi.cfg \
+				IS_PURE_GTK "$(IS_PURE_GTK)" \
+			> $(TEMP_CD_INFO_DIR)/grub/grub.cfg; \
+		fi; \
+		cp -a $(GRUB_FONT) $(TEMP_CD_INFO_DIR)/grub/font.pf2; \
+		cp -a $(TEMP_GRUB_EFI)/boot/grub/$(GRUB_EFI_PLATFORM)/* \
+			$(TEMP_CD_INFO_DIR)/grub/$(GRUB_EFI_PLATFORM)/; \
+	fi
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/crc-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/crc-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/crypto-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/crypto-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/fat-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/fat-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/fb-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/fb-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/input-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/input-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/kernel-image-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/kernel-image-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/localechooser_2.104_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/localechooser_2.104_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/mtd-core-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/mtd-core-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/nic-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/nic-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/nic-shared-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/nic-shared-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/sata-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/sata-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/scsi-core-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/scsi-core-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/usb-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/usb-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/usb-serial-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/usb-serial-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
Binary files /tmp/NPfKsiDfkf/debian-installer-20230607+deb12u2/build/localudebs/usb-storage-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb and /tmp/WqLlsqaPdK/debian-installer-20230607+deb12u2/build/localudebs/usb-storage-modules-6.5.0-3-loongson-3-di_6.5.8-2_loong64.udeb differ
diff -Nru debian-installer-20230607+deb12u2/build/pkg-lists/cdrom/loong64.cfg debian-installer-20230607+deb12u2/build/pkg-lists/cdrom/loong64.cfg
--- debian-installer-20230607+deb12u2/build/pkg-lists/cdrom/loong64.cfg	1970-01-01 00:00:00.000000000 +0000
+++ debian-installer-20230607+deb12u2/build/pkg-lists/cdrom/loong64.cfg	2023-10-01 22:16:20.000000000 +0000
@@ -0,0 +1,21 @@
+console-setup-pc-ekmap
+fat-modules-${kernel:Version}
+debian-ports-archive-keyring-udeb
+
+input-modules-${kernel:Version}
+fb-modules-${kernel:Version}
+console-setup-udeb
+kbd-udeb
+
+usb-modules-${kernel:Version}
+usb-serial-modules-${kernel:Version} ?
+usb-storage-modules-${kernel:Version}
+virtio-modules-${kernel:Version} ?
+uinput-modules-${kernel:Version} ?
+
+# Support for usb cdroms
+usb-storage-modules-${kernel:Version}
+# USB and firewire cdroms both need this.
+scsi-core-modules-${kernel:Version}
+
+sata-modules-${kernel:Version}
diff -Nru debian-installer-20230607+deb12u2/debian/control debian-installer-20230607+deb12u2/debian/control
--- debian-installer-20230607+deb12u2/debian/control	2023-10-01 22:16:20.000000000 +0000
+++ debian-installer-20230607+deb12u2/debian/control	2023-10-01 22:16:20.000000000 +0000
@@ -51,7 +51,7 @@
 	genromfs [sparc sparc64],
 #		Used for creating sparc floppies (which are not built by
 #		default.)
-	dosfstools [hurd-i386 i386 ia64 m68k amd64 armhf arm64],
+	dosfstools [hurd-i386 i386 ia64 loong64 m68k amd64 armhf arm64],
 #		For creating FAT filesystems with mkfs.msdos.
 #		Of course i386/amd64 use this for floppies, CDs etc.
 #		m68k uses it for atari floppies
@@ -109,7 +109,8 @@
 	grub-efi-ia32-bin [hurd-i386 i386],
 	grub-efi-ia64-bin [ia64],
 	grub-efi-arm-bin [armhf],
-	grub-common [amd64 arm64 i386], xorriso,
+	grub-efi-loong64-bin [loong64],
+	grub-common [amd64 arm64 i386 loong64], xorriso,
 #		Used to make EFI bootable images
 	grub-ieee1275-bin [powerpc ppc64 ppc64el sparc sparc64],
 #		IEEE1275 bootloader support.
@@ -131,7 +132,7 @@
 	tofrodos [i386 amd64 kfreebsd-i386 kfreebsd-amd64],
 #		For todos, used on files that need to be accessible from
 #		DOS.
-	mtools [i386 ia64 m68k amd64 armhf arm64 kfreebsd-i386 kfreebsd-amd64 hurd-i386],
+	mtools [i386 ia64 loong64 m68k amd64 armhf arm64 kfreebsd-i386 kfreebsd-amd64 hurd-i386],
 #		mcopy is used to put files onto FAT filesystems w/o
 #		mounting them. Note that patches from #900409 and #900410
 #		are required for a reproducible build (available since
@@ -155,11 +156,11 @@
 #		Used as the CD-ROM's bootloader
 	xorriso (>= 1.3.2-1~) [kfreebsd-i386 kfreebsd-amd64 hurd-i386],
 #               Used by grub-pc to create the CD-ROM images
-	debian-ports-archive-keyring [alpha hppa ia64 m68k powerpc powerpcspe ppc64 riscv64 sh4 sparc64 x32],
+	debian-ports-archive-keyring [alpha hppa ia64 loong64 m68k powerpc powerpcspe ppc64 riscv64 sh4 sparc64 x32],
 #		Used for architectures hosted on debian-ports.org
 	librsvg2-bin [any-amd64 any-i386],
 #		Used to convert splash SVG to splash PNG during build
-	fdisk [amd64 arm64 armhf i386],
+	fdisk [amd64 arm64 armhf i386 loong64],
 #		sfdisk is used by util/gen-hd-image when creating SD card
 #		images for arm64 and armhf systems.
 #		fdisk is used is used by util/geniso_hybrid_plus_firmware_partition

Reply to: