Skip to content

Commit 304f008

Browse files
author
Martin Sirringhaus
committed
Update cross-compilation README
1 parent 9d09331 commit 304f008

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

src/ci/docker/README.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ for example:
1616

1717
Images will output artifacts in an `obj` dir at the root of a repository.
1818

19+
To match conditions in rusts CI, also set the environment variable `DEPLOY=1`, e.g.:
20+
```
21+
DEPLOY=1 ./src/ci/docker/run.sh x86_64-gnu
22+
```
23+
1924
**NOTE**: Re-using the same `obj` dir with different docker images with
2025
the same target triple (e.g. `dist-x86_64-linux` and `dist-various-1`)
2126
may result in strange linker errors, due shared library versions differing between platforms.
@@ -85,27 +90,44 @@ how to generate them, and how the existing ones were generated.
8590
8691
### Generating a `.config` file
8792
93+
**NOTE:** Existing Dockerfiles can be a good guide for the process and order
94+
of script execution.
95+
8896
If you have a `linux-cross` image lying around you can use that and skip the
8997
next two steps.
9098
91-
- First we spin up a container and copy `build_toolchain_root.sh` into it. All
99+
- First we spin up a container and copy all scripts into it. All
92100
these steps are outside the container:
93101
94102
```
95-
# Note: We use ubuntu:15.10 because that's the "base" of linux-cross Docker
96-
# image
97-
$ docker run -it ubuntu:15.10 bash
103+
# Note: We use ubuntu:16.04 because that's the "base" of linux-cross Docker
104+
# image, or simply run ./src/ci/docker/run.sh once, which will download the correct
105+
# one and you can check it out with `docker images`
106+
$ docker run -it ubuntu:16.04 bash
107+
# in another terminal:
98108
$ docker ps
99109
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
100-
cfbec05ed730 ubuntu:15.10 "bash" 16 seconds ago Up 15 seconds drunk_murdock
101-
$ docker cp build_toolchain_root.sh drunk_murdock:/
110+
cfbec05ed730 ubuntu:16.04 "bash" 16 seconds ago Up 15 seconds drunk_murdock
111+
$ docker cp src/ci/docker/scripts drunk_murdock:/tmp/
102112
```
103113
104114
- Then inside the container we build crosstool-ng by simply calling the bash
105115
script we copied in the previous step:
106116
107117
```
108-
$ bash build_toolchain_root.sh
118+
$ cd /tmp/scripts
119+
# Download packages necessary for building
120+
$ bash ./cross-apt-packages.sh
121+
# Download and build crosstool-ng
122+
$ bash ./crosstool-ng.sh
123+
```
124+
125+
- In case you cant to adjust or start from an existing config, copy that
126+
to the container. `crosstool-ng` will automatically load `./.config` if
127+
present. Otherwise one can use the TUI to load any config-file.
128+
129+
```
130+
$ docker cp arm-linux-gnueabi.config drunk_murdock:/tmp/.config
109131
```
110132
111133
- Now, inside the container run the following command to configure the
@@ -120,7 +142,7 @@ $ ct-ng menuconfig
120142
meaningful name. This is done outside the container.
121143
122144
```
123-
$ docker drunk_murdock:/.config arm-linux-gnueabi.config
145+
$ docker cp drunk_murdock:/.config arm-linux-gnueabi.config
124146
```
125147
126148
- Now you can shutdown the container or repeat the two last steps to generate a

0 commit comments

Comments
 (0)