Skip to content

Instantly share code, notes, and snippets.

@olivierlemoal
Last active March 17, 2020 12:10
Show Gist options
  • Save olivierlemoal/363786f98abd5cbce539fc045fd8e369 to your computer and use it in GitHub Desktop.
Save olivierlemoal/363786f98abd5cbce539fc045fd8e369 to your computer and use it in GitHub Desktop.
buildroot ARM QEMU image
git clone https://github.com/buildroot/buildroot
cd buildroot
git checkout 2020.02
make qemu_arm_versatile_defconfig
make menuconfig # add packages (dropbear ...)
unset LD_LIBRARY_PATH
=================
File sharing
https://superuser.com/questions/628169/how-to-share-a-directory-with-the-host-without-networking-in-qemu
Edit board/qemu/arm-versatile
CONFIG_9P_FS=y
CONFIG_9P_FS_POSIX_ACL=y
CONFIG_9P_FS_SECURITY=y
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NET_9P=y
CONFIG_NET_9P_DEBUG=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y
CONFIG_PCI_HOST_COMMON=y
CONFIG_PCI_HOST_GENERIC=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_NET=y
qemu option : -virtfs local,path=/path/to/share,mount_tag=host0,security_model=passthrough,id=host0
In guest : mount -t 9p -o trans=virtio,version=9p2000.L host0 /mnt
=================
make BR2_JLEVEL="$(($(nproc) - 2))"
# From: https://github.com/buildroot/buildroot/blob/master/board/qemu/arm-versatile/readme.txt
qemu-system-arm -M versatilepb -kernel output/images/zImage -dtb output/images/versatile-pb.dtb -drive file=output/images/rootfs.ext2,if=scsi,format=raw -append "rootwait root=/dev/sda console=ttyAMA0,115200" -serial stdio -net nic,model=rtl8139 -net user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment