Foreword |
|
xv | |
Preface |
|
xvii | |
Acknowledgments |
|
xxi | |
About the Author |
|
xxiii | |
1 Linux for Embedded Systems |
|
1 | (14) |
|
1.1 Why Linux for Embedded Systems? |
|
|
1 | (2) |
|
1.2 Embedded Linux Landscape |
|
|
3 | (5) |
|
1.2.1 Embedded Linux Distributions |
|
|
3 | (2) |
|
1.2.2 Embedded Linux Development Tools |
|
|
5 | (3) |
|
1.3 A Custom Linux Distribution-Why Is It Hard? |
|
|
8 | (1) |
|
1.4 A Word about Open Source Licensing |
|
|
9 | (2) |
|
1.5 Organizations, Relevant Bodies, and Standards |
|
|
11 | (2) |
|
1.5.1 The Linux Foundation |
|
|
11 | (1) |
|
1.5.2 The Apache Software Foundation |
|
|
11 | (1) |
|
|
12 | (1) |
|
1.5.4 Linux Standard Base |
|
|
12 | (1) |
|
1.5.5 Consumer Electronics Workgroup |
|
|
13 | (1) |
|
|
13 | (1) |
|
|
14 | (1) |
2 The Yocto Project |
|
15 | (20) |
|
2.1 Jumpstarting Your First Yocto Project Build |
|
|
15 | (11) |
|
|
16 | (1) |
|
2.1.2 Obtaining the Yocto Project Tools |
|
|
17 | (1) |
|
2.1.3 Setting Up the Build Host |
|
|
18 | (2) |
|
2.1.4 Configuring a Build Environment |
|
|
20 | (3) |
|
2.1.5 Launching the Build |
|
|
23 | (1) |
|
2.1.6 Verifying the Build Results |
|
|
24 | (1) |
|
2.1.7 Yocto Project Build Appliance |
|
|
24 | (2) |
|
2.2 The Yocto Project Family |
|
|
26 | (2) |
|
2.3 A Little Bit of History |
|
|
28 | (3) |
|
|
29 | (1) |
|
|
29 | (1) |
|
|
29 | (1) |
|
|
30 | (1) |
|
2.3.5 The OpenEmbedded and Yocto Project Relationship |
|
|
30 | (1) |
|
|
31 | (2) |
|
|
33 | (1) |
|
|
34 | (1) |
3 OpenEmbedded Build System |
|
35 | (24) |
|
3.1 Building Open Source Software Packages |
|
|
35 | (4) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
37 | (1) |
|
|
38 | (1) |
|
|
38 | (1) |
|
|
38 | (1) |
|
3.2 OpenEmbedded Workflow |
|
|
39 | (6) |
|
|
41 | (2) |
|
3.2.2 Workflow Process Steps |
|
|
43 | (2) |
|
3.3 OpenEmbedded Build System Architecture |
|
|
45 | (11) |
|
3.3.1 Build System Structure |
|
|
47 | (3) |
|
3.3.2 Build Environment Structure |
|
|
50 | (3) |
|
3.3.3 Metadata Layer Structure |
|
|
53 | (3) |
|
|
56 | (1) |
|
|
57 | (2) |
4 BitBake Build Engine |
|
59 | (50) |
|
4.1 Obtaining and Installing BitBake |
|
|
59 | (2) |
|
4.1.1 Using a Release Snapshot |
|
|
60 | (1) |
|
4.1.2 Cloning the BitBake Development Repository |
|
|
60 | (1) |
|
4.1.3 Building and Installing BitBake |
|
|
60 | (1) |
|
|
61 | (9) |
|
4.2.1 BitBake Execution Environment |
|
|
61 | (2) |
|
4.2.2 BitBake Command Line |
|
|
63 | (7) |
|
|
70 | (1) |
|
|
71 | (15) |
|
|
71 | (1) |
|
|
72 | (4) |
|
|
76 | (1) |
|
|
77 | (2) |
|
4.4.5 Executable Metadata |
|
|
79 | (6) |
|
4.4.6 Metadata Attributes |
|
|
85 | (1) |
|
4.4.7 Metadata Name (Key) Expansion |
|
|
86 | (1) |
|
|
86 | (9) |
|
4.5.1 Using the Fetch Class |
|
|
87 | (1) |
|
4.5.2 Fetcher Implementations |
|
|
88 | (6) |
|
|
94 | (1) |
|
4.6 HelloWorld-BitBake Style |
|
|
95 | (4) |
|
|
99 | (3) |
|
|
99 | (2) |
|
4.7.2 Declaring Dependencies |
|
|
101 | (1) |
|
|
101 | (1) |
|
|
102 | (1) |
|
|
103 | (1) |
|
|
103 | (4) |
|
|
103 | (4) |
|
|
107 | (1) |
|
|
107 | (1) |
|
|
108 | (1) |
5 Troubleshooting |
|
109 | (18) |
|
|
110 | (6) |
|
|
110 | (4) |
|
5.1.2 Using Logging Statements |
|
|
114 | (2) |
|
|
116 | (3) |
|
5.2.1 Executing Specific Tasks |
|
|
118 | (1) |
|
|
118 | (1) |
|
|
119 | (1) |
|
|
120 | (1) |
|
|
121 | (1) |
|
|
122 | (2) |
|
|
124 | (3) |
6 Linux System Architecture |
|
127 | (18) |
|
|
127 | (1) |
|
6.2 Anatomy of a Linux System |
|
|
128 | (1) |
|
|
129 | (5) |
|
6.3.1 Role of the Bootloader |
|
|
130 | (1) |
|
|
130 | (4) |
|
|
134 | (7) |
|
6.4.1 Major Linux Kernel Subsystems |
|
|
136 | (4) |
|
6.4.2 Linux Kernel Startup |
|
|
140 | (1) |
|
|
141 | (2) |
|
|
143 | (1) |
|
|
144 | (1) |
7 Building a Custom Linux Distribution |
|
145 | (40) |
|
7.1 Core Images-Linux Distribution Blueprints |
|
|
146 | (14) |
|
7.1.1 Extending a Core Image through Local Configuration |
|
|
149 | (1) |
|
7.1.2 Testing Your Image with QEMU |
|
|
150 | (1) |
|
7.1.3 Verifying and Comparing Images Using the Build History |
|
|
151 | (1) |
|
7.1.4 Extending a Core Image with a Recipe |
|
|
152 | (1) |
|
|
153 | (2) |
|
|
155 | (5) |
|
7.2 Building Images from Scratch |
|
|
160 | (1) |
|
|
161 | (8) |
|
7.3.1 Languages and Locales |
|
|
162 | (1) |
|
|
162 | (1) |
|
|
163 | (1) |
|
7.3.4 Root Filesystem Types |
|
|
164 | (2) |
|
7.3.5 Users, Groups, and Passwords |
|
|
166 | (1) |
|
7.3.6 Tweaking the Root Filesystem |
|
|
167 | (2) |
|
7.4 Distribution Configuration |
|
|
169 | (12) |
|
7.4.1 Standard Distribution Policies |
|
|
169 | (1) |
|
7.4.2 Poky Distribution Policy |
|
|
170 | (6) |
|
7.4.3 Distribution Features |
|
|
176 | (3) |
|
|
179 | (1) |
|
7.4.5 Default Distribution Setup |
|
|
179 | (2) |
|
|
181 | (1) |
|
|
181 | (3) |
|
|
184 | (1) |
8 Software Package Recipes |
|
185 | (40) |
|
8.1 Recipe Layout and Conventions |
|
|
185 | (11) |
|
|
186 | (1) |
|
|
186 | (9) |
|
8.1.3 Formatting Guidelines |
|
|
195 | (1) |
|
|
196 | (16) |
|
8.2.1 Establish the Recipe |
|
|
198 | (1) |
|
8.2.2 Fetch the Source Code |
|
|
199 | (1) |
|
8.2.3 Unpack the Source Code |
|
|
200 | (1) |
|
8.2.4 Patch the Source Code |
|
|
201 | (1) |
|
8.2.5 Add Licensing Information |
|
|
201 | (1) |
|
8.2.6 Configure the Source Code |
|
|
202 | (1) |
|
|
203 | (1) |
|
8.2.8 Install the Build Output |
|
|
204 | (2) |
|
8.2.9 Setup System Services |
|
|
206 | (1) |
|
8.2.10 Package the Build Output |
|
|
207 | (3) |
|
8.2.11 Custom Installation Scripts |
|
|
210 | (1) |
|
|
211 | (1) |
|
|
212 | (6) |
|
8.3.1 C File Software Package |
|
|
212 | (1) |
|
8.3.2 Makefile-Based Software Package |
|
|
213 | (2) |
|
8.3.3 CMake-Based Software Package |
|
|
215 | (1) |
|
8.3.4 GNU Autotools-Based Software Package |
|
|
216 | (1) |
|
8.3.5 Externally Built Software Package |
|
|
217 | (1) |
|
|
218 | (6) |
|
8.4.1 Round-Trip Development Using Devtool |
|
|
219 | (4) |
|
8.4.2 Workflow for Existing Recipes |
|
|
223 | (1) |
|
|
224 | (1) |
|
|
224 | (1) |
9 Kernel Recipes |
|
225 | (36) |
|
|
226 | (5) |
|
|
227 | (1) |
|
9.1.2 Configuration Fragments |
|
|
228 | (3) |
|
|
231 | (2) |
|
|
233 | (18) |
|
9.3.1 Building from a Linux Kernel Tree |
|
|
234 | (4) |
|
9.3.2 Building from Yocto Project Kernel Repositories |
|
|
238 | (13) |
|
|
251 | (6) |
|
9.4.1 Developing a Kernel Module |
|
|
251 | (3) |
|
9.4.2 Creating a Recipe for a Third-Party Module |
|
|
254 | (2) |
|
9.4.3 Including the Module with the Root Filesystem |
|
|
256 | (1) |
|
|
257 | (1) |
|
|
257 | (1) |
|
|
258 | (1) |
|
|
259 | (2) |
10 Board Support Packages |
|
261 | (40) |
|
10.1 Yocto Project BSP Philosophy |
|
|
261 | (4) |
|
10.1.1 BSP Dependency Handling |
|
|
263 | (2) |
|
|
265 | (12) |
|
10.2.1 Building for the BeagleBone |
|
|
265 | (7) |
|
10.2.2 External Yocto Project BSP |
|
|
272 | (5) |
|
10.3 Inside a Yocto Project BSP |
|
|
277 | (5) |
|
|
279 | (1) |
|
|
279 | (1) |
|
|
279 | (1) |
|
10.3.4 README. sources File |
|
|
280 | (1) |
|
|
280 | (1) |
|
10.3.6 Layer Configuration File |
|
|
280 | (1) |
|
10.3.7 Machine Configuration Files |
|
|
280 | (1) |
|
|
281 | (1) |
|
|
281 | (1) |
|
10.4 Creating a Yocto Project BSP |
|
|
282 | (7) |
|
10.4.1 Yocto Project BSP Tools |
|
|
282 | (4) |
|
10.4.2 Creating a BSP with the Yocto Project BSP Tools |
|
|
286 | (3) |
|
|
289 | (1) |
|
10.6 Creating Bootable Media Images |
|
|
290 | (9) |
|
10.6.1 Creating an Image with Cooked Mode |
|
|
292 | (1) |
|
10.6.2 Creating an Image with Raw Mode |
|
|
292 | (1) |
|
|
293 | (2) |
|
10.6.4 Kickstart File Directives |
|
|
295 | (2) |
|
|
297 | (1) |
|
10.6.6 Transferring Images |
|
|
298 | (1) |
|
|
299 | (1) |
|
|
299 | (2) |
11 Application Development |
|
301 | (34) |
|
11.1 Inside a Yocto Project ADT |
|
|
302 | (2) |
|
11.2 Setting Up a Yocto Project ADT |
|
|
304 | (11) |
|
11.2.1 Building a Toolchain Installer |
|
|
304 | (1) |
|
11.2.2 Installing the Toolchain |
|
|
305 | (2) |
|
11.2.3 Working with the Toolchain |
|
|
307 | (3) |
|
11.2.4 On-Target Execution |
|
|
310 | (1) |
|
11.2.5 Remote On-Target Debugging |
|
|
311 | (4) |
|
11.3 Building Applications |
|
|
315 | (2) |
|
11.3.1 Makefile-Based Applications |
|
|
315 | (1) |
|
11.3.2 Autotools-Based Applications |
|
|
316 | (1) |
|
|
317 | (14) |
|
11.4.1 Installing the Eclipse IDE |
|
|
317 | (2) |
|
11.4.2 Integrating a Yocto Project ADT |
|
|
319 | (2) |
|
11.4.3 Developing Applications |
|
|
321 | (2) |
|
11.4.4 Deploying, Running, and Testing on the Target |
|
|
323 | (8) |
|
11.5 Application Development Using an Emulated Target |
|
|
331 | (2) |
|
11.5.1 Preparing for Application Development with QEMU |
|
|
331 | (2) |
|
11.5.2 Building an Application and Launching It in QEMU |
|
|
333 | (1) |
|
|
333 | (1) |
|
|
334 | (1) |
12 Licensing and Compliance |
|
335 | (10) |
|
|
335 | (6) |
|
|
337 | (1) |
|
|
338 | (1) |
|
12.1.3 Commercially Licensed Packages |
|
|
339 | (1) |
|
12.1.4 License Deployment |
|
|
340 | (1) |
|
12.1.5 Blacklisting Licenses |
|
|
340 | (1) |
|
12.1.6 Providing License Manifest and Texts |
|
|
341 | (1) |
|
12.2 Managing Source Code |
|
|
341 | (2) |
|
|
343 | (1) |
|
|
344 | (1) |
13 Advanced Topics |
|
345 | (32) |
|
|
345 | (13) |
|
13.1.1 Toaster Operational Modes |
|
|
346 | (1) |
|
|
347 | (1) |
|
13.1.3 Local Toaster Development |
|
|
348 | (1) |
|
13.1.4 Toaster Configuration |
|
|
349 | (2) |
|
13.1.5 Toaster Production Deployment |
|
|
351 | (5) |
|
13.1.6 Toaster Web User Interface |
|
|
356 | (2) |
|
|
358 | (8) |
|
13.2.1 Enabling Build History |
|
|
358 | (1) |
|
13.2.2 Configuring Build History |
|
|
359 | (1) |
|
13.2.3 Pushing Build History to a Git Repository Server |
|
|
360 | (1) |
|
13.2.4 Understanding the Build History |
|
|
361 | (5) |
|
|
366 | (2) |
|
13.3.1 Using Source Mirrors |
|
|
366 | (2) |
|
13.3.2 Setting Up Source Mirrors |
|
|
368 | (1) |
|
|
368 | (6) |
|
13.4.1 Installing Autobuilder |
|
|
369 | (1) |
|
13.4.2 Configuring Autobuilder |
|
|
370 | (4) |
|
|
374 | (1) |
|
|
375 | (2) |
A Open Source Licenses |
|
377 | (26) |
|
|
377 | (1) |
|
A.2 GNU General Public License (GPL) Version 2 |
|
|
378 | (6) |
|
A.3 GNU General Public License (GPL) Version 3 |
|
|
384 | (13) |
|
A.4 Apache License Version 2.0 |
|
|
397 | (6) |
B Metadata Reference |
|
403 | (26) |
Index |
|
429 | |