-
Notifications
You must be signed in to change notification settings - Fork 0
Development
This page is dedicated to the developers of Safecor.
Safecor is developed with a few technologies:
- The API, controllers and services are developped in Python 3.
- The system base is Alpine Linux.
- Some scripts are developped in
shelllanguage. - Tests apps are developped with Qt and particularly PySide (Qt for Python)
A developer's environement can be setup on Windows, GNU/Linux or MacOS. It uses tools that operate on all these operational systems.
You can develop directly on an Alpine Linux environment. In this case you can skip the Docker section.
The source code is maintained on Github. At least a git command line should be installed on your environement. Otherwise, graphical tools like Github Desktop can be used.
The source code is provided with a default configuration for Visual Studio Code. The usage of VSCode is not mandatory, any code editor can be used to edit shell scripts and python code.
Test unittests are coded in Python using the module unittests and can be executed from the command line.
In order to code on the tests and diag apps, the Qt environment is necessary.
The build environment is necessary to calculate the checksums of the Alpine packages and build the packages for local tests.
A build environment requires an Alpine Linux setup. This can be done in a virtual machine or a Docker. This section documents the Docker environment as the scripts and images are provided for Docker and this can be done on Windows, GNU/Linux and MacOS.
First of all you need to install Docker, preferably with Docker desktop.
The only image required is an official Alpine Linux image alpine-latest. It will downloaded automatically by the setup script.
Once Docker is setup on your system, you have to run the script setup/docker/create-dev-image.sh. You may have to adapt the DOCKER_PATH variable in the script to match your environment.
At the end of the script execution, you will have a new image named safecor-dev. This is the image that will be used for all the tasks, it is prepared with all the necessary tools.
Different aspects of the development and integration of Safecor.
In Alpine Linux, a splash screen is automatically shown when a file named fbsplash[0-9].ppm is present on the root of a device mounted in /media, which includes the initramfs. An additional fbsplash[0-9].cff can be provided to configure the image aspect (see fbsplash busybox).
This sections contains different notes for the developers...
Measured between a USB HDD on sys-usb and the storage on Dom0:
| command | mount msize | tool options | file size | Duration | Rate | Result |
|---|---|---|---|---|---|---|
| cp (coreutils) | 65 535 | - | 2 277 091 816 | 21,2s | 107 MB/s | Success |
| cp (coreutils) | 131 072 | - | 2 277 091 816 | 18,35s | 124 MB/s | Success |
| cp (coreutils) | 262 144 | - | 2 277 091 816 | 18,5s | 123 MB/s | Success -> Failure? |
| cp (coreutils) | 524 288 | - | 2 277 091 816 | - | - | Failure |
| cp (Busybox) | 65 535 | - | 2 277 091 816 | 18,71s | 121 MB/s | Success |
| cp (Busybox) | 131 072 | - | 2 277 091 816 | 18,45s | 123 MB/s | Success |
| cp (Busybox) | 262 144 | - | 2 277 091 816 | 18,53s | 123 MB/s | Success |
| cp (Busybox) | 524 288 | - | 2 277 091 816 | 18,4s | 124 MB/s | Success |
| dd (coreutils) | 65 535 | bs=512 | 2 277 091 816 | minutes | - | Success |
| dd (coreutils) | 65 535 | bs=1M | 2 277 091 816 | 18,05s | 126 MB/s | Success |
| dd (coreutils) | 65 535 | bs=4M | 2 277 091 816 | 19,02s | 120 MB/s | Success |
| dd (coreutils) | 131 072 | bs=512 | 2 277 091 816 | minutes | - | Failure |
| dd (coreutils) | 131 072 | bs=1M | 2 277 091 816 | 18,02s | 126 MB/s | Success |
| dd (coreutils) | 131 072 | bs=4M | 2 277 091 816 | 18,32s | 124 MB/s | Success |
| dd (coreutils) | 262 144 | bs=4M | 2 277 091 816 | - | - | Failure |
| dd (coreutils) | 262 144 | bs=1M | 2 277 091 816 | - | - | Failure |
| dd (coreutils) | 262 144 | bs=512 | 2 277 091 816 | minutes | - | Failure |
| rsync | 131 072 | - | 2 277 091 816 | - | - | Failure |
| rsync | 131 072 | - | 2 277 091 816 | - | - | Failure |
| rsync | default | - | 2 277 091 816 | - | - | Failure |
| rsync | 262 144 | - | 2 277 091 816 | - | - | Failure |
Measured on a Durabook R8 Core i7
2277091816