# Cross-compilation of Security Components for ARM

The cross-compilation of DPCM and Secure Storage for ARM is done via an automated bash script. The script was prepared for Ubuntu 20.04 (Focal Fossa).

# Using the bash script

To run the script do the following steps:

  1. git clone https://abilityplatform.visualstudio.com/Ability%20Platform/_git/ABB.Ability.EdgeSecurity

  2. export SYSTEM_DEFAULTWORKINGDIRECTORY=$(pwd)/ABB.Ability.EdgeSecurity

  3. cd ABB.Ability.EdgeSecurity/Scripts/ARM_CrossCompilationScripts/

  4. ./build_DPCM_cross_compilation_armhf.sh

# What does the script do

  1. The entire cross-compilation happens under a chroot environment such that the actual Linux root file system is untouched by the cross-compilation process.

    chroot

    The chroot command is essential in Linux systems. It helps you change the root directory for a process along with its child processes. When we create a fake root directory for a user or group, it loses access to the true root directory. Hence, the user or group is now isolated from the rest of our system.

  2. The EdgeSecurity repo gets mounted on chroot environment at /srv/armRoot/edgeSecRepo location.

  3. The script copies all ARM sources of Ubuntu 20.04 to /etc/apt/sources.list and installs all the dependencies of the ARM architecture.

  4. The ARM tool chain is taken from $SYSTEM_DEFAULTWORKINGDIRECTORY/Tools/ARM_Toolchain/arm_cross_toolchain.cmake.

  5. The cross-compilation script is followed by debian package script $SYSTEM_DEFAULTWORKINGDIRECTORY/Scripts/ARM_CrossCompilationScripts/build_all_packages_cross_compilation_armhf.sh. Hence the binaries and libraries are created under temporary folder.

  6. Initially, the script builds libSecstoreEngine.so for EdgeProxy and then builds DPCM binaries, and all are kept in a temp folder as shown below.

    temp/alpine/libSecStoreEngine.so
    temp/PasswdGen
    temp/pki_wrapper
    temp/secstore_service
    
  7. After the cross-compilation, the chroot is unmounted.

Last updated: 10/13/2021, 7:29:21 AM
Feedback