build-xen 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. # https://cirosantilli.com/linux-kernel-module-cheat#xen
  3. set -eux
  4. cd submodules/xen
  5. make \
  6. -j `nproc` \
  7. dist-xen \
  8. CONFIG_DEBUG=y \
  9. CONFIG_EARLY_PRINTK=pl011,0x09000000 \
  10. CROSS_COMPILE=aarch64-linux-gnu- \
  11. XEN_TARGET_ARCH=arm64 \
  12. ;
  13. cd ../boot-wrapper-aarch64
  14. ../../out/qemu/default/aarch64-softmmu/qemu-system-aarch64 \
  15. -machine virt \
  16. -machine virtualization=on \
  17. -machine gic_version=3 \
  18. -cpu cortex-a57 \
  19. -kernel xen-system.axf \
  20. -serial mon:stdio \
  21. -nographic \
  22. -machine dumpdtb=dtb.dtb \
  23. ;
  24. autoreconf -i
  25. ./configure \
  26. --enable-gicv3 \
  27. --enable-psci \
  28. --host=aarch64-linux-gnu \
  29. --with-cmdline="console=hvc0 earlycon=pl011,0x09000000 root=/dev/vda rw" \
  30. --with-dtb=dtb.dtb \
  31. --with-kernel-dir=../../out/linux/default/aarch64 \
  32. --with-xen-cmdline="dtuart=/pl011,0x09000000 console=dtuart no-bootscrub dom0_mem=512M loglvl=all guest_loglvl=all" \
  33. --with-xen=../xen/xen/xen \
  34. ;
  35. make -j `nproc`
  36. ../../out/qemu/default/aarch64-softmmu/qemu-system-aarch64 \
  37. -machine virt \
  38. -machine virtualization=on \
  39. -machine gic_version=3 \
  40. -cpu cortex-a57 \
  41. -kernel xen-system.axf \
  42. -serial mon:stdio \
  43. -nographic \
  44. ;