readme.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. Bare PC sample config
  2. =====================
  3. 1. Build
  4. First select the appropriate target you want.
  5. For BIOS-based boot strategy:
  6. $ make pc_x86_64_bios_defconfig
  7. For EFI-based boot strategy on a GPT-partitioned disk:
  8. $ make pc_x86_64_efi_defconfig
  9. Add any additional packages required and build:
  10. $ make
  11. 2. Write the pendrive
  12. The build process will create a pendrive image called sdcard.img in
  13. output/images.
  14. Write the image to a pendrive:
  15. $ dd if=output/images/disk.img of=/dev/sdc; sync
  16. Once it's done insert it into the target PC and boot.
  17. Remember that if said PC has another boot device you might need to
  18. select this alternative for it to boot.
  19. In the case of EFI boot you might need to disable Secure Boot from
  20. the setup as well.
  21. 3. Enjoy
  22. Emulation in qemu (BIOS)
  23. ========================
  24. 1. Edit grub-bios.cfg
  25. Since the driver will show up in the virtual machine as /dev/vda,
  26. change board/pc/grub-bios.cfg to use root=/dev/vda2 instead of
  27. root=/dev/sda2. Then rebuild grub2 and the image.
  28. 2. Run the emulation with:
  29. qemu-system-x86_64 \
  30. -M pc \
  31. -drive file=output/images/disk.img,if=virtio,format=raw \
  32. -net nic,model=virtio \
  33. -net user
  34. Emulation in qemu (UEFI)
  35. ========================
  36. Run the emulation with:
  37. qemu-system-x86_64 \
  38. -M pc \
  39. -bios </path/to/OVMF_CODE.fd> \
  40. -drive file=output/images/disk.img,if=virtio,format=raw \
  41. -net nic,model=virtio \
  42. -net user
  43. Note that </path/to/OVMF.fd> needs to point to a valid x86_64 UEFI
  44. firmware image for qemu. It may be provided by your distribution as a
  45. edk2 or OVMF package, in path such as
  46. /usr/share/edk2/ovmf/OVMF_CODE.fd .