buildroot/board/pc
Cherniaev Andrei 9e3d572ff5 configs/pc: fix grub root device in help
The rootfs partition is the first partition, not the second one: the
Grub configuration file already contains root=/dev/sda1 by default,
and it should be changed to root=/dev/vda1 is Qemu emulation is used.

Signed-off-by: Cherniaev Andrei <dungeonlords789@naver.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-10-31 18:40:40 +01:00
..
genimage-bios.cfg board/pc: fix build failure due to new genimage 15 2022-02-12 23:04:28 +01:00
genimage-efi.cfg board/*/genimage.cfg: use partition-type-uuid U where relevant 2022-07-23 15:36:22 +02:00
grub-bios.cfg configs/pc: refactor to use genimage and grub.cfg 2017-10-22 16:27:53 +02:00
grub-efi.cfg configs/pc_x86_64_efi: use genimage GPT partition table support 2019-11-12 23:01:38 +01:00
linux.config board/pc/linux.config: Add framebuffer and pci support 2023-04-14 20:28:26 +02:00
post-build.sh configs/pc_x86_64_bios_defconfig: fix image generation after grub2 rework 2021-12-05 12:32:24 +01:00
post-image-efi.sh board/pc/post-image-efi.sh: fail on any error 2019-12-02 12:47:47 +01:00
readme.txt configs/pc: fix grub root device in help 2024-10-31 18:40:40 +01:00

Bare PC sample config
=====================

1. Build

  First select the appropriate target you want.

  For BIOS-based boot strategy:

  $ make pc_x86_64_bios_defconfig

  For EFI-based boot strategy on a GPT-partitioned disk:

  $ make pc_x86_64_efi_defconfig

  Add any additional packages required and build:

  $ make

2. Write the pendrive

  The build process will create a pendrive image called sdcard.img in
  output/images.

  Write the image to a pendrive:

  $ dd if=output/images/disk.img of=/dev/sdc; sync

  Once it's done insert it into the target PC and boot.

  Remember that if said PC has another boot device you might need to
  select this alternative for it to boot.

  In the case of EFI boot you might need to disable Secure Boot from
  the setup as well.

3. Enjoy

Emulation in qemu (BIOS)
========================

1. Edit grub-bios.cfg

  Since the driver will show up in the virtual machine as /dev/vda,
  change board/pc/grub-bios.cfg to use root=/dev/vda1 instead of
  root=/dev/sda1. Then rebuild grub2 and the image.

2. Run the emulation with:

qemu-system-x86_64 \
	-M pc \
	-drive file=output/images/disk.img,if=virtio,format=raw \
	-net nic,model=virtio \
	-net user


Emulation in qemu (UEFI)
========================

Run the emulation with:

qemu-system-x86_64 \
	-M pc \
	-bios </path/to/OVMF_CODE.fd> \
	-drive file=output/images/disk.img,if=virtio,format=raw \
	-net nic,model=virtio \
	-net user

Note that </path/to/OVMF.fd> needs to point to a valid x86_64 UEFI
firmware image for qemu. It may be provided by your distribution as a
edk2 or OVMF package, in path such as
/usr/share/edk2/ovmf/OVMF_CODE.fd .