# 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:
git clone https://abilityplatform.visualstudio.com/Ability%20Platform/_git/ABB.Ability.EdgeSecurity
export SYSTEM_DEFAULTWORKINGDIRECTORY=$(pwd)/ABB.Ability.EdgeSecurity
cd ABB.Ability.EdgeSecurity/Scripts/ARM_CrossCompilationScripts/
./build_DPCM_cross_compilation_armhf.sh
# What does the script do
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.
The
EdgeSecurity
repo gets mounted on chroot environment at/srv/armRoot/edgeSecRepo
location.The script copies all ARM sources of Ubuntu 20.04 to
/etc/apt/sources.list
and installs all the dependencies of the ARM architecture.The ARM tool chain is taken from
$SYSTEM_DEFAULTWORKINGDIRECTORY/Tools/ARM_Toolchain/arm_cross_toolchain.cmake
.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.Initially, the script builds
libSecstoreEngine.so
for EdgeProxy and then builds DPCM binaries, and all are kept in atemp
folder as shown below.temp/alpine/libSecStoreEngine.so temp/PasswdGen temp/pki_wrapper temp/secstore_service
After the cross-compilation, the chroot is unmounted.