You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

IN PROGRESS

introduction

 RDKM team in collaboration with  bringup RDK-B on ARM System Ready reference device and make it available for RDK-B community as a reference for RDK-B          


Yocto Build Instructiuons

NXP:

Build Instructions for NXP
$ mkdir rdkb-arm
$ cd rdkb-arm
$ repo init -u 'https://github.com/rdkcentral/meta-rdk-bsp-arm/' \
    -m "manifests/rdkb-bsp-arm.xml" \
    -b "main"
$ repo sync
$ source meta-rdk-bsp-arm/setup-environment
$ bitbake rdk-generic-broadband-image

RPI:

Build Instruction for RPI
$ mkdir rdkb-arm
$ cd rdkb-arm
$ repo init -u 'https://github.com/rdkcentral/meta-rdk-bsp-arm/' \
    -m "manifests/rdkb-bsp-arm.xml" \
    -b "main"
$ repo sync
$ MACHINE="raspberrypi64-rdk-broadband" source meta-rdk-bsp-arm/setup-environment
$ bitbake rdk-generic-broadband-image


QEMU:

Build Instruction for QEMU
$ mkdir rdkb-arm
$ cd rdkb-arm
$ repo init -u 'https://github.com/rdkcentral/meta-rdk-bsp-arm/' \
    -m "manifests/rdkb-bsp-arm.xml" \
    -b "main"
$ repo sync
$ MACHINE="armefi64-qemu-broadband" source meta-rdk-bsp-arm/setup-environment
$ bitbake rdk-generic-broadband-image

 

The default ARM build have been updated to include additional features such as  erouter0, Captive Portal and WebUI support.

The required PRs to be cherry-picked

 https://github.com/rdkcentral/ethernet-agent/pull/40
 https://github.com/rdkcentral/meta-rdk-bsp-arm/pull/4
 https://github.com/rdkcentral/meta-rdk-bsp-arm/pull/7
 https://github.com/rdkcentral/meta-rdk-bsp-arm/pull/8
 https://github.com/rdkcentral/webui/pull/81
 https://github.com/rdkcentral/meta-rdk-bsp-arm/pull/11


There are two types of build outputs:

  • The platform firmware, which abstracts the hardware platform in a standard manner (the SystemReady standards).

  • The operating system image, which includes the root filesystem, Linux kernel and boot manager.

    Development images generated by this layer can be used across any machine which has a compatible platform firmware deployed.

The default armefi64-rdk-broadband machine type will generate an operating system image that will be bootable on platforms with SystemReady (EFI) compatible firmware and a platform firmware firmware which can be used with QEMU's arm64 virt machine type.

The following generated binaries (in build-armefi64-rdk-broadband/tmp/deploy/images/armefi64-rdk-broadband/) are relevant:

  • rdk-generic-broadband-image-armefi64-rdk-broadband.wic: Uncompressed operating system image (kernel + rootfs + boot manager)

    This image can be booted on a board (or virtual machine) which already has SystemReady compatible firmware

  • rdk-generic-broadband-image-armefi64-rdk-broadband.wic.qcow2: QCOW2 operating system image, best to use with virtual machine programs

  • rdk-generic-broadband-image-armefi64-rdk-broadband.tar.gz: Compressed tar archive of the operating system image (including kernel). This is currently used for system upgrades.

  • u-boot-armefi64-rdk-broadband.bin (linked to u-boot.bin): Reference platform firmware (used with QEMU virt machine)

The generated disk (wic) images are intended for block storage devices, for example, eMMC, SD cards, USB or NVMe storage devices, or emulated types such as virtio-blk.

A production device may use flash (NOR or NAND) devices for storing the system level firmware.

Additional files like Image (Linux kernel Image file), linuxaa64.efi.stub (Kernel EFI stub), systemd-bootaa64.efi (systemd-boot executable) and u-boot-initial-env-armefi64-rdk-broadband (U-Boot "Factory" environment) are also generated by the Yocto build process. These are not needed for normal development and deployment activities.

It is intended that the rdk-generic-broadband-image-armefi64-rdk-broadband.wic is a universal operating system image that will boot on as many real and virtual machines as possible.

(For example, you can write the .wic file onto a USB drive, and move the USB drive between different boards without making any changes)

Where possible, the same Linux kernel, firmware (U-Boot) and other relevant component versions will be used, with a strong preference for "mainline" versions.

Configuring multiconfig for multiple target builds

It is possible to use BitBake's "multiconfig" feature to setup the same build folder for multiple targets at once.

Doing so will save you time and disk space, as most packages between machines defined in this layer are shared.

If you specify MACHINE=all, the setup-environment script will do the necessary setup:

$ MACHINE="all" source meta-rdk-bsp-arm/setup-environment


 You can then run the build cycle for each target:

$ bitbake mc:generic:rdk-generic-broadband-image && \
    bitbake mc:raspberrypi:rdk-generic-broadband-image
(Due to the way RDK-B components are built, it is not possible to do a "parallel" build for two targets at once, however, you will still save a significant amount of time and disk space by using multiconfig builds sequentially)

Build images for each target will be available in tmp/deploy:

$ ls build-armefi64-rdk-broadband/tmp/deploy/images/
armefi64-rdk-broadband
raspberrypi64-rdk-broadband.

Running the generated image on QEMU

Direct QEMU invocation

You can use the generated wic.qcow2 and u-boot.bin to invoke QEMU directly. This allows you to customize your QEMU setup for your own environment and requirements.

On virtualization capable Arm64 hosts you can use KVM for near-native performance.

You can invoke QEMU like this:

QEMU invocation
# Copy the QCOW2 image and u-boot.bin from the deploy directory
cp $HOME/rdkb-cmf-arm/build-armefi64-rdk-broadband/tmp/deploy/images/armefi64-rdk-broadband/{rdk-generic-broadband-image-armefi64-rdk-broadband.wic.qcow2,u-boot.bin} .

# It can be helpful to create a snapshot to quickly revert
# any changes that are made
qemu-img create -f qcow2 -b rdk-generic-broadband-image-armefi64-rdk-broadband.wic.qcow2 -F qcow2 rdk.snapshot.qcow2
# And resize that snapshot to allow space for upgrades
qemu-img resize rdk.snapshot.qcow2 10G

DISK=${DISK:-rdk.snapshot.qcow2}
sudo qemu-system-aarch64 -nographic \
    -cpu cortex-a53 -machine virt \
    -bios u-boot.bin \
    -smp 2 -m 1024 \
    -device virtio-rng-pci \
    -hda "${DISK}" \
    -netdev tap,id=testlan -net nic,netdev=testlan \
    -netdev tap,id=testlan2 -net nic,netdev=testlan2 \
    -netdev user,id=testwan -net nic,netdev=testwan \
    -device pci-serial
#using bridge manager:
# ensure /usr/local/libexec/qemu-bridge-helper is present and executable
# provide /usr/local/etc/qemu/bridge.conf:
#     allow br10
#     allow br100

sudo qemu-system-aarch64 -nographic \
    -cpu cortex-a53 -machine virt \
    -bios u-boot.bin  \
    -smp 2 -m 1024  \
    -device virtio-rng-pci  \
    -hda "${DISK}"  \
    -netdev bridge,id=testwan,br=br10 \
    -device virtio-net pci,netdev=testwan,mac=52:54:00:2d:6e:99  \
    -netdev bridge,id=testlan,br=br100 \
    -device virtio-net-pci,netdev=testlan,mac=52:54:00:2d:6e:98  \
    -device pci-serial






  • No labels