Skip to content

RPI5 build Linux domain

Oleksii Moisieiev edited this page Jun 6, 2024 · 2 revisions

This article describes how to build an external image with embedded initrd which could serve the demonstration purposes to show work of PVNET and PVBLOCK drivers.

This image is generic Linux Kernel port for RaspberryPI board

Build

Build Ramdisk image

Please follow instructions from the following link. Build ramdisk

Before building image the following script should be created as <ramdisk_root>/init

#!/bin/sh
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev
# Set loglevel to debug to see the messages from the module on the console
echo \"7\" > /proc/sys/kernel/printk
/bin/sh

Please see the following link for details: ramdisk

As the result the following artifact should be generated:

initrd_domU1

Please make sure that the result image has cpio.gz format.

Build kernel with ramdisk

Please follow instructions from the following link. Build RPI5 Kernel

Before building kernel please add the following configuration to the bcm2712_defconfig

CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="/path/to/initrd_domU1"
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0

After building the following image will be generated:

arch/arm64/boot/Image

Please see instructions from the following link about how to add the result image to the build: Readme.md

Test

After building successfully the result image can be tested using the following commands: From Dom0 execute commands:

xu create linux_pv_domu
xu console 2

where 2 is domain_id and it could be different if there are another Domus running.

Then from domu2 console pvblk frontend can be checled

ls /dev/xvda

this is the device which is created by XEN which indicates that pvblk works.

To test pvnet please use the following commands from domu console:

ip addr add dev <eth device> 192.168.0.2/24
ip link set <eth device> up
ping -c 3 192.168.0.1

The same test can be run from DomD console. Please switch to DomD console and execute command from shell:

ping 192.168.0.2