@@ -16,6 +16,11 @@ for example:
16
16
17
17
Images will output artifacts in an ` obj ` dir at the root of a repository.
18
18
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
+
19
24
** NOTE** : Re-using the same ` obj ` dir with different docker images with
20
25
the same target triple (e.g. ` dist-x86_64-linux ` and ` dist-various-1 ` )
21
26
may result in strange linker errors, due shared library versions differing between platforms.
@@ -85,42 +90,60 @@ how to generate them, and how the existing ones were generated.
85
90
86
91
### Generating a `.config` file
87
92
93
+ **NOTE:** Existing Dockerfiles can also be a good guide for the process and order
94
+ of script execution.
95
+
88
96
If you have a `linux-cross` image lying around you can use that and skip the
89
97
next two steps.
90
98
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
92
100
these steps are outside the container:
93
101
94
102
```
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:
98
108
$ docker ps
99
109
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 /
102
112
```
103
113
104
114
- Then inside the container we build crosstool-ng by simply calling the bash
105
115
script we copied in the previous step:
106
116
107
117
```
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 want 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
109
131
```
110
132
111
133
- Now, inside the container run the following command to configure the
112
134
toolchain. To get a clue of which options need to be changed check the next
113
135
section and come back.
114
136
115
137
```
138
+ $ cd /tmp/
116
139
$ ct-ng menuconfig
117
140
```
118
141
119
142
- Finally, we retrieve the `.config` file from the container and give it a
120
143
meaningful name. This is done outside the container.
121
144
122
145
```
123
- $ docker drunk_murdock:/.config arm-linux-gnueabi.config
146
+ $ docker cp drunk_murdock:/tmp /.config arm-linux-gnueabi.config
124
147
```
125
148
126
149
- Now you can shutdown the container or repeat the two last steps to generate a
0 commit comments