Skip to content

Dev_documentation

Zaplana Fabien edited this page Mar 10, 2021 · 10 revisions

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