README 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. This target generates images that can be used on ARM machines with EFI
  2. support (e.g EDKII/TianoCore or U-Boot with bootefi).
  3. There are two subtargets:
  4. - armv7 for 32-bit machines
  5. - armv8 for 64-bit machines
  6. The kernel and filesystem images can also be used directly by QEMU:
  7. Run with qemu-system-arm
  8. # boot with initramfs embedded in
  9. qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armsr-armv7-generic-initramfs-kernel.bin
  10. # boot with accel=kvm
  11. qemu-system-arm -nographic -M virt,accel=kvm -cpu host -m 64 -kernel
  12. openwrt-armsr-armv7-generic-initramfs-kernel.bin
  13. # boot with a separate rootfs
  14. qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armsr-armv7-generic-kernel.bin \
  15. -drive file=openwrt-armsr-armv7-generic-ext4-rootfs.img,format=raw,if=virtio -append 'root=/dev/vda rootwait'
  16. # boot with local dir as rootfs
  17. qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armsr-armv7-generic-kernel.bin \
  18. -fsdev local,id=rootdev,path=root-armsr/,security_model=none \
  19. -device virtio-9p-pci,fsdev=rootdev,mount_tag=/dev/root \
  20. -append 'rootflags=trans=virtio,version=9p2000.L,cache=loose rootfstype=9p'
  21. Run with kvmtool
  22. # start a named machine
  23. lkvm run -k openwrt-armsr-armv7-zImage -i openwrt-armsr-armv7-rootfs.cpio --name armsr0
  24. # start with virtio-9p rootfs
  25. lkvm run -k openwrt-armsr-armv7-zImage -d root-armsr/
  26. # stop "armsr0"
  27. lkvm stop --name armsr0
  28. # stop all
  29. lkvm stop --all
  30. The multi-platform ARMv8 target can be used with QEMU:
  31. qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic \
  32. -kernel openwrt-armsr-armv8-generic-initramfs-kernel.bin \
  33. With a EDKII or U-Boot binary for the QEMU ARM virtual machines, you can use these
  34. images in EFI mode:
  35. 32-bit:
  36. gunzip -c bin/targets/armsr/armv7/openwrt-armsr-armv7-generic-ext4-combined-efi.img.gz > openwrt-arm-32.img
  37. qemu-system-arm -nographic \
  38. -cpu cortex-a15 -machine virt \
  39. -bios bin/targets/armsr/armv7/u-boot-qemu_armv7/u-boot.bin \
  40. -smp 1 -m 1024 \
  41. -device virtio-rng-pci \
  42. -drive file=openwrt-arm-32.img,format=raw,index=0,media=disk \
  43. -netdev user,id=testlan -net nic,netdev=testlan \
  44. -netdev user,id=testwan -net nic,netdev=testwan
  45. 64-bit:
  46. gunzip -c bin/targets/armsr/armv8/openwrt-armsr-armv8-generic-ext4-combined-efi.img.gz > openwrt-arm-64.img
  47. qemu-system-aarch64 -nographic \
  48. -cpu cortex-a53 -machine virt \
  49. -bios bin/targets/armsr/armv8/u-boot-qemu_armv8/u-boot.bin \
  50. -smp 1 -m 1024 \
  51. -device virtio-rng-pci \
  52. -drive file=openwrt-arm-64.img,format=raw,index=0,media=disk \
  53. -netdev user,id=testlan -net nic,netdev=testlan \
  54. -netdev user,id=testwan -net nic,netdev=testwan
  55. One can obtain other EFI/BIOS binaries from:
  56. - Distribution packages (such as qemu-efi-arm and qemu-efi-aarch64 in Debian)
  57. - Community builds, like retrage/edk2-nightly: https://retrage.github.io/edk2-nightly/