Skip to content

Dev_documentation

Zaplana Fabien edited this page Apr 20, 2021 · 10 revisions

MAY 2021 :

How to (re)generate TuxML images

When you modify the source of TuxML you will need to regenerate de docker images of TuxML for use it.
This need is specific for every changement of source code in the folder ./compilation.

Before use it, you should delete the old images of TuxML, it's detailed here (ADD LINK HERE ***)

You should execute the script docker_image_tuxml.py with python3 who is inside the folder ./docker_management :

cd docker_management/ ;
python3 docker_image_tuxml.py -f ;
cd ../ ;

For help the developpers a bash script is available : ./scripts_bash/generate_images.sh

For finish, it's interesting to know that there are a way who permit to don't always need to regenerate images when you are in a developpment session and if you need to try and debug your code before you want to generate the images.

You wan use the specific options --mount_host_dev like : python3 kernel_generator.py --local --dev 1 --tiny --mount_host_dev

This option is more detailed here (ADD LINK HERE ***) but if you modify the dockerfile you will still need to regenerate images, this option can not modify the "core" of the images, it only mount the modify sources of TuxML inside the images.

How to delete old images of TuxML ?

TODO

How to mount your code without generate images when debugging ?

TODO

How to debug inside a running TuxML container ?

TODO

How work the API ?

TODO

How modify Dockerfiles ?

TODO

What is the principals sections of code ?

TODO

Last update : 2018-2019

Here is our code recovery manual. You will find an overview as well as information on our tools and scripts, and the operation of the project

Advanced use case : Compilation inside Docker Tuxml

TODO: maybe add some screenshots

The goal of this tutorial is to use the docker container in order to build a specific kernel configuration, in order to do that we need to manipulate the container.

First of all we need to install the docker image locally if it isn't done yet. using this command you can download the image:

$ python3 kernel_generator.py 1 --tiny 

first we need to run the container based on the tuxml/tuxml:prod, then copy the file, you can use this command to run a container:

$ docker run -it tuxml/tuxml:prod

(to list all images use: $ docker images or $ docker image ls -> same output)

this will open you a shell inside the container, from that point you could exit the container to start it again then copy then attach. or you could simply open another terminal, list the running containers, and then copy your file in the right one.

  • open another terminal
  • use $ docker container ls to find your container's id or alias (funny two words names).
  • then: $ docker cp <file> <container-id>:/<rest of the path>

so as an example:

$ docker cp .config objective_montalcini:/TuxML/linux-4.13.3/.config

The other method (one terminal):

  • exit the shell with the "exit" command.
  • restart the container, to know which one it is used $ docker container ls -a, once you find it use: $ docker restart <container-id>
  • then: $ docker cp <file> <container-id>:/<rest of the path> Example:
$ docker cp .config objective_montalcini:/TuxML/linux-4.13.3/.config"

and then do what you have to do, that is installing dependencies through apt or using make on the kernel to see what happens.

(as an example if you need git: "apt install git")

2

4.2  Compilation and boot testing with specific optionsYou may want to test a specific configuration, e.g to study the impact ofsome options. In order to do this, you can use kernel_generator.py and give it theconfiguration file that you want to test (use –config followed by the path to the.config file).Starting from a basic configuration, here is a command to switch an optionwith bash. To disable an option :sed's|CONFIG_<option>=y|# CONFIG_<option> is not set|'-i .configTo activate a disabled option :sed's|# CONFIG_<option> is not set|CONFIG_<option>=y|'-i .configNote : this method is only for the study of options and their impact, andyou should be careful about the dependancies before any changings. You can findinformation about an option and its dependencies here :https://cateee.net/lkddb/web-lkddb/10
Clone this wiki locally