@@ -10,123 +10,113 @@ Build SOF with Docker
10
10
This guide will show you how to use a Docker image containing the
11
11
|SOF | build environment.
12
12
13
- .. note ::
14
-
15
- The example uses ``$SOF_WORKSPACE `` as the working directory.
16
-
17
13
Set up the workspace directory
18
14
******************************
19
15
20
- .. code-block :: bash
16
+ 1. Point the ``$SOF_WORKSPACE `` environment variable to the directory
17
+ in which you store all SOF work.
21
18
22
- SOF_WORKSPACE=~ /work/sof
23
- mkdir " $SOF_WORKSPACE "
19
+ .. code-block :: bash
24
20
25
- Clone the *sof * repo.
21
+ SOF_WORKSPACE=~ /work/sof
22
+ mkdir -p " $SOF_WORKSPACE "
26
23
27
- .. code-block :: bash
24
+ #. Clone the SOF repository.
25
+
26
+ .. code-block :: bash
28
27
29
- cd " $SOF_WORKSPACE "
30
- git clone --recurse-submodules https://github.com/thesofproject/sof.git
28
+ cd " $SOF_WORKSPACE "
29
+ git clone --recurse-submodules https://github.com/thesofproject/sof.git
31
30
32
31
Set up Docker
33
32
*************
34
33
35
- Docker is a popular container management framework. To install on Ubuntu,
36
- visit `Get Docker CE for Ubuntu <https://docs.docker.com/install/linux/docker-ce/ubuntu/ >`__.
34
+ Docker is a popular container management framework. To install Docker and get the Docker image with the SOF build environment:
37
35
38
- Installation instructions for other Linux distributions: ` About Docker CE < https://docs.docker.com/install/ >`__ .
36
+ 1. Install Docker.
39
37
40
- Set Proxy
41
- =========
38
+ For information on how to install Docker on Ubuntu, visit `Install
39
+ Docker Engine on Ubuntu
40
+ <https://docs.docker.com/engine/install/ubuntu/> `__.
42
41
43
- Docker must be configured if used behind a proxy.
44
- Visit `HTTP/HTTPS proxy <https://docs.docker.com/config/daemon/systemd/#httphttps-proxy >`__ for the guide.
42
+ For information on how to install Docker on other Linux
43
+ distributions, visit `Install Docker Engine
44
+ <https://docs.docker.com/engine/install/> `__.
45
45
46
- Set user group
47
- ==============
46
+ #. Optionally, configure Docker to run under a proxy.
48
47
49
- To use Docker without ``sudo `` follow these post-install steps.
50
- `Post-installation steps for Linux <https://docs.docker.com/install/linux/linux-postinstall/ >`__
48
+ For more information about configuring Docker to use a proxy, visit
49
+ `HTTP/HTTPS proxy
50
+ <https://docs.docker.com/config/daemon/systemd/#httphttps-proxy> `__.
51
51
52
- Get Docker image
53
- ================
52
+ #. To use Docker without ``sudo ``, add your user to the `docker ` group.
54
53
55
- To easily build SOF binaries, we need a Docker image containing all
56
- of the cross-compiler and build environment dependencies. We can either
57
- build a Docker image from a DockerFile or pull an image binary from
58
- Docker Hub.
54
+ For more information, visit
55
+ `Post-installation steps for Linux <https://docs.docker.com/install/linux/linux-postinstall/ >`__.
59
56
60
- .. note ::
61
-
62
- Building the container from DockerFile will take more than 2 hours,
63
- so we recommend using the pre-built image.
57
+ #. Get a Docker image with the SOF build environment.
64
58
65
- Pull Docker image
66
- -----------------
59
+ To easily build SOF binaries, we need a Docker image containing all
60
+ of the cross-compiler and build environment dependencies. We can
61
+ either build a Docker image from a DockerFile or pull an image
62
+ binary from Docker Hub.
67
63
68
- Pull the docker image from Docker Hub.
64
+ .. note ::
69
65
70
- .. code-block :: bash
71
-
72
- docker pull thesofproject/sof
73
-
74
- .. note ::
75
-
76
- Since there is not yet an offical |SOF | presence on Dockerhub, the
77
- image is hosted in a personal Docker Hub repo until the
78
- official image can go live.
66
+ Building the container from DockerFile will take more than 2 hours,
67
+ so we recommend using the pre-built image.
79
68
80
- Retag the image with `sof ` for scripts.
69
+ - Pull the Docker image from Docker Hub and retag the image with `sof ` for scripts:
81
70
82
- .. code-block :: bash
71
+ .. code-block :: bash
83
72
84
- docker tag thesofproject/sof sof
73
+ docker pull thesofproject/sof
74
+ docker tag thesofproject/sof sof
85
75
76
+ .. note ::
86
77
87
- Build Docker image
88
- ------------------
78
+ Since there is not yet an offical |SOF | presence on
79
+ Dockerhub, the image is hosted in a personal Docker Hub repo
80
+ until the official image can go live.
89
81
90
- Run the Docker build from the ` sof ` repo.
82
+ - Build a Docker image:
91
83
92
- .. code-block :: bash
84
+ Run the Docker build from the SOF repository.
93
85
94
- cd " ${SOF_WORKSPACE} " /sof/scripts/docker_build/sof_qemu
95
- ./docker-build.sh
96
- cd " ${SOF_WORKSPACE} " /sof/scripts/docker_build/sof_builder
97
- ./docker-build.sh
86
+ .. code-block :: bash
98
87
99
- After building the Docker image you will see:
88
+ cd "${SOF_WORKSPACE}"/sof/scripts/docker_build/sof_qemu
89
+ ./docker-build.sh
90
+ cd "${SOF_WORKSPACE}"/sof/scripts/docker_build/sof_builder
91
+ ./docker-build.sh
100
92
101
- .. code-block :: bash
93
+ Verify that the docker image is built successfully.
102
94
103
- docker images
104
- # REPOSITORY TAG IMAGE ID CREATED SIZE
105
- # sof latest c8b0e8913fcb 2 days ago 1.46 GB
95
+ .. code-block :: bash
106
96
107
- Build with Docker
108
- *****************
97
+ docker images
98
+
99
+ #REPOSITORY TAG IMAGE ID CREATED SIZE
100
+ #sof latest c8b0e8913fcb 2 days ago 1.46 GB
109
101
110
- Build firmware binaries
111
- =======================
102
+ Build firmware binaries with Docker
103
+ ***********************************
112
104
113
105
Build with scripts
114
- ------------------
106
+ ==================
115
107
116
- Build the SOF binaries:
108
+ To build the SOF binaries for all platforms :
117
109
118
110
.. code-block :: bash
119
111
120
112
cd " ${SOF_WORKSPACE} " /sof/
121
- ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh
122
-
123
- .. note ::
113
+ ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -a
124
114
125
- ./scripts/docker-run.sh will mount the *sof * and directories
126
- into Docker container and build them inside the container. The build
127
- result can be accessed outside the container after the build.
115
+ `` ./scripts/docker-run.sh `` mounts the *sof * and directories into the
116
+ Docker container and builds them inside the container. You can access
117
+ the build result outside the container after the build.
128
118
129
- Build one or more platform binaries.
119
+ To build the SOF binaries for one or more platforms:
130
120
131
121
.. code-block :: bash
132
122
@@ -137,65 +127,66 @@ Build one or more platform binaries.
137
127
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt apl
138
128
139
129
Build inside container
140
- ----------------------
130
+ ======================
141
131
142
- Enter the container bash.
132
+ 1. Enter the container bash:
143
133
144
- .. code-block :: bash
134
+ .. code-block :: bash
145
135
146
- cd " ${SOF_WORKSPACE} " /sof/
147
- ./scripts/docker-run.sh bash
136
+ cd " ${SOF_WORKSPACE} " /sof/
137
+ ./scripts/docker-run.sh bash
148
138
149
- From inside the container, follow the manual configuration and build steps.
139
+ #. From inside the container, follow the manual configuration and build
140
+ steps. For more information, see
141
+ :ref: `build-and-sign-firmware-binaries-from-scratch `.
150
142
151
143
Firmware build results
152
- ----------------------
144
+ ======================
153
145
154
- The firmware binary files are located in src/arch/xtensa/. Copy them to
155
- your target machine's /lib/firmware/intel/sof folder.
146
+ The firmware binary files are located in the
147
+ ``build_<platform>/src/arch/xtensa/ `` directory. Copy them to the
148
+ ``/lib/firmware/intel/sof `` directory on the target machine.
156
149
157
150
.. code-block :: bash
158
151
159
152
sof-apl.ri sof-bdw.ri sof-byt.ri sof-cht.ri sof-cnl.ri sof-hsw.ri
160
153
161
154
.. _docker-topology-tools :
162
155
163
- Build topology and tools
164
- ========================
156
+ Build topology and tools with Docker
157
+ ************************************
165
158
166
159
Build with scripts
167
- ------------------
160
+ ==================
168
161
169
- Build the * sof * tools and topology files.
162
+ Build the SOF tools and topology files.
170
163
171
164
.. code-block :: bash
172
165
173
166
cd " ${SOF_WORKSPACE} " /sof/
174
167
./scripts/docker-run.sh ./scripts/build-tools.sh
175
168
176
169
Build inside container
177
- ----------------------
178
-
179
- Enter the container bash.
170
+ ======================
180
171
181
- .. code-block :: bash
182
-
183
- cd " ${SOF_WORKSPACE} " /sof/
184
- ./scripts/docker-run.sh bash
185
-
186
- From inside the container:
187
-
188
- .. code-block :: bash
172
+ 1. Enter the container bash:
189
173
190
- cd tools
174
+ .. code-block :: bash
175
+
176
+ cd " ${SOF_WORKSPACE} " /sof/
177
+ ./scripts/docker-run.sh bash
191
178
192
- and follow the manual configuration and build steps.
179
+ 2. From inside the container, change to the ``tools `` directory and
180
+ follow the manual configuration and build steps. For more
181
+ information, see :ref: `build-topology-and-tools-from-scratch `.
193
182
194
183
Topology and tools build results
195
- --------------------------------
184
+ ================================
196
185
197
- The topology files are all in the topology folder ("${SOF_WORKSPACE}"/sof/tools/build_tools/topology). Copy them to the target
198
- machine's /lib/firmware/intel/sof-tplg folder.
186
+ The topology files are located in the
187
+ ``"$SOF_WORKSPACE"/sof/tools/build_tools/topology `` folder. Copy the
188
+ files to the ``/lib/firmware/intel/sof-tplg `` directory on the target
189
+ machine.
199
190
200
- The *sof-logger * tool is in the * tools/logger * folder . Copy it to the target machine's
201
- /usr/bin directory.
191
+ The *sof-logger * tool is located in the `` tools/logger `` directory . Copy
192
+ it to the `` /usr/bin `` directory on the target machine .
0 commit comments