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/leosac
cd leosac
git submodule init && git submodule update
Clone the bin-resources repository:
cd ..
git clone http://github.com/leosac/bin-resources
cp -r bin-resources/cross-compile-resources leosac/
Build the leosaccli tool:
cd leosac/python
sudo apt-get install python3-pip
sudo pip3 install -e .
Build the cross-compile container:
leosaccli dev docker build cross_compile
Cross-compile Leosac:
leosaccli dev cc cmake
leosaccli dev cc fakeroot-package
leosaccli dev cc make
leosaccli dev cc package
Deploy files to the target machine (Raspberry Pi):
leosaccli dev cc dev-push
After 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.service
sudo cp leosac.service /etc/systemd/system
Finally, before you can start Leosac, you need to create a kernel.xml file. See the installation guide.