Wind River Linux 5.X and Intel Gateway Solutions for Iot
Total Page:16
File Type:pdf, Size:1020Kb
Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute EDUCATION SERVICES Wind River Linux 5.x and Intel Gateway Solutions for IoT Version 1.0 A LECTURE GUIDE Volume 1 of 2 Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute LECTURE GUIDE Wind River Linux 5.x and Intel Gateway Solutions for IoT, Version 1.0 A Education Services Production Date: October 2014 Copyright c 2014 Wind River Systems, Inc. All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means without the prior written permission of Wind River Systems, Inc. Wind River, Tornado, and VxWorks are registered trademarks of Wind River Systems, Inc. The Wind River logo is a trademark of Wind River Systems, Inc. Any third-party trademarks refer- enced are the property of their respective owners. For further information regarding Wind River trademarks, please see: http://www.windriver.com/company/terms/trademark.html Wind River may refer to third-party documentation by listing publications or providing links to third-party Web sites for informational purposes. Wind River accepts no responsibility for the information provided in such third-party documentation. This document is designed to support the Wind River Linux 5.x and Intel Gateway Solutions for IoT course. It is not designed as a stand-alone document, nor is it intended as a substitute for documentation that accompanies Tornado, VxWorks, or Wind River Workbench or any other Wind River Systems, Inc. software or hardware product. http://education.windriver.com Education Services Department Wind River Systems, Inc. 500 Wind River Way, Alameda, CA 94501 510-748-4100 (phone) 510-749-2454 (fax) E-mail: [email protected] For training outside of North America, please contact your local sales office. Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Contents Course Prerequisites vii Course Objectives viii 1 Wind River Linux Build System 1 2 Working with Packages 43 3 Working with Templates and Layers 77 4 Introduction to IDP 113 5 IDP Architecture 139 6 Secure Remote Management Basics 169 7 Verified and Secure Boot 211 v Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Course Prerequisites Course Prerequisites • General prerequisites: – Basic understanding of embedded operating systems and debugging techniques – Functional knowledge of Linux in a command-line environment – One year of C or C++ programming experience on Linux/UNIX 1 © 2014 Wind River Systems, Inc. Wind River Education Services vii Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux 5.x and Intel Gateway Solutions for IoT Course Objectives By the end of this course you will be able to: • Configure, build, and validate a Wind River Linux kernel and file system • Use layers and templates effectively • Install and build run-time and kernel packages • Understand the IDP architecture, the major IDP components, and their interactions • Create and customize IDP images • Develop IDP-compatible applications 1 © 2014 Wind River Systems, Inc. viii Wind River Education Services Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux Build System © 2013 Wind River Systems, Inc. 1 Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux 5.x and Intel Gateway Solutions for IoT Agenda Wind River Linux Build System • Overview • Creating the Build Environment • The Build Environment • Building the Project • Optimizing the Build 2 © 2013 Wind River Systems, Inc. 2 Wind River Education Services Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux Build System Objectives By the end of this chapter you will be able to: • Understand the basic concepts of the Wind River Linux build system • Understand the steps involved in building a Wind River Linux Platform project • Create and build your own Wind River Linux Platform project • Effect quick changes to your target file system 3 © 2013 Wind River Systems, Inc. Wind River Education Services 3 Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux 5.x and Intel Gateway Solutions for IoT Agenda Wind River Linux Build System • Overview • Creating the Build Environment • The Build Environment • Building the Project • Optimizing the Build 4 © 2013 Wind River Systems, Inc. 4 Wind River Education Services Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux Build System Overview • The build environment is considered as the directory containing a Wind River Linux Platform project. – Throughout this training, we refer to this directory as $TARGET_BASE – Can be located anywhere you have write access – Projects created in Workbench are usually located in the workspace directory • The build environment is customized to your project, based on the parameters you choose when you initially create it. – All the build activity for a particular project takes place here – You can modify your build environment as you see fit 5 © 2013 Wind River Systems, Inc. • $PROJECT_DIR must be writeable Wind River Education Services 5 Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux 5.x and Intel Gateway Solutions for IoT Overview (cont’d) • This is in contrast to the development environment, which contains the installed Wind River product. – The location of the development environment is determined by the individual who installed the product – By default, the Wind River software installation utility uses $HOME/WindRiver/wrlinux-5 – Throughout this training, we refer to this directory as $WIND_BASE • The development environment should not be modified by developers – One exception: Workbench by default locates workspace in $HOME/WindRiver/workspace 6 © 2013 Wind River Systems, Inc. In the lab environment provided with this course, the development environment is located at wr-path/WindRiver. 6 Wind River Education Services Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux Build System Agenda Wind River Linux Build System • Overview • Creating the Build Environment • The Build Environment • Building the Project • Optimizing the Build 7 © 2013 Wind River Systems, Inc. Wind River Education Services 7 Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux 5.x and Intel Gateway Solutions for IoT Creating the Build Environment • To begin developing a Wind River Linux Platform, you must first create a build environment using parameters that are characteristic of the device you’d like to target. • There are two ways to establish a new build environment – Command-line interface: using the command-line configure script, included with the Wind River Linux product installation. – Wind River Workbench: the Wind River Linux Platform Project wizard allows you to create a new build environment (which actually uses configure to generate the build environment) --enable-board --enable-kernel Build configure Image --enable-rootfs Environment etc 8 © 2013 Wind River Systems, Inc. 8 Wind River Education Services Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux Build System Creating the Build Environment (cont’d) • The configure script, found in the $WIND_BASE/wrlinux, supports a large number of command-line arguments – The following settings are mandatory: Option Example Usage Effect Specify the BSP for the board you --enable-board --enable-board=qemux86_64 are targeting. Select a base user-space around --enable-rootfs --enable-rootfs=glibc_small which to model your build environment rootfs. Select a profile for your build --enable-kernel --enable-kernel=standard kernel environment. 9 © 2013 Wind River Systems, Inc. The –help command provides an exhaustive list of all supported options. Wind River Education Services 9 Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux 5.x and Intel Gateway Solutions for IoT Creating the Build Environment (cont’d) • Other commonly used configure options include: Option Example Usage Effect Show an exhaustive list of --help --help options available. Specify additional layers to include. Layers provide content --with-layer --with-layer=examples/lemon_layer which can be incorporated into your build environment. Specify a bitbake cache directory. Caching bitbake --with-sstate-dir --with-sstate-dir=$HOME/sstate objects this way can speed up subsequent builds dramatically. Include additional templates. --with-template --with-template=feature/usttrace_demo Templates add features to your user space and/or kernel. 10 © 2013 Wind River Systems, Inc. 10 Wind River Education Services Subject to Wind River Terms of Use - Do Not Copy – Do Not Distribute Wind River Linux Build System Creating the Build Environment (cont’d) • Workbench can also be used to establish a new build environment, by creating a Wind River Linux Platform Project. – Workbench uses the configure script to generate the build environment – The generated build Workbench tells you the command environment is found in a it will use to create the build directory named environment. <projectName>_prj within the workspace 11 © 2013 Wind River Systems, Inc. When generating a new Wind River Linux Platform Project in Workbench, two new directories are created in the workspace. Suppose, for example, we create a new project called foo: • The directory foo is created,