Skip to content

Instantly share code, notes, and snippets.

@korjaa
Last active May 26, 2022 14:34
Show Gist options
  • Save korjaa/6fe4e9d0b91350486514487aad242cf1 to your computer and use it in GitHub Desktop.
Save korjaa/6fe4e9d0b91350486514487aad242cf1 to your computer and use it in GitHub Desktop.
Buildroot & QEMU notes

Buildroot & QEMU

Navigating menuconfig

  • Search with /
  • Jump with 1

Building Commands

make xapp_dwm-rebuild

make BR2_JLEVEL=$(nproc)

Generic changes on default

  • Change BR2_TOOLCHAIN_BUILDROOT to glibc (required by matplotlib)
  • No need for BR2_TOOLCHAIN_BUILDROOT_WCHAR as it's uClibc thing
  • Enable C++ required by many packages at BR2_TOOLCHAIN_BUILDROOT_CXX
  • Enable BR2_CCACHE for quicker build
  • Increase BR2_TARGET_ROOTFS_EXT2_SIZE size to 128M (quickly required)

Enabling X-server

  • Enable BR2_PACKAGE_XORG7
  • Enable BR2_PACKAGE_XSERVER_XORG_SERVER (modular)
  • Enable "Dynamic using devtmpfs + eudev" for "/dev management" under System configuration.
  • Enable drivers
    • BR2_PACKAGE_XDRIVER_XF86_INPUT_KEYBOARD
    • BR2_PACKAGE_XDRIVER_XF86_INPUT_MOUSE
    • BR2_PACKAGE_XDRIVER_XF86_VIDEO_CIRRUS (QEMU simulates this)
    • BR2_PACKAGE_XDRIVER_XF86_VIDEO_FBDEV
    • BR2_PACKAGE_XDRIVER_XF86_VIDEO_VESA
    • BR2_PACKAGE_XDRIVER_XF86_INPUT_EVDEV (QEMU tablet mode mouse)

Python Matplotlib

  • Enable BR2_PACKAGE_PYTHON3
  • Enable BR2_PACKAGE_PYTHON_MATPLOTLIB

Buildroot has matplotlib-qt if you have qt5 enabled - Enable QT5 - Enable mesa3d backend (qt supports OpenGL ES also)

Fixing mouse

By default it seems the mouse doesn't want to move

I was able to fix this by manual xorg.conf. This can be done with following steps:

  1. Launch qemu with "-usb -device usb-tablet"
  2. Find /dev/eventX for "QEMU QEMU USB Tablet" with "cat /proc/bus/input/devices"
  3. Stop Xorg with "/etc/init.d/S40xorg stop"
  4. Create default Xorg configuration with "Xorg -configure"
  5. Modify the "InputDevice" for mouse to:
Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "evdev"
        Option      "Device" "/dev/input/event2"
EndSection

Modifying rootfs files

  1. Create "rootfs_overlay" folder to project root.
  2. Set BR2_ROOTFS_OVERLAY to "rootfs_overlay"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment