4

I'm trying to build packages for Alpine Linux, which has official support for x86, x86_64, armhf, aarch64, s390x, ppc64le, so I want to build for all of these architectures.

Currently I'm using QEMU's user mode emulation to run chroot environments of these architectures on a x86_64 host, but it seems that it's quite unstable and often lead to crashes. So now I'm trying to run full virtual machines using QEMU.

Installing Alpine Linux for the non-ARM architectures is quite simple and can be done by attaching the .iso images provided in the official download page. However, it's a different story for ARM. There is no other things provided except the archives for netboot and u-boot so I have no idea how to install it. I have tried extracting the archive for netboot and setting -kernel and -initrd to the extracted files but that didn't work. (The full command I used was qemu-system-aarch64 -M vexpress-a9 -kernel vmlinuz-vanilla -initrd initrd-vanilla -append "root=/dev/ram") I got no output in the terminal and Guest had not initialized the display (yet) in the VNC window.

So how can I get the virtual machine booted up? Thanks.

2

1 Answer 1

9

Finally, I successfully booted the virtual machines up. Simply use a command similar to the following one:

aarch64

qemu-system-aarch64 \
  -M virt -m 512M -cpu cortex-a57 \ # Required, cortex-a53 is OK, too
  -kernel vmlinuz-lts -initrd initramfs-lts \ # These two files can be downloaded from http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/
  -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/" \ # The console argument is required to get console output
  -nographic

armv7

Same as aarch64 but replace qemu-system-aarch64 with qemu-system-arm, and cortex-a57 with cortex-a15.

3
  • 1
    Your github repo link to the custom kernel is broken.
    – Justin
    Commented Apr 25, 2019 at 18:59
  • 2
    @Justin I deleted the files because I found out that the official kernel also works. I'll delete the link. Commented Apr 26, 2019 at 2:31
  • This is strange, i have run this command and i get a blank screen if i run it with -nographic option... Works fine without this option
    – Bob5421
    Commented Aug 2, 2022 at 9:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .