This is a documentation about how to use Docker as a compilation environment for OpenLinux SDK. The idea is not provide the SDK source code files, but avoid you to waste time installing software dependencies and libraries that will allow you to compile the SDK itself.
In other words, you will be able to start a container and run `make` without worry about software compatibility (and means you can compile using docker on Linux, Windows or Mac).
The Docker images was already created and is available in DockerHub for MDM9607 and SDX62.
1.1 Understanding DockerBeing very simplistic, Docker uses the concept of "Containers" that can be associated as an "Virtual Machine" with all software, libraries and dependencies already installed on it.
Instead need to create a full VM, allocate a Virtual Hard Disk and install a lot of useless software. Docker will "containerize" the real minimum requirements (and by "real minimum" I mean to ignore OS softwares and libraries that will not be required by the application), so you can download this ready-to-go container, attach the current folder and compile your files.
Docker has it own engine to abstract what should be a "hypervisor" and allow you to run whatever you want in any platform (x86, ARM, etc) or OS (Linux, Windows, Mac).
If this is your first contact with Docker, I really recommend you to take a look on more information and start to use it more in your projects: https://docs.docker.com/get-started/overview/
2. Requirements- Docker installed*
- NL668 or FG160 (preferably the devKit)
- OpenLinux SDK
*Obs.: Please, follow Docker instructions if not installed yet
3. MDM9607 SDK3.1 Download Image and Mount folderOpen your extracted OpenLinux root folder in terminal, then run the command bellow to download image and mount the current folder in container:
docker run -di --name mdm9607_sdk --mount type=bind,source=$PWD/,target=/home/openlinux victorffs/mdm9607_sdk:latest &
Run docker start
to initiate the container and access the bash:
docker start mdm9607_sdk && docker exec -it mdm9607_sdk bash
3.3 CompilingEverytime you start the container it will be needed to identify the source crosstools using the commands bellow:
source fibo_crosstools/fibo-crosstool-env-init
Then you can compile the SDK:
make
If you need to change your environment (open a secondary SDK source folder for example) I recommend you to stop and remove the current container and then create a new one mounting the desired folder:
docker stop container mdm9607_sdk
docker rm container mdm9607_sdk
Then, just run again the same command to create the first container, but now on the new folder:
docker run -di --name mdm9607_sdk --mount type=bind,source=$PWD/,target=/home/openlinux victorffs/mdm9607_sdk:latest &
3.4.2 Multiples environmentsIf by some reason you will need to work with multiple environments (multiple SDK source code folders), you can just create a new container changing the parameter --name
and running the command on the new folder:
docker run -di --name mdm9607_sdk_env2 --mount type=bind,source=$PWD/,target=/home/openlinux victorffs/mdm9607_sdk:latest &
Then you can access the secondary environment changing the container name:
docker start mdm9607_sdk_env2 && docker exec -it mdm9607_sdk_env2 bash
You can check the multiple environments using the command bellow:
docker container ls -a
Open your extracted OpenLinux root folder in terminal, then run the command bellow to download image and mount the current folder in container:
docker run -di --name sdx62_sdk --mount type=bind,source=$PWD/,target=/home/openlinux victorffs/sdx62_sdk:latest &
4.2 Start Docker ContainerRun docker start
to initiate the container and access the bash:
docker start sdx62_sdk && docker exec -it sdx62_sdk bash
To compile the kernel, just run the script build_kernel.sh
with the desired parameters (clean, compile, menuconfig or compile_perf)
./build_kernel clean
./build_kernel compile
You will need to change the source crosstools to compile the SDK apps. So, go to the desired app folder that you want to compile and run the following command\*:
*Obs: Keep the parentheses "( )" to avoid change your entire container session source settings
(source /usr/local/nogplv3-debug-x86_64/environment-setup-armv7vet2hf-neon-oe-linux-gnueabi && make)
Example:
If you need to change your environment (open a secondary SDK source folder for example) I recommend you to stop and remove the current container and then create a new one mounting the desired folder:
docker container stop sdx62_sdk
docker container rm sdx62_sdk
Then, just run again the same command to create the first container, but now on the new folder:
docker run -di --name sdx62_sdk --mount type=bind,source=$PWD/,target=/home/openlinux victorffs/sdx62_sdk:latest &
3.4.2 Multiples environmentsIf by some reason you will need to work with multiple environments (multiple SDK source code folders), you can just create a new container changing the parameter --name
and running the command on the new folder:
docker run -di --name sdx62_sdk_env2 --mount type=bind,source=$PWD/,target=/home/openlinux victorffs/sdx62_sdk:latest &
Then you can access the secondary environment changing the container name:
docker start sdx62_sdk_env2 && docker exec -it sdx62_sdk_env2 bash
You can check the multiple environments using the command bellow:
docker container ls -a
Comments
Please log in or sign up to comment.