Skip to content

Instantly share code, notes, and snippets.

@hhromic
Last active January 28, 2023 13:53
Show Gist options
  • Save hhromic/9de455e943a52e0a641cf5171cc18e86 to your computer and use it in GitHub Desktop.
Save hhromic/9de455e943a52e0a641cf5171cc18e86 to your computer and use it in GitHub Desktop.
Building WPE with Yocto for Raspberry Pi Zero W

Repositories Cloning

BRANCH=master  # or 'rocko'
xargs -n 1 git clone -b $BRANCH <<'__EOF__'
git://git.yoctoproject.org/poky
git://git.openembedded.org/meta-openembedded
git://github.com/agherzan/meta-raspberrypi
git://github.com/webplatformforembedded/meta-wpe
__EOF__

Patching

In rocko, fix building of mesa-gl in meta-raspberrypi for ARMv6 (source):

cat <<'__EOF__' >> meta-raspberrypi/recipes-graphics/mesa/mesa-gl_%.bbappend
CFLAGS_append_armv6 = " -DMISSING_64BIT_ATOMICS"
__EOF__

Image Building

Build dependencies (install user or system wide once):

Create build directory and add layers:

source poky/oe-init-build-env
xargs -n 1 bitbake-layers add-layer <<'__EOF__'
../meta-openembedded/meta-oe
../meta-openembedded/meta-python
../meta-openembedded/meta-multimedia
../meta-openembedded/meta-networking
../meta-raspberrypi
../meta-wpe
__EOF__

Configure the build:

cat <<'__EOF__' >> conf/local.conf
    
# configuration
MACHINE = "raspberrypi0-wifi"
SERIAL_CONSOLE = ""
DISABLE_RPI_BOOT_LOGO = "1"
DISABLE_OVERSCAN = "1"
DISABLE_SPLASH = "1"
BOOT_DELAY = "0"
GPU_MEM_256 = "128"
GPU_MEM_512 = "196"
GPU_MEM_1024 = "396"
DISTRO_FEATURES_remove = "x11"
DISTRO_FEATURES_append = " opengl"
PACKAGE_CLASSES = "package_ipk"
IMAGE_INSTALL_append = " chrony"
IMAGE_INSTALL_append = " linux-firmware-bcm43430 wpa-supplicant"
IMAGE_FSTYPES = "tar.bz2 ext4 rpi-sdimg"
SDIMG_ROOTFS_TYPE = "ext4"
__EOF__

For basic Bluetooth support:

cat <<'__EOF__' >> conf/local.conf
IMAGE_INSTALL_append = " bluez5 udev-rules-rpi"
__EOF__

Westeros Backend

Build the image:

bitbake wpe-westeros-image

EGLFS Backend

Remove wayland and set the WPE backend and platform to rpi:

cat <<'__EOF__' >> conf/local.conf
WPE_BACKEND = "rpi"
WPE_PLATFORM = "rpi"
DISTRO_FEATURES_remove = "wayland"
__EOF__

Build the image:

bitbake wpe-eglfs-image

Running Image Configuration

Networking Setup

  • Set wlan0 to auto in /etc/network/interfaces.
  • Remove auto from eth0 in /etc/network/interfaces.
  • Edit /etc/wpa_supplicant.conf to add your wireless networks configuration.

Bluetooth Setup

You need to attach the firmware to the HCI:

/usr/bin/hciattach /dev/serial1 bcm43xx 921600 noflow -
@ajpenner
Copy link

This is an old thread, but for those (like me) who come across this later, there is support for headless configuratio. Add the following line to your local.conf:
ENABLE_DWC2_PERIPHERAL = "1"
And the Raspberry-Pi can be run in device mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment