Busybox boot on Armv-A Base AEM FVP platforms

Overview of Busybox boot

Busybox is a lightweight executable which packages lots of POSIX compliant UNIX utilities in a single file system. Busybox boot with Armv-A base design platform software stack demonstrates the integration of various software components on the software stack resulting in the ability to boot Linux Kernel on Armv-A Base AEM FVP.

Booting to Busybox is especially helpful when porting the software stack for new platforms which are derivative of Armv-A base design platform as this can be quickly executed to ensure that the various software components are properly integrated and verify the basic functionality of various software components.

This document describes how to build the Armv-A based design platform software stack and use it to boot up to Busybox on the Armv-A Base AEM FVP.

Download the platform software

To obtain the required sources for the platform, follow the steps listed on the user guide page. Ensure that the platform software is downloaded before proceeding with the steps listed below. Also, note the host machine requirements listed on that page which is essential to build and execute the platform software stack.

Skip this section if the required sources already have been downloaded.

Build the platform software

This section describes the procedure to build the following software components for Busybox boot.

  • Trusted firmware (TF-A)

  • U-Boot

  • UEFI

  • GRUB

  • Linux

  • Busybox

The disk image consists of two partitions. The first partition is an EFI system partition and contains GRUB and Kernel Image. The second partition is an ext3 partition which contains the Busybox based rootfs. Examples of how to use the build command for Busybox boot are listed below.

To build the software stack, the command to be used is

./build-scripts/aemfvp-a/build-test-busybox.sh -p <platform name> <command>

Supported command line options are listed below

  • <platform name>

    • aemfvp-a

  • <command>

    • Supported commands are

      • clean

      • build

      • package

      • all (all of the three above)

Note: On networks where the git port is blocked, the build procedure might not progress. Refer to the troubleshooting guide for possible ways to resolve this issue.

Examples of the build command are

  • Command to clean, build and package the software stack required for Busybox boot on Armv-A Base AEM FVP platform:

    ./build-scripts/aemfvp-a/build-test-busybox.sh -p aemfvp-a all
    
  • Command to perform an incremental build of the software components included in the software stack for the Armv-A Base platform.

    Note: this command should be followed by the package command to complete the preparation of the FIP and the disk image.

    ./build-scripts/aemfvp-a/build-test-busybox.sh -p aemfvp-a build
    
  • Command to package the previously built software stack and prepare the FIP and the disk image.

    ./build-scripts/aemfvp-a/build-test-busybox.sh -p aemfvp-a package
    

Individual software component build (Optional)

The user can use the following command if they want to rebuild individual software component. Each software component has a separate script to build that component. After the software components have been built they must be packaged as a disk image using build-test-busybox.sh.

To rebuild individual software components, the command to be used is

./build-scripts/build-<component>.sh -p <platform name> -f <filesystem> <command>

Supported command line options are listed below

  • <component>

    • Supported components are

      • arm-tf

      • uboot

      • uefi

      • grub

      • linux

      • busybox

  • <platform name>

    • aemfvp-a

  • <filesystem>

    • busybox

  • <command>

    • Supported commands are

      • clean

      • build

To repackage the disk image, the command to be used is

./build-scripts/aemfvp-a/build-test-busybox.sh -p <platform name> package

Boot up to Busybox

After the build of the platform software stack for Busybox is complete, the following commands can be used to start the execution of the Armv-A Base AEM FVP model and boot the platform up to the Busybox prompt. Refer to the user guide section Obtaining the Arm-A Base AEM FVP for information on downloading the Arm-A Base AEM FVP model. Examples of how to use the command are listed below.

To boot up to the Busybox prompt, the commands to be used are

  • Set MODEL path before launching the model:

    export MODEL=<absolute path to the platform Armv-A AEM FVP binary>
    
  • Launch Busybox boot:

    ./model-scripts/aemfvp-a/boot.sh -p <platform name> -b <bootloader> -n [true|false]
    

Supported command line options are listed below

  • -p <platform name>

    • aemfvp-a

  • -b <bootloader>

    • Select bootloader to boot with Busybox.

    • uefi (Default)

    • u-boot

  • -n [true|false] (optional)

    • Enable or disable network controller support on the platform. If network ports have to be enabled, use ‘true’ as the option. Default value is set to ‘false’.

Example commands for booting Busybox are listed below.

  • Command to start the execution of the Armv-A Base model to boot up to the Busybox prompt using uefi:

    ./model-scripts/aemfvp-a/boot.sh -p aemfvp-a -b uefi
    
  • Command to start the execution of the Armv-A Base model to boot up to the Busybox prompt using U-Boot:

    ./model-scripts/aemfvp-a/boot.sh -p aemfvp-a -b u-boot
    
  • Command to start the execution of the Armv-A Base model to boot up to the Busybox prompt. The selection of the bootloader to be either UEFI or U-Boot is based on command line parameters. The model supports networking allowing the software running within the model to access the network.

    ./model-scripts/aemfvp-a/boot.sh -p aemfvp-a -b [uefi|u-boot] -n true
    

    Note: If the user stops autoboot while booting with U-Boot and enters the U-Boot command line console, the user must run the following command to continue the boot process.

    run bootcmd
    

    Command to exit from the command line console.

    Ctrl + ]
    telnet> close
    

When the script is executed, four terminal instances will be launched. The usage of each terminal can be seen below,

  • Terminal-0 is the debug console for the AP (Application Processor) and contains the booting logs of Trusted firmware-A, U-Boot, Linux, and user-space applications.

  • Terminal-1 is the debug console for the AP (Application Processor) and contains the UEFI boot logs.

  • Terminal-2 is the debug console that displays the localhost information.

  • The fourth Terminal uses the GUI representation of the model, which contains information about the overall executed instructions of the CPUs and the status of each CPU in the clusters.

The AP will start booting Trusted Firmware-A, followed by UEFI/U-Boot, Linux, and then BusyBox.

To run terminal-only mode on hosts without graphics/display:

env -u DISPLAY ./model-scripts/aemfvp-a/boot.sh -p <platform name> -b <bootloader>

This launches FVP in the background and automatically connects to the interactive application console via telnet.

To stop the model, exit telnet:

Ctrl + ]
telnet> close

Note: The boot logs can be found at <aemfvp-a_workspace>/aemfvp-a path after booting busybox. The following logs are generated in this path.

  • uart0.log: Terminal-0 debug console logs are stored in the uart0.log file. It is a symbolic link for uart0 log file with the latest timestamp.

  • uart1.log: Terminal-1 debug console logs are stored in the uart1.log file. It is a symbolic link for uart1 log file with the latest timestamp.


Copyright (c) 2021, Arm Limited. All rights reserved.