Linux Build Systems:

bawltherapistΛογισμικό & κατασκευή λογ/κού

13 Δεκ 2013 (πριν από 3 χρόνια και 9 μήνες)

59 εμφανίσεις

Linux Build Systems:
Comparing the joys & pains of
Freescale Linux (LTIB) and MVL6
Klaas van Gend
Senior Solutions & Services Architect, MontaVista
© 2009 MontaVista Software 2
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 3
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

6
th
generation embedded Linux product announced in
May 2009
We help you get the most out of open source
© 2009 MontaVista Software 4
Who is Klaas van Gend?

“Senior Solutions & Services Architect”

“Sales Realist”
Eindhoven
Eindhoven
Santa Clara
Santa Clara
© 2009 MontaVista Software 5
Development Life Cycle – “real life”
require-
ments
design
implement
integrate
maintenance
test
deploy
Time progresses
“Development”
© 2009 MontaVista Software 6
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 7
“metadata”
Packages: Feature selections
System Designer must map requirements to packages
Multithreading?
Use “libc” with “NPTL”
SNMP?
RFC 3927/2608 ?
“Net-SNMP”
“Avahi”
You
© 2009 MontaVista Software 8
Packages: Versioning and Stabilization

New features as patches

Project maintainer has important role

Interesting version numbering schemes
• Is version 0.76 bad?

Is 2.5.43 better?

Check your “distribution” first

Don’t re-invent the wheel !
CVS
Unstable
Beta
RC
Stable
Legacy
© 2009 MontaVista Software 9
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
Dependency resolution can be a big task

“RPM hell” anyone?

You need to document this or automate it
• Don’t surprise your successor !!!
Samba
CUPS
Ghost
Script
Linux Target Image Builder
(LTIB)
© 2009 MontaVista Software 11
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 12
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 13
How does LTIB work?
(image © Stuart Hughes, July 2008)
MontaVista Linux
6
(MVL6)
© 2009 MontaVista Software 15
How does MVL6 work?
© 2009 MontaVista Software 16
How does MVL6 work?
© 2009 MontaVista Software 17
How does MVL6 work?
© 2009 MontaVista Software 18
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 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) - 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 23
do_stage() {
oe_libinstall -so libsqlite3 ${STAGING_LIBDIR}
install -m 0644 sqlite3.h ${STAGING_INCDIR}
}
PACKAGES = "libsqlite libsqlite-dev libsqlite-doc sqlite3 sqlite3-
dbg"
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"
Example recipe (sqlite3, modified) - 2
© 2009 MontaVista Software 24
do_stage() {
oe_libinstall -so libsqlite3 ${STAGING_LIBDIR}
install -m 0644 sqlite3.h ${STAGING_INCDIR}
}
PACKAGES = "libsqlite libsqlite-dev libsqlite-doc sqlite3 sqlite3-
dbg"
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"
Example recipe (sqlite3, modified) - 2
© 2009 MontaVista Software 25
Preventing problems – the extra’s of MVL6

Documentation
• Quick Start
• MVIP
• All use cases covered
• System Deployment
• Kernel development
• Power management*

Device Trees

Support
• Web/Email/(Phone/Fax)
• We fix bugs !

Graphical IDE: DevRocket

Tools!
• KGDB
• Memory Usage Analysis
• Memtraq
• OProfile
• LTT-ng

strace / ltrace
LTIB & MVL6:
no enemies!
© 2009 MontaVista Software 27
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 28
A side-by-side comparison
LTIB for 8548cds
(late 2007)
MVL6 for 8548cds
(mid 2009)
Kernel, gcc, libc Kernel: 2.6.23+pq3,
Gcc: 4.1.78,
C library: 2.5.78 (eglibc)
Kernel: 2.6.27+,
Gcc: 4.3.3,
C library: 2.8 (eglibc)
Uses Device Tree?Yes!Yes
(+documentation)
NFS Yes
(no instructions for host)
Yes
(+documentation)
Builds user land
packages?
RPM
+ cross compile fixes
MVL6IP
(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 29
Target audience – why both deserve to exist
LTIB
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
MVL6
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 30
Want more?

Live Q&A session

Join Meld: http://meld.mvista.com/

Not just for MontaVista customers!!!

Send an e-mail:
klaas.van.gend@mvista.com