![]() |
Leosac
0.8.0
Open Source Access Control
|
Describes how to use the "cross_compile" helper container. For ready to run Leosac docker images, see https://hub.docker.com/r/maxhy/leosac
Leosac comes with a container tailored for cross compiling Leosac to the Raspberry Pi. The process of cross-compilation builds, then bundles, all dependencies.
This method trades simplicity for speed. If your idea of fun is not watching your Pi take hours to build Leosac, then you should consider this method to build Leosac.
The recommended way to interact with the cross-compile container is to use leosaccli dev cc XXX. This tool must be built first, however, and the steps below explain how to do that.
The leosaccli tool is the swiss army knife of the Leosac project. It can peform many tasks. Once the tool is built, run leosaccli dev cc --help to see what you can do with it.
When building the container, required libraries are built and installed into /opt/rpi_fakeroot inside the container. Running the container will build an ARM version of Leosac.
To accomplish this, the container expects two or three volumes:
leosaccli dev cc dev-push command.The build will take place in /leosac_arm_build.
This will create a set of files in an aribtrary folder under /tmp. This folder will contain two files, fakeroot.tar and LEOSAC-x.y.x.sh, which should be copied to and then extracted on your RaspberryPi.
Prior to following the steps below, Docker must be installed, and you must be able to run Docker as a non-root user. Verify Docker is working currently by running the "Hello World" container as shown in the Get-Started guide.
Clone the Leosac repository:
git clone https://github.com/leosac/leosaccd leosacgit submodule init && git submodule updateClone the bin-resources repository:
cd ..git clone http://github.com/leosac/bin-resourcescp -r bin-resources/cross-compile-resources leosac/Build the leosaccli tool:
cd leosac/pythonsudo apt-get install python3-pipsudo pip3 install -e .Build the cross-compile container:
leosaccli dev docker build cross_compileCross-compile Leosac:
leosaccli dev cc cmakeleosaccli dev cc fakeroot-packageleosaccli dev cc makeleosaccli dev cc packageDeploy files to the target machine (Raspberry Pi):
leosaccli dev cc dev-pushAfter copying the files to the target machine, log in and unpack the files:
tar -xf fakeroot.tar -C /sudo LEOSAC-x.y.x.sh --prefix=/usr/local where x.y.x is the version of LeosacLeosac is now installed on your system, but there are couple of additional tasks you should perform.
Get the Leosac service file:
Edit the leosac service file, changing /usr/bin/leosac to /usr/local/bin/leosac, then copy it into place:
vi/gedit leosac.servicesudo cp leosac.service /etc/systemd/systemFinally, before you can start Leosac, you need to create a kernel.xml file. See the installation guide.