ELBE Overview: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
Prepare for ELBE docker container
Some corrections and inclusion of the docker parts for review
 
(One intermediate revision by the same user not shown)
Line 21: Line 21:
As an addition ELBE is able to create a cdrom image which can be used as a input to reconstruct the exact root-filesystem that was created.
As an addition ELBE is able to create a cdrom image which can be used as a input to reconstruct the exact root-filesystem that was created.


ELBE can also create a Software Development Kit (SDK) for the built root-filesystem. The SDK contains the toolchain with the cross compiler and other tools and the corresponding sysroot with needed headers. These can be used to create software for the specific root-filesystem. The SDK is very similar to Yocto's Standard-SDK and can be used in the same way. An explanation how to use the SDK with some IDEs/buildsystems can be found here: ''Link following''
ELBE can also create a Software Development Kit (SDK) for the built root-filesystem. The SDK contains the toolchain with the cross compiler and other tools and the corresponding sysroot with needed headers. These can be used to create software for the specific root-filesystem. The SDK is very similar to Yocto's Standard-SDK and can be used in the same way. An explanation how to use the SDK with some IDEs/buildsystems can be found here: [[Using Yocto/ELBE SDK for application development]]


==Installation==
==Installation==
Line 44: Line 44:
===Cloning the git repository of ELBE===
===Cloning the git repository of ELBE===


There is also the possibility to clone the git repository of ELBE. To do this the following packages have to be installed on the system:
There is also the possibility to clone the git repository of ELBE.
 
'''Up to version 12.5''' the following packages have to be installed on the system:
  <tt>apt install python python-debian python-mako python-lxml python-apt python-gpg python-suds python-libvirt qemu-utils qemu-kvm p7zip-full make libvirt-daemon libvirt-daemon-system libvirt-clients</tt>
  <tt>apt install python python-debian python-mako python-lxml python-apt python-gpg python-suds python-libvirt qemu-utils qemu-kvm p7zip-full make libvirt-daemon libvirt-daemon-system libvirt-clients</tt>
'''Starting with version 13.0''' ELBE did switch to version 3 of Python (due to the EOL of Python 2), so the following packages have to be installed:
<tt>apt install python3 python3-debian python3-mako python3-lxml python3-apt python3-gpg python3-suds python3-libvirt qemu-utils qemu-kvm p7zip-full make libvirt-daemon libvirt-daemon-system libvirt-clients</tt>


Then you can clone the repo with:
Then you can clone the repo with:
Line 53: Line 58:
  <tt>adduser <user> libvirt && adduser <user> libvirt-qemu</tt>
  <tt>adduser <user> libvirt && adduser <user> libvirt-qemu</tt>


<!--
===Premade Docker container===
===Docker container===


We created docker container images with ELBE preinstalled, these can be found at [https://hub.docker.com/r/dhelectronics/elbe Docker Hub] under the name dhelectronics/elbe. There are two different versions of container tags available:
We created docker container images with ELBE preinstalled, these can be found at [https://hub.docker.com/r/dhelectronics/elbe Docker Hub] under the name dhelectronics/elbe. There are two different versions of container tags available:
Line 60: Line 64:
{| class="wikitable"
{| class="wikitable"
|-
|-
! Tag !! Meaning
! Tag !! Version the tag is pointing to.
|-
|-
| git-latest-tested || This tag always points to the latest version we have used and confirmed that is working with our own recipies. This version will change from time to time.
| git-latest-tested || Points to the latest version we have used and confirmed that is working with our own recipies. This version will change from time to time and some versions may be skipped.
|-
|-
| git-vX || These tags always point to a specific version of ELBE (e.g. git-v12.4 points to version 12.4 of ELBE).
| git-vX || Always points to the specific version X of ELBE (as an example git-v12.4 points to version 12.4 of ELBE).
|}
|}


Line 70: Line 74:
  <tt>docker pull dhelectronics/elbe:git-v12.4</tt>
  <tt>docker pull dhelectronics/elbe:git-v12.4</tt>


The container can be started with:
The container can be started with the following command: (the container does need extensive rights because a virtual machine is started inside it):


  <tt>docker run --name=elbe --mount type=bind,src=./,dst=/workdir-w /workdir/ --cap-add SYS_ADMIN --security-opt seccomp:unconfined --security-opt apparmor:unconfined --mount type=bind,src=/sys/fs/cgroup,dst=/sys/fs/cgroup --device /dev/kvm --device /dev/fuse --group-add kvm dhelectronics/elbe:git-v12.4</tt>
  <tt>docker run --name=elbe --mount type=bind,src=./,dst=/workdir-w /workdir/ --cap-add SYS_ADMIN --security-opt seccomp:unconfined --security-opt apparmor:unconfined --mount type=bind,src=/sys/fs/cgroup,dst=/sys/fs/cgroup --device /dev/kvm --device /dev/fuse --group-add kvm dhelectronics/elbe:git-v12.4</tt>
Line 79: Line 83:


Inside the container you can now run your ELBE build, you can exit the shell with CTRL+D and remove the container with <tt>docker container rm -f elbe</tt>.
Inside the container you can now run your ELBE build, you can exit the shell with CTRL+D and remove the container with <tt>docker container rm -f elbe</tt>.
-->
 
==Usage==
==Usage==


Line 90: Line 94:
This command appends the xml-file "example.xml" with the archive "example-archive.tar.bz2". The binary content of the archive is stored in BASE64 encoding inside a xml tag.
This command appends the xml-file "example.xml" with the archive "example-archive.tar.bz2". The binary content of the archive is stored in BASE64 encoding inside a xml tag.


If you add  <tt>--build-sdk</tt> at the "<tt>intvm create/submit</tt>"-command then as an addition to creating the root-filesystem, the SDK (for developing software for the root-filesystem) is created too.
If you add  <tt>--build-sdk</tt> at the "<tt>initvm create/submit</tt>"-command then as an addition to creating the root-filesystem, the SDK (for developing software for the root-filesystem) is created too. Usually CD-Images with all binary packages and all source packages (for the exact recreation of the rootfilesystem) are created. The creation of these can be skipped with the commandline switches <tt>--skip-build-bin</tt> and <tt>--skip-build-sources</tt>.
 
If an error happens while building the rootfilesystem, no files are returned. It is possible to get the log and other files of the build with an extra command. The complete call of the command (which differs for each build) is printed as exit-message of the ELBE build.


<!--
===Script for easy use with container images===
===Script for easy use with container images===


We created a script for easing the use of ELBE inside the container. This script is preinstalled in our [[Virtual_Machine_for_Application_Development|Virtual Machine for Application Development]] starting with version Stretch Vx. The script is called '''elbe_container_build_start.sh [OPTIONS] <elbe_build_description.xml>'''. The following options are available:
We created a script for easing the use of ELBE inside the container. This script is preinstalled in our [[Virtual_Machine_for_Application_Development|Virtual Machine for Application Development]] starting with version '''Not yet available'''. The script is called '''elbe_container_build_start.sh [OPTIONS] <elbe_build_description.xml>'''. In the standard configuration the CD-images with binary and source packages are created. The SDK is also created.
 
It is possible to start an additional container with a debian repository, the given path at --repodir has to point at the root of a debian repository. The directory is mounted into the directory <tt><nowiki>/repo/dh_debian_repo</nowiki></tt> of the container. Any container which is configured to publish the mounted directory can be used. Inside the xml the repository can be used by adding the repo to the list of mirrors. Note that after the build process the repository is still inside the <tt>/etc/apt/sources.list</tt> of the resulting rootfilesystem. You have to remove this line at the finetuning section of the xml file or when the device running with the rootfilesystem has started. If you do not remove the repo, <tt>apt-get update</tt> will fail with an error if you want to update the system or install new packages afterwards.
 
The following options are available for the script:


{| class="wikitable"
{| class="wikitable"
|-
|-
! Option !! Meaning of the option
| --elbedockerimage <REPO:TAG> || Sets the docker image which is used for the elbe build.
|-
| --elbedockerimage <REPO:TAG> || Change elbe docker image
|-
|-
| --repodir <path> || Initiates a Debian repo web server to start, which uses this repo path
| --repodir <path> || Starts an additional container with a Debian repo webserver, which uses this repo path. If this option isn't set, then no container with the repo is started.
|-
|-
| --repodockerimage <REPO:TAG> || Change Debian repo webserver docker image
| --repodockerimage <REPO:TAG> || Sets Debian repo webserver docker image. Has no effect if <tt>--repodir<tt> is not set.
|-
|-
| --initvmtopdir <path> || Change initvm top directory
| --initvmtopdir <path> || Change initvm top directory, default value is the <tt><current-working-directory>/initvm-docker</tt>
|-
|-
| --fast || Using elbe fast option (--skip-build-bin --skip-build-sources)
| --fast || Speed up the build of the rootfilesystem with only building the rootfilesystem itself, and skipping the creation of the CD-images and of the SDK.
|-
|-
| --console || Ignore everything  and start console in docker
| --console || Ignore every other option and start the container and enter a console inside of the container. The current working directory is mounted into the container
|-
|-
| --version || Display version info
| --version || Display version info of the script and exit
|-
|-
| --help || Display this help and exit
| --help || Display the command line help and exit
|}
|}


It is possible to start an additional container with a debian repository, the given path at --repodir has to point at the root of a debian repository.
It is not possible to append a XML file with an archive via an option of the script. If you need to do this you have to use the "<tt>--console</tt>"-option to open a console inside the container where you can use the "<tt>elbe chg_archive</tt>"-command.
-->
 
When the build is finished, the container exits and is removed. If an error happenes the container is not exited, and a console inside the container is opened, where you can get the logs and files of the failed build.
 
==XML-Example==
==XML-Example==



Latest revision as of 09:57, 5 October 2020