logo资料库

Embedded Linux Development Using Yocto Project Cookbook Second E....pdf

第1页 / 共450页
第2页 / 共450页
第3页 / 共450页
第4页 / 共450页
第5页 / 共450页
第6页 / 共450页
第7页 / 共450页
第8页 / 共450页
资料共450页,剩余部分请下载后查看
Cover
Title Page
Copyright and Credits
Dedication
Packt Upsell
Foreword
Contributors
Table of Contents
Preface
Chapter 1: The Build System
Introduction
Setting up the host system
Getting ready
How to do it...
How it works...
There's more...
See also
Installing Poky
Getting ready
How to do it...
How it works...
There's more...
See also
Creating a build directory
How to do it...
How it works...
There's more...
Building your first image
Getting ready
How to do it...
How it works...
There's more...
Explaining the NXP Yocto ecosystem
Getting ready
How to do it...
How it works...
There's more...
See also
Installing support for NXP hardware
Getting ready
How to do it...
How it works...
There's more...
See also
Building Wandboard images
How to do it...
How it works...
See also
Using the Toaster web interface
Getting ready
How to do it...
Administrator interface
Starting a build
Customizing images with Toaster
Building SDKs with Toaster
How it works...
There's more...
Running a Toaster Docker container
How to do it...
See also
Configuring network booting for a development setup
Getting ready
Installing a TFTP server
Installing an NFS server
How to do it...
Using Docker as a Yocto build system container
Getting ready
How to do it...
How it works...
See also
Sharing downloads
Getting ready
How to do it...
Sharing the shared state cache
How to do it...
There's more...
Setting up a package feed
Getting ready
Versioning packages
How to do it...
There's more...
Generating signed packages
Using signed package feeds
Creating a GNUPG key pair
Backing up your keys
See also
Using build history
How to do it...
How it works...
Looking at build history
There's more...
Working with build statistics
How to do it...
How it works...
There's more...
See also
Debugging the build system
Getting ready
Finding recipes
Dumping BitBake's environment
Using the development shell
How to do it...
Task log and run files
Adding logging to recipes
Looking at dependencies
Debugging dependencies
Debugging BitBake
Error reporting tool
Chapter 2: The BSP Layer
Introduction
Creating a custom BSP layer
How to do it...
How it works...
There's more...
Adding a new machine
Adding a custom device tree to the Linux kernel
Adding a custom U-Boot machine
Adding a custom formfactor file
Build your custom machine
See also
Adding a custom kernel and bootloader
Getting ready
Finding the Linux kernel source
Finding the U-Boot source
Developing using a Git repository fork
How to do it...
How it works...
Building the U-Boot bootloader
Getting ready
How to do it...
There's more...
Describing Linux's build system
How to do it...
How it works...
There's more...
Configuring the Linux kernel
Getting ready
How to do it...
Using Yocto to configure the Linux kernel
There's more...
Building the Linux kernel
How to do it...
Using Yocto to build the Linux kernel
There's more...
Building external kernel modules
Getting ready
How to do it...
There's more...
Module auto-loading
See also
Debugging the Linux kernel and modules
How to do it...
How it works...
There's more...
Using dynamic debug
Rate-limiting debug messages
See also
Debugging the Linux kernel booting process
How to do it...
How it works...
Dumping the kernel's printk buffer from the bootloader
There's more...
Using the kernel function tracing system
Getting ready
How to do it...
How it works...
There's more...
Filtering function traces
Enabling trace options
Using the function tracer on oops
Getting a stack trace for a given function
Configuring the function tracer at boot
See also
Managing the device tree
Getting ready
How to do it...
How it works...
The compatible property
The Wandboard device tree file
Defining buses and memory-addressable devices
There's more...
Modifying and compiling the device tree in Yocto
See also
Debugging device tree issues
How to do it...
How it works...
Looking at the device tree from U-Boot
Looking at the device tree from the Linux kernel
Chapter 3: The Software Layer
Introduction
Exploring an image's contents
Getting ready
How to do it...
How it works...
Adding a new software layer
Getting ready
How to do it...
How it works...
There's more...
See also
Selecting a specific package version and provider
How to do it...
How do we select which provider to use?
How do we select which version to use?
How do we select which version not to use?
Adding supported packages
Getting ready
How to do it...
How it works...
There's more...
Configuring packages
Adding new packages
Getting ready
How to do it...
How it works...
Package licensing
Fetching package contents
Specifying task overrides
Configuring packages
Splitting into several packages
Setting machine-specific variables
Adding data, scripts, or configuration files
How to do it...
There's more...
Managing users and groups
Getting ready
How to do it...
There's more...
Using the sysvinit initialization manager
Getting ready
How to do it...
Using the systemd initialization manager
Getting ready
How to do it...
There's more...
Installing systemd unit files
See also
Installing package installation scripts
Getting ready
How to do it...
How it works...
Reducing the Linux kernel image size
How to do it...
How it works...
Reducing the root filesystem size
How to do it...
How it works...
Memory-based root filesystems
Getting ready
How to do it...
How it works...
There's more...
Securing the root filesystem
Getting ready
How to do it...
Setting up SELinux
Setting up SMACK
How it works...
Looking into SELinux
Looking into SMACK
See also
Releasing software
Getting ready
How to do it...
There's more...
See also
Analyzing your system for compliance
How to do it...
There's more...
Working with open source and proprietary code
How to do it...
How it works...
The U-Boot bootloader
The Linux kernel
glibc
musl
BusyBox
The Qt framework
The X Windows system
There's more...
See also
Chapter 4: Application Development
Introduction
Introducing toolchains
Getting ready
How to do it...
Preparing an SDK
Getting ready
How to do it...
How it works...
Customizing standard and extensible SDKs
Adding packages to the SDKs
Using the extensible SDK
Getting ready
Exploring the extensible SDK contents
How to do it...
How it works...
The workspace layer
Recipe development workflow
Adding a recipe to the workspace layer
Removing a recipe from the workspace layer
Modifying a recipe in the workspace layer
Building and testing your recipe
Updating a recipe with your changes
Finishing work on a recipe
There's more...
Using the Eclipse IDE
Getting ready
How to do it...
There's more...
See also
Developing GTK+ applications
Getting ready
How to do it...
There's more...
Using the Qt Creator IDE
Getting ready
How to do it...
Developing Qt applications
Getting ready
How to do it...
There's more...
Describing workflows for application development
How to do it...
How it works...
External development
Working directory development
External source development
Working with GNU make
How to do it...
See also
Working with the GNU build system
Getting ready
How to do it...
See also
Working with the CMake build system
Getting ready
How to do it...
See also
Working with the SCons builder
Getting ready
How to do it...
See also
Developing with libraries
Getting ready
Building a static library
Building a shared dynamic library
How to do it...
How it works...
There's more...
See also
Working with the Linux framebuffer
Getting ready
How to do it...
How it works...
There's more...
See also
Using the X Windows system
Getting ready
How to do it...
There's more...
See also
Using Wayland
Getting ready
How to do it...
There's more...
See also
Adding a web browser application
Getting ready
How to do it...
There's more...
See also
Adding Python applications
Getting ready
How to do it...
There's more...
Integrating the Open Java Development Kit
Getting ready
How to do it...
How it works...
There's more...
See also
Integrating Java applications
Getting ready
How to do it...
How it works...
There's more...
See also
Integrating Node.js applications
Getting ready
How to do it...
How it works...
There's more...
See also
Running Docker application containers
Getting ready
How to do it...
How it works...
See also
Chapter 5: Debugging, Tracing, and Profiling
Introduction
Analyzing core dumps
Getting ready
How to do it...
How it works...
See also
Native GDB debugging
Getting ready
How to do it...
There's more...
Cross GDB debugging
Getting ready
How to do it...
There's more...
Using strace for application debugging
Getting ready
How to do it...
How it works...
See also
Using the kernel's performance counters
Getting ready
How to do it...
How it works...
There's more...
See also
Using static kernel tracing
Getting ready
How to do it...
How it works...
There's more...
See also
Using dynamic kernel tracing
Getting ready
How to do it...
There's more...
See also
Using dynamic kernel events
Getting ready
How to do it...
How it works...
There's more...
Exploring Yocto's tracing and profiling tools
Getting ready
How to do it...
There's more...
Tracing and profiling with perf
Getting ready
How to do it...
How it works...
Reading tracing data
There's more...
Profile charts
Using perf as a strace substitute
See also
Using SystemTap
Getting ready
How to do it...
How it works...
See also
Using LTTng
Getting ready
How to do it...
How it works...
Extending application profiling
There's more...
See also
Using blktrace
Getting ready
How to do it...
How it works...
There's more...
Other Books You May Enjoy
Leave a review - let other readers know what you think
Index
Humble bundle_Ad_CDP.pdf
Table of Contents
Humble Bundle
Index
Embedded Linux Development Using Yocto Project Cookbook Second Edition Practical recipes to help you leverage the power of Yocto to build exciting Linux-based systems Alex González BIRMINGHAM - MUMBAI
Embedded Linux Development Using Yocto Project Cookbook Second Edition Copyright © 2018 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Commissioning Editor: Gebin George Acquisition Editor: Prachi Bisht Content Development Editor: Dattatraya More Technical Editor: Jovita Alva Copy Editor: Safis Editing Project Coordinator: Shweta H Birwatkar Proofreader: Safis Editing Indexer: Francy Puthiry Graphics: Tania Dutta Production Coordinator: Arvindkumar Gupta First published: March 2015 Second edition: January 2018 Production reference: 1240118 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78839-921-0 www.packtpub.com
I dedicate this second edition to the loving memory of my mum whose example makes me constantly challenge myself.
mapt.io Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website. Why subscribe? Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals Improve your learning with Skill Plans built especially for you Get a free eBook or video every month Mapt is fully searchable Copy and paste, print, and bookmark content PacktPub.com Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Foreword Adoption of Linux continues to grow year by year, with the majority of growth in the area of embedded systems. While it is possible to build an embedded Linux operating system from scratch, it is hard work and error prone. Thankfully, there is a better way—using the BitBake build tool, the OpenEmbedded Core metadata and the Poky distribution, which, together, make up the Yocto Project. Since its inception in 2010, the Yocto Project has progressed to become the de facto build system for a wide range of appliances and devices running Linux. Now, with the advent of the connected world known as the Internet of Things, the Yocto Project is taking on a key role in creating the backbone operating systems for devices that we rely on every day. So, the Yocto Project does not stand still, it has to continually evolve to cater for current generations of hardware and to support the tools and applications used in modern connected devices. However, as anyone who has dipped a toe into the Yocto Project pool will know, the water gets deep very quickly. The flexibility of the Yocto Project means that you need to be aware of many concepts if you are to make best use of the tool. I heartily recommend this book as your lifesaver! Alex’s thorough understanding of the topic, coupled with a practical approach to problem solving, makes this an easy-to-read, essential companion that will help you not only to keep your head above water but to become a proficient swimmer. This second edition of Embedded Linux Development Using Yocto Project Cookbook follows in the same style and technical content as the first, but has been refreshed and extended to describe the current versions of the Yocto Project. Alex’s deep understanding of the Yocto Project conjoins with his practical knowledge of the subject to produce a practical guide to the Yocto Project. The cookbook style allows you to dip in and out as needed to find answers to particular problems. Alex always adds pointers to more detailed descriptions of the problems covered, so that, step by step, you can build up a thorough understanding of the underlying principles. As an educator, I am always looking for books to recommend to my students. This is at the top of my list when teaching people about the Yocto Project. Chris Simmonds Founder of 2net.co.uk, author and teacher
Contributors About the author Alex González is a software engineering supervisor at Digi International and product owner of the Digi Embedded Yocto distribution. He started working professionally with embedded systems in 1999 and the Linux kernel in 2004, designing products for voice and video over IP networks, and followed his interests into machine-to-machine (M2M) technologies and the Internet of Things. Born and raised in Bilbao, Spain, Alex has an electronic engineering degree from the University of the Basque Country and he received his MSc in communication systems from the University of Portsmouth. I would like to thank the Yocto and OpenEmbedded communities, whose dedication keep the Yocto Project running, and the people involved with the Freescale BSP community layer, whose joint work is the basis for this book. Also, the amazing people who work with me on a daily basis and from whom I am constantly learning, and especially to Javier Viguera for his efforts in thoroughly reviewing the contents of the book.
分享到:
收藏