On Thu, 16 May 2024 at 20:35:51 +0200, Paul Gevers wrote: > On Wed, 31 Jan 2024 10:03:42 +0000 Simon McVittie <s...@debian.org> wrote: > > On Wed, 31 Jan 2024 at 01:28:43 +0000, Zhang Na wrote: > > > Add loongarch64 support, thanks!
In autopkgtest 5.39 I updated the list of known qemu architectures to add the mapping between loong64 (dpkg) and loongarch64 (qemu), which covers 80% of your patch. > > Thanks, have you successfully tested this? Does it successfully test > > packages under qemu? I would still like to know that someone has successfully tested a package under qemu on loongarch64 before merging any loongarch64-specific changes. That would typically go something like this: $ sudo autopkgtest-build-qemu --architecture=loong64 sid ./sid-loong64.qcow2 $ autopkgtest hello -- qemu ./sid-loong64.qcow2 and might involve contributing changes to vmdb2 (which is used by autopkgtest-build-qemu) to teach it how to install a suitable loongarch64 bootloader. If autopkgtest-build-qemu doesn't work yet, another way to demonstrate a successful test would be to prepare the image sid-loong64.qcow2 by hand. It should either have at least 2 PC-style serial ports (ttyS0 and ttyS1 on x86) or at least 2 virtio serial consoles (hvc0 and hvc1) or both, and it should put a getty/login prompt on ttyS0 and hvc0, and a passwordless root shell on ttyS1 and hvc1 (the setup-testbed script knows how to configure this). And then run something like: $ autopkgtest hello -- qemu ./sid-loong64.qcow2 Some places that I would expect that you will need to customize: * autopkgtest_qemu.py: - If loongarch64 machines normally boot using EFI (like aarch64 and riscv64), you will need to make EFI boot the default (like it is for arm, aarch64, riscv64) and configure the paths to suitable firmware for qemu (search for "RISCV_VIRT_CODE" and you will see what I mean). The edk2 source package doesn't seem to build loong64 firmware yet, so presumably you'll need a patched version of that package first. - Or if loongarch64 machines normally boot using some sort of built-in boot protocol like x86 BIOS or ppc64el IEEE 1275, you'll need to configure that instead. - You might need to set it up to have serial ports (search for "self.consoles.add"), or it might be like ppc64le and only have virtio serial consoles. Please adjust the qemu command-line as necessary. * autopkgtest-build-qemu: - You might need to write something loongarch64-specific into the vmdb2 configuration. - You might need to choose a kernel package. The default is probably linux-image-loong64 on Debian and linux-image-virtual on Ubuntu, so if those are correct then you might not need anything special. * vmdb2 (not part of autopkgtest): - You might need to teach vmdb2 how to install a suitable bootloader, presumably grub-efi-loong64. > > > + elif self.qemu_architecture in ('arm', 'riscv64', > > > 'loongarch64'): > > > argv.extend(['-machine', 'virt']) > > > > Is this required? `qemu-system-loongarch64 -machine help` says virt is > > the default anyway. We probably shouldn't be forcing particular options > > if it isn't required. I don't want to add extra options to the qemu command line unless your testing demonstrates that they're necessary. smcv