problem
I need to create a qcow2 image of Debian (arm64) through packer and Debian (arm64) ISO. The community examples of packer are all AMD64. I modified the example of the packer community of AMD 64 HCl file can start QEMU arm64 virtual machine, load preset file and enter automatic installation,
However, no root file system is defined appears in the partition disks step. I checked the QEMU disk (qcow2), and partman auto doesn't work. Here are my relevant codes. Please point out the problems and solutions
Related code
. HCl is also x86, but by modifying the binary file of QEMU, there is boot_ command qemu_ Args can be installed automatically
The amendments are as follows
boot_command = [
"<wait10>c<wait5><wait10>",
"linux /install.a64/vmlinuz --quiet",
" auto=true ",
" url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/${var.preseed_file} ",
" hostname=${var.vm_name} ", " domain=${var.domain} ", " interface=auto ",
" ---",
"<enter><wait>",
"initrd /install.a64/initrd.gz",
"<enter><wait>",
"boot<enter><wait>"
]
qemuargs = [
[ "-m", "8192" ],
[ "-cpu", "max" ],
[ "-smp", "4" ],
[ "-M", "virt" ],
# iso
[ "-device", "nec-usb-xhci" ],
[ "-device", "usb-storage,drive=install" ],
[ "-drive", "file=/root/packer-build-master/source/debian/debian-11.2.0-arm64-netinst.iso,if=none,id=install,media=cdrom,readonly=on" ],
# hd
[ "-drive", "if=none,file=build/test/arm64/base-bullseye,id=hd,cache=writeback,discard=ignore,format=qcow2" ],
["-device", "virtio-blk-device,drive=hd"],
# [ "-bios", "edk2-aarch64-code.fd" ],
[ "-bios", "/usr/share/qemu-efi-aarch64/QEMU_EFI.fd" ],
[ "-boot", "strict=off" ],
[ "-monitor", "none" ]
The preseed code is directly used by x86 because the community example does not have arm. Another pitfall here is that the packer variable is used in the preset file, but this is a feature community example. This feature has not been implemented yet. My local preset has changed the variable to the actual value
Operation results and error reporting contents
Connect the QEMU virtual machine through VNC to check whether the disk partition is reached, and then no root file system is defined appears
My solution ideas and tried methods
Find the partition example of Debian preset about amr64, but it is not found
Official link:
https://www.debian.org/releases/stable/arm64/apbs04.en.html#preseed -Partman#preset partition related
https://salsa.debian.org/installer-team/partman-auto#pressed There are various architecture partition examples in the open source warehouse, but there is no arm64
What I want to achieve
Find the partition about arm64 Debian preset, so that the automatic installation of packer can continue