readme.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. Or for EFI:
  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. 1. Edit grub-efi.cfg
  37. Since the driver will show up in the virtual machine as /dev/vda,
  38. change board/pc/grub-efi.cfg to use root=/dev/vda2 instead of
  39. root=/dev/sda2. Then rebuild grub2 and the image.
  40. 2. Run the emulation with:
  41. qemu-system-x86_64 \
  42. -M pc \
  43. -bios </path/to/OVMF_CODE.fd> \
  44. -drive file=output/images/disk.img,if=virtio,format=raw \
  45. -net nic,model=virtio \
  46. -net user
  47. Note that </path/to/OVMF.fd> needs to point to a valid x86_64 UEFI
  48. firmware image for qemu. It may be provided by your distribution as a
  49. edk2 or OVMF package, in path such as
  50. /usr/share/edk2/ovmf/OVMF_CODE.fd .