Linux Build Systems - Freescale Semiconductor

102 downloads 369 Views 2MB Size Report
Packages: Feature selections. System Designer must map requirements to packages. Multithreading? Use “libc” with “NPTL”. SNMP? RFC 3927/2608 ?
Linux Build Systems: Comparing the joys & pains of Freescale Linux (LTIB) and MVL6 Klaas van Gend Senior Solutions & Services Architect, MontaVista

Distribution License

• The slides of this presentation are licensed under the Creative Commons Attribution Noncommercial Share Alike 3.0 Unported License.

• To view a copy of this license: • Visit http://creativecommons.org/licenses/by-nc-sa/3.0/ • Send a letter to: Creative Commons 171 Second Street, Suite 300 San Francisco, California, 94105 USA © 2009 MontaVista Software

2

Who is MontaVista?

• Industry veteran embedded Linux provider • Founded in 1999 by Jim Ready (Ready Systems / VRTX)

• World-wide player • Headquartered in Santa Clara, CA • Offices and engineering centers around the world, including USA, Europe, Japan, Asia/Pacific

• 75 Freescale LSPs released • 6th generation embedded Linux product announced in May 2009

We help you get the most out of open source

© 2009 MontaVista Software

3

Who is Klaas van Gend?

• “Senior Solutions & Services Architect” • “Sales Realist”

Eindhoven Santa Clara

© 2009 MontaVista Software

4

Development Life Cycle – “real life” requirements

design implement integrate

test “Development” deploy maintenance

Time progresses © 2009 MontaVista Software

5

But it runs Linux !!! Linux • Is Free! • Is Free? Where do you get it? What do you get? Where do you start?

  

Is Linux just a kernel? What is a “user land”?

© 2009 MontaVista Software

6

Packages: Feature selections System Designer must map requirements to packages Use “libc” with “NPTL”

Multithreading?

“Net-SNMP”

SNMP?

“Avahi”

RFC 3927/2608 ?

You

“metadata” © 2009 MontaVista Software

7

Packages: Versioning and Stabilization

• New features as patches

CVS

• Project maintainer has important role

Unstable

• Interesting version numbering schemes

Beta

• Is version 0.76 bad? • Is 2.5.43 better?

RC Stable

• Check your “distribution” first • Don’t re-invent the wheel !

© 2009 MontaVista Software

Legacy

8

Dependencies Problems always come in pairs Most packages depend on others At least two types of dependencies exist: • Build-time dependencies e.g: cmake, glade, qt-devel, perl • Run-time dependencies e.g: fonts, perl, PAM, libqt

CUPS Samba Ghost Script

Dependency resolution can be a big task • “RPM hell” anyone?

• You need to document this or automate it • Don’t surprise your successor !!! © 2009 MontaVista Software

9

Linux Target Image Builder (LTIB)

What is LTIB?

• Automated System to configure & build: • • • • •

Compilers+Build tools U-Boot Linux kernel User land applications File systems

• © Stuart Hughes, Freescale Semiconductor 2004-2009 • http://www.freescale.com/ • Under “Software&Downloads” for each processor

• http://www.bitshrine.org/ © 2009 MontaVista Software

11

Your first build

• (Using LTIB for 8548cds) • Installation: 5 minutes • First build: 2 hours • Most time spent in setting up host platform and downloading extra files • No real package builds • Result is rootfs that can be used with NFS

• Second build: ./ltib --configure • “Kconfig” mechanism • Add/remove packages • Specify build options • Remove directories

• Not fool proof • 3rd build attempt failed horribly © 2009 MontaVista Software

12

How does LTIB work?

(image © Stuart Hughes,Software July 2008) © 2009 MontaVista

13

MontaVista Linux 6 (MVL6)

How does MVL6 work?

© 2009 MontaVista Software

15

How does MVL6 work?

© 2009 MontaVista Software

16

How does MVL6 work?

© 2009 MontaVista Software

17

Problems solved

• Installation/Updates • Cross-compilation & Similar package classes • Dependencies • Compile time vs run time • tasks

• Requirement for Root • sudo doesn’t wait forever – another build lost • export LOG_DIRECTORY=“/home/kaa-ching/logs” rm –rf $LOGDIRECTORY/*

• Extensibility / Community • OpenEmbedded contains 6000+ recipes • MontaVista will ship approx 400 validated packages • Other packages can be easily added as an “collection” © 2009 MontaVista Software

18

Example recipe (sqlite3, modified) - 1 DESCRIPTION = "An Embeddable SQL Database Engine" SECTION = "libs" PRIORITY = "optional" DEPENDS = "readline ncurses" LICENSE = "PD" SRC_URI = "http://www.sqlite.org/sqlite-${PV}.tar.gz \ file://libtool.patch;patch=1" S = "${WORKDIR}/sqlite-${PV}" inherit autotools pkgconfig EXTRA_OECONF = "--disable-tcl --enable-shared \ --enable-threadsafe“ do_compile_prepend() { oe_runmake sqlite3.h install -m 0644 sqlite3.h ${STAGING_INCDIR} } © 2009 MontaVista Software

19

Example recipe (sqlite3, modified) - 1 DESCRIPTION = "An Embeddable SQL Database Engine" SECTION = "libs" PRIORITY = "optional" DEPENDS = "readline ncurses" LICENSE = "PD" SRC_URI = "http://www.sqlite.org/sqlite-${PV}.tar.gz \ file://libtool.patch;patch=1" S = "${WORKDIR}/sqlite-${PV}" inherit autotools pkgconfig EXTRA_OECONF = "--disable-tcl --enable-shared \ --enable-threadsafe“ do_compile_prepend() { oe_runmake sqlite3.h install -m 0644 sqlite3.h ${STAGING_INCDIR} } © 2009 MontaVista Software

20

Example recipe (sqlite3, modified) - 1 DESCRIPTION = "An Embeddable SQL Database Engine" SECTION = "libs" PRIORITY = "optional" DEPENDS = "readline ncurses" LICENSE = "PD" SRC_URI = "http://www.sqlite.org/sqlite-${PV}.tar.gz \ file://libtool.patch;patch=1" S = "${WORKDIR}/sqlite-${PV}" inherit autotools pkgconfig EXTRA_OECONF = "--disable-tcl --enable-shared \ --enable-threadsafe“ do_compile_prepend() { oe_runmake sqlite3.h install -m 0644 sqlite3.h ${STAGING_INCDIR} } © 2009 MontaVista Software

21

Example recipe (sqlite3, modified) - 1 DESCRIPTION = "An Embeddable SQL Database Engine" SECTION = "libs" PRIORITY = "optional" DEPENDS = "readline ncurses" LICENSE = "PD" SRC_URI = "http://www.sqlite.org/sqlite-${PV}.tar.gz \ file://libtool.patch;patch=1" S = "${WORKDIR}/sqlite-${PV}" inherit autotools pkgconfig EXTRA_OECONF = "--disable-tcl --enable-shared \ --enable-threadsafe“ do_compile_prepend() { oe_runmake sqlite3.h install -m 0644 sqlite3.h ${STAGING_INCDIR} } © 2009 MontaVista Software

22

Example recipe (sqlite3, modified) - 2 do_stage() { oe_libinstall -so libsqlite3 ${STAGING_LIBDIR} install -m 0644 sqlite3.h ${STAGING_INCDIR} }

PACKAGES = "libsqlite libsqlite-dev libsqlite-doc sqlite3 sqlite3dbg" FILES_sqlite3 = "${bindir}/*" FILES_libsqlite = "${libdir}/*.so.*" FILES_libsqlite-dev = "${libdir}/*.a ${libdir}/*.la ${libdir}/*.so \ ${libdir}/pkgconfig ${includedir}" FILES_libsqlite-doc = "${docdir} ${mandir} ${infodir}" AUTO_LIBNAME_PKGS = "libsqlite"

© 2009 MontaVista Software

23

Example recipe (sqlite3, modified) - 2 do_stage() { oe_libinstall -so libsqlite3 ${STAGING_LIBDIR} install -m 0644 sqlite3.h ${STAGING_INCDIR} }

PACKAGES = "libsqlite libsqlite-dev libsqlite-doc sqlite3 sqlite3dbg" FILES_sqlite3 = "${bindir}/*" FILES_libsqlite = "${libdir}/*.so.*" FILES_libsqlite-dev = "${libdir}/*.a ${libdir}/*.la ${libdir}/*.so \ ${libdir}/pkgconfig ${includedir}" FILES_libsqlite-doc = "${docdir} ${mandir} ${infodir}" AUTO_LIBNAME_PKGS = "libsqlite"

© 2009 MontaVista Software

24

Preventing problems – the extra’s of MVL6

• Documentation

• Graphical IDE: DevRocket • Tools!

• Quick Start • MVIP • All use cases covered

• • • •

System Deployment Kernel development Power management* Device Trees

• • • • • •

KGDB Memory Usage Analysis Memtraq OProfile LTT-ng strace / ltrace

• Support • Web/Email/(Phone/Fax) • We fix bugs ! © 2009 MontaVista Software

25

LTIB & MVL6: no enemies!

Other options to get Linux for 8548 ? 8548 is a fairly popular platform:

• ELDK – http://www.denx.de/ • GCC 4.2.2, Linux 2.6.24 • RPM based, controlled & supported by Denx

• Wind River – http://www.intel.com/ ??? • GCC 4.1.2, Linux 2.6.21

• Timesys – http://www.timesys.com/ • GCC 4.3.3, Linux 2.6.28 “basic kernel”

• http://www.kernel.org/ • Linux from scratch is not for the faint of heart!

© 2009 MontaVista Software

27

A side-by-side comparison

Kernel, gcc, libc

Uses Device Tree?

LTIB for 8548cds

MVL6 for 8548cds

(late 2007)

(mid 2009)

Kernel: 2.6.23+pq3,

Kernel: 2.6.27+,

Gcc: 4.1.78,

Gcc: 4.3.3,

C library: 2.5.78 (eglibc)

C library: 2.8 (eglibc)

Yes!

Yes (+documentation)

NFS

Yes

Yes

(no instructions for host)

(+documentation)

Builds user land packages?

RPM

MVL6IP

+ cross compile fixes

(Bitbake+other tools)

Packages selectable?

Yes, KConfig tool

Yes, using tasks/images/recipes

Needs root?

Yes

No

Availability? Support?

From FreeScale, AS IS, for free

From MontaVista, supported, licensed

© 2009 MontaVista Software

28

Target audience – why both deserve to exist LTIB

MVL6

Available for free, AS IS. • A quick start to prototype • Acceptable Quality • No support • Initial learning curve is remarkably low • Extending is not as simple • SRPM magic required • Platform tuning will cost time

Paid distribution • Feature-by-feature drop-in replacement of LTIB • Extends LTIB by providing • More packages • Extensive QA • Dedicated Support Team • Adding packages is easy • Recipe mechanism is well documented • Many packages available in Open Embedded

Works for very experienced Linux users with more time than money

Better suited for professionals & commercial development

© 2009 MontaVista Software

29

Want more?

• Live Q&A session • Join Meld: http://meld.mvista.com/ • Not just for MontaVista customers!!!

• Send an e-mail: [email protected]

© 2009 MontaVista Software

30