From ae72bb9e415c7a8695c52a83523af966d46b7ebd Mon Sep 17 00:00:00 2001 From: Erwin Ried <1091420+eried@users.noreply.github.com> Date: Tue, 4 Aug 2020 19:38:25 +0200 Subject: [PATCH] Updated Compile firmware (markdown) --- Compile-firmware.md | 60 ++++++++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/Compile-firmware.md b/Compile-firmware.md index cfa0604..7ec9444 100644 --- a/Compile-firmware.md +++ b/Compile-firmware.md @@ -1,4 +1,45 @@ -The easiest way is to use Docker. After you install Docker in your machine, if you are inclined for using the command line, you can try the following: +There are severals ways to compile the firmware. As the traditional way, check the original [Building from Source](https://github.com/furrtek/portapack-havoc/wiki/Building-from-source) document, however, Docker is recommended because it provides a very clean way to compile the firmware. + +# Using Docker Hub and Kitematic + +## Step 1: Prepare environment +1. Install Docker +https://docs.docker.com/get-docker/ + +2. Get Kitematic +https://github.com/docker/kitematic/releases/ + +3. Install GitHub Desktop +https://desktop.github.com/ + +## Step 2: Clone the repository + +If you are using Windows, line endings may produce some errors. For example: ``python/r` not found` messages are generated by the line endings. To prevent this, configure git to not manipulate the line endings, open a terminal and execute: + + + +`git config --global core.autocrlf false` + +Open Github Desktop, and click "Open with Github Desktop" from the main page of the repository, under the button "Code". Next, create a "build" folder inside of the repository. + + + +## Step 3: Prepare the Docker container +[[img/Kitematic_MChWCyp6g1.png]] + +You need to configure the path to the source code from the Volumes of the container as show in the image below. + +[[img/Kitematic_VL5an8rufV.png]] + +## Step 4: Compile! + +Everytime you run the container you prepared in the previous step, it will compile the source and (if successful) leave the results in `build/firmware/` + +[[img/Kitematic_uvIvGXRbFR.png]] + +# Docker - Command line reference + +If you are inclined for using the command line, you can try the following: * For building: `docker build -t portapackccache -f dockerfile-nogit .` @@ -6,22 +47,7 @@ The easiest way is to use Docker. After you install Docker in your machine, if y * For running (in the root of the repo): `docker run -it -v ${PWD}:/havoc portapackccache` -You have to create a `build` folder before running the image. - -# Using Docker Hub and Kitematic -The required Docker image is also in Docker Hub, browse for it in [Kitematic](https://github.com/docker/kitematic): - -[[img/Kitematic_MChWCyp6g1.png]] - -You need to configure the path to the source code from the Volumes of the container as show in the image below. Everytime you run this container, it will compile the source and (if successful) leave the results in `build/firmware/` - -[[img/Kitematic_VL5an8rufV.png]] - -In Windows, the line endings may produce some errors. If you get some `python/r` not found messages, then the easiest way to fix this is to configure git to not manipulate the line endings with: - -`git config --global core.autocrlf false` - -And subsequently, download another copy of the repository. +Remember that you have to create a `build` folder before running the image. # Using Buddy.Works (and other CI platforms)