You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Performance/Mobile Device Lab/Raspberry Pi Image

From Wikitech-static
Jump to navigation Jump to search

The device lab images are based on the upstream Debian GNU/Linux image. I’ve forked the build scripts to include the additional dependencies we require.

Some of the installation steps still need to be converted to .deb packages.

Building the image

Install the dependencies, per the upstream instructions.

Run make raspi_4_bullseye.img. You don’t need to be root if fakemachine is installed.

I compress the image using pv -s 4G < raspi_4_bullseye.img | xz -8c > devicelab_bullseye.img. (The compress.sh script from upstream doesn’t work as a non-root user and didn’t generate much in the way of space savings when I tested it.)

Writing the image

Run sudo dd if=devlicelab_bullseye.img of=/dev/mmcblk0 bs=8M.

After writing, I run fsck /dev/mmcblk0p2 to check for errors. In the past, I’ve run into issues with no-brand SD cards silently eating data.

If you get garbage on the serial console starting mid-way through the boot sequence, you should mount /dev/mmcblk0p1 and edit cmdline.txt to add module_blacklist=vc4. This works around an upstream bug for me.

Running the image

The default user is wmf, which is in sudoers.

You can configure a static IP or wifi network information by mounting the image (or, if you have console access, booting and logging in) and editing the files in /etc/network/interfaces.d. Wireguard is included, and soon the image will contain startup scripts to automatically “phone home” with a VPN connection for talking to the attached devices.

If you’re connection a modern Android device, the usb0 interface corresponds to a USB ethernet interface that can be used for reverse tethering. Otherwise, either Web Page Relay or gnirehtet can be used to tunnel web traffic over the USB interface. Work is in progress to make both solutions work better out of the box.

Sitespeed.io is installed for running mobile tests. Our current test setup is in [Gerrit https://gerrit.wikimedia.org/g/performance/mobile-synthetic-monitoring-tests/+/refs/heads/master].