Skip to content

Commit 65d9f9a

Browse files
anton-intellgirdwood
authored andcommitted
Edit the topic so it looks like a task. Minor corrections to commands and links.
1 parent 9426615 commit 65d9f9a

File tree

2 files changed

+98
-104
lines changed

2 files changed

+98
-104
lines changed

getting_started/build-guide/build-from-scratch.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ This should take a few minutes.
347347
The required headers are now in ``"$SOF_WORKSPACE"/xtensa-root``, and
348348
cross-compilation toolchains for xtensa DSPs are set up.
349349

350+
.. _build-and-sign-firmware-binaries-from-scratch:
351+
350352
Step 4. Build and sign firmware binaries
351353
****************************************
352354

@@ -510,6 +512,7 @@ folder.
510512
511513
sof-apl.ri sof-bdw.ri sof-byt.ri sof-cht.ri sof-cnl.ri sof-hsw.ri
512514
515+
.. _build-topology-and-tools-from-scratch:
513516

514517
Step 5. Build topology and tools
515518
********************************

getting_started/build-guide/build-with-docker.rst

Lines changed: 95 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -10,123 +10,113 @@ Build SOF with Docker
1010
This guide will show you how to use a Docker image containing the
1111
|SOF| build environment.
1212

13-
.. note::
14-
15-
The example uses ``$SOF_WORKSPACE`` as the working directory.
16-
1713
Set up the workspace directory
1814
******************************
1915

20-
.. code-block:: bash
16+
1. Point the ``$SOF_WORKSPACE`` environment variable to the directory
17+
in which you store all SOF work.
2118

22-
SOF_WORKSPACE=~/work/sof
23-
mkdir "$SOF_WORKSPACE"
19+
.. code-block:: bash
2420
25-
Clone the *sof* repo.
21+
SOF_WORKSPACE=~/work/sof
22+
mkdir -p "$SOF_WORKSPACE"
2623
27-
.. code-block:: bash
24+
#. Clone the SOF repository.
25+
26+
.. code-block:: bash
2827
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
3130
3231
Set up Docker
3332
*************
3433

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:
3735

38-
Installation instructions for other Linux distributions: `About Docker CE <https://docs.docker.com/install/>`__.
36+
1. Install Docker.
3937

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/>`__.
4241

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/>`__.
4545

46-
Set user group
47-
==============
46+
#. Optionally, configure Docker to run under a proxy.
4847

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>`__.
5151

52-
Get Docker image
53-
================
52+
#. To use Docker without ``sudo``, add your user to the `docker` group.
5453

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/>`__.
5956

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.
6458

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.
6763

68-
Pull the docker image from Docker Hub.
64+
.. note::
6965

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.
7968

80-
Retag the image with `sof` for scripts.
69+
- Pull the Docker image from Docker Hub and retag the image with `sof` for scripts:
8170

82-
.. code-block:: bash
71+
.. code-block:: bash
8372
84-
docker tag thesofproject/sof sof
73+
docker pull thesofproject/sof
74+
docker tag thesofproject/sof sof
8575

76+
.. note::
8677

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.
8981

90-
Run the Docker build from the `sof` repo.
82+
- Build a Docker image:
9183

92-
.. code-block:: bash
84+
Run the Docker build from the SOF repository.
9385

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
9887
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
10092

101-
.. code-block:: bash
93+
Verify that the docker image is built successfully.
10294

103-
docker images
104-
#REPOSITORY TAG IMAGE ID CREATED SIZE
105-
#sof latest c8b0e8913fcb 2 days ago 1.46 GB
95+
.. code-block:: bash
10696
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
109101

110-
Build firmware binaries
111-
=======================
102+
Build firmware binaries with Docker
103+
***********************************
112104

113105
Build with scripts
114-
------------------
106+
==================
115107

116-
Build the SOF binaries:
108+
To build the SOF binaries for all platforms:
117109

118110
.. code-block:: bash
119111
120112
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
124114
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.
128118

129-
Build one or more platform binaries.
119+
To build the SOF binaries for one or more platforms:
130120

131121
.. code-block:: bash
132122
@@ -137,65 +127,66 @@ Build one or more platform binaries.
137127
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt apl
138128
139129
Build inside container
140-
----------------------
130+
======================
141131

142-
Enter the container bash.
132+
1. Enter the container bash:
143133

144-
.. code-block:: bash
134+
.. code-block:: bash
145135
146-
cd "${SOF_WORKSPACE}"/sof/
147-
./scripts/docker-run.sh bash
136+
cd "${SOF_WORKSPACE}"/sof/
137+
./scripts/docker-run.sh bash
148138
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`.
150142

151143
Firmware build results
152-
----------------------
144+
======================
153145

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.
156149

157150
.. code-block:: bash
158151
159152
sof-apl.ri sof-bdw.ri sof-byt.ri sof-cht.ri sof-cnl.ri sof-hsw.ri
160153
161154
.. _docker-topology-tools:
162155

163-
Build topology and tools
164-
========================
156+
Build topology and tools with Docker
157+
************************************
165158

166159
Build with scripts
167-
------------------
160+
==================
168161

169-
Build the *sof* tools and topology files.
162+
Build the SOF tools and topology files.
170163

171164
.. code-block:: bash
172165
173166
cd "${SOF_WORKSPACE}"/sof/
174167
./scripts/docker-run.sh ./scripts/build-tools.sh
175168
176169
Build inside container
177-
----------------------
178-
179-
Enter the container bash.
170+
======================
180171

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:
189173

190-
cd tools
174+
.. code-block:: bash
175+
176+
cd "${SOF_WORKSPACE}"/sof/
177+
./scripts/docker-run.sh bash
191178
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`.
193182

194183
Topology and tools build results
195-
--------------------------------
184+
================================
196185

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.
199190

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

Comments
 (0)