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)
 
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===
===Premade Docker container===


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 does need extensive rights because a virtual machine is started inside it):
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 93: Line 97:


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.
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>'''. In the standard configuration the CD-images with binary and source packages are created. The SDK is also created.
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. Inside the xml the repository can be used by adding the repo "<tt>http:<nowiki/>//dhdebrepo/dh_debian_repo <distro> <component></tt>" 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.
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:
The following options are available for the script:
Line 114: Line 118:
| --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.
| --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 every other option and start the container and enter a console inside of the container.
| --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 of the script and exit
| --version || Display version info of the script and exit
Line 120: Line 124:
| --help || Display the command line help and exit
| --help || Display the command line help and exit
|}
|}
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.
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 08:57, 5 October 2020