yocto project extensible sdk - elinux · yocto project* extensible sdk simplifying the workflow for...

39
Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce Intel Open Source Technology Center

Upload: others

Post on 12-Jun-2020

29 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Yocto Project* Extensible SDKsimplifying the workflow for application developers

Henry BruceIntel Open Source Technology Center

Page 2: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Why do we need the Extensible SDK?

How do distro maintainers create one?

How does the Extensible SDK improve workflow?

Not a devtool deep dive

What We’ll be Covering

Page 3: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

What is the Extensible sdk

3

Page 4: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

4

Develop code to run on target machine

Delivered as a shell script installer

• Cross-Development toolchain

• Target libraries, headers, and symbols

• Environment setup script

THE standard SDK

Page 5: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Updateable

Extensible

Packages

Images

Teamwork

what Could BE IMPROVED?

Page 6: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Major design change

Shrink-wrapped distro maintainer environment

Allows compact installer (as small as 35MB)

Updateable and extensible – lazy install

Simplifies team-work

First appeared in Jethro, usable in Krogoth

Meet the Extensible SDK

Page 7: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Using the Extensible sdk

7

Page 8: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

8

Installer created by distro maintainer

Shell script installer

Completely self contained

Can be installed to an arbitrary location

INSTALL

Page 9: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

9

poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.2.1.sh$ chmod +x poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.2.1.sh

$ ./poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.2.1.sh –d mysdk

Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.2.1

You are about to install the SDK to "/home/hbruce/mysdk". Proceed[Y/n]? Y

Extracting SDK....done

Extracting buildtools...

Preparing build system...

Parsing recipes: 100% |####################################| Time: 0:00:17

SDK has been successfully set up and is ready to be used.

Each time you wish to use the SDK in a new shell session, you need to source

the environment setup script e.g.

. /home/hbruce/mysdk/environment-setup-i586-poky-linux

Install example

Page 10: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

10

Assumes SDK contains toolchain

$ . /home/hbruce/mysdk/environment-setup-i586-poky-linux

$ $(CC) hello.c –o hello

Also enables Eclipse* integration

Keep updatability but act like standard SDK

Simple example

*Other names and brands may be claimed as the property of others.

Page 11: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

11

Most of the distro maintainer tools

• devtool

• recipetool

• wic

• …

Access to new tools

Page 12: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

$ . /home/hbruce/mysdk/environment-setup-i586-poky-linux

$ devtool add https://github.com/whbruce/bbexample.git

$ devtool edit-recipe bbexample

$ devtool build bbexample

$ devtool deploy-target bbexample [email protected]

Run, fix, repeat.

$ devtool finish bbexample /path/to/bitbake/layer

Issue pull request

Maintainer builds and publishes updated eSDK with your work in it

Example devtool workflow

Page 13: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Update$ devtool sdk-update [url]

Extend$ devtool search package-name

$ devtool sdk-install [-s] recipe-name

Example$ devtool sdk-install meta-extsdk-toolchain

Updating and Extending the SDK

Page 14: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

14

A Docker* container is available

https://hub.docker.com/r/crops/extsdk-container

Enables operation on macOS* and Windows*

Run in a container

*Other names and brands may be claimed as the property of others.

Page 15: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Tasks for the distro maintainer

Creating and maintaining an extensible sdk

15

Page 16: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Build$ bitbake image-recipe -c populate_sdk_ext

Default contains everything for image recipe

SDK installer in tmp/deploy/sdk

Make installer available to your developers

Generating SDK: Building

Page 17: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Make a minimal installer (full by default)SDK_EXT_TYPE = "minimal"

Add toolchain to minimal installerSDK_INCLUDE_TOOLCHAIN = “1”

Add all package info SDK_INCLUDE_PKGDATA = “1”

Add specific tools or librariesSDK_EXTRA_TOOLS += “nativesdk-package-name”

TOOLCHAIN_HOST_TASK += “package-name”

Configure Esdk: Installer aND CONTENT

Page 18: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Define a URL for the updater, say http://mysite.com/sdk-updater

Set default update URL in your configurationSDK_UPDATE_URL = "http://mysite.com/sdk-updater”

When you make change, re-build SDK and generate updater files$ oe-publish-sdk tmp/deploy/sdk/installer.sh /path/to/sdk-updater

Let your developers know when updates are available

CONFIGURE ESDK: Updater

Page 19: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Pre-built objects on a server

eSDK checks if you can re-use objects

Qemux86 core-image-minimal build times

• Without: 35mins

• With: 1 min

Faster builds through Shared State

Page 20: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Define URL of the shared state mirror server. http://mysite.com/sstate-cache

Set in conf/sdk-extra.confSSTATE_MIRRORS = "file://.* http://mysite.com/sstate-cache/PATH"

Ensure sstate-cache is served up at this location

CONFIGURE SDK: Shared State mirror

Page 21: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Pulling it all together

Extensible sdk Workflow

21

Page 22: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

Bubba makes eSDK1

1

eSDK

Page 23: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

Update eSDK

Bubba makes eSDK1

Joe updates eSDK2

1 2

eSDK

Page 24: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

3

Update eSDK

Uses “devtool add” to generate recipe3

Recipe

Bubba makes eSDK1

Joe updates eSDK2

1 2

eSDK

Page 25: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

Build/debug

Sensor Lib

3

4

Update eSDK

Recipe

Build and debug sensor Lib4

1 2

eSDK3 Uses “devtool add” to generate recipe

1 Bubba makes eSDK

2 Joe updates eSDK

Page 26: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

Build/debug

Sensor Lib

“Finalize” Recipe

3

4

Update eSDK

Recipe

When Lib is ready “devtool finish” finalizes recipe (and patches), and sends recipe to Bubba

5

5

1 2

eSDK3 Uses “devtool add” to generate recipe

4 Build and debug sensor Lib

1 Bubba makes eSDK

2 Joe updates eSDK

Page 27: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

CI

Test

Build/debug

Sensor Lib

“Finalize” Recipe

3

4

6Bubba “turns the crank” for continuous integration process

Update eSDK

Recipe

5

61 2

eSDK3 Uses “devtool add” to generate recipe

4 Build and debug sensor Lib

5When Lib is ready “devtool finish” finalizes recipe (and patches), and sends recipe to Bubba

1 Bubba makes eSDK

2 Joe updates eSDK

Page 28: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

CI

Test

“Revised”

eSDK

Build/debug

Sensor Lib

“Finalize” Recipe

3

4

7Bubba publishes “revised” eSDK with Joe’s sensor Lib

Update eSDK

Recipe

5

6

7

1 2

eSDK

6Bubba “turns the crank” for continuous integration process

3 Uses “devtool add” to generate recipe

4 Build and debug sensor Lib

5When Lib is ready “devtool finish” finalizes recipe (and patches), and sends recipe to Bubba

1 Bubba makes eSDK

2 Joe updates eSDK

Page 29: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

CI

Test

“Revised”

eSDK

Build/debug

Sensor Lib

“Finalize” Recipe

3

4

8

Update eSDK

Update eSDK

Recipe

5

6

7

Laurie and Betsy update their eSDKs8

8

Update eSDK

1 2

eSDK

7Bubba publishes “revised” eSDK with Joe’s sensor Lib

6Bubba “turns the crank” for continuous integration process

3 Uses “devtool add” to generate recipe

4 Build and debug sensor Lib

5When Lib is ready “devtool finish” finalizes recipe (and patches), and sends recipe to Bubba

1 Bubba makes eSDK

2 Joe updates eSDK

Page 30: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

CI

Test

“Revised”

eSDK

Build/debug

Sensor Lib

“Finalize” Recipe

3

4

8

9They use “devtool add” to generate recipes; Laurie for a Python app, Betsy for a Node.js app

Update eSDK

Update eSDK

Recipe

5

6

7

8

Recipe

9

Recipe

9

Update eSDK

1 2

eSDK

7Bubba publishes “revised” eSDK with Joe’s sensor Lib

6Bubba “turns the crank” for continuous integration process

3 Uses “devtool add” to generate recipe

4 Build and debug sensor Lib

5When Lib is ready “devtool finish” finalizes recipe (and patches), and sends recipe to Bubba

8 Laurie and Betsy update their eSDKs

1 Bubba makes eSDK

2 Joe updates eSDK

Page 31: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

CI

Test

“Revised”

eSDK

Build/debug

Sensor Lib

“Finalize” Recipe

3

4

Build/debug

App

8

Update eSDK

Update eSDK

Recipe

5

6

7

8

Recipe

9

Recipe

9

Build/debug

App

12

They build and debug their apps10

Update eSDK

1 2

10 10

eSD

K

9They use “devtool add” to generate recipes; Laurie for a Python app, Betsy for a Node.js app

7Bubba publishes “revised” eSDK with Joe’s sensor Lib

6Bubba “turns the crank” for continuous integration process

3 Uses “devtool add” to generate recipe

4 Build and debug sensor Lib

5When Lib is ready “devtool finish” finalizes recipe (and patches), and sends recipe to Bubba

8 Laurie and Betsy update their eSDKs

1 Bubba makes eSDK

2 Joe updates eSDK

Page 32: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

CI

Test

“Revised”

eSDK

Build/debug

Sensor Lib

“Finalize” Recipe

3

4

Build/debug

App

“Finalize” Recipe

8

Update eSDK

Update eSDK

Recipe

5

6

7

8

Recipe

9

Recipe

9

Build/debug

App

“Finalize” Recipe

When apps are working, they use “devtoolfinish” and send recipes to Bubba11

Update eSDK

1 2

10 10

11 11

eSDK

9They use “devtool add” to generate recipes; Laurie for a Python app, Betsy for a Node.js app

7Bubba publishes “revised” eSDK with Joe’s sensor Lib

6Bubba “turns the crank” for continuous integration process

3 Uses “devtool add” to generate recipe

4 Build and debug sensor Lib

5When Lib is ready “devtool finish” finalizes recipe (and patches), and sends recipe to Bubba

8 Laurie and Betsy update their eSDKs

1 Bubba makes eSDK

2 Joe updates eSDK

10 They build and debug their apps

Page 33: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

BubbaDistro

Eng

JoeC Lib Dev

LauriePython

App Eng

BetsyJS App Dev

(3rd party)

eSDKServer

CI

Test

“Revised”

eSDK

Build/debug

Sensor Lib

“Finalize” Recipe

3

4

Build/debug

App

“Finalize” Recipe

8

Update eSDK

Update eSDK

Recipe

5

6

7

8

Recipe

9

Recipe

9

Build/debug

App

“Finalize” Recipe

12

Bubba “turns the crank” and ships the product image12

Update eSDK

1 2

10 10

11 11

eSDK

9They use “devtool add” to generate recipes; Laurie for a Python app, Betsy for a Node.js app

7Bubba publishes “revised” eSDK with Joe’s sensor Lib

6Bubba “turns the crank” for continuous integration process

3 Uses “devtool add” to generate recipe

4 Build and debug sensor Lib

5When Lib is ready “devtool finish” finalizes recipe (and patches), and sends recipe to Bubba

8 Laurie and Betsy update their eSDKs

1 Bubba makes eSDK

2 Joe updates eSDK

10 They build and debug their apps

11When apps are working, they use “devtoolfinish” and send recipes to Bubba

Page 34: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Wrap up

34

Page 35: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Shared development environment

Power of devtool

Improved team workflow

Leverages shared state for faster builds

Runs on a range of host operating systems

Extensible sdk benefits

Page 36: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

36

Paul Eggleton

Randy Witt

Brian Avery

Doug Martin

Thanks

Page 37: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Use the Extensible SDK

Use it on Windows and Mac

https://wiki.yoctoproject.org/wiki/Extensible_SDK

Call to Action

Page 38: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

questions

38

Page 39: Yocto Project Extensible SDK - eLinux · Yocto Project* Extensible SDK simplifying the workflow for application developers Henry Bruce ... (CC) hello.c –o hello Also enables Eclipse*

Disclaimer

39

Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.

*Other names and brands may be claimed as the property of others.

© Intel Corporation