-
Notifications
You must be signed in to change notification settings - Fork 2
EXA8 Development
The EXA8 ships by default with OS Ubuntu Xenial for ARM64. Developers can easily cross-compile software for the platform using Docker and the arm64v8/ubuntu:xenial
image
QEMU is required on the Docker host in order to execute arm64/aarch64 code:
apt-get install -y qemu-user-static qemu-user
Create a script (builder.sh
) with commands to build your application inside the running container.
git clone https://github.com/example/my_arm_app.git
cd my_arm_app.git
make
The following pipeline can be used as example to map qemu and launch any script within the arm64v8/ubuntu:xenial
container:
docker run --rm \
-v /usr/bin/qemu-aarch64-static:/usr/bin/qemu-aarch64-static \
-v $(pwd)/:/tmp/build \
--entrypoint=/scripts/builder.sh \
arm64v8/ubuntu:xenial
FPM can be used to easily generate deb
packages for our platform in a few simple steps
Inside the running container install fpm
and its requirements before compiling your code
apt-get -y install ruby ruby-dev rubygems build-essential
gem install --no-ri --no-rdoc fpm
Compile and Install your code to a custom directory, later used to create the package
mkdir /tmp/mycode
make && make DESTDIR=/tmp/mycode install
Launch fpm using the installation directory and adding your variables for name, version, etc:
fpm -s dir -t deb -C /tmp/mycode \
--name ${VERSION_NAME} --version ${VERSION_PROJECT} -p "${VERSION_NAME}_${VERSION_PROJECT}-${INV}.${OS}.${ARCH}.deb" \
--iteration 1 --deb-no-default-config-files --depends ${DEPENDENCY} --description "rtpagent" .
Last but not least, copy the generated package the the mounted directory on the host:
cp -v *.deb /tmp/build
The EXA8 Ubuntu distribution ships w/ kernel 4.14.11-svn258
and no Headers. In order to compile modules:
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.11/linux-headers-4.14.11-041411_4.14.11-041411.201801022143_all.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.14.11/linux-headers-4.14.11-041411-generic_4.14.11-041411.201801022143_arm64.deb
dpkg -i ./linux-headers-*
ln -s /lib/modules/4.14.11-041411-generic /lib/modules/4.14.11-svn258
cd /lib/modules/4.14.11-041411-generic/build
sed -i '/CONFIGS_SECURITY_SELINUX/d' ./scripts/Makefile
make headers_check
make headers_install
make scripts
In case of need, packages and their dependecies can be edited as follows:
Command will create i.e. three files: debian-binary control.tar.gz data.tar.gz
ar x golden-linux.deb
command will create: postinst postrm preinst prerm md5sums control
tar xzf control.tar.gz
(use a text editor)
tar c {post,pre}{inst,rm} md5sums control | gzip -c > control.tar.gz
ar rcs newpackage.deb debian-binary control.tar.gz data.tar.gz