WR User Guide3.0

Embed Size (px)

Citation preview

  • 7/22/2019 WR User Guide3.0

    1/384

    Wind River

    Linux

    USER'S GUIDE

    3.0

    Wind River LinuxUser's Guide, 3.0

  • 7/22/2019 WR User Guide3.0

    2/384

    Copyright 2009 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 referenced are the property of their respective owners. For further information

    regarding Wind River trademarks, please see:www.windriver.com/company/terms/trademark.html

    This product may include software licensed to Wind River by third parties. Relevantnotices (if any) are provided in your product installation at the following location:

    installDir/product_name/3rd_party_licensor_notice.pdf.

    Wind River may refer to third-party documentation by listing publications or providinglinks to third-party Web sites for informational purposes. Wind River accepts no

    responsibility for the information provided in such third-party documentation.

    Corporate Headquarters

    Wind River500 Wind River Way

    Alameda, CA 94501-1153U.S.A.

    Toll free (U.S.A.): 800-545-WINDTelephone: 510-748-4100

    Facsimile: 510-749-2010

    For additional contact information, see the Wind River Web site:

    www.windriver.com

    For information on how to contact Customer Support, see:

    www.windriver.com/support

    Wind River Linux

    User's Guide

    3.0

    24 Feb 09

    Part #: DOC-16337-ND-00

    http://www.windriver.com/company/terms/trademark.htmlhttp://www.windriver.com/http://www.windriver.com/supporthttp://www.windriver.com/supporthttp://www.windriver.com/http://www.windriver.com/company/terms/trademark.html
  • 7/22/2019 WR User Guide3.0

    3/384

    iii

    Contents

    PART I: INTRODUCTION, DESIGN, AND BUILD

    1 Introduction ................................................................................................. 3

    1.1 Introduction ...................................................................................................................... 3

    1.2 Wind River Linux Documentation ............................................................................... 4

    1.3 Roadmap to the Wind River Linux Users Guide ..................................................... 5

    1.4 Document Conventions ................................................................................................. 6

    1.5 Overview of Wind River Linux .................................................................................... 6

    1.6 Platform Developer and Application Developer ...................................................... 7

    Platform Developer ........................................................................................... 7

    Application Developer ..................................................................................... 7

    1.7 Kernel and File System Components .......................................................................... 8

    Kernel Feature Profiles ..................................................................................... 8Four File Systems .............................................................................................. 9Combinations of File System and Kernel Feature Profiles .......................... 10

    1.8 Cross Development Tools .............................................................................................. 10

    1.9 Supported Run-time Boards ......................................................................................... 11

    1.10 Additional Resources ..................................................................................................... 11

    Online Support .................................................................................................. 11Use Cases ............................................................................................................ 11Installation .......................................................................................................... 11

    2 Development Workflow .............................................................................. 13

    2.1 Introduction ...................................................................................................................... 13

    2.2 Installing, Configuring, and Deploying Run-Time Software ................................ 14

    Creating Platform and Application Projects ................................................. 14

  • 7/22/2019 WR User Guide3.0

    4/384

    Wind River Linux

    User's Guide, 3.0

    iv

    Configuring and Building the Platform Project ............................................ 14Configuring for a Custom Target .................................................................... 15Deploying Runtime Software .......................................................................... 15

    2.3 Updating and Debugging .............................................................................................. 15

    Updating Packages ........................................................................................... 15Updating the Kernel Configuration ............................................................... 16Debugging Runtime Software ......................................................................... 16

    2.4 Preparing a Product Deployment ................................................................................. 16

    3 The Development Environment ................................................................. 17

    3.1 Introduction ...................................................................................................................... 17

    3.2 Development Environment Directory Structure ....................................................... 18

    startWorkbench.sh and the Workbench Directories ..................................... 18

    The updates Directory ...................................................................................... 19

    3.2.1 The wrlinux-3.0 Directory ................................................................................ 19

    The sysroots Directory ...................................................................................... 19The wrlinux Directory ...................................................................................... 19The ldat Directory ............................................................................................. 19The layers Directory .......................................................................................... 20

    3.3 Templates and Layers ..................................................................................................... 20

    3.3.1 What is a Template? .......................................................................................... 20

    3.3.2 What is a Layer? ................................................................................................ 20

    3.4 Layers in the Development Environment .................................................................. 21The layers Directory .......................................................................................... 21Layer Structure and Replaceability ................................................................ 23

    3.5 Templates in the Development Environment ............................................................ 23

    3.5.1 Template Configuration Files .......................................................................... 23

    3.5.2 Core Layer Template Directory Structure and Contents ............................. 24

    profile Templates ............................................................................................... 25rootfs Templates ................................................................................................ 26board Templates (BSPs) ............. ............ ............. ............. ............. ............. ....... 27test Templates .................................................................................................... 28

    feature Templates .............................................................................................. 28extra Templates .................................................................................................. 28

    3.5.3 Toolchain Layer Template Directory Structure and Contents .................... 28

    arch Templates ................................................................................................... 28cpu Templates .................................................................................................... 28multilib Templates ............................................................................................. 28

    3.5.4 Kernel Layer Template Directory Structure and Contents .......................... 29

    default Templates .............................................................................................. 29feature Templates .............................................................................................. 29

  • 7/22/2019 WR User Guide3.0

    5/384

    Contents

    v

    karch Templates ................................................................................................. 29kernel Templates ............................................................................................... 29

    4 Configuring and Building .......................................................................... 31

    4.1 Introduction ...................................................................................................................... 31

    4.1.1 Design Benefits .................................................................................................. 31

    Post-installation ................................................................................................. 32

    4.2 Configuring Your Platform Project .............................................................................. 32

    4.2.1 Creating the Project Build Directory .............................................................. 32

    4.2.2 Configuring the Build Environment .............................................................. 33

    4.2.3 Build Environment Directory Structure ......................................................... 34

    Local Custom Layer Directories ...................................................................... 35

    4.2.4 Configure Options ............................................................................................. 35

    Configuring with Profiles ................................................................................ 36Complete Run-time System ............................................................................. 36Kernel-only ......................................................................................................... 36File System-only ................................................................................................ 36

    4.2.5 Configure Option Rules ................................................................................... 36

    4.2.6 Configure Option Examples ............................................................................ 37

    Common PC Complete Run-time ................................................................... 38Common PC Kernel Only ................................................................................ 38Common PC File System Only ........................................................................ 38ARM Versatile AB-926EJS Complete Flash-Capable Run-time .................. 39ARM Versatile AB-926EJS Complete Debug-Capable Run-time ............... 39

    Adding Analysis Tools Support to Projects ................................................... 40

    4.2.7 Some Common Configure Options ................................................................ 40

    Basic Configure Options .................................................................................. 40Some Additional Configure Options ............................................................. 41Rebuilding the Toolchain or Libc From Source ............................................ 42Configuring Rebuilding of Host Tools ........................................................... 43

    4.3 Building Your Platform Project .................................................................................... 43

    4.3.1 Two Build Methods ........................................................................................... 43

    4.3.2 Using the RPM Build Method (make fs) ........................................................ 44

    Looking More Closely at the RPM Build Process ......................................... 444.3.3 Using the Source Build Method (make build-all) ......................................... 46

    Looking More Closely at the Source Build Process ...................................... 46

    4.3.4 Building Parts of the Run-Time from Source ................................................ 47

    Building Only the Kernel from Source ........................................................... 47Building Only the File System from Source .................................................. 48Building Individual Packages from Source ................................................... 48

  • 7/22/2019 WR User Guide3.0

    6/384

    Wind River Linux

    User's Guide, 3.0

    vi

    5 Layer and Template Processing ................................................................ 49

    5.1 Introduction ...................................................................................................................... 49

    5.2 Understanding Layers .................................................................................................... 50

    5.2.1 Creating the Layer Search List ........................................................................ 50

    Layer Path Environment Variable ................................................................... 51Basic Layer Contents ........................................................................................ 51

    5.3 Understanding Templates .............................................................................................. 52

    Identifying Explicit and Implicit Templates .................................................. 52

    5.3.1 Template Search Order ..................................................................................... 52

    The Initial Template Search List ...................................................................... 53The Final Template Search Paths .................................................................... 53Template Processing ......................................................................................... 54An Example of Template Processing Order .................................................. 54

    5.3.2 Processing Template include Files .................................................................. 56

    Including Templates of the Same Name ........................................................ 58

    5.4 Processing Template Components ............................................................................... 60

    Processing File Fragments ............................................................................... 60Processing File System Components .............................................................. 60Processing Package Lists .................................................................................. 60

    5.5 Constructing the Target File System ............................................................................ 62

    Configure Time File System Construction (filesystem/fs) .......................... 62Build Time File System Construction (export/dist) ..................................... 63

    Viewing the Target File Settings ...................................................................... 64Determining Which Package Contributes a File ........................................... 65

    6 Custom Layers and Templates .................................................................. 67

    6.1 Introduction ...................................................................................................................... 67

    6.2 Creating Custom Templates .......................................................................................... 67

    Naming Your Templates ................................................................................... 68The Structure of Templates .............................................................................. 69

    6.3 Using Custom Templates ............................................................................................... 71

    Configuration with Templates ........................................................................ 71Verifying Template Processing ........................................................................ 72Creating Custom Profiles ................................................................................. 72

    6.4 Creating Custom Layers ................................................................................................. 73

    The Structure of Layers .................................................................................... 74

    6.4.1 Workflow and the Local Custom Layer ......................................................... 74

    Creating Exportable Layers with make export-layer ................................... 75

  • 7/22/2019 WR User Guide3.0

    7/384

    Contents

    vii

    6.4.2 Manually Creating Layers ............................................................................... 77

    6.5 Using Custom Layers ...................................................................................................... 78

    Configuration with Layers ............................................................................... 78Verifying Layer Processing .............................................................................. 79

    6.6 Combining Custom Layers and Templates ................................................................ 79

    Another Custom Profile Example ................................................................... 80Specifying Templates in a Custom Layer ...................................................... 82

    7 Application Development .......................................................................... 83

    7.1 Introduction ...................................................................................................................... 83

    7.2 Working with Sysroots ................................................................................................... 83

    7.2.1 Exporting Sysroots ............................................................................................ 84

    Exporting Sysroots ............................................................................................ 84

    7.2.2 Using sysroots in Application Development ................................................ 84

    7.2.3 sysroots and Multilibs ...................................................................................... 86

    7.3 Adding Custom Applications to Platform Projects .................................................. 87

    Referencing External Application Code from a Project ............................... 87Including the Source in the Package dist Directory ..................................... 88

    PART II: CONFIGURING AND CUSTOMIZING

    8 Changing Basic Linux Configuration Files .............................................. 91

    8.1 Introduction ...................................................................................................................... 91

    8.2 Creating Basic Linux Configuration Files .................................................................. 91

    8.3 Changing Preset Linux Configuration Files .............................................................. 92

    8.4 Moving Changes to a Custom Layer ............................................................................ 93

    8.5 Moving Changes to a Custom Template ..................................................................... 94

    8.6 Tutorial: Configuring Robust Networking and NTP ............................................... 94

    9 Configuring the Kernel ............................................................................... 97

    9.1 Introduction ...................................................................................................................... 97

    9.2 Initial Creation of the Kernel Configuration File ..................................................... 97

    9.3 Kernel Configuration Fragment Auditing ................................................................. 99

    More on Kernel Configuration Fragment Auditing ..................................... 99

  • 7/22/2019 WR User Guide3.0

    8/384

    Wind River Linux

    User's Guide, 3.0

    viii

    Audit Reporting ................................................................................................ 100Example of Auditing Output .......................................................................... 100

    9.4 Reconfiguring and Rebuilding the Kernel ................................................................ 103

    Using GUI Tools for Kernel Modification ...................................................... 103

    Adding a Kernel Fragment File in a Template .............................................. 104Adding a Config Fragment in Your Project Build Directory ...................... 105

    9.4.1 Resetting the Original Kernel Configuration ................................................ 106

    10 Adding Packages ........................................................................................ 107

    10.1 Introduction ...................................................................................................................... 107

    10.2 Before Adding a Package ............................................................................................... 108

    10.3 Adding a Package: rpmbuild with a Source RPM .................................................... 109

    Preparing to Add an SRPM Package .............................................................. 109

    10.3.1 Adding a Third-Party SRPM Package ............................................................ 109

    Detailed Procedure for Adding Third-Party SRPMs ................................... 110Install the Package in the File System ............................................................ 111Necessary Makefile Contents .......................................................................... 112Necessary spec File Changes ........................................................................... 113Lua Scripting in Spec Files ............................................................................... 114

    10.3.2 Older Method of Adding SRPMs .................................................................... 114

    Create the Local Layer Package Environment .............................................. 115Create the Patch ................................................................................................. 116Build with the Patch .......................................................................................... 119

    10.4 Adding a Package: rpmbuild with a Classic Package .............................................. 120

    Preparing to Add a Standard Source Archive with rpmbuild ................... 120Adding a Standard Source Archive with rpmbuild ..................................... 120

    10.5 Adding a Package: the Classic Method ....................................................................... 121

    Preparing to Add a Source Archive with the Classic Method .................... 121Adding a Source Archive with the Classic Method ..................................... 121

    10.6 Removing a Package ....................................................................................................... 121

    10.7 Adding a Package to a Running Target ....................................................................... 122

    11 Configuring PREEMPT_RT ........................................................................ 123

    11.1 Introduction ...................................................................................................................... 123

    11.2 Enabling Real Time ......................................................................................................... 123

    11.3 Application Programming Considerations for PREEMPT_RT .............................. 124

    11.4 Configuring the Preemption Level .............................................................................. 124

  • 7/22/2019 WR User Guide3.0

    9/384

    Contents

    ix

    No Forced Preemption (Server) ...................................................................... 125Voluntary Kernel Preemption (Desktop) ....................................................... 125Preemptible Kernel (Low-latency Desktop) .................................................. 125Complete Preemption (Real-Time) ................................................................. 126

    11.5 Interrupt Service Routine (ISR) Payload Execution Context .................................. 126Thread Softirqs .................................................................................................. 127Thread Hardirqs ................................................................................................ 127Preemptible RCU ............................................................................................... 127

    11.6 Run-time Scheduler Debug Instrumentation ............................................................ 128

    Debug preemptible kernel ............................................................................... 128Wakeup latency histogram .............................................................................. 128Non-preemptible critical section latency timing .......................................... 128Interrupts-off critical section latency timing ................................................. 128RT Mutex Integrity Checker ............................................................................ 129

    12 Configuring Scalable Features ................................................................. 131

    12.1 Introduction ...................................................................................................................... 131

    12.2 BusyBox ............................................................................................................................. 131

    Configuring BusyBox ....................................................................................... 132Configuring Busybox with a Custom Layer ................................................. 133

    12.3 Static Link Option ........................................................................................................... 133

    Static Link Implementation ............................................................................. 134

    12.4 Library Optimization Option ....................................................................................... 134

    Implementing Library Optimization .............................................................. 135

    12.5 Reducing Kernel Boot Time .......................................................................................... 135

    12.5.1 An Overview of the Boot Process ................................................................... 135

    Identifying Sources of Boot Latency ............................................................... 136

    12.6 Analyzing and Optimizing Boot Time ........................................................................ 138

    Collecting Boot-Time Data with bootlogger .................................................. 138

    12.6.1 Analyzing Early Boot Time .............................................................................. 139

    12.6.2 Analyzing and Optimizing Late Boot Time .................................................. 141

    Visualizing Late Boot Time .............................................................................. 141An Example of Investigating the other Category ......................................... 143An Example of Investigating Idle Time ......................................................... 145

    12.7 Analyzing and Optimizing Runtime Footprint ........................................................ 152

    12.7.1 Querying the RPM Installation Database ...................................................... 152

    Script Usage ....................................................................................................... 152Querying Package Sizes ................................................................................... 152Querying for Package File Lists ...................................................................... 153

  • 7/22/2019 WR User Guide3.0

    10/384

    Wind River Linux

    User's Guide, 3.0

    x

    Smart Querying for Dependencies ................................................................. 153

    12.7.2 Getting a Footprint Snapshot .......................................................................... 154

    13 Patch Management ..................................................................................... 157

    13.1 Introduction ...................................................................................................................... 157

    Patching Models in Wind River Linux ........................................................... 157

    13.2 Patch Principles and Workflow .................................................................................... 158

    13.2.1 Applying and Resolving Patches .................................................................... 158

    Deploying Patches ............................................................................................ 159

    13.3 The Quilt Patching Model ............................................................................................. 160

    13.3.1 Patching SRPMs with Quilt ............................................................................. 160

    Configure Your Environment and Project ..................................................... 160

    Create a New RPM Patch ................................................................................. 161Create a Layer and Save Your Patch ............................................................... 162Copy and Modify the Existing Spec File ....................................................... 163Testing Your Patches ......................................................................................... 164

    13.4 git and the Kernel ............................................................................................................ 165

    13.4.1 An Overview of gits Role in the Kernel ........................................................ 165

    The Kernel Build Workflow ............................................................................. 166The kernel-cache ................................................................................................ 166The Kernel Source Tree ..................................................................................... 167

    13.4.2 Starting to Use git .............................................................................................. 168

    Types of Commands ......................................................................................... 168Tools Overview .................................................................................................. 169The Kernel Lifecycle and Developer Workflow ............................................ 170

    13.4.3 Examples ............................................................................................................ 174

    Adding a Patch to the Kernel .......................................................................... 174Patch Management ........................................................................................... 176BSP Example ...................................................................................................... 177Patch Merge ....................................................................................................... 179Sharing a Kernel ................................................................................................ 180

    13.5 Kernel Patching with scc ................................................................................................ 180

    Kernel Patching Design Philosophy ............................................................... 180

    scc Facilities ........................................................................................................ 181scc Files ............................................................................................................... 181scc File Examples ............................................................................................... 183

    PART III: DEPLOYING YOUR PLATFORM PROJECT

    14 Simulated Deployment with QEMU ........................................................... 187

    14.1 Introduction ...................................................................................................................... 187

  • 7/22/2019 WR User Guide3.0

    11/384

    Contents

    xi

    Internals .............................................................................................................. 187

    14.2 Deployment ...................................................................................................................... 187

    Accessing the Simulation ................................................................................. 188

    14.3 Configuration ................................................................................................................... 189

    Ending the Simulation ...................................................................................... 190Command Line Options ................................................................................... 190Enabling TUN/TAP Networking ................................................................... 191

    14.4 QEMU Example: Deploying initramfs ........................................................................ 193

    Building and Running initramfs ..................................................................... 194Switching the file system from initramfs ....................................................... 194

    15 Network Server Configuration .................................................................. 199

    15.1 Introduction ...................................................................................................................... 199

    Boot Process Overview ..................................................................................... 199Network Services During Boot ....................................................................... 200Network Configuration on Different Hosts .................................................. 200Setting Target and Server Host Names .......................................................... 201

    15.2 Configuring DHCP ......................................................................................................... 201

    The DHCP Configuration File ......................................................................... 201The DHCP Leases File ...................................................................................... 202Starting the DHCP Server ................................................................................ 202

    15.3 Configuring TFTP ........................................................................................................... 202

    Making the Kernel Available for Download ................................................. 202The TFTP Configuration File ........................................................................... 203

    15.4 Configuring NFS ............................................................................................................. 203

    Making the Root File System Available for Export ...................................... 203Configuring /etc/exports ................................................................................ 204

    16 Deploying Your Board from a Network ..................................................... 205

    16.1 Introduction ...................................................................................................................... 205

    16.2 Configuring a Serial Connection to the Board .......................................................... 206

    Setting up the Workbench Terminal ............................................................... 206Setting-up cu and UUCP .................................................................................. 206

    16.3 Example Network Deployments with RedBoot ........................................................ 207

    16.3.1 Deploying with Flash ....................................................................................... 207

    Deploying with JFFS2 ....................................................................................... 208Deploying with CRAMFS ................................................................................ 210Deploying with YAFFS ..................................................................................... 211

  • 7/22/2019 WR User Guide3.0

    12/384

    Wind River Linux

    User's Guide, 3.0

    xii

    16.4 Example Ramdisk Deployment with U-Boot ............................................................ 213

    Create the initrd Image ..................................................................................... 213Configure U-Boot .............................................................................................. 213Deployment ........................................................................................................ 214

    17 Deploying Your Board with PXE ................................................................ 215

    17.1 Introduction ...................................................................................................................... 215

    Process Overview .............................................................................................. 215

    17.2 Preparing the Downloaded Files .................................................................................. 216

    The PXELinux Boot Loader File ...................................................................... 216The PXELinux Configuration File .................................................................. 216

    17.3 Configuring DHCP for PXE .......................................................................................... 217

    17.4 Setting up and Booting the Target ............................................................................... 218

    Configuring PXE Boot On the Target ............................................................. 218Booting the Target ............................................................................................. 219

    18 Stand-Alone Deployment With Flash Devices ......................................... 221

    18.1 Introduction ...................................................................................................................... 221

    18.2 Process Overview ............................................................................................................ 222

    18.3 Preliminaries .................................................................................................................... 222

    18.4 Setting up Hosts .............................................................................................................. 222

    18.5 Stand-alone Deployment with a Ramdisk ................................................................. 223

    Loading the Ramdisk Image ............................................................................ 223Booting the Target ............................................................................................. 223

    18.6 Stand-alone Deployment with JFFS2 .......................................................................... 224

    Booting the Target ............................................................................................. 224Simplifying Your Network and U-Boot Environment ................................. 224

    18.7 Stand-alone Deployment with CRAMFS ................................................................... 225

    Booting the Target ............................................................................................. 225

    Simplifying Your Network and U-Boot Environment ................................. 226

    19 Stand-Alone Deployment to Disk .............................................................. 227

    19.1 Introduction ...................................................................................................................... 227

    19.2 Server-Based Installation of Wind River Linux ........................................................ 227

    An Example of a Self-Contained Server Installation ................................... 228Configuring and Building the Server Install ................................................. 228Booting and Installing ...................................................................................... 229

  • 7/22/2019 WR User Guide3.0

    13/384

    Contents

    xiii

    19.3 Booting Standalone with LinuxLive ............................................................................ 230

    Before You Begin ............................................................................................... 231

    19.3.1 Creating a Platform Project .............................................................................. 231

    19.3.2 Preparing the Target's Hard Drive .................................................................. 233

    19.3.3 Placing the File System and Kernel on the Hard Disk ................................. 235

    Copying from the Wind River CD-ROM ....................................................... 235Copying from a USB Disk ................................................................................ 235Downloading from a Network Host .............................................................. 236

    19.3.4 Configuring Target System Files and Booting .............................................. 237

    19.4 Creating ISO and USB Flash Drive Images ............................................................... 238

    20 Deploying SELinux ..................................................................................... 241

    20.1 Introduction ...................................................................................................................... 241

    20.1.1 Configuring an SELinux Platform Project ..................................................... 241

    Configuring SELinux on the Target ................................................................ 241Booting the Target and Loading the Policy ................................................... 241Building the policy store .................................................................................. 242

    PART IV: USE CASES

    21 Building Run-times with RPM and Source ............................................... 247

    21.1 Introduction ...................................................................................................................... 247

    21.2 Tutorial One: RPM Build for Common PC ................................................................. 248

    21.3 Tutorial Two: Source Build for Common PC ............................................................. 250

    21.4 Tutorial Three: Building ISO Images and Partial Run-time Systems ................... 251

    Building an ISO Image ..................................................................................... 251Building a File System Only ............................................................................ 251Building a Kernel Only ..................................................................................... 252

    21.5 Tutorial Four: RPM Build on ARM Versatile AB-926EJS ........................................ 252

    21.6 Tutorial Five: Source Build on ARM Versatile AB-926EJS ...................................... 253

    21.7 Tutorial Six: Building Ramdisk and Flash File Systems ......................................... 254

    Building a Ramdisk Image ............................................................................... 254Building a JFFS2 Image .................................................................................... 254Building a CRAMFS Image .............................................................................. 254

    22 Examples of Adding Packages ................................................................. 255

    22.1 Introduction ...................................................................................................................... 255

  • 7/22/2019 WR User Guide3.0

    14/384

    Wind River Linux

    User's Guide, 3.0

    xiv

    22.2 Adding SRPM Packages ................................................................................................ 256

    22.2.1 Adding the logwatch SRPM ............................................................................ 256

    22.3 Adding Spec Packages ................................................................................................... 259

    Adding mm ........................................................................................................ 259

    22.4 Adding Classic Packages ............................................................................................... 261

    22.4.1 Adding Classic Packages with configure ...................................................... 261

    Adding links ...................................................................................................... 261

    22.4.2 Adding Classic Packages without configure ................................................ 263

    Adding schedutils ............................................................................................. 264

    22.5 Adding Packages with a GUI Tool ............................................................................... 268

    22.6 Adding an RPM Package to a Running Target .......................................................... 270

    23 Using Custom Templates and Layers ....................................................... 271

    23.1 Introduction ...................................................................................................................... 271

    23.1.1 Examples in this Use Case ............................................................................... 272

    23.1.2 The Layers Used in the Example .................................................................... 272

    23.2 Adding a Layer to a Platform Project .......................................................................... 273

    23.3 Adding Another Layer ................................................................................................... 274

    23.4 Overriding Layer Contents with Another Layer ....................................................... 275

    23.5 Patching a Host Tools Package ..................................................................................... 276

    23.6 Configuring and Patching the Kernel ......................................................................... 277

    Enabling CONFIG_BINFMT_AOUT ............................................................. 277Patching the Kernel ........................................................................................... 278Configuring and Building ................................................................................ 278

    23.7 Using Feature Templates in Layers .............................................................................. 279

    23.8 Modifying a BSP ............................................................................................................. 280

    24 Kernel Use Cases ....................................................................................... 283

    24.1 Introduction ...................................................................................................................... 283

    24.2 Adding a Feature to a Supported Kernel .................................................................... 283

    24.3 Using KVM ....................................................................................................................... 285

    Overview Of KVM ............................................................................................ 285KVM Host Requirements ................................................................................. 286

    24.3.1 Configuring the KVM Host ............................................................................. 286

  • 7/22/2019 WR User Guide3.0

    15/384

    Contents

    xv

    Boot KVM on common_pc_64 (with TAP) .................................................... 287

    24.3.2 Configuring the KVM Guest ........................................................................... 288

    Start the KVM guest (linux) from the KVM host (linux): ............................ 289

    24.3.3 Run apache or boa ............................................................................................. 289

    24.4 Collecting Kernel Core Dumps with Kdump ............................................................ 290

    24.4.1 Kdump Example with x86 ............................................................................... 290

    Using kexec for Quick Reboot ......................................................................... 292Issues and Limitations ...................................................................................... 292

    PART V: APPENDIXES

    A Open Source Documentation .................................................................... 295

    A.1 Introduction ...................................................................................................................... 295

    A.2 Carrier Grade Linux ........................................................................................................ 295

    A.3 Networking ....................................................................................................................... 296

    A.4 Security .............................................................................................................................. 296

    A.5 Linux Development ........................................................................................................ 296

    B Common make Command Targets ............................................................ 299

    B.1 Introduction ...................................................................................................................... 299

    C File System Layout Configuration ............................................................. 303

    C.1 Introduction ...................................................................................................................... 303

    C.2 changelist.xml Commands ............................................................................................ 304

    General Attributes ............................................................................................. 304Removing a File, Directory, Pipe, Symlink, or Device ................................. 304Adding a File ..................................................................................................... 304Adding a Directory ........................................................................................... 305Adding a Symlink ............................................................................................. 306Adding a Device ................................................................................................ 307

    Adding a Pipe .................................................................................................... 307

    C.3 The fs_final.sh Script ...................................................................................................... 308

    D KGDB Debugging and the Command Line ............................................... 309

    D.1 Introduction ...................................................................................................................... 309

    D.2 Debugging with KGDB from the Command Line ................................................... 309

  • 7/22/2019 WR User Guide3.0

    16/384

    Wind River Linux

    User's Guide, 3.0

    xvi

    D.2.1 Enabling and Disabling KGDB in the Kernel ............................................... 311

    Using the Command Line ................................................................................ 311

    D.3 KGDB Debugging Using the Serial Console (KGDBOC) ...................................... 312

    E Connecting with TIPC ................................................................................. 313

    E.1 Introduction ...................................................................................................................... 313

    E.2 Configuring TIPC Targets ............................................................................................. 314

    E.2.1 Adding the TIPC Utilities ................................................................................ 314

    E.2.2 Installing the TIPC Kernel Module and Utilities .......................................... 314

    E.2.3 Running the usermode-agent .......................................................................... 315

    E.3 Configuring a TIPC Proxy ............................................................................................. 315

    E.4 Configuring Your Workbench Host ............................................................................. 316

    E.5 Using usermode-agent with TIPC ................................................................................ 317

    F Control Groups (cgroups) .......................................................................... 321

    F.1 Introduction ...................................................................................................................... 321

    F.2 CPUSETS .......................................................................................................................... 322

    F.3 cgroups .............................................................................................................................. 323

    G Build Variables ............................................................................................ 325

    G.1 Introduction ...................................................................................................................... 325

    Additional Notes on Build Variables .............................................................. 329

    H Cavium Simple Executive Integration and Debugging ............................ 331

    H.1 Introduction ...................................................................................................................... 331

    H.1.1 Components of Wind River Simple Executive Support .............................. 332

    Cavium Simple Executive SDK RPM ............................................................. 332Cavium Simple Executive Linux RPM ........................................................... 332

    WRLinux Simple Executive Layer .................................................................. 332Workbench 3.x Simple Executive Debug Integration Patch ....................... 333

    H.1.2 Provided "Feature Templates" ......................................................................... 333

    H.2 Preparing the Host .......................................................................................................... 334

    H.2.1 Installing the Simple Executive Layer Prerequisites .................................... 334

    H.2.2 Available Documentation ................................................................................ 335

    H.3 Configuring and Building from the Command Line ............................................... 335

  • 7/22/2019 WR User Guide3.0

    17/384

    Contents

    xvii

    H.3.1 Configuring your Project ................................................................................. 335

    H.3.2 Customize your Package List .......................................................................... 335

    Using the Feature Templates ........................................................................... 336Making Changes Manually .............................................................................. 336

    H.3.3 Building the Project ........................................................................................... 336

    H.3.4 Specifying Build Types ..................................................................................... 337

    H.4 Running Simple Executive Applications ................................................................... 337

    H.4.1 Linux Usermode Applications ........................................................................ 338

    H.4.2 Standalone Applications .................................................................................. 338

    H.5 Simple Executive Layer Technical Notes .................................................................... 339

    H.5.1 Simple Executive Applications as wrlinux Packages .................................. 339

    Application Wrapper Makefiles ...................................................................... 339Application Wrapper Support Files ............................................................... 340

    H.5.2 .........................................................Miscellaneous Simple Executive Details 340

    H.6 Configuring and Building with Workbench .............................................................. 341

    H.6.1 Adding the SDK Path ....................................................................................... 341

    H.6.2 Overriding the OCTEON_MODEL Value ..................................................... 341

    H.6.3 Starting Workbench .......................................................................................... 341

    H.6.4 Configure a Platform Project with Simple Executive Support ................... 342

    H.6.5 Building the Platform Project .......................................................................... 343

    H.6.6 Working with the Package List ....................................................................... 343

    H.6.7 Changing the OCTEON_TARGET Value for a Package .............................. 344

    H.7 Configuring the Kernel with Workbench .................................................................. 345

    H.8 Debugging from the Command Line .......................................................................... 347

    H.8.1 Overview ............................................................................................................ 347

    H.8.2 Prerequisites ....................................................................................................... 348

    H.8.3 Available Documentation ................................................................................ 348

    H.9 Setting Up the Target ...................................................................................................... 348

    H.9.1 Review: Starting a Standalone Application ................................................... 348

    H.9.2 Starting an Application for Debugging ......................................................... 349

    H.10 Setting up the Host ......................................................................................................... 350

    H.10.1 Starting GDB ...................................................................................................... 350

    H.10.2 Connecting to a Target ...................................................................................... 350

    H.11 Debugging Caveats ......................................................................................................... 351

    H.11.1 Single-step and Atomic Operations ................................................................ 351

  • 7/22/2019 WR User Guide3.0

    18/384

    Wind River Linux

    User's Guide, 3.0

    xviii

    H.11.2 Debugging Multiprocessor Applications ...................................................... 351

    H.11.3 Debugging Standalone Images with Linux Running .................................. 352

    H.11.4 Debugging the Linux Kernel ........................................................................... 352

    H.12 Debugging with Workbench ......................................................................................... 353H.12.1 Prerequisites ....................................................................................................... 353

    H.12.2 Importing the Application to a C/C++ Project (optional) .......................... 353

    H.12.3 Creating a Launch Configuration ................................................................... 354

    H.12.4 Debugging the Application ............................................................................. 355

    H.12.5 Note(s) on Workflow ........................................................................................ 357

    H.13 Known Issues, Limitations, and Tips .......................................................................... 357

    I Glossary ...................................................................................................... 359

    Index ................................................................................................................ 363

  • 7/22/2019 WR User Guide3.0

    19/384

    1

    PAR T I

    Introduction, Design, and Build

    1 Introduction .............................................................................. 3

    2 Development Workflow ............................................................ 13

    3 The Development Environment ............................................... 17

    4 Configuring and Building ........................................................ 31

    5 Layer and Template Processing .............................................. 49

    6 Custom Layers and Templates ................................................ 67

    7 Application Development ........................................................ 83

  • 7/22/2019 WR User Guide3.0

    20/384

    Wind River Linux

    User's Guide, 3.0

    2

  • 7/22/2019 WR User Guide3.0

    21/384

    3

    1Introduction

    1.1 Introduction 3

    1.2 Wind River Linux Documentation 4

    1.3 Roadmap to the Wind River Linux Users Guide 5

    1.4 Document Conventions 6

    1.5 Overview of Wind River Linux 6

    1.6 Platform Developer and Application Developer 7

    1.7 Kernel and File System Components 8

    1.8 Cross Development Tools 10

    1.9 Supported Run-time Boards 11

    1.10 Additional Resources 11

    1.1 Introduction

    Welcome to the Wind River Linux User's Guide.Wind River Linux is a softwaredevelopment environment that creates optimized Linux distributions forembedded devices.

    Development environments are available on a number of host platforms, andsupport a large and ever-growing set of targets. For details on particular hostsupport refer to the Release Notes. For supported target boards, refer to Wind RiverOnline Support.

  • 7/22/2019 WR User Guide3.0

    22/384

    Wind River Linux

    User's Guide, 3.0

    4

    1.2 Wind River Linux Documentation

    The following is a list of the documentation provided by Wind River that supportsdevelopment of Linux targets. Much of this documentation is available throughthe installation hosts start menu, for example under

    Applications > Wind River > Documentationon Red Hat Enterprise Linux.

    Wind River Linux Users Guide (this document)

    This guide describes Wind River Linuxhow to configure it, and customize itfor your needs. It is primarily oriented toward command line usage, but it isalso useful to Workbench developers who want to understand some of theunderlying design and implementation of the build system. It provides bothexplanatory and procedural use case material.

    Wind River Linux Getting Started

    The Getting Startedprovides a few brief procedures that you can perform onthe command line or with Workbench. Its primary purpose is to orient you in

    the primary ways to use Wind River Linux and point to the documentationareas that focus most on the way you will be using the product.

    Wind River Workbench Users Guide

    This guide describes how to use Workbench to develop projects, managetargets, and edit, compile, and debug code.

    Wind River Workbench by Example, Linux Version

    This guide is for Linux-specific use of Workbench, and provides examples onhow to configure and build application, platform, and kernel module projects.

    Wind River Workbench Online Help

    Wind River Workbench provides context-sensitive help. To access the full help

    set, select Help > Help Contentsin Wind River Workbench. To see helpinformation for a particular view or dialog box, press the help key when in thatview or dialog box. See 1.4 Document Conventions, p.6for details on the helpkey.

    Wind River Linux Reference Pages

    Reference manual pages (man pages) for the gnu commands on the WindRiver Linux development host. Accessible though Workbench help withHelp > Help Contents Wind River Documentation > References >Wind River Linux Operating System Reference.

    Wind River Analysis Tools documentation

    This is a set of documents that describe how to use the Wind River Analysis

    tools that are provided with Workbench. The tools include a memory useanalyzer, an execution profiler, and System Viewer, a logic analyzer forvisualizing and troubleshooting complex embedded software. The Wind RiverSystem Viewer API Referenceis also included.

    Wind River Workbench Host Shell User's Guide

    The host shell is a host-resident shell provided with Workbench that providesa command line interface for debugging targets.

  • 7/22/2019 WR User Guide3.0

    23/384

    1 Introduction

    1.3 Roadmap to the Wind River Linux Users Guide

    5

    Most of the documentation is available online as PDFs or HTML accessiblethrough Wind River Workbench online help. Links to the PDF files are availableby selecting Wind River > Documentationfrom your operating system startmenu. The documentation is also available below your installation directory(called installDir) through the command line as follows:

    PDF VersionsTo access the PDF, point your PDF reader to the *.pdffile, forexample:installDir/docs/extensions/eclipse/plugins/com.windriver.ide.doc.wr_linux_platforms/wr_linux_users_guide_3.0/wr_linux_users_guide_3.0.pdf.

    HTML VersionsTo access the HTML, point your web browser to theindex.htmlfile, for example:installDir/docs/extensions/eclipse/plugins/com.windriver.ide.doc.wr_linux_platforms/wr_linux_users_guide_3.0/html/index.html.

    1.3 Roadmap to the Wind River Linux Users Guide

    This document is divided into the following parts:

    Part I. Introduction, Design, and BuildProvides an overview of Wind River Linuxincluding kernel and file system combinations, descriptions of the developmentand build environments, development workflow, and use of custom templates,layers, and sysroots.

    Part II. Configuring and CustomizingProvides information on configuring kernelsand file systems, configuring conditional real-time Linux, configuring scalablefeatures to control the size of your run-time, and application and kernel patch

    management.Part III. Deploying your Platform ProjectDescribes how to deploy your run-time ina networked or standalone environment, including how to use the QEMUsimulator, multiple network servers, PXE and U-Boot boot loaders, andstand-alone deployment issues including deployment with Ramdisk, JFFS2,CRAMFS, hard disks, and USB disks.

    Part IV. Use CasesA variety of examples of how to develop with Wind RiverLinux, including creating platform projects, customizing them, adding andremoving packages, and using layers and templates.

    Part V. AppendixesProvide miscellaneous information including open sourcedocumentation pointers, make target summary, build variables, and further

    details on various features.

  • 7/22/2019 WR User Guide3.0

    24/384

    Wind River Linux

    User's Guide, 3.0

    6

    1.4 Document Conventions

    In this document, placeholders for which you must substitute a value are shownin italics. Literal values are shown in bold. For example, this document uses theplaceholder installDirto refer to the location where you have installed Workbench.

    By default, this is C:\WindRiveron Windows hosts and $HOME/WindRiveronLinux and Solaris hosts. The placeholderprjbuildDirrefers to the project builddirectory in which much of your work takes place.

    Menu choices are shown in bold, for example File > New > Projectmeans to selectFile, then New, then Project. Commands that you enter on a command line arealso shown in bold and system output is shown in typewriter text, for example:

    $pwd/home/mary/WindRiver/workdir/prjbuildDir$

    Long command lines that would normally wrap are shown using the backslash (\)followed by ENTER, which produces a secondary prompt, at which you maycontinue typing. (The secondary prompts are not shown to make it easier to cut

    and paste from the examples.) In the following example you would entereverything literally except the $prompt:

    $ configure --enable-board=sun_niagara2_sun4v \--enable-kernel=standard \--enable-rootfs=glibc_std

    If a command requires rootprivileges to run, the prompt is displayed as #. Thepath to the configurescript used to configure a project is generally omitted forbrevity. The script is found in installDir/wrlinux-version/wrlinux/.

    The following naming conventions are used throughout the guide:

    /home/user/WindRiver is referred to as installDir.

    The directory or folder where you build your projects, for example/home/user/workdir/common_pc (common_pc_prj in Workbench), is referredto asprjbuildDir.

    1.5 Overview of Wind River Linux

    Wind River Linux supports many leading commercial off-the-shelf (COTS)boards. The build system consists of a complete development environment thatincludes a complete set of standard Linux run-time components, both as binary

    and source packages. It also includes cross-development tools that can be used toconfigure and build customized run-time systems and applications for a range ofCOTS hardware.

    Wind River supports boards according to customer demand. Please contact WindRiver if yours is not yet officially supported.

    Wind River Workbench is included as part of Wind River Linux to provide a robustapplication development and debugging environment.

    For more information about Wind River Linux, seehttp://www.windriver.com/products/.

  • 7/22/2019 WR User Guide3.0

    25/384

    1 Introduction

    1.6 Platform Developer and Application Developer

    7

    1.6 Platform Developer and Application Developer

    You may purchase Wind River Linux in two different packages, depending on thetype of development work you intend to perform and on your host system.

    Platform Developer

    The Platform Developer package is for developers who are intimately concernedwith the Linux operating system including:

    configuring and rebuilding the kernel and file system

    developing or adding device drivers or kernel modules

    deploying the kernel and file system to target boards.

    The Platform Developer package is available for the Linux host systems specifiedin the release notes.

    Platform Developer Package Contents

    The Platform Developer package includes the full Wind River Linux:

    reference source reference file system target libraries cross-build system host utilities GNU toolchain Board Support Package (BSP) components for supported boards

    Included is Wind River Workbench, with debugging and analysis features:

    KGDB kernel mode agent debugging ptraceuser mode agent debugging Wind River System Viewer Wind River Analysis Tools core file analysis

    The platform developer can export a sysroot(a portable set of libraries, includefiles, and other resources) as well as a toolchain to be used by the applicationdeveloper.

    Application Developer

    The Application Developer package is for the developer of user-level applicationsonly. It is available for Linux, Solaris, and Windows host systems as listed in therelease notes.

    Application Developer Package Contents

    The Application Developer package includes a subset of Wind River Linux:

    target libraries Wind River host utilities Wind River GNU GCC 4.3.xtoolchain

  • 7/22/2019 WR User Guide3.0

    26/384

    Wind River Linux

    User's Guide, 3.0

    8

    Included is Wind River Workbench, with a debugging and analysis tools subset:

    ptraceuser mode agent debugging Wind River System Viewer Wind River Analysis Tools

    1.7 Kernel and File System Components

    Wind River Linux supports user-configurable combinations of kernel profiles andfile systems.

    The kernel-BSP-filesystem feature matrix, available on Wind River OnlineSupport, is the foundation of the kernel feature profiles, and documents thesupported configurations as tested by Wind River. The matrix consists of kernelfeature profiles, supported BSPs, and the types of file systems supported.

    Kernel Feature Profiles

    A kernel feature profile implements a supported set of kernel features. Eachcontains features that are compatible with each other and excludes features thatare not compatible. Kernel profiles use a combination of kernel configuration,kernel patches, and build system changes to support their features.

    The kernel profiles are layered to build a set of increasingly specific or enhancedfunctionality. The set of features that is available and tested on all boards is calledthe standard kernel profile.

    Kernel feature profiles that add or modify the functionality of the standard profile

    are called enhanced kernel profiles. Enhanced profiles are available on a selected setof boards and are mutually exclusive with other enhanced profiles. A single boardmay be supported by multiple mutually exclusive (runtime) enhanced profilesalong with the standard profile.

    Wind River Linux provides the following kernel profiles:

    NOTE: The sections of this book that deal mainly with the Wind River Linuxcross-build system, reference source and file system, and BSP components, are notrelevant to the Application Developer Package.

    NOTE: Not all kernel feature and file system combinations are supported on anyparticular board. Refer to Wind River Online Support for information onsupported root file system and kernel combinations for your board.

    NOTE: Kernel feature profiles are not the same as profile templates. Profiletemplates (or simplyprofiles, are described inprofile Templates, p.25).

    NOTE: All features of the standard kernel profile work within any particularenhanced profile.

  • 7/22/2019 WR User Guide3.0

    27/384

    1 Introduction

    1.7 Kernel and File System Components

    9

    standardall boards support the standard profile, fundamental kernelfeatures are implemented in this profile to provide a common platform for allboards.

    smallthe small kernel profile represents a configuration suitable forresource contained deployment. Available on selected boards.

    cglThis is the Carrier Grade Linux profile, designed to support the LinuxFoundations CGL 4.0 specification. Seehttp://www.linux-foundation.org/en/Carrier_Grade_Linuxfor a summaryand details on the CGL specification. Available on selected boards. Notavailable for ARM or MIPS based boards.

    ecglThis is an extended CGL profile. Kernels with this profile provide theCGL features plus extensions. Available on a subset of CGL boards. Refer toWind River Online Support for more information.preempt_rtThis kernelprofile provides the PREEMPT_RTkernel patches to enable conditional hardreal-time support for selected boards. For details, refer tohttp://rt.wiki.kernel.org/index.php.

    rtcoreKernels with this profile support the Real-Time Core guaranteedreal-time core extensions. Real-Time Core is an optional product availablefrom Wind River.

    For detailed instructions on reconfiguring and customizing Wind River Linuxkernels, see chapter 9. Configuring the Kernel.

    Four File Systems

    There are four basic file systems:

    Glibc Standard (glibc_std)A full file system, with Glibcbut withoutCGL-relevant packages or extensions.

    Glibc CGL (glibc_cgl)A full file system, with CGL-relevant packages andCGL extensions.

    Glibc Small (glibc_small)A much smaller, BusyBox-based file system, withGlibc.

    uClibc (uclibc_small)The same BusyBox-based file system as glibc_small,but with uClibc, a small C library intended specifically for very small footprintsystems.

    Run-time components are available both as binary RPMs and source tar files.

    NOTE: A single board may be in one or more enhanced kernel profiles.

    http://www.linux-foundation.org/en/Carrier_Grade_Linuxhttp://rt.wiki.kernel.org/index.phphttp://rt.wiki.kernel.org/index.phphttp://www.linux-foundation.org/en/Carrier_Grade_Linux
  • 7/22/2019 WR User Guide3.0

    28/384

    Wind River Linux

    User's Guide, 3.0

    10

    Combinations of File System and Kernel Feature Profiles

    Table 1-1shows which file systems are available with each kernel profile.

    1.8 Cross Development Tools

    You can use the Wind River Linux build system to create a Linux kernel and aseparate target root file system with all necessary configuration and initializationfiles for a deployed Linux platform. You can add or remove source RPM andtraditional tararchive packages for customized solutions. You can also add orremove RPM binary packages from the target file system, automatically checkingdependencies, flagging missing libraries, components, or version mismatches. Thebuild system provides a version controllable development environment, separatefrom the host file system which is protected from inadvertent damage.

    Cross-development is supported by the inclusion of the GNU cross-toolchain, and

    enhanced by the addition of Wind River Workbench. Workbench supports kernelmode debugging through the Kernel GNU Debugger (KGDB), and user modedebugging through the ptraceagent.

    For detailed information on using Wind River Workbench, see theWind River Workbench Users Guide, and the Wind River Workbench by Example,Linux Version.

    Table 1-1 Kernel Profiles and Supported File Systems

    Kernel Feature Profile glibc_std glibc_cgl glibc_small uclibc_small

    standard Yesa Nob Yes No

    small No No Yes Yes

    cgl No Yes Yes No

    ecgl No Yes No No

    preempt_rt Yes No Yes No

    rtcore(optional product) Yes No Yes Yes

    a. In some cases this combination may not be supported as it is not needed on purelynetworking equipment. Individual board readme files contain details.

    b. In cases where a board cannot support the cglkernel profile (for example MIPS boards)it instead supports the standardkernel profile and the glibc_cglroot file system withsome features of the userspace gracefully failing for lack of kernel support.

    NOTE: Refer to Wind River Online Support for the latest kernel-filesystem-BSPfeature matrix to determine which kernel features and file systems are supportedfor your board.

  • 7/22/2019 WR User Guide3.0

    29/384

    1 Introduction

    1.9 Supported Run-time Boards

    11

    1.9 Supported Run-time Boards

    Wind River Linux comes complete with pre-built Linux kernels and pre-builtrun-time file system packages (and will build identical and configurable kernelsand file systems from source), for many boards from a variety of manufacturers.

    For the most recent list of supported boards, see Wind River Online Support.

    Information on setting up target servers and booting supported boards, as well asdetails on booting with ISO, hard disk, and flash RAM, can be found inPart III. Deploying your Platform Project.

    1.10 Additional Resources

    Online Support

    Wind River Online Support provides updates and enhancements to packages asthey become available, which can be downloaded and added to Wind River Linux.

    Tutorials designed to illustrate Wind River integration with Workbench, as well assample configuration files to simplify the target board boot process, are alsoavailable.

    Use Cases

    Besides step-by-step instructions in several chapters, this Users Guideincludesseveral tutorial examples, in Part IV. Use Cases.

    Installation

    Complete installation instructions can be found in the Wind River productinstallation and licensing guides. Go to http://www.windriver.com/licensingandthen choose the Site Configuration Documentationlink on that page.

    Any last-minute changes in the installation procedure or host requirements can befound in the Wind River Linux Release Notesor at Wind River Online Support.

    NOTE: Wind River strongly recommends that you read your boards READMEfile,located within installDir/wrlinux-3.0/wrlinux/templates/board/boardname/. Thisfile contains important information on board bring-up, boot loaders, boardfeatures, and board limitations. The board READMEand other READMEfiles canalso be found in yourprjbuildDir/READMESdirectory when you configure aproject.

    NOTE: Detailed Workbench tutorials are available in the Wind River WorkbenchUsers Guide and Wind River Workbench by Example, Linux Version.

    http://www.windriver.com/licensinghttp://www.windriver.com/licensing
  • 7/22/2019 WR User Guide3.0

    30/384

    Wind River Linux

    User's Guide, 3.0

    12

  • 7/22/2019 WR User Guide3.0

    31/384

    13

    2Development Workflow

    2.1 Introduction 13

    2.2 Installing, Configuring, and Deploying Run-Time Software 14

    2.3 Updating and Debugging 15

    2.4 Preparing a Product Deployment 16

    2.1 Introduction

    This chapter presents an overview of the development workflow for applicationand platform development using Wind River Linux with Wind River Workbench.The cycle starts at product installation and ends at product deployment. This

    chapter provides basic instructions for building the run-time system. Each sectionrefers to subsequent chapters for detailed explanations and step-by-step tutorials.

    Figure 2-1illustrates the basic stages of product development.

    Figure 2-1 Overview of the Product Development Lifecycle

    ProductSetup

    RPMs, CVS, . . .,Applications

    Files

    Packages

    Unit Tests

    Docs

    Layers

    Sysroots

    Profiles

    Kernel

    File System

    Templates Layers Packages

    Develop

    On-Host Workbench

    Config Edit Compile

    Diagnose

    On-Host Workbench & Target

    Deploy Debug Test

    Optimize

    Workbench, Eclipse, Target

    Static Analysis Cores Footprint

    System Layout Views Profiles

    Requirements

    Kernel Image

    File System Image

    Layers

    Sysroots

    ProductDeliverables

  • 7/22/2019 WR User Guide3.0

    32/384

    Wind River Linux

    User's Guide, 3.0

    14

    This document is largely concerned with the Setup and Develop phases shown inFigure 2-1. Refer to the Analysis Tools documentation listed in 1.2 Wind River LinuxDocumentation, p.4for details on the Diagnose and Optimize phases.

    You can perform most of the operations involved in the development cycle withinthe GUI environment of Workbench, although most of the operations performed

    in this book occur at the command line. For full details, see Wind River WorkbenchUsers Guideand Wind River Workbench by Example, Linux Version.

    2.2 Installing, Configuring, and Deploying Run-Time Software

    For full instructions on installing Wind River Linux, please see your Release Notes,the Developer Install Guide, a fold-out included with the product, and Wind RiverOnline Support.

    Initial deployment includes configuring and building the run-time system,deploying to a target, and debugging with Workbench or some other tool.

    Building a working run-time system (make fs) for the first time will take roughlythirty minutes or so depending on your configuration and resources. As long asthe basic hardware and system infrastructure is in place for target deployment,target bring-up can be performed in an additional five minutes. To connect withWorkbench and start debugging can take even less time.

    Refer to 4. Configuring and Buildingfor details on building from prebuilt binariesand default kernels, as well as creating more custom configurations.

    Creating Platform and Application Projects

    Platform projects consist of default or customized kernel and file systemcombinations, and application projects are targeted for specific platforms.

    Platform developers create a platform project and then produce a sysroot(withmake export-sysroot) for application developers. The sysroot provides the targetruntime libraries and header files for use by the application developers on theirdevelopment hosts. Because the sysroot duplicates application dependencies ofthe eventual runtime environment, applications are easily deployed afterdevelopment.

    Platform developers can incorporate developed applications in a project byplacing the application underprjbuildDir/filesystem/fs/or by using the file system

    layout feature, and then rebuilding the file system (see 8. Changing Basic LinuxConfiguration Filesand C. File System Layout Configurationfor more information).

    Configuring and Building the Platform Project

    By configuring and building a platform project, you create a complete run-timesystem.

    You typically create a platform project within a work directory, called in thisdocument workdir. Within workdiryou create a subdirectory for the particular

  • 7/22/2019 WR User Guide3.0

    33/384

    2 Development Workflow

    2.3 Updating and Debugging

    15

    project, which will be referred to in this document asprjbuildDir. YourprjbuildDirwould typically have some name indicating its contents, for examplecommon_pc_small, or new_powerpc. Within yourprjbuildDir, issue a configurecommand with the necessary options to configure the appropriate buildenvironment and makefiles. You then issue a makecommand to build a complete

    platform including the kernel and root file system.For more detailed instructions on the configuration and build proces