Compare commits

..

14 Commits

Author SHA1 Message Date
Alexandru DAMIAN
e5cf3e598e bitbake: toaster: fix target package information
Toaster needs to record information about packages
installed on a built target image, and dependencies
between these packages.

This patch fixes a bug where the variable from the
server wasn't read correctly leading which caused
the buildhistory to not be processed correctly.

Additionally, two display issues in the package table
were fixed, issues that lead to package information
being displayed incorrectly.

    [YOCTO #5197]

(Bitbake rev: ab4bc18409d80de6d069e3dd76c3c54964fe5764)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-05 12:50:58 +00:00
Cristiana Voicu
46814c99ee bitbake: toaster: add variable description for prefixed/suffixed variables
In the Configuration table, we need to link prefixed / suffixed
variables to the corresponding variable descriptions in documentation.conf.

[YOCTO #5198]

(Bitbake rev: 641d9c4fda5fe978154fdfab978c3c09e3906eab)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:56:04 +00:00
Alexandru DAMIAN
b0c24033bb bitbake: toaster: enable required classes in the toaster startup script
In order to use toaster, now you have to set INHERIT+="toaster buildhistory"
To keep it simple, I've done some changes in order to automate it. When toaster
is started, this line is added to a new file called toaster.conf.

This file is passed to the bitbake server with the --postread parameter.

Based on a patch by Cristiana Voicu <cristiana.voicu@intel.com>

(Bitbake rev: 029e868044989eda370340f8bf4200cfd2670fca)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:55:54 +00:00
Alexandru DAMIAN
25f50e24c7 bitbake: toaster: server shutdown on terminal exit
If the terminal where the server was started is closed,
the bitbake server should shutdown. Currently the system
is left in hanging state.

This patch uses "trap" command to make sure the servers
are closed on terminal exit.

[YOCTO #5376]

(Bitbake rev: 5f8b97010f7b465753b6ff6275d18426006ee14b)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:53:50 +00:00
Alexandru DAMIAN
a6b357a9af bitbake: toaster: fix timezone settings
This patch fixes an issue where, if not defined,
the timezone defaults to 'America/Chicago'.

The solution is to set the timezone to current computer's
timezone.

[YOCTO #5186]

(Bitbake rev: a4102b549f04a9b52cdcd318bf511a18ab48067d)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:53:43 +00:00
Alexandru DAMIAN
57beaf994f bitbake: cooker: do not recreate recipecache in buildfile mode
When building a single file, the cooker will recreate
the recipecache from scratch.

I suspect this is a remnant of past code, since:
* the current recipecache works fine
* the new recipecache will not have all the fields as
requested by HOB_EXTRA_CACHES setting

This patch disables recreating the recipecache, leading
to shorter times when building single build files
(-b option) and better compatibility with Toaster.

(Bitbake rev: 618d69b00075981b8553513130d7deb1aed61578)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:53:35 +00:00
Alexandru DAMIAN
e1aebfe018 bitbake: build, toaster: record proper task type
Bitbake tasks may be of type 'python' or 'shell',
or they may not be executed at all, which is record
as task type 'noexec'.

In order to record proper task type, this patch:

* creates no exec task type as the default value in
the toaster model definition

* adds full task flags to the bb.build.TaskStarted event
in build.py

* if the task actually starts, the toaster ui will
record the type of the task as either 'python' or 'shell'
based on the task flags.

[YOCTO #5073]
[YOCTO #5075]
[YOCTO #5327]

(Bitbake rev: 6648c57e6d369fc009ea3a9fe939def5d2c67bf5)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:53:24 +00:00
Alexandru DAMIAN
f6847b0cd2 bitbake: cooker: add data to the dependency tree dump
Toaster needes to record extra data that needs to
be moved at the time of the dependency tree dump.

This data includes:
* layer priorities for recording in the layer section
* the inherit list for each PN which allows to determine
the type of the PN (regular package, image, etc).

This patch adds this data to the dependency tree dump.

(Bitbake rev: 7636aba37320aaf9b044d3832ddc21af51ccd69c)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:53:12 +00:00
Alexandru DAMIAN
1e6e27d98d bitbake: toaster: fixes for null values from events
Some of the data values may come of as None through the event system,
and the UI would encounter a problem saving the Configuration.
It would be trying to save these values as NULL in the
database, which is not allowed.

This patch adds more verification for data coming through
the event system.

Other minor updates:
* update for the event model from toaster.bbclass
* minor code flow fix in the event system

(Bitbake rev: 03fafd086381723c6486522873671515824e49f2)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:52:59 +00:00
Alexandru DAMIAN
73293c6481 toaster: add class to dump toaster-tracked data
Adding a new bbclass that will collect and send relevant
data from the task context to the Toaster UI.

This bbclass consists of postfuncs that get executed
right after the main task func, and in the same context.
This allows data gathering in a synchronous manner during
the build, guaranteeing data integrity. This approach also
preserves the task signatures.

The data is moved to the UI through the event system.

There is no performance impact if the class is disabled.

License is MIT.

(From OE-Core rev: 1d2d37d579492b63d20ff8aa890a43b9a1576cf0)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:52:45 +00:00
Belen Barros Pena
d7b8f82a64 documentation.conf: update contents
This patch updates descriptions and brings more
info for the variable configurations as documented
in the OE-Core manual.

This file is used by Toaster to display help for
the configuration variables.

(From OE-Core rev: 98405beddb93490c8a2e9903adc2a510969ed6a9)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04 10:52:39 +00:00
Alexandru DAMIAN
4b64eb444a bitbake: add Toaster UI interface
Adding a new bitbake UI interface named 'toasterui'.

'toasterui' listens for events and data coming from a
bitbake server during a run, and records it
in a data store using the Toaster object model.

Adds a helper class named BuildInfoHelper that
reconstructs the state of the bitbake server and
saves relevant data to the data store.

Code portions contributed by Calin Dragomir <calindragomir@gmail.com>.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2013-10-16 15:27:03 +01:00
Alexandru DAMIAN
db2a7845a9 bitbake: toaster: adding frameworks for the Simple UI
This commit adds the 3rd party frameworks used for the web UI.

jQuery is licensed under MIT.

Bootstrap is licensed under APACHE-2.0

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2013-10-16 15:26:52 +01:00
Alexandru DAMIAN
cb1338dedc bitbake: add toaster code to bitbake
This patch adds the Toaster component to Bitbake.

Toaster is a module designed to record the progress of a
Bitbake build, and data about the resultant artifacts.

It contains a web-based interface and a REST API allowing
post-facto inspection of the build process and artifacts.

Features present in this build:
* toaster start script
* relational data model
* Django boilerplate code
* the REST API
* the Simple UI web interface

This patch has all the development history squashed together.

Code portions contributed by Calin Dragomir <calindragomir@gmail.com>.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2013-10-16 15:26:37 +01:00
229 changed files with 11238 additions and 7340 deletions

10
bitbake/LICENSE Normal file
View File

@@ -0,0 +1,10 @@
BitBake is licensed under the GNU General Public License version 2.0. See COPYING for further details.
The following external components are distributed with this software:
* The Toaster Simple UI application is based upon the Django project template, the files of which are covered by the BSD license and are copyright (c) Django Software
Foundation and individual contributors.
* Twitter Bootstrap (including Glyphicons), redistributed under the Apache License 2.0.
* jQuery is redistributed under the MIT license.

164
bitbake/bin/toaster Executable file
View File

@@ -0,0 +1,164 @@
#!/bin/bash
# (c) 2013 Intel Corp.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# This script enables toaster event logging and
# starts bitbake resident server
# use as: source toaster [start|stop]
# Helper function to kill a background toaster development server
function webserverKillAll()
{
local pidfile
for pidfile in ${BUILDDIR}/.toastermain.pid; do
if [ -f ${pidfile} ]; then
while kill -0 $(< ${pidfile}) 2>/dev/null; do
kill -SIGTERM -$(< ${pidfile}) 2>/dev/null
sleep 1;
done;
rm ${pidfile}
fi
done
}
function webserverStartAll()
{
retval=0
python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1
if [ $retval -eq 1 ]; then
echo "Failed db sync, stopping system start" 1>&2
else
python $BBBASEDIR/lib/toaster/manage.py runserver 0.0.0.0:8000 </dev/null >${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid
fi
return $retval
}
# Helper functions to add a special configuration file
function addtoConfiguration()
{
echo "#Created by toaster start script" > ${BUILDDIR}/conf/$2
echo $1 >> ${BUILDDIR}/conf/$2
}
# define the stop command
function stop_system()
{
if [ -f ${BUILDDIR}/.toasterui.pid ]; then
kill $(< ${BUILDDIR}/.toasterui.pid )
rm ${BUILDDIR}/.toasterui.pid
fi
BBSERVER=localhost:8200 bitbake -m
unset BBSERVER
webserverKillAll
# force stop any misbehaving bitbake server
lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill
}
# We make sure we're running in the current shell and in a good environment
if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; then
echo "Error: This script needs to be sourced. Please run as 'source toaster [start|stop]'" 1>&2;
exit 1
fi
if [ -z "$BUILDDIR" ] || [ -z `which bitbake` ]; then
echo "Error: Build environment is not setup or bitbake is not in path." 1>&2;
return 2
fi
BBBASEDIR=`dirname ${BASH_SOURCE}`/..
# Verify prerequisites
if ! echo "import django; print (1,4,5) == django.VERSION[0:3]" | python 2>/dev/null | grep True >/dev/null; then
echo -e "This program needs Django 1.4.5. Please install with\n\nsudo pip install django==1.4.5"
return 2
fi
# Determine the action. If specified by arguments, fine, if not, toggle it
if [ "x$1" == "xstart" ] || [ "x$1" == "xstop" ]; then
CMD="$1"
else
if [ -z "$BBSERVER" ]; then
CMD="start"
else
CMD="stop"
fi;
fi
NOTOASTERUI=0
if [ "x$2" == "xnoui" ]; then
NOTOASTERUI=1
fi
echo "The system will $CMD."
# Make sure it's safe to run by checking bitbake lock
lock=1
if [ -e $BUILDDIR/bitbake.lock ]; then
(flock -n 200 ) 200<$BUILDDIR/bitbake.lock || lock=0
fi
if [ ${CMD} == "start" ] && ( [ $lock -eq 0 ] || [ -e $BUILDDIR/.toastermain.pid ] ); then
echo "Error: bitbake lock state error. System is already on." 2>&1
return 3
elif [ ${CMD} == "stop" ] && ( [ $lock -eq 1 ] || ! [ -e $BUILDDIR/.toastermain.pid ] ) ; then
echo "Error: bitbake lock state error. Trying to stop a stopped system ?
If you think the system is hanged up, you can try to manually stop system with the commands
# BBSERVER=localhost:8200 bitbake -m
and
# webserverKillAll
" 2>&1
return 3
fi
# Execute the commands
case $CMD in
start )
addtoConfiguration "INHERIT+=\"toaster buildhistory\"" toaster.conf
webserverStartAll || return 4
unset BBSERVER
bitbake --postread conf/toaster.conf --server-only -t xmlrpc -B localhost:8200
export BBSERVER=localhost:8200
if [ $NOTOASTERUI == 0 ]; then # we start the TOASTERUI only if not inhibited
bitbake --observe-only -u toasterui >${BUILDDIR}/toaster_ui.log 2>&1 & echo $! >${BUILDDIR}/.toasterui.pid
fi
# stop system on terminal exit
trap stop_system SIGHUP
;;
stop )
stop_system
trap '' SIGHUP
;;
esac
echo "Successful ${CMD}."

View File

@@ -91,6 +91,9 @@ class TaskBase(event.Event):
class TaskStarted(TaskBase):
"""Task execution started"""
def __init__(self, t, logfile, taskflags, d):
super(TaskStarted, self).__init__(t, logfile, d)
self.taskflags = taskflags
class TaskSucceeded(TaskBase):
"""Task execution completed"""
@@ -285,7 +288,7 @@ set -e
if bb.msg.loggerVerboseLogs:
script.write("set -x\n")
if cwd:
script.write("cd '%s'\n" % cwd)
script.write("cd %s\n" % cwd)
script.write("%s\n" % func)
script.write('''
# cleanup
@@ -422,7 +425,9 @@ def _exec_task(fn, task, d, quieterr):
localdata.setVar('BB_LOGFILE', logfn)
localdata.setVar('BB_RUNTASK', task)
event.fire(TaskStarted(task, logfn, localdata), localdata)
flags = localdata.getVarFlags(task)
event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
try:
for func in (prefuncs or '').split():
exec_func(func, localdata)

View File

@@ -86,8 +86,6 @@ class Command:
def runAsyncCommand(self):
try:
if self.cooker.state == bb.cooker.state.error:
return False
if self.currentAsyncCommand is not None:
(command, options) = self.currentAsyncCommand
commandmethod = getattr(CommandsAsync, command)

View File

@@ -61,7 +61,7 @@ class CollectionError(bb.BBHandledException):
"""
class state:
initial, parsing, running, shutdown, forceshutdown, stopped, error = range(7)
initial, parsing, running, shutdown, forceshutdown, stopped = range(6)
class SkippedPackage:
@@ -511,6 +511,7 @@ class BBCooker:
depend_tree["packages"] = {}
depend_tree["rdepends-pkg"] = {}
depend_tree["rrecs-pkg"] = {}
depend_tree["layer-priorities"] = self.recipecache.bbfile_config_priorities
for task in xrange(len(rq.rqdata.runq_fnid)):
taskname = rq.rqdata.runq_task[task]
@@ -522,6 +523,7 @@ class BBCooker:
depend_tree["pn"][pn] = {}
depend_tree["pn"][pn]["filename"] = fn
depend_tree["pn"][pn]["version"] = version
depend_tree["pn"][pn]["inherits"] = self.recipecache.inherits.get(fn, None)
# if we have extra caches, list all attributes they bring in
extra_info = []
@@ -1083,7 +1085,6 @@ class BBCooker:
self.buildSetVars()
self.recipecache = bb.cache.CacheData(self.caches_array)
infos = bb.cache.Cache.parse(fn, self.collection.get_file_appends(fn), \
self.data,
self.caches_array)
@@ -1321,7 +1322,6 @@ class BBCooker:
self.prhost = prserv.serv.auto_start(self.data)
except prserv.serv.PRServiceConfigError:
bb.event.fire(CookerExit(), self.event_data)
self.state = state.error
return
def post_serve(self):

View File

@@ -805,10 +805,6 @@ def try_mirror_url(newuri, origud, ud, ld, check = False):
dest = os.path.join(dldir, os.path.basename(ud.localpath))
if not os.path.exists(dest):
os.symlink(ud.localpath, dest)
if not os.path.exists(origud.donestamp) or origud.method.need_update(origud.url, origud, ld):
origud.method.download(origud.url, origud, ld)
if hasattr(ud.method,"build_mirror_data"):
origud.method.build_mirror_data(origud.url, origud, ld)
return None
# Otherwise the result is a local file:// and we symlink to it
if not os.path.exists(origud.localpath):

View File

@@ -92,10 +92,7 @@ class Hg(FetchMethod):
if not ud.user:
hgroot = host + ud.path
else:
if ud.pswd:
hgroot = ud.user + ":" + ud.pswd + "@" + host + ud.path
else:
hgroot = ud.user + "@" + host + ud.path
hgroot = ud.user + "@" + host + ud.path
if command == "info":
return "%s identify -i %s://%s/%s" % (basecmd, proto, hgroot, ud.module)
@@ -115,10 +112,7 @@ class Hg(FetchMethod):
# do not pass options list; limiting pull to rev causes the local
# repo not to contain it and immediately following "update" command
# will crash
if ud.user and ud.pswd:
cmd = "%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" pull" % (basecmd, ud.user, ud.pswd, proto)
else:
cmd = "%s pull" % (basecmd)
cmd = "%s pull" % (basecmd)
elif command == "update":
cmd = "%s update -C %s" % (basecmd, " ".join(options))
else:

View File

@@ -112,7 +112,7 @@ class Perforce(FetchMethod):
base = path
which = path.find('/...')
if which != -1:
base = path[:which-1]
base = path[:which]
base = self._strip_leading_slashes(base)

View File

@@ -27,7 +27,6 @@ import os
import sys
import logging
import bb
import re
from bb import data
from bb.fetch2 import FetchMethod
from bb.fetch2 import FetchError
@@ -92,8 +91,6 @@ class Svn(FetchMethod):
if command == "info":
svncmd = "%s info %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
elif command == "log1":
svncmd = "%s log --limit 1 %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
else:
suffix = ""
if ud.revision:
@@ -170,13 +167,14 @@ class Svn(FetchMethod):
"""
Return the latest upstream revision number
"""
bb.fetch2.check_network_access(d, self._buildsvncommand(ud, d, "log1"))
bb.fetch2.check_network_access(d, self._buildsvncommand(ud, d, "info"))
output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "log1"), d, True)
output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "info"), d, True)
# skip the first line, as per output of svn log
# then we expect the revision on the 2nd line
revision = re.search('^r([0-9]*)', output.splitlines()[1]).group(1)
revision = None
for line in output.splitlines():
if "Last Changed Rev" in line:
revision = line.split(":")[1].strip()
return revision

View File

@@ -243,7 +243,7 @@ class diskMonitor:
# zero, this is a feature of the fs, we disable the inode
# checking for such a fs.
if st.f_files == 0:
logger.info("Inode check for %s is unavaliable, will remove it from disk monitor" % path)
logger.warn("Inode check for %s is unavaliable, will remove it from disk monitor" % path)
self.devDict[k][2] = None
continue
# Always show warning, the self.checked would always be False if the action is WARN

View File

@@ -1204,8 +1204,6 @@ class RunQueueExecuteTasks(RunQueueExecute):
self.stampcache = {}
initial_covered = self.rq.scenequeue_covered.copy()
# Mark initial buildable tasks
for task in xrange(self.stats.total):
self.runq_running.append(0)
@@ -1259,27 +1257,12 @@ class RunQueueExecuteTasks(RunQueueExecute):
except TypeError:
covered_remove = bb.utils.better_eval(call2, locs)
def removecoveredtask(task):
for task in covered_remove:
fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
taskname = self.rqdata.runq_task[task] + '_setscene'
bb.build.del_stamp(taskname, self.rqdata.dataCache, fn)
self.rq.scenequeue_covered.remove(task)
toremove = covered_remove
for task in toremove:
logger.debug(1, 'Not skipping task %s due to setsceneverify', task)
while toremove:
covered_remove = []
for task in toremove:
removecoveredtask(task)
for deptask in self.rqdata.runq_depends[task]:
if deptask not in self.rq.scenequeue_covered:
continue
if deptask in toremove or deptask in covered_remove or deptask in initial_covered:
continue
logger.debug(1, 'Task %s depends on task %s so not skipping' % (task, deptask))
covered_remove.append(deptask)
toremove = covered_remove
self.rq.scenequeue_covered.remove(task)
logger.debug(1, 'Full skip list %s', self.rq.scenequeue_covered)

View File

@@ -0,0 +1,723 @@
#
# BitBake ToasterUI Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import datetime
import sys
import bb
import re
import subprocess
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toaster.toastermain.settings")
import toaster.toastermain.settings as toaster_django_settings
from toaster.orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage
from toaster.orm.models import Target_Package, Build_Package, Variable, Build_File
from toaster.orm.models import Task_Dependency, Build_Package_Dependency, Target_Package_Dependency, Recipe_Dependency
from bb.msg import BBLogFormatter as format
class ORMWrapper(object):
""" This class creates the dictionaries needed to store information in the database
following the format defined by the Django models. It is also used to save this
information in the database.
"""
def __init__(self):
pass
def create_build_object(self, build_info):
build = Build.objects.create(
machine=build_info['machine'],
image_fstypes=build_info['image_fstypes'],
distro=build_info['distro'],
distro_version=build_info['distro_version'],
started_on=build_info['started_on'],
completed_on=build_info['completed_on'],
cooker_log_path=build_info['cooker_log_path'],
build_name=build_info['build_name'],
bitbake_version=build_info['bitbake_version'])
return build
def create_target_objects(self, target_info):
targets = []
for tgt_name in target_info['targets']:
tgt_object = Target.objects.create( build = target_info['build'],
target = tgt_name,
is_image = False,
file_name = "",
file_size = 0);
targets.append(tgt_object)
return targets
def update_build_object(self, build, errors, warnings, taskfailures):
outcome = Build.SUCCEEDED
if errors or taskfailures:
outcome = Build.FAILED
build.completed_on = datetime.datetime.now()
build.errors_no = errors
build.warnings_no = warnings
build.outcome = outcome
build.save()
def get_update_task_object(self, task_information):
task_object, created = Task.objects.get_or_create(
build=task_information['build'],
recipe=task_information['recipe'],
task_name=task_information['task_name'],
)
for v in vars(task_object):
if v in task_information.keys():
vars(task_object)[v] = task_information[v]
# if we got covered by a setscene task, we're SSTATE
if task_object.outcome == Task.OUTCOME_COVERED and 1 == Task.objects.filter(task_executed=True, build = task_object.build, recipe = task_object.recipe, task_name=task_object.task_name+"_setscene").count():
task_object.outcome = Task.OUTCOME_SSTATE
# mark down duration if we have a start time
if 'start_time' in task_information.keys():
duration = datetime.datetime.now() - task_information['start_time']
task_object.elapsed_time = duration.total_seconds()
task_object.save()
return task_object
def get_update_recipe_object(self, recipe_information):
recipe_object, created = Recipe.objects.get_or_create(
layer_version=recipe_information['layer_version'],
file_path=recipe_information['file_path'])
for v in vars(recipe_object):
if v in recipe_information.keys():
vars(recipe_object)[v] = recipe_information[v]
recipe_object.save()
return recipe_object
def get_layer_version_object(self, layer_version_information):
layer_version_object = Layer_Version.objects.get_or_create(
layer = layer_version_information['layer'],
branch = layer_version_information['branch'],
commit = layer_version_information['commit'],
priority = layer_version_information['priority']
)
layer_version_object[0].save()
return layer_version_object[0]
def get_update_layer_object(self, layer_information):
layer_object = Layer.objects.get_or_create(
name=layer_information['name'],
local_path=layer_information['local_path'],
layer_index_url=layer_information['layer_index_url'])
layer_object[0].save()
return layer_object[0]
def save_target_package_information(self, target_obj, packagedict, bldpkgs, recipes):
for p in packagedict:
packagedict[p]['object'] = Target_Package.objects.create( target = target_obj,
name = p,
size = packagedict[p]['size'])
if p in bldpkgs:
packagedict[p]['object'].version = bldpkgs[p]['version']
packagedict[p]['object'].recipe = recipes[bldpkgs[p]['pn']]
packagedict[p]['object'].save()
for p in packagedict:
for (px,deptype) in packagedict[p]['depends']:
Target_Package_Dependency.objects.create( package = packagedict[p]['object'],
depends_on = packagedict[px]['object'],
dep_type = deptype);
def create_logmessage(self, log_information):
log_object = LogMessage.objects.create(
build = log_information['build'],
level = log_information['level'],
message = log_information['message'])
for v in vars(log_object):
if v in log_information.keys():
vars(log_object)[v] = log_information[v]
return log_object.save()
def save_build_package_information(self, build_obj, package_info, recipes):
# create and save the object
bp_object = Build_Package.objects.create( build = build_obj,
recipe = recipes[package_info['PN']],
name = package_info['PKG'],
version = package_info['PKGV'],
revision = package_info['PKGR'],
summary = package_info['SUMMARY'],
description = package_info['DESCRIPTION'],
size = package_info['PKGSIZE'],
section = package_info['SECTION'],
license = package_info['LICENSE'],
)
# save any attached file information
for path in package_info['FILES_INFO']:
fo = Build_File.objects.create( bpackage = bp_object,
path = path,
size = package_info['FILES_INFO'][path] )
# save soft dependency information
if 'RDEPENDS' in package_info and package_info['RDEPENDS']:
for p in bb.utils.explode_deps(package_info['RDEPENDS']):
Build_Package_Dependency.objects.get_or_create( package = bp_object,
depends_on = p, dep_type = Build_Package_Dependency.TYPE_RDEPENDS)
if 'RPROVIDES' in package_info and package_info['RPROVIDES']:
for p in bb.utils.explode_deps(package_info['RPROVIDES']):
Build_Package_Dependency.objects.get_or_create( package = bp_object,
depends_on = p, dep_type = Build_Package_Dependency.TYPE_RPROVIDES)
if 'RRECOMMENDS' in package_info and package_info['RRECOMMENDS']:
for p in bb.utils.explode_deps(package_info['RRECOMMENDS']):
Build_Package_Dependency.objects.get_or_create( package = bp_object,
depends_on = p, dep_type = Build_Package_Dependency.TYPE_RRECOMMENDS)
if 'RSUGGESTS' in package_info and package_info['RSUGGESTS']:
for p in bb.utils.explode_deps(package_info['RSUGGESTS']):
Build_Package_Dependency.objects.get_or_create( package = bp_object,
depends_on = p, dep_type = Build_Package_Dependency.TYPE_RSUGGESTS)
if 'RREPLACES' in package_info and package_info['RREPLACES']:
for p in bb.utils.explode_deps(package_info['RREPLACES']):
Build_Package_Dependency.objects.get_or_create( package = bp_object,
depends_on = p, dep_type = Build_Package_Dependency.TYPE_RREPLACES)
if 'RCONFLICTS' in package_info and package_info['RCONFLICTS']:
for p in bb.utils.explode_deps(package_info['RCONFLICTS']):
Build_Package_Dependency.objects.get_or_create( package = bp_object,
depends_on = p, dep_type = Build_Package_Dependency.TYPE_RCONFLICTS)
return bp_object
def save_build_variables(self, build_obj, vardump):
for k in vardump:
if not bool(vardump[k]['func']):
value = vardump[k]['v'];
if value is None:
value = ''
desc = vardump[k]['doc'];
if desc is None:
var_words = [word for word in k.split('_')]
root_var = "_".join([word for word in var_words if word.isupper()])
if root_var and root_var != k and root_var in vardump:
desc = vardump[root_var]['doc']
if desc is None:
desc = ''
Variable.objects.create( build = build_obj,
variable_name = k,
variable_value = value,
description = desc)
class BuildInfoHelper(object):
""" This class gathers the build information from the server and sends it
towards the ORM wrapper for storing in the database
It is instantiated once per build
Keeps in memory all data that needs matching before writing it to the database
"""
def __init__(self, server, has_build_history = False):
self._configure_django()
self.internal_state = {}
self.task_order = 0
self.server = server
self.orm_wrapper = ORMWrapper()
self.has_build_history = has_build_history
self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
def _configure_django(self):
# Add toaster to sys path for importing modules
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'toaster'))
###################
## methods to convert event/external info into objects that the ORM layer uses
def _get_layer_dict(self, layer_path):
layer_info = {}
layer_name = layer_path.split('/')[-1]
layer_url = 'http://layers.openembedded.org/layerindex/layer/{layer}/'
layer_url_name = self._get_url_map_name(layer_name)
layer_info['name'] = layer_name
layer_info['local_path'] = layer_path
layer_info['layer_index_url'] = layer_url.format(layer=layer_url_name)
return layer_info
def _get_url_map_name(self, layer_name):
""" Some layers have a different name on openembedded.org site,
this method returns the correct name to use in the URL
"""
url_name = layer_name
url_mapping = {'meta': 'openembedded-core'}
for key in url_mapping.keys():
if key == layer_name:
url_name = url_mapping[key]
return url_name
def _get_layer_information(self):
layer_info = {}
return layer_info
def _get_layer_version_information(self, layer_object):
layer_version_info = {}
layer_version_info['build'] = self.internal_state['build']
layer_version_info['layer'] = layer_object
layer_version_info['branch'] = self._get_git_branch(layer_object.local_path)
layer_version_info['commit'] = self._get_git_revision(layer_object.local_path)
layer_version_info['priority'] = 0
return layer_version_info
def _get_git_branch(self, layer_path):
branch = subprocess.Popen("git symbolic-ref HEAD 2>/dev/null ", cwd=layer_path, shell=True, stdout=subprocess.PIPE).communicate()[0]
branch = branch.replace('refs/heads/', '').rstrip()
return branch
def _get_git_revision(self, layer_path):
revision = subprocess.Popen("git rev-parse HEAD 2>/dev/null ", cwd=layer_path, shell=True, stdout=subprocess.PIPE).communicate()[0].rstrip()
return revision
def _get_build_information(self):
build_info = {}
# Generate an identifier for each new build
build_info['machine'] = self.server.runCommand(["getVariable", "MACHINE"])[0]
build_info['distro'] = self.server.runCommand(["getVariable", "DISTRO"])[0]
build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0]
build_info['started_on'] = datetime.datetime.now()
build_info['completed_on'] = datetime.datetime.now()
build_info['image_fstypes'] = self._remove_redundant(self.server.runCommand(["getVariable", "IMAGE_FSTYPES"])[0] or "")
build_info['cooker_log_path'] = self.server.runCommand(["getVariable", "BB_CONSOLELOG"])[0]
build_info['build_name'] = self.server.runCommand(["getVariable", "BUILDNAME"])[0]
build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0]
return build_info
def _get_task_information(self, event, recipe):
task_information = {}
task_information['build'] = self.internal_state['build']
task_information['outcome'] = Task.OUTCOME_NA
task_information['recipe'] = recipe
task_information['task_name'] = event.taskname
try:
# some tasks don't come with a hash. and that's ok
task_information['sstate_checksum'] = event.taskhash
except AttributeError:
pass
return task_information
def _get_layer_version_for_path(self, path):
def _slkey(layer_version):
return len(layer_version.layer.local_path)
# Heuristics: we always match recipe to the deepest layer path that
# we can match to the recipe file path
for bl in sorted(self.internal_state['layer_versions'], reverse=True, key=_slkey):
if (path.startswith(bl.layer.local_path)):
return bl
#TODO: if we get here, we didn't read layers correctly
assert False
return None
def _get_recipe_information_from_build_event(self, event):
layer_version_obj = self._get_layer_version_for_path(re.split(':', event.taskfile)[-1])
recipe_info = {}
recipe_info['layer_version'] = layer_version_obj
recipe_info['file_path'] = re.split(':', event.taskfile)[-1]
return recipe_info
def _get_task_build_stats(self, task_object):
bs_path = self._get_path_information(task_object)
for bp in bs_path: # TODO: split for each target
task_build_stats = self._get_build_stats_from_file(bp, task_object.task_name)
return task_build_stats
def _get_path_information(self, task_object):
build_stats_format = "{tmpdir}/buildstats/{target}-{machine}/{buildname}/{package}/"
build_stats_path = []
for t in self.internal_state['targets']:
target = t.target
machine = self.internal_state['build'].machine
buildname = self.internal_state['build'].build_name
package = task_object.recipe.name + "-" + task_object.recipe.version.strip(":")
build_stats_path.append(build_stats_format.format(tmpdir=self.tmp_dir, target=target,
machine=machine, buildname=buildname,
package=package))
return build_stats_path
def _get_build_stats_from_file(self, bs_path, task_name):
task_bs_filename = str(bs_path) + str(task_name)
task_bs = open(task_bs_filename, 'r')
cpu_usage = 0
disk_io = 0
startio = ''
endio = ''
for line in task_bs.readlines():
if line.startswith('CPU usage: '):
cpu_usage = line[11:]
elif line.startswith('EndTimeIO: '):
endio = line[11:]
elif line.startswith('StartTimeIO: '):
startio = line[13:]
task_bs.close()
if startio and endio:
disk_io = int(endio.strip('\n ')) - int(startio.strip('\n '))
if cpu_usage:
cpu_usage = float(cpu_usage.strip('% \n'))
task_build_stats = {'cpu_usage': cpu_usage, 'disk_io': disk_io}
return task_build_stats
def _remove_redundant(self, string):
ret = []
for i in string.split():
if i not in ret:
ret.append(i)
return " ".join(ret)
################################
## external available methods to store information
def store_layer_info(self):
layers = self.server.runCommand(["getVariable", "BBLAYERS"])[0].strip().split(" ")
self.internal_state['layers'] = []
for layer_path in { l for l in layers if len(l) }:
layer_information = self._get_layer_dict(layer_path)
self.internal_state['layers'].append(self.orm_wrapper.get_update_layer_object(layer_information))
def store_started_build(self, event):
build_information = self._get_build_information()
build_obj = self.orm_wrapper.create_build_object(build_information)
self.internal_state['build'] = build_obj
# create target information
target_information = {}
target_information['targets'] = event.getPkgs()
target_information['build'] = build_obj
self.internal_state['targets'] = self.orm_wrapper.create_target_objects(target_information)
# Load layer information for the build
self.internal_state['layer_versions'] = []
for layer_object in self.internal_state['layers']:
layer_version_information = self._get_layer_version_information(layer_object)
self.internal_state['layer_versions'].append(self.orm_wrapper.get_layer_version_object(layer_version_information))
del self.internal_state['layers']
# Save build configuration
self.orm_wrapper.save_build_variables(build_obj, self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0])
def update_build_information(self, event, errors, warnings, taskfailures):
if 'build' in self.internal_state:
self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures)
def store_started_task(self, event):
identifier = event.taskfile + event.taskname
recipe_information = self._get_recipe_information_from_build_event(event)
recipe = self.orm_wrapper.get_update_recipe_object(recipe_information)
task_information = self._get_task_information(event, recipe)
task_information['outcome'] = Task.OUTCOME_NA
if isinstance(event, bb.runqueue.runQueueTaskSkipped):
task_information['task_executed'] = False
if event.reason == "covered":
task_information['outcome'] = Task.OUTCOME_COVERED
if event.reason == "existing":
task_information['outcome'] = Task.OUTCOME_EXISTING
else:
task_information['task_executed'] = True
if 'noexec' in vars(event) and event.noexec == True:
task_information['script_type'] = Task.CODING_NOEXEC
self.task_order += 1
task_information['order'] = self.task_order
task_obj = self.orm_wrapper.get_update_task_object(task_information)
self.internal_state[identifier] = {'start_time': datetime.datetime.now()}
def update_and_store_task(self, event):
identifier = event.taskfile + event.taskname
recipe_information = self._get_recipe_information_from_build_event(event)
recipe = self.orm_wrapper.get_update_recipe_object(recipe_information)
task_information = self._get_task_information(event,recipe)
try:
task_information['start_time'] = self.internal_state[identifier]['start_time']
except:
pass
if 'logfile' in vars(event):
task_information['logfile'] = event.logfile
if '_message' in vars(event):
task_information['message'] = event._message
if 'taskflags' in vars(event):
# with TaskStarted, we get even more information
if 'python' in event.taskflags.keys() and event.taskflags['python'] == '1':
task_information['script_type'] = Task.CODING_PYTHON
else:
task_information['script_type'] = Task.CODING_SHELL
if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)):
task_information['outcome'] = Task.OUTCOME_SUCCESS
task_build_stats = self._get_task_build_stats(self.orm_wrapper.get_update_task_object(task_information))
task_information['cpu_usage'] = task_build_stats['cpu_usage']
task_information['disk_io'] = task_build_stats['disk_io']
del self.internal_state[identifier]
if isinstance(event, bb.runqueue.runQueueTaskFailed):
task_information['outcome'] = Task.OUTCOME_FAILED
del self.internal_state[identifier]
self.orm_wrapper.get_update_task_object(task_information)
def read_target_package_dep_data(self, event):
# for all targets
for target in self.internal_state['targets']:
# verify that we have something to read
if not target.is_image or not self.has_build_history:
print "not collecting package info ", target.is_image, self.has_build_history
break
# TODO this is a temporary replication of the code in buildhistory.bbclass
# This MUST be changed to query the actual BUILD_DIR_IMAGE in the target context when
# the capability will be implemented in Bitbake
MACHINE_ARCH, error = self.server.runCommand(['getVariable', 'MACHINE_ARCH'])
TCLIBC, error = self.server.runCommand(['getVariable', 'TCLIBC'])
BUILDHISTORY_DIR, error = self.server.runCommand(['getVariable', 'BUILDHISTORY_DIR'])
BUILDHISTORY_DIR_IMAGE = "%s/images/%s/%s/%s" % (BUILDHISTORY_DIR, MACHINE_ARCH, TCLIBC, target.target)
self.internal_state['packages'] = {}
with open("%s/installed-package-sizes.txt" % BUILDHISTORY_DIR_IMAGE, "r") as fin:
for line in fin:
line = line.rstrip(";")
psize, px = line.split("\t")
punit, pname = px.split(" ")
self.internal_state['packages'][pname.strip()] = {'size':int(psize)*1024, 'depends' : []}
with open("%s/depends.dot" % BUILDHISTORY_DIR_IMAGE, "r") as fin:
p = re.compile(r' -> ')
dot = re.compile(r'.*style=dotted')
for line in fin:
line = line.rstrip(';')
linesplit = p.split(line)
if len(linesplit) == 2:
pname = linesplit[0].rstrip('"').strip('"')
dependsname = linesplit[1].split(" ")[0].strip().strip(";").strip('"').rstrip('"')
deptype = Target_Package_Dependency.TYPE_DEPENDS
if dot.match(line):
deptype = Target_Package_Dependency.TYPE_RECOMMENDS
if not pname in self.internal_state['packages']:
self.internal_state['packages'][pname] = {'size': 0, 'depends' : []}
if not dependsname in self.internal_state['packages']:
self.internal_state['packages'][dependsname] = {'size': 0, 'depends' : []}
self.internal_state['packages'][pname]['depends'].append((dependsname, deptype))
self.orm_wrapper.save_target_package_information(target,
self.internal_state['packages'],
self.internal_state['bldpkgs'], self.internal_state['recipes'])
def store_dependency_information(self, event):
# save layer version priorities
if 'layer-priorities' in event._depgraph.keys():
for lv in event._depgraph['layer-priorities']:
(name, path, regexp, priority) = lv
layer_version_obj = self._get_layer_version_for_path(path[1:]) # paths start with a ^
assert layer_version_obj is not None
layer_version_obj.priority = priority
layer_version_obj.save()
# save build time package information
self.internal_state['bldpkgs'] = {}
for pkg in event._depgraph['packages']:
self.internal_state['bldpkgs'][pkg] = event._depgraph['packages'][pkg]
# save recipe information
self.internal_state['recipes'] = {}
for pn in event._depgraph['pn']:
file_name = re.split(':', event._depgraph['pn'][pn]['filename'])[-1]
layer_version_obj = self._get_layer_version_for_path(re.split(':', file_name)[-1])
assert layer_version_obj is not None
recipe_info = {}
recipe_info['name'] = pn
recipe_info['version'] = event._depgraph['pn'][pn]['version']
recipe_info['layer_version'] = layer_version_obj
recipe_info['summary'] = event._depgraph['pn'][pn]['summary']
recipe_info['license'] = event._depgraph['pn'][pn]['license']
recipe_info['description'] = event._depgraph['pn'][pn]['description']
recipe_info['section'] = event._depgraph['pn'][pn]['section']
recipe_info['licensing_info'] = 'Not Available'
recipe_info['homepage'] = event._depgraph['pn'][pn]['homepage']
recipe_info['bugtracker'] = event._depgraph['pn'][pn]['bugtracker']
recipe_info['author'] = 'Not Available'
recipe_info['file_path'] = file_name
recipe = self.orm_wrapper.get_update_recipe_object(recipe_info)
if 'inherits' in event._depgraph['pn'][pn].keys():
recipe.is_image = True in map(lambda x: x.endswith('image.bbclass'), event._depgraph['pn'][pn]['inherits'])
else:
recipe.is_image = False
if recipe.is_image:
for t in self.internal_state['targets']:
if pn == t.target:
t.is_image = True
t.save()
self.internal_state['recipes'][pn] = recipe
# save recipe dependency
# buildtime
for recipe in event._depgraph['depends']:
try:
target = self.internal_state['recipes'][recipe]
for dep in event._depgraph['depends'][recipe]:
dependency = self.internal_state['recipes'][dep]
Recipe_Dependency.objects.get_or_create( recipe = target,
depends_on = dependency, dep_type = Recipe_Dependency.TYPE_DEPENDS)
except KeyError: # we'll not get recipes for key w/ values listed in ASSUME_PROVIDED
pass
# runtime
for recipe in event._depgraph['rdepends-pn']:
try:
target = self.internal_state['recipes'][recipe]
for dep in event._depgraph['rdepends-pn'][recipe]:
dependency = self.internal_state['recipes'][dep]
Recipe_Dependency.objects.get_or_create( recipe = target,
depends_on = dependency, dep_type = Recipe_Dependency.TYPE_RDEPENDS)
except KeyError: # we'll not get recipes for key w/ values listed in ASSUME_PROVIDED
pass
# save all task information
def _save_a_task(taskdesc):
spec = re.split(r'\.', taskdesc);
pn = ".".join(spec[0:-1])
taskname = spec[-1]
e = event
e.taskname = pn
recipe = self.internal_state['recipes'][pn]
task_info = self._get_task_information(e, recipe)
task_info['task_name'] = taskname
task_obj = self.orm_wrapper.get_update_task_object(task_info)
return task_obj
for taskdesc in event._depgraph['tdepends']:
target = _save_a_task(taskdesc)
for taskdesc1 in event._depgraph['tdepends'][taskdesc]:
dep = _save_a_task(taskdesc1)
Task_Dependency.objects.get_or_create( task = target, depends_on = dep )
def store_build_package_information(self, event):
package_info = event.data
self.orm_wrapper.save_build_package_information(self.internal_state['build'],
package_info,
self.internal_state['recipes'],
)
def _store_log_information(self, level, text):
log_information = {}
log_information['build'] = self.internal_state['build']
log_information['level'] = level
log_information['message'] = text
self.orm_wrapper.create_logmessage(log_information)
def store_log_info(self, text):
self._store_log_information(LogMessage.INFO, text)
def store_log_warn(self, text):
self._store_log_information(LogMessage.WARNING, text)
def store_log_error(self, text):
self._store_log_information(LogMessage.ERROR, text)
def store_log_event(self, event):
# look up license files info from insane.bbclass
m = re.match("([^:]*): md5 checksum matched for ([^;]*)", event.msg)
if m:
(pn, fn) = m.groups()
self.internal_state['recipes'][pn].licensing_info = fn
self.internal_state['recipes'][pn].save()
if event.levelno < format.WARNING:
return
if not 'build' in self.internal_state:
return
log_information = {}
log_information['build'] = self.internal_state['build']
if event.levelno >= format.ERROR:
log_information['level'] = LogMessage.ERROR
elif event.levelno == format.WARNING:
log_information['level'] = LogMessage.WARNING
log_information['message'] = event.msg
log_information['pathname'] = event.pathname
log_information['lineno'] = event.lineno
self.orm_wrapper.create_logmessage(log_information)

View File

@@ -0,0 +1,272 @@
#
# BitBake ToasterUI Implementation
# based on (No)TTY UI Implementation by Richard Purdie
#
# Handling output to TTYs or files (no TTY)
#
# Copyright (C) 2006-2012 Richard Purdie
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import division
try:
import bb
except RuntimeError as exc:
sys.exit(str(exc))
from bb.ui import uihelper
from bb.ui.buildinfohelper import BuildInfoHelper
import bb.msg
import copy
import fcntl
import logging
import os
import progressbar
import signal
import struct
import sys
import time
import xmlrpclib
featureSet = [bb.cooker.CookerFeatures.HOB_EXTRA_CACHES, bb.cooker.CookerFeatures.SEND_DEPENDS_TREE]
logger = logging.getLogger("BitBake")
interactive = sys.stdout.isatty()
def _log_settings_from_server(server):
# Get values of variables which control our output
includelogs, error = server.runCommand(["getVariable", "BBINCLUDELOGS"])
if error:
logger.error("Unable to get the value of BBINCLUDELOGS variable: %s" % error)
raise BaseException(error)
loglines, error = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"])
if error:
logger.error("Unable to get the value of BBINCLUDELOGS_LINES variable: %s" % error)
raise BaseException(error)
return includelogs, loglines
def main(server, eventHandler, params ):
includelogs, loglines = _log_settings_from_server(server)
# verify and warn
build_history_enabled = True
inheritlist, error = server.runCommand(["getVariable", "INHERIT"])
if not "buildhistory" in inheritlist.split(" "):
logger.warn("buildhistory is not enabled. Please enable INHERIT += \"buildhistory\" to see image details.")
build_history_enabled = False
helper = uihelper.BBUIHelper()
console = logging.StreamHandler(sys.stdout)
format_str = "%(levelname)s: %(message)s"
format = bb.msg.BBLogFormatter(format_str)
bb.msg.addDefaultlogFilter(console)
console.setFormatter(format)
logger.addHandler(console)
if not params.observe_only:
logger.error("ToasterUI can only work in observer mode")
return
main.shutdown = 0
interrupted = False
return_value = 0
errors = 0
warnings = 0
taskfailures = []
buildinfohelper = BuildInfoHelper(server, build_history_enabled)
buildinfohelper.store_layer_info()
while True:
try:
event = eventHandler.waitEvent(0.25)
if event is None:
if main.shutdown > 0:
break
continue
helper.eventHandler(event)
if isinstance(event, bb.event.BuildStarted):
buildinfohelper.store_started_build(event)
if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)):
buildinfohelper.update_and_store_task(event)
continue
if isinstance(event, bb.event.LogExecTTY):
logger.warn(event.msg)
continue
if isinstance(event, logging.LogRecord):
buildinfohelper.store_log_event(event)
if event.levelno >= format.ERROR:
errors = errors + 1
return_value = 1
elif event.levelno == format.WARNING:
warnings = warnings + 1
# For "normal" logging conditions, don't show note logs from tasks
# but do show them if the user has changed the default log level to
# include verbose/debug messages
if event.taskpid != 0 and event.levelno <= format.NOTE:
continue
logger.handle(event)
continue
if isinstance(event, bb.build.TaskFailed):
buildinfohelper.update_and_store_task(event)
return_value = 1
logfile = event.logfile
if logfile and os.path.exists(logfile):
bb.error("Logfile of failure stored in: %s" % logfile)
continue
# these events are unprocessed now, but may be used in the future to log
# timing and error informations from the parsing phase in Toaster
if isinstance(event, bb.event.ParseStarted):
continue
if isinstance(event, bb.event.ParseProgress):
continue
if isinstance(event, bb.event.ParseCompleted):
continue
if isinstance(event, bb.event.CacheLoadStarted):
continue
if isinstance(event, bb.event.CacheLoadProgress):
continue
if isinstance(event, bb.event.CacheLoadCompleted):
continue
if isinstance(event, bb.event.MultipleProviders):
continue
if isinstance(event, bb.event.NoProvider):
return_value = 1
errors = errors + 1
if event._runtime:
r = "R"
else:
r = ""
if event._dependees:
text = "Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)" % (r, event._item, ", ".join(event._dependees), r)
else:
text = "Nothing %sPROVIDES '%s'" % (r, event._item)
logger.error(text)
if event._reasons:
for reason in event._reasons:
logger.error("%s", reason)
text += reason
buildinfohelper.store_log_error(text)
continue
if isinstance(event, bb.event.ConfigParsed):
continue
if isinstance(event, bb.event.RecipeParsed):
continue
# end of saved events
if isinstance(event, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped)):
buildinfohelper.store_started_task(event)
continue
if isinstance(event, bb.runqueue.runQueueTaskCompleted):
buildinfohelper.update_and_store_task(event)
continue
if isinstance(event, bb.runqueue.runQueueTaskFailed):
buildinfohelper.update_and_store_task(event)
taskfailures.append(event.taskstring)
logger.error("Task %s (%s) failed with exit code '%s'",
event.taskid, event.taskstring, event.exitcode)
continue
if isinstance(event, (bb.runqueue.sceneQueueTaskCompleted, bb.runqueue.sceneQueueTaskFailed)):
buildinfohelper.update_and_store_task(event)
continue
if isinstance(event, (bb.event.TreeDataPreparationStarted, bb.event.TreeDataPreparationCompleted)):
continue
if isinstance(event, (bb.event.BuildCompleted)):
buildinfohelper.read_target_package_dep_data(event)
buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
continue
if isinstance(event, (bb.command.CommandCompleted,
bb.command.CommandFailed,
bb.command.CommandExit)):
buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
# we start a new build info
errors = 0
warnings = 0
taskfailures = []
buildinfohelper = BuildInfoHelper(server, build_history_enabled)
buildinfohelper.store_layer_info()
continue
if isinstance(event, bb.event.MetadataEvent):
if event.type == "SinglePackageInfo":
buildinfohelper.store_build_package_information(event)
continue
# ignore
if isinstance(event, (bb.event.BuildBase,
bb.event.StampUpdate,
bb.event.RecipePreFinalise,
bb.runqueue.runQueueEvent,
bb.runqueue.runQueueExitWait,
bb.event.OperationProgress,
bb.command.CommandFailed,
bb.command.CommandExit,
bb.command.CommandCompleted,
bb.cooker.CookerExit)):
continue
if isinstance(event, bb.event.DepTreeGenerated):
buildinfohelper.store_dependency_information(event)
continue
logger.error("Unknown event: %s", event)
except EnvironmentError as ioerror:
# ignore interrupted io
if ioerror.args[0] == 4:
pass
except KeyboardInterrupt:
main.shutdown = 1
pass
except Exception as e:
logger.error(e)
import traceback
traceback.print_exc()
pass
if interrupted:
if return_value == 0:
return_value = 1
return return_value

View File

View File

@@ -0,0 +1,37 @@
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.conf.urls import patterns, include, url
urlpatterns = patterns('bldviewer.views',
url(r'^builds$', 'model_explorer', {'model_name':'build'}, name='builds'),
url(r'^targets$', 'model_explorer', {'model_name':'target'}, name='targets'),
url(r'^tasks$', 'model_explorer', {'model_name':'task'}, name='task'),
url(r'^task_dependencies$', 'model_explorer', {'model_name':'task_dependency'}, name='task_dependencies'),
url(r'^packages$', 'model_explorer', {'model_name':'build_package'}, name='build_packages'),
url(r'^package_dependencies$', 'model_explorer', {'model_name':'build_package_dependency'}, name='build_package_dependencies'),
url(r'^target_packages$', 'model_explorer', {'model_name':'target_package'}, name='target_packages'),
url(r'^package_files$', 'model_explorer', {'model_name':'build_file'}, name='build_files'),
url(r'^layers$', 'model_explorer', {'model_name':'layer'}, name='layer'),
url(r'^layerversions$', 'model_explorer', {'model_name':'layerversion'}, name='layerversion'),
url(r'^recipes$', 'model_explorer', {'model_name':'recipe'}, name='recipe'),
url(r'^recipe_dependencies$', 'model_explorer', {'model_name':'recipe_dependency'}, name='recipe_dependencies'),
url(r'^variables$', 'model_explorer', {'model_name':'variable'}, name='variables'),
url(r'^logmessages$', 'model_explorer', {'model_name':'logmessage'}, name='logmessages'),
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
{% load static %}
<html>
<head>
<title>Toaster Simple Explorer</title>
<script src="{% static 'js/jquery-2.0.3.js' %}">
</script>
<script src="{% static 'js/bootstrap.js' %}">
</script>
<link href="{% static 'css/bootstrap.css' %}" rel="stylesheet" type="text/css">
</head>
<body style="height: 100%">
<div style="width:100%; height: 100%; position:absolute">
<div style="width: 100%; height: 3em" class="nav">
<ul class="nav nav-tabs">
<li><a href="{% url all-builds %}">All Builds</a></li>
<li><a href="{% url all-layers %}">All Layers</a></li>
</ul>
</div>
<div style="overflow-y:scroll; width: 100%; position: absolute; top: 3em; bottom:70px ">
{% block pagecontent %}
{% endblock %}
</div>
<div class="navbar" style="position: absolute; bottom: 0; width:100%"><br/>About Toaster | Yocto Project </div>
</div>
</body>
</html>

View File

@@ -0,0 +1,17 @@
{% extends "basetable.html" %}
{% block pagename %}
<ul class="nav nav-tabs" style="display: inline-block">
<li><a>Build {{build.target_set.all|join:"&nbsp;"}} at {{build.started_on}} : </a></li>
<li><a href="{% url task build.id %}"> Tasks </a></li>
<li><a href="{% url bpackage build.id %}"> Build Packages </a></li>
{% for t in build.target_set.all %}
{% if t.is_image %}
<li><a href="{% url tpackage build.id t.pk %}"> Packages for {{t.target}} </a> </li>
{% endif %}
{% endfor %}
<li><a href="{% url configuration build.id %}"> Configuration </a> </li>
</ul>
<h1>Toaster - Build {% block pagetitle %} {% endblock %}</h1>
{% endblock %}

View File

@@ -0,0 +1,46 @@
{% extends "base.html" %}
{% block pagecontent %}
<script>
function showhideTableColumn(i, sh) {
if (sh)
$('td:nth-child('+i+'),th:nth-child('+i+')').show();
else
$('td:nth-child('+i+'),th:nth-child('+i+')').hide();
}
function filterTableRows(test) {
if (test.length > 0) {
var r = test.split(/[ ,]+/).map(function (e) { return new RegExp(e, 'i') });
$('tr.data').map( function (i, el) {
(! r.map(function (j) { return j.test($(el).html())}).reduce(function (c, p) { return c && p;} )) ? $(el).hide() : $(el).show();
});
} else
{
$('tr.data').show();
}
}
</script>
<div style="margin-bottom: 0.5em">
{% block pagename %}
{% endblock %}
<div align="left" style="display:inline-block; width: 40%; margin-left: 2em"> Search: <input type="search" id="filterstring" style="width: 80%" onkeyup="filterTableRows($('#filterstring').val())" autocomplete="off">
</div>
{% if hideshowcols %}
<div align="right" style="display: inline-block; width: 40%">Show/Hide columns:
{% for i in hideshowcols %}
<span>{{i.name}} <input type="checkbox" id="ct{{i.name}}" onchange="showhideTableColumn({{i.order}}, $('#ct{{i.name}}').is(':checked'))" checked autocomplete="off"></span> |
{% endfor %}
</div>
{% endif %}
</div>
<div>
<table class="table table-striped table-condensed" style="width:95%">
{% block pagetable %}
{% endblock %}
</table>
</div>
{% endblock %}

View File

@@ -0,0 +1,24 @@
{% extends "basebuildpage.html" %}
{% block pagetitle %}Files for package {{files.0.bpackage.name}} {% endblock %}
{% block pagetable %}
{% if not files %}
<p>No files were recorded for this package!</p>
{% else %}
<tr>
<th>Name</th>
<th>Size (Bytes)</th>
</tr>
{% for file in files %}
<tr class="data">
<td>{{file.path}}</td>
<td>{{file.size}}</td>
{% endfor %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,44 @@
{% extends "basebuildpage.html" %}
{% block pagetitle %}Packages{% endblock %}
{% block pagetable %}
{% if not packages %}
<p>No packages were recorded for this target!</p>
{% else %}
<tr>
<th>Name</th>
<th>Version</th>
<th>Recipe</th>
<th>Summary</th>
<th>Section</th>
<th>Description</th>
<th>Size on host disk (KBytes)</th>
<th>License</th>
<th>Dependencies List (all)</th>
</tr>
{% for package in packages %}
<tr class="data">
<td><a name="#{{package.name}}" href="{% url bfile build.pk package.pk %}">{{package.name}} ({{package.filelist_bpackage.count}} files)</a></td>
<td>{{package.version}}-{{package.revision}}</td>
<td><a href="{% url layer_versions_recipes package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a></td>
<td>{{package.summary}}</td>
<td>{{package.section}}</td>
<td>{{package.description}}</td>
<td>{{package.size}}</td>
<td>{{package.license}}</td>
<td>
<div style="height: 3em; overflow:auto">
{% for bpd in package.bpackage_dependencies_package.all %}
{{bpd.dep_type}}: {{bpd.depends_on}} <br/>
{% endfor %}
</div>
</td>
{% endfor %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,43 @@
{% extends "basetable.html" %}
{% block pagename %}
<h1>Toaster - Builds</h1>
{% endblock %}
{% block pagetable %}
{% load projecttags %}
<tr>
<th>Outcome</th>
<th>Started On</th>
<th>Completed On</th>
<th>Target</th>
<th>Machine</th>
<th>Time</th>
<th>Errors</th>
<th>Warnings</th>
<th>Output</th>
<th>Log</th>
<th>Bitbake Version</th>
<th>Build Name</th>
</tr>
{% for build in builds %}
<tr class="data">
<td><a href="{% url configuration build.id %}">{{build.get_outcome_display}}</a></td>
<td>{{build.started_on}}</td>
<td>{{build.completed_on}}</td>
<td>{% for t in build.target_set.all %}<a href="{% url tpackage build.id t.id %}">{{t.target}}</a>{% if t.is_image %} (Img){% endif %}<br/>{% endfor %}</td>
<td>{{build.machine}}</td>
<td>{% time_difference build.started_on build.completed_on %}</td>
<td>{{build.errors_no}}:{% if build.errors_no %}{% for error in logs %}{% if error.build == build %}{% if error.level == 2 %}<p>{{error.message}}</p>{% endif %}{% endif %}{% endfor %}{% else %}None{% endif %}</td>
<td>{{build.warnings_no}}:{% if build.warnings_no %}{% for warning in logs %}{% if warning.build == build %}{% if warning.level == 1 %}<p>{{warning.message}}</p>{% endif %}{% endif %}{% endfor %}{% else %}None{% endif %}</td>
<td>{% if build.outcome == 0 %}{% for t in build.target_set.all %}{% if t.is_image %}{{build.image_fstypes}}{% endif %}{% endfor %}{% endif %}</td>
<td>{{build.cooker_log_path}}</td>
<td>{{build.bitbake_version}}</td>
<td>{{build.build_name}}</td>
</tr>
{% endfor %}
{% endblock %}

View File

@@ -0,0 +1,20 @@
{% extends "basebuildpage.html" %}
{% block pagetitle %}Configuration{% endblock %}
{% block pagetable %}
<tr>
<th>Name</th>
<th>Value</th>
<th>Description</th>
</tr>
{% for variable in configuration %}
<tr class="data">
<td>{{variable.variable_name}}</td>
<td>{{variable.variable_value}}</td>
<td>{% if variable.description %}{{variable.description}}{% endif %}</td>
{% endfor %}
{% endblock %}

View File

@@ -0,0 +1,34 @@
{% extends "basetable.html" %}
{% block pagename %}
<h1>Toaster - Layers</h1>
{% endblock %}
{% block pagetable %}
{% load projecttags %}
<tr>
<th>Name</th>
<th>Local Path</th>
<th>Layer Index URL</th>
<th>Known Versions</th>
</tr>
{% for layer in layers %}
<tr class="data">
<td>{{layer.name}}</td>
<td>{{layer.local_path}}</td>
<td><a href='{{layer.layer_index_url}}'>{{layer.layer_index_url}}</a></td>
<td><table>
{% for lv in layer.versions %}
<tr><td>
<a href="{% url layer_versions_recipes lv.id %}">({{lv.priority}}){{lv.branch}}:{{lv.commit}} ({{lv.count}} recipes)</a>
</td></tr>
{% endfor %}
</table></td>
</tr>
{% endfor %}
{% endblock %}

View File

@@ -0,0 +1,36 @@
{% extends "basebuildpage.html" %}
{% block pagetable %}
{% if not packages %}
<p>No packages were recorded for this target!</p>
{% else %}
<tr>
<th>Name</th>
<th>Version</th>
<th>Size (Bytes)</th>
<th>Recipe</th>
<th>Depends on</th>
</tr>
{% for package in packages %}
<tr class="data">
<td><a name="#{{package.name}}">{{package.name}}</a></td>
<td>{{package.version}}</td>
<td>{{package.size}}</td>
<td>{%if package.recipe %}<a name="{{package.recipe.name}}.{{package.package_name}}">
<a href="{% url layer_versions_recipes package.recipe.layer_version_id %}#{{package.recipe.name}}">{{package.recipe.name}}</a>{{package.package_name}}</a>{%endif%}</td>
<td>
<div style="height: 4em; overflow:auto">
{% for d in package.tpackage_dependencies_package.all %}
<a href="#{{d.name}}">{{d.depends_on.name}}</a><br/>
{% endfor %}
</div>
</td>
{% endfor %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,54 @@
{% extends "basetable.html" %}
{% block pagename %}
<ul class="nav nav-tabs" style="display: inline-block">
<li><a>Layer {{layer_version.layer.name}}&nbsp;:&nbsp;{{layer_version.branch}}&nbsp;:&nbsp;{{layer_version.commit}}&nbsp;:&nbsp;{{layer_version.priority}}</a></li>
</ul>
<h1>Toaster - Recipes for a Layer</h1>
{% endblock %}
{% block pagetable %}
{% load projecttags %}
<tr>
</tr>
<th>Name</th>
<th>Version</th>
<th>Summary</th>
<th>Description</th>
<th>Section</th>
<th>License</th>
<th>License file</th>
<th>Homepage</th>
<th>Bugtracker</th>
<th>Author</th>
<th>File_path</th>
<th style="width: 30em">Recipe Dependency</th>
{% for recipe in recipes %}
<tr class="data">
<td><a name="{{recipe.name}}">{{recipe.name}}</a></td>
<td>{{recipe.version}}</td>
<td>{{recipe.summary}}</td>
<td>{{recipe.description}}</td>
<td>{{recipe.section}}</td>
<td>{{recipe.license}}</td>
<td>{{recipe.licensing_info}}</td>
<td>{{recipe.homepage}}</td>
<td>{{recipe.bugtracker}}</td>
<td>{{recipe.author}}</td>
<td>{{recipe.file_path}}</td>
<td>
<div style="height: 5em; overflow:auto">
{% for rr in recipe.r_dependencies_recipe.all %}
<a href="#{{rr.depends_on.name}}">{{rr.depends_on.name}}</a><br/>
{% endfor %}
</div>
</td>
</tr>
{% endfor %}
{% endblock %}

View File

@@ -0,0 +1,63 @@
{% extends "basebuildpage.html" %}
{% block pagetitle %}Tasks{% endblock %}
{% block pagetable %}
{% if not tasks %}
<p>No tasks were executed in this build!</p>
{% else %}
<tr>
<th>Order</th>
<th>Task</th>
<th>Recipe Version</th>
<th>Task Type</th>
<th>Checksum</th>
<th>Outcome</th>
<th>Message</th>
<th>Logfile</th>
<th>Time</th>
<th>CPU usage</th>
<th>Disk I/O</th>
<th>Script type</th>
<th>File path</th>
<th>Depends</th>
</tr>
{% for task in tasks %}
<tr class="data">
<td>{{task.order}}</td>
<td><a name="{{task.recipe.name}}.{{task.task_name}}">
<a href="{% url layer_versions_recipes task.recipe.layer_version_id %}#{{task.recipe.name}}">{{task.recipe.name}}</a>.{{task.task_name}}</a></td>
<td>{{task.recipe.version}}</td>
{% if task.task_executed %}
<td>Executed</td>
{% else %}
<td>Prebuilt</td>
{% endif %}
<td>{{task.sstate_checksum}}</td>
<td>{{task.get_outcome_display}}{% if task.provider %}</br>(by <a href="#{{task.provider.recipe.name}}.{{task.provider.task_name}}">{{task.provider.recipe.name}}.{{task.provider.task_name}}</a>){% endif %}</td>
<td><p>{{task.message}}</td>
<td><a target="_fileview" href="file:///{{task.logfile}}">{{task.logfile}}</a></td>
<td>{{task.elapsed_time}}</td>
<td>{{task.cpu_usage}}</td>
<td>{{task.disk_io}}</td>
<td>{{task.get_script_type_display}}</td>
<td><a target="_fileview" href="file:///{{task.recipe.file_path}}">{{task.recipe.file_path}}</a></td>
<td>
<div style="height: 3em; overflow:auto">
{% for tt in task.task_dependencies_task.all %}
<a href="#{{tt.depends_on.recipe.name}}.{{tt.depends_on.task_name}}">
{{tt.depends_on.recipe.name}}.{{tt.depends_on.task_name}}</a><br/>
{% endfor %}
</div>
</td>
</tr>
{% endfor %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,26 @@
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from datetime import datetime
from django import template
register = template.Library()
@register.simple_tag
def time_difference(start_time, end_time):
return end_time - start_time

View File

@@ -0,0 +1,32 @@
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.conf.urls import patterns, include, url
from django.views.generic.simple import redirect_to
urlpatterns = patterns('bldviewer.views',
url(r'^builds/$', 'build', name='all-builds'),
url(r'^build/(?P<build_id>\d+)/task/$', 'task', name='task'),
url(r'^build/(?P<build_id>\d+)/packages/$', 'bpackage', name='bpackage'),
url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)/files/$', 'bfile', name='bfile'),
url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packages/$', 'tpackage', name='tpackage'),
url(r'^build/(?P<build_id>\d+)/configuration/$', 'configuration', name='configuration'),
url(r'^layers/$', 'layer', name='all-layers'),
url(r'^layerversions/(?P<layerversion_id>\d+)/recipes/.*$', 'layer_versions_recipes', name='layer_versions_recipes'),
url(r'^$', redirect_to, {'url': 'builds/'}),
)

View File

@@ -0,0 +1,260 @@
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import operator
from django.db.models import Q
from django.shortcuts import render
from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe, Target_Package, LogMessage, Variable
from orm.models import Task_Dependency, Recipe_Dependency, Build_Package, Build_File, Build_Package_Dependency
from django.views.decorators.cache import cache_control
@cache_control(no_store=True)
def build(request):
template = 'build.html'
build_info = Build.objects.all()
logs = LogMessage.objects.all()
context = {'builds': build_info, 'logs': logs ,
'hideshowcols' : [
{'name': 'Output', 'order':10},
{'name': 'Log', 'order':11},
]}
return render(request, template, context)
def _find_task_revdep(task):
tp = []
for p in Task_Dependency.objects.filter(depends_on=task):
tp.append(p.task);
return tp
def _find_task_provider(task):
task_revdeps = _find_task_revdep(task)
for tr in task_revdeps:
if tr.outcome != Task.OUTCOME_COVERED:
return tr
for tr in task_revdeps:
trc = _find_task_provider(tr)
if trc is not None:
return trc
return None
def task(request, build_id):
template = 'task.html'
tasks = Task.objects.filter(build=build_id)
for t in tasks:
if t.outcome == Task.OUTCOME_COVERED:
t.provider = _find_task_provider(t)
context = {'build': Build.objects.filter(pk=build_id)[0], 'tasks': tasks}
return render(request, template, context)
def configuration(request, build_id):
template = 'configuration.html'
variables = Variable.objects.filter(build=build_id)
context = {'build': Build.objects.filter(pk=build_id)[0], 'configuration' : variables}
return render(request, template, context)
def bpackage(request, build_id):
template = 'bpackage.html'
packages = Build_Package.objects.filter(build = build_id)
context = {'build': Build.objects.filter(pk=build_id)[0], 'packages' : packages}
return render(request, template, context)
def bfile(request, build_id, package_id):
template = 'bfile.html'
files = Build_File.objects.filter(bpackage = package_id)
context = {'build': Build.objects.filter(pk=build_id)[0], 'files' : files}
return render(request, template, context)
def tpackage(request, build_id, target_id):
template = 'package.html'
packages = Target_Package.objects.filter(target=target_id)
context = {'build' : Build.objects.filter(pk=build_id)[0],'packages': packages}
return render(request, template, context)
def layer(request):
template = 'layer.html'
layer_info = Layer.objects.all()
for li in layer_info:
li.versions = Layer_Version.objects.filter(layer = li)
for liv in li.versions:
liv.count = Recipe.objects.filter(layer_version__id = liv.id).count()
context = {'layers': layer_info}
return render(request, template, context)
def layer_versions_recipes(request, layerversion_id):
template = 'recipe.html'
recipes = Recipe.objects.filter(layer_version__id = layerversion_id)
context = {'recipes': recipes,
'layer_version' : Layer_Version.objects.filter( id = layerversion_id )[0]
}
return render(request, template, context)
#### API
import json
from django.core import serializers
from django.http import HttpResponse, HttpResponseBadRequest
def model_explorer(request, model_name):
DESCENDING = 'desc'
response_data = {}
model_mapping = {
'build': Build,
'target': Target,
'target_package': Target_Package,
'task': Task,
'task_dependency': Task_Dependency,
'package': Build_Package,
'layer': Layer,
'layerversion': Layer_Version,
'recipe': Recipe,
'recipe_dependency': Recipe_Dependency,
'build_package': Build_Package,
'build_package_dependency': Build_Package_Dependency,
'build_file': Build_File,
'variable': Variable,
'logmessage': LogMessage,
}
if model_name not in model_mapping.keys():
return HttpResponseBadRequest()
model = model_mapping[model_name]
try:
limit = int(request.GET.get('limit', 0))
except ValueError:
limit = 0
try:
offset = int(request.GET.get('offset', 0))
except ValueError:
offset = 0
ordering_string, invalid = _validate_input(request.GET.get('orderby', ''),
model)
if invalid:
return HttpResponseBadRequest()
filter_string, invalid = _validate_input(request.GET.get('filter', ''),
model)
if invalid:
return HttpResponseBadRequest()
search_term = request.GET.get('search', '')
if filter_string:
filter_terms = _get_filtering_terms(filter_string)
try:
queryset = model.objects.filter(**filter_terms)
except ValueError:
queryset = []
else:
queryset = model.objects.all()
if search_term:
queryset = _get_search_results(search_term, queryset, model)
if ordering_string and queryset:
column, order = ordering_string.split(':')
if order.lower() == DESCENDING:
queryset = queryset.order_by('-' + column)
else:
queryset = queryset.order_by(column)
if offset and limit:
queryset = queryset[offset:(offset+limit)]
elif offset:
queryset = queryset[offset:]
elif limit:
queryset = queryset[:limit]
if queryset:
response_data['count'] = queryset.count()
else:
response_data['count'] = 0
response_data['list'] = serializers.serialize('json', queryset)
return HttpResponse(json.dumps(response_data),
content_type='application/json')
def _get_filtering_terms(filter_string):
search_terms = filter_string.split(":")
keys = search_terms[0].split(',')
values = search_terms[1].split(',')
return dict(zip(keys, values))
def _validate_input(input, model):
invalid = 0
if input:
input_list = input.split(":")
# Check we have only one colon
if len(input_list) != 2:
invalid = 1
return None, invalid
# Check we have an equal number of terms both sides of the colon
if len(input_list[0].split(',')) != len(input_list[1].split(',')):
invalid = 1
return None, invalid
# Check we are looking for a valid field
valid_fields = model._meta.get_all_field_names()
for field in input_list[0].split(','):
if field not in valid_fields:
invalid = 1
return None, invalid
return input, invalid
def _get_search_results(search_term, queryset, model):
search_objects = []
for st in search_term.split(" "):
q_map = map(lambda x: Q(**{x+'__icontains': st}),
model.search_allowed_fields)
search_objects.append(reduce(operator.or_, q_map))
search_object = reduce(operator.and_, search_objects)
queryset = queryset.filter(search_object)
return queryset

10
bitbake/lib/toaster/manage.py Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toastermain.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

View File

View File

@@ -0,0 +1,260 @@
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Build(models.Model):
SUCCEEDED = 0
FAILED = 1
IN_PROGRESS = 2
BUILD_OUTCOME = (
(SUCCEEDED, 'Succeeded'),
(FAILED, 'Failed'),
(IN_PROGRESS, 'In Progress'),
)
search_allowed_fields = ['machine',
'cooker_log_path']
machine = models.CharField(max_length=100)
image_fstypes = models.CharField(max_length=100)
distro = models.CharField(max_length=100)
distro_version = models.CharField(max_length=100)
started_on = models.DateTimeField()
completed_on = models.DateTimeField()
outcome = models.IntegerField(choices=BUILD_OUTCOME, default=IN_PROGRESS)
errors_no = models.IntegerField(default=0)
warnings_no = models.IntegerField(default=0)
cooker_log_path = models.CharField(max_length=500)
build_name = models.CharField(max_length=100)
bitbake_version = models.CharField(max_length=50)
@python_2_unicode_compatible
class Target(models.Model):
search_allowed_fields = ['target', 'image_fstypes', 'file_name']
build = models.ForeignKey(Build)
target = models.CharField(max_length=100)
is_image = models.BooleanField(default = False)
file_name = models.CharField(max_length=100)
file_size = models.IntegerField()
def __str__(self):
return self.target
class Task(models.Model):
SSTATE_NA = 0
SSTATE_MISS = 1
SSTATE_FAILED = 2
SSTATE_RESTORED = 3
SSTATE_RESULT = (
(SSTATE_NA, 'Not Applicable'), # For rest of tasks, but they still need checking.
(SSTATE_MISS, 'Missing'), # it is a miss
(SSTATE_FAILED, 'Failed'), # there was a pkg, but the script failed
(SSTATE_RESTORED, 'Restored'), # succesfully restored
)
CODING_NOEXEC = 0
CODING_PYTHON = 1
CODING_SHELL = 2
TASK_CODING = (
(CODING_NOEXEC, 'NoExec'),
(CODING_PYTHON, 'Python'),
(CODING_SHELL, 'Shell'),
)
OUTCOME_SUCCESS = 0
OUTCOME_COVERED = 1
OUTCOME_SSTATE = 2
OUTCOME_EXISTING = 3
OUTCOME_FAILED = 4
OUTCOME_NA = 5
TASK_OUTCOME = (
(OUTCOME_SUCCESS, 'Succeeded'),
(OUTCOME_COVERED, 'Covered'),
(OUTCOME_SSTATE, 'Sstate'),
(OUTCOME_EXISTING, 'Existing'),
(OUTCOME_FAILED, 'Failed'),
(OUTCOME_NA, 'Not Available'),
)
build = models.ForeignKey(Build, related_name='task_build')
order = models.IntegerField(null=True)
task_executed = models.BooleanField(default=False) # True means Executed, False means Prebuilt
outcome = models.IntegerField(choices=TASK_OUTCOME, default=OUTCOME_NA)
sstate_checksum = models.CharField(max_length=100, blank=True)
path_to_sstate_obj = models.FilePathField(max_length=500, blank=True)
recipe = models.ForeignKey('Recipe', related_name='build_recipe')
task_name = models.CharField(max_length=100)
source_url = models.FilePathField(max_length=255, blank=True)
work_directory = models.FilePathField(max_length=255, blank=True)
script_type = models.IntegerField(choices=TASK_CODING, default=CODING_NOEXEC)
line_number = models.IntegerField(default=0)
disk_io = models.IntegerField(null=True)
cpu_usage = models.DecimalField(max_digits=6, decimal_places=2, null=True)
elapsed_time = models.CharField(max_length=50, default=0)
sstate_result = models.IntegerField(choices=SSTATE_RESULT, default=SSTATE_NA)
message = models.CharField(max_length=240)
logfile = models.FilePathField(max_length=255, blank=True)
class Meta:
ordering = ('order', 'recipe' ,)
class Task_Dependency(models.Model):
task = models.ForeignKey(Task, related_name='task_dependencies_task')
depends_on = models.ForeignKey(Task, related_name='task_dependencies_depends')
class Build_Package(models.Model):
build = models.ForeignKey('Build')
recipe = models.ForeignKey('Recipe', null=True)
name = models.CharField(max_length=100)
version = models.CharField(max_length=100, blank=True)
revision = models.CharField(max_length=32, blank=True)
summary = models.CharField(max_length=200, blank=True)
description = models.CharField(max_length=200, blank=True)
size = models.IntegerField(default=0)
section = models.CharField(max_length=80, blank=True)
license = models.CharField(max_length=80, blank=True)
class Build_Package_Dependency(models.Model):
TYPE_RDEPENDS = 0
TYPE_RPROVIDES = 1
TYPE_RRECOMMENDS = 2
TYPE_RSUGGESTS = 3
TYPE_RREPLACES = 4
TYPE_RCONFLICTS = 5
DEPENDS_TYPE = (
(TYPE_RDEPENDS, "rdepends"),
(TYPE_RPROVIDES, "rprovides"),
(TYPE_RRECOMMENDS, "rrecommends"),
(TYPE_RSUGGESTS, "rsuggests"),
(TYPE_RREPLACES, "rreplaces"),
(TYPE_RCONFLICTS, "rconflicts"),
)
package = models.ForeignKey(Build_Package, related_name='bpackage_dependencies_package')
depends_on = models.CharField(max_length=100) # soft dependency
dep_type = models.IntegerField(choices=DEPENDS_TYPE)
class Target_Package(models.Model):
target = models.ForeignKey('Target')
recipe = models.ForeignKey('Recipe', null=True)
name = models.CharField(max_length=100)
version = models.CharField(max_length=100, blank=True)
size = models.IntegerField()
class Target_Package_Dependency(models.Model):
TYPE_DEPENDS = 0
TYPE_RDEPENDS = 1
TYPE_RECOMMENDS = 2
DEPENDS_TYPE = (
(TYPE_DEPENDS, "depends"),
(TYPE_RDEPENDS, "rdepends"),
(TYPE_RECOMMENDS, "recommends"),
)
package = models.ForeignKey(Target_Package, related_name='tpackage_dependencies_package')
depends_on = models.ForeignKey(Target_Package, related_name='tpackage_dependencies_depends')
dep_type = models.IntegerField(choices=DEPENDS_TYPE)
class Build_File(models.Model):
bpackage = models.ForeignKey(Build_Package, related_name='filelist_bpackage')
path = models.FilePathField(max_length=255, blank=True)
size = models.IntegerField()
class Target_File(models.Model):
tpackage = models.ForeignKey(Target_Package, related_name='filelist_tpackage')
path = models.FilePathField(max_length=255, blank=True)
size = models.IntegerField()
class Recipe(models.Model):
name = models.CharField(max_length=100, blank=True)
version = models.CharField(max_length=100, blank=True)
layer_version = models.ForeignKey('Layer_Version', related_name='recipe_layer_version')
summary = models.CharField(max_length=100, blank=True)
description = models.CharField(max_length=100, blank=True)
section = models.CharField(max_length=100, blank=True)
license = models.CharField(max_length=200, blank=True)
licensing_info = models.TextField(blank=True)
homepage = models.URLField(blank=True)
bugtracker = models.URLField(blank=True)
author = models.CharField(max_length=100, blank=True)
file_path = models.FilePathField(max_length=255)
class Recipe_Dependency(models.Model):
TYPE_DEPENDS = 0
TYPE_RDEPENDS = 1
DEPENDS_TYPE = (
(TYPE_DEPENDS, "depends"),
(TYPE_RDEPENDS, "rdepends"),
)
recipe = models.ForeignKey(Recipe, related_name='r_dependencies_recipe')
depends_on = models.ForeignKey(Recipe, related_name='r_dependencies_depends')
dep_type = models.IntegerField(choices=DEPENDS_TYPE)
class Layer(models.Model):
name = models.CharField(max_length=100)
local_path = models.FilePathField(max_length=255)
layer_index_url = models.URLField()
class Layer_Version(models.Model):
layer = models.ForeignKey(Layer, related_name='layer_version_layer')
branch = models.CharField(max_length=50)
commit = models.CharField(max_length=100)
priority = models.IntegerField()
class Variable(models.Model):
build = models.ForeignKey(Build, related_name='variable_build')
variable_name = models.CharField(max_length=100)
variable_value = models.TextField(blank=True)
file = models.FilePathField(max_length=255)
changed = models.BooleanField(default=False)
human_readable_name = models.CharField(max_length=200)
description = models.TextField(blank=True)
class LogMessage(models.Model):
INFO = 0
WARNING = 1
ERROR = 2
LOG_LEVEL = ( (INFO, "info"),
(WARNING, "warn"),
(ERROR, "error") )
build = models.ForeignKey(Build)
level = models.IntegerField(choices=LOG_LEVEL, default=INFO)
message=models.CharField(max_length=240)
pathname = models.FilePathField(max_length=255, blank=True)
lineno = models.IntegerField(null=True)

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -0,0 +1,13 @@
<html>
<head>
<title>GUI Page</title>
</head>
<body>
{% load staticfiles %}
<img src="{% static "/static/images/yocto.jpg" %}" alt="Yocto"/>
This is your basic index page!
</body>
</html>

View File

@@ -0,0 +1,27 @@
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os
from django.conf import settings
from django.conf.urls import patterns, include, url
urlpatterns = patterns('toastergui.views',
url(r'^$', 'guihome', name='guihome'),
)

View File

@@ -0,0 +1,26 @@
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.shortcuts import render
from orm.models import Build, Task
def guihome(request):
template = 'index.html'
return render(request, template)

View File

@@ -0,0 +1,191 @@
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Django settings for Toaster project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'toaster.sqlite', # Or path to database file if using sqlite3.
'USER': '',
'PASSWORD': '',
'HOST': '127.0.0.1', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '3306', # Set to empty string for default.
}
}
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
# Always use local computer's time zone
import time
TIME_ZONE = time.tzname[0]
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'NOT_SUITABLE_FOR_HOSTED_DEPLOYMENT'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'toastermain.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'toastermain.wsgi.application'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
INSTALLED_APPS = (
#'django.contrib.auth',
#'django.contrib.contenttypes',
#'django.contrib.sessions',
#'django.contrib.sites',
#'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'orm',
'toastermain',
'bldviewer',
'toastergui',
)
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
# If we're using sqlite, we need to tweak the performance a bit
from django.db.backends.signals import connection_created
def activate_synchronous_off(sender, connection, **kwargs):
if connection.vendor == 'sqlite':
cursor = connection.cursor()
cursor.execute('PRAGMA synchronous = 0;')
connection_created.connect(activate_synchronous_off)
#

View File

@@ -0,0 +1,41 @@
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.conf.urls import patterns, include, url
from django.views.generic.simple import redirect_to
from django.views.decorators.cache import never_cache
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
url(r'^simple/', include('bldviewer.urls')),
url(r'^api/1.0/', include('bldviewer.api')),
url(r'^gui/', include('toastergui.urls')),
url(r'^$', never_cache(redirect_to), {'url': '/simple/'}),
# Examples:
# url(r'^toaster/', include('toaster.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)

View File

@@ -0,0 +1,32 @@
"""
WSGI config for Toaster project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
"""
import os
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "Toaster.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toastermain.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)

View File

@@ -8,32 +8,23 @@
<para>
Recall that earlier the manual discussed how to use an existing toolchain
tarball that had been installed into the default installation
directory, <filename>/opt/poky/&DISTRO;</filename>, which is outside of the
directory, <filename>/opt/poky</filename>, which is outside of the
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
(see the section "<link linkend='using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball)</link>".
And, that sourcing your architecture-specific environment setup script
initializes a suitable cross-toolchain development environment.
</para>
<para>
During this setup, locations for the compiler, QEMU scripts, QEMU binary,
During the setup, locations for the compiler, QEMU scripts, QEMU binary,
a special version of <filename>pkgconfig</filename> and other useful
utilities are added to the <filename>PATH</filename> variable.
Also, variables to assist
<filename>pkgconfig</filename> and <filename>autotools</filename>
are also defined so that, for example, <filename>configure.sh</filename>
can find pre-generated test results for tests that need target hardware
on which to run.
Variables to assist <filename>pkgconfig</filename> and <filename>autotools</filename>
are also defined so that,
for example, <filename>configure.sh</filename> can find pre-generated
test results for tests that need target hardware on which to run.
These conditions allow you to easily use the toolchain outside of the
OpenEmbedded build environment on both autotools-based projects and
Makefile-based projects.
</para>
<para>
Collectively, these conditions allow you to easily use the toolchain
outside of the OpenEmbedded build environment on both autotools-based
projects and Makefile-based projects.
This chapter provides information for both these types of projects.
</para>
<section id='autotools-based-projects'>
<title>Autotools-Based Projects</title>
@@ -188,7 +179,7 @@
If <filename>configure</filename> script results in problems recognizing the
<filename>--with-libtool-sysroot=&lt;sysroot-dir&gt;</filename> option,
regenerate the script to enable the support by doing the following and then
run the script again:
re-running the script:
<literallayout class='monospaced'>
$ libtoolize --automake
$ aclocal -I ${OECORE_NATIVE_SYSROOT}/usr/share/aclocal \

View File

@@ -22,8 +22,8 @@
and an introduction to the <trademark class='trade'>Eclipse</trademark> IDE
Yocto Plug-in.
<note>
The ADT is distribution-neutral and does not require the Yocto
Project reference distribution, which is called Poky.
The ADT is distribution-neutral and does not require the Yocto
Project reference distribution, which is called Poky.
This manual, however, uses examples that use the Poky distribution.
</note>
</para>
@@ -43,7 +43,7 @@
<itemizedlist>
<listitem><para>An architecture-specific cross-toolchain and matching
sysroot both built by the OpenEmbedded build system.
The toolchain and sysroot are based on a
The toolchain and sysroot are based on a
<ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
configuration and extensions,
which allows you to cross-develop on the host machine for the target hardware.
@@ -149,7 +149,8 @@
that causes skips in audio,
stutters in your desktop experience, or situations that overload your server
even when you have plenty of CPU power left.
</para></listitem>
You can find out more about LatencyTOP at
<ulink url='https://latencytop.org/'></ulink>.</para></listitem>
<listitem><para><emphasis>PowerTOP:</emphasis> Helps you determine what
software is using the most power.
You can find out more about PowerTOP at

View File

@@ -66,11 +66,6 @@
<date>October 2013</date>
<revremark>Released with the Yocto Project 1.5 Release.</revremark>
</revision>
<revision>
<revnumber>1.5.1</revnumber>
<date>Sometime in 2013</date>
<revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
</revision>
</revhistory>
<copyright>
@@ -84,10 +79,11 @@
the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
</para>
<note>
For the latest version of this manual associated with this
Yocto Project release, see the
<ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Developer's Guide</ulink>
from the Yocto Project website.
Due to production processes, there could be differences between the Yocto Project
documentation bundled in the release tarball and the
<ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Developer's Guide</ulink> on
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
For the latest version of this manual, see the manual on the website.
</note>
</legalnotice>

View File

@@ -80,48 +80,39 @@
<para>
The ADT Installer is contained in the ADT Installer tarball.
You can get the tarball using either of these methods:
<itemizedlist>
<listitem><para><emphasis>Download the Tarball:</emphasis>
You can download the tarball from
<ulink url='&YOCTO_ADTINSTALLER_DL_URL;'></ulink> into
any directory.</para></listitem>
<listitem><para><emphasis>Build the Tarball:</emphasis>
You can use BitBake to generate the tarball inside an
existing
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
</para>
<para>If you use BitBake to generate the ADT Installer
tarball, you must <filename>source</filename> the
environment setup script
(<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
or
<ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>)
located in the Source Directory before running the
BitBake command that creates the tarball.</para>
<para>The following example commands establish
the
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
check out the current release branch, set up the
build environment while also creating the default
Build Directory, and run the BitBake command that
results in the tarball
<filename>poky/build/tmp/deploy/sdk/adt_installer.tar.bz2</filename>:
<note>
Before using BitBake to build the ADT tarball, be
sure to make sure your
<filename>local.conf</filename> file is properly
configured.
</note>
<literallayout class='monospaced'>
You can download the tarball into any directory from the
<ulink url='&YOCTO_DL_URL;/releases'>Index of Releases</ulink>, specifically
at
<ulink url='&YOCTO_ADTINSTALLER_DL_URL;'></ulink>.
Or, you can use BitBake to generate the tarball inside the existing
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
</para>
<para>
If you use BitBake to generate the ADT Installer tarball, you must
<filename>source</filename> the environment setup script
(<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
or
<ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>)
located in the Source Directory before running the
BitBake command that creates the tarball.
</para>
<para>
The following example commands download the Poky tarball, set up the
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
set up the environment while also creating the default Build Directory,
and run the BitBake command that results in the tarball
<filename>~/yocto-project/build/tmp/deploy/sdk/adt_installer.tar.bz2</filename>:
<literallayout class='monospaced'>
$ cd ~
$ git clone git://git.yoctoproject.org/poky
$ cd poky
$ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME;
$ source &OE_INIT_FILE;
$ mkdir yocto-project
$ cd yocto-project
$ wget &YOCTO_RELEASE_DL_URL;/&YOCTO_POKY_TARBALL;
$ tar xjf &YOCTO_POKY_TARBALL;
$ source &OE_INIT_PATH;
$ bitbake adt-installer
</literallayout></para></listitem>
</itemizedlist>
</literallayout>
</para>
</section>
@@ -136,7 +127,7 @@
a top-level directory named <filename>adt-installer</filename>:
<literallayout class='monospaced'>
$ cd ~
$ cp poky/build/tmp/deploy/sdk/adt_installer.tar.bz2 $HOME
$ cp ~/poky/build/tmp/deploy/sdk/adt_installer.tar.bz2 $HOME
$ tar -xjf adt_installer.tar.bz2
</literallayout>
Unpacking it creates the directory <filename>adt-installer</filename>,
@@ -206,7 +197,7 @@
When you run the installer, the environment must use a
host <filename>gcc</filename>:
<literallayout class='monospaced'>
$ cd adt-installer
$ cd ~/adt-installer
$ ./adt_installer
</literallayout>
Once the installer begins to run, you are asked to enter the
@@ -277,7 +268,7 @@
target, go into the <filename>x86_64</filename>
folder and download the following installer:
<literallayout class='monospaced'>
poky-eglibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
poky-eglibc-x86_64-core-image-sato-i586-&DISTRO;.sh
</literallayout></para></listitem>
<listitem><para>Build your own toolchain installer.
For cases where you cannot use an installer
@@ -288,32 +279,27 @@
</itemizedlist></para></listitem>
<listitem><para>Once you have the installer, run it to install
the toolchain.
<note>
You must change the permissions on the toolchain
installer script so that it is executable.
</note></para>
You must change the permissions on the toolchain installer
script so that it is executable.</para>
<para>The following command shows how to run the installer
given a toolchain tarball for a 64-bit x86 development host
system and a 32-bit x86 target architecture.
The example assumes the toolchain installer is located
in <filename>~/Downloads/</filename>.
<literallayout class='monospaced'>
$ ~/Downloads/poky-eglibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
$ ~/Downloads/poky-eglibc-x86_64-core-image-sato-i586-&DISTRO;.sh
</literallayout>
The first thing the installer prompts you for is the
directory into which you want to install the toolchain.
The default directory used is
<filename>/opt/poky/&DISTRO;</filename>.
If you do not have write permissions for the directory
into which you are installing the toolchain, the
toolchain installer notifies you and exits.
Be sure you have write permissions in the directory and
run the installer again.</para>
<para>When the script finishes, the cross-toolchain is
<note>
If you do not have write permissions for the directory
into which you are installing the toolchain, the
toolchain installer notifies you and exits.
Be sure you have write permissions in the directory and
run the installer again.
</note>
Once the tarball is expanded, the cross-toolchain is
installed.
You will notice environment setup files for the
cross-toolchain in the installation directory.
</para></listitem>
cross-toolchain in the directory.</para></listitem>
</orderedlist>
</para>
</section>
@@ -334,43 +320,37 @@
<para>
Follow these steps to generate the toolchain into the Build Directory:
<orderedlist>
<listitem><para><emphasis>Set up the Build Environment:</emphasis>
Source the OpenEmbedded build environment setup
script (i.e.
<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
or
<ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>)
located in the
<listitem><para>Source the environment setup script
<filename>&OE_INIT_FILE;</filename> located in the
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
</para></listitem>
<listitem><para><emphasis>Check your Local Configuration File:</emphasis>
At this point, you should be sure that the
<listitem><para>At this point, you should be sure that the
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> variable
in the <filename>local.conf</filename> file found in the
<filename>conf</filename> directory of the Build Directory
is set for the target architecture.
Comments within the <filename>local.conf</filename> file
list the values you can use for the
<filename>MACHINE</filename> variable.
<note>
You can populate the Build Directory with the
cross-toolchains for more than a single architecture.
You just need to edit the <filename>MACHINE</filename>
variable in the <filename>local.conf</filename> file and
re-run the BitBake command.
</note></para></listitem>
<listitem><para><emphasis>Generate the Cross-Toolchain:</emphasis>
Run <filename>bitbake meta-ide-support</filename> to
complete the cross-toolchain generation.
Once the BitBake command finishes, the cross-toolchain is
generated and populated within the Build Directory.
You will notice environment setup files for the
cross-toolchain that contain the string
"<filename>environment-setup</filename>" in the
Build Directory's <filename>tmp</filename> folder.</para>
<para>Be aware that when you use this method to install the
toolchain, you still need to separately extract and install
the sysroot filesystem.
Comments within the <filename>local.conf</filename> file list the values you
can use for the <filename>MACHINE</filename> variable.
<note>You can populate the Build Directory with the cross-toolchains for more
than a single architecture.
You just need to edit the <filename>MACHINE</filename> variable in the
<filename>local.conf</filename> file and re-run the BitBake
command.</note></para></listitem>
<listitem><para>Run <filename>bitbake meta-ide-support</filename> to complete the
cross-toolchain generation.
<note>If you change out of your working directory after you
<filename>source</filename> the environment setup script and before you run
the BitBake command, the command might not work.
Be sure to run the BitBake command immediately
after checking or editing the <filename>local.conf</filename> but without
changing out of your working directory.</note>
Once the BitBake command finishes,
the cross-toolchain is generated and populated within the Build Directory.
You will notice environment setup files for the cross-toolchain in the
Build Directory in the <filename>tmp</filename> directory.
Setup script filenames contain the strings <filename>environment-setup</filename>.</para>
<para>Be aware that when you use this method to install the toolchain you still need
to separately extract and install the sysroot filesystem.
For information on how to do this, see the
"<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" section.
</para></listitem>
@@ -457,8 +437,8 @@
application from within the
Eclipse IDE, you must have an image that contains the Yocto Target Communication
Framework (TCF) agent (<filename>tcf-agent</filename>).
By default, the Yocto Project provides only one type of pre-built
image that contains the <filename>tcf-agent</filename>.
By default, the Yocto Project provides only one type pre-built image that contains the
<filename>tcf-agent</filename>.
And, those images are SDK (e.g.<filename>core-image-sato-sdk</filename>).
</para>
@@ -487,16 +467,13 @@
the following commands:
<literallayout class='monospaced'>
$ git clone http://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git
$ cd org.eclipse.tcf.agent/agent
$ cd agent
</literallayout></para></listitem>
<listitem><para>Locate the
<filename>Makefile.inc</filename> file inside the
<filename>agent</filename> folder and modify it
<listitem><para>Modify the <filename>Makefile.inc</filename> file
for the cross-compilation environment by setting the
<filename>OPSYS</filename> and
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
variables according to your target.
</para></listitem>
variables according to your target.</para></listitem>
<listitem><para>Use the cross-development tools to build the
<filename>tcf-agent</filename>.
Before you "Make" the file, be sure your cross-tools are set up first.
@@ -516,63 +493,32 @@
<title>Extracting the Root Filesystem</title>
<para>
If you install your toolchain by hand or build it using BitBake and
you need a root filesystem, you need to extract it separately.
If you use the ADT Installer to install the ADT, the root
filesystem is automatically extracted and installed.
</para>
<para>
Here are some cases where you need to extract the root filesystem:
<itemizedlist>
<listitem><para>You want to boot the image using NFS.
</para></listitem>
<listitem><para>You want to use the root filesystem as the
target sysroot.
For example, the Eclipse IDE environment with the Eclipse
Yocto Plug-in installed allows you to use QEMU to boot
under NFS.</para></listitem>
<listitem><para>You want to develop your target application
using the root filesystem as the target sysroot.
</para></listitem>
</itemizedlist>
You must extract the root filesystem if you want to boot the image using NFS
or you want to use the root filesystem as the target sysroot.
For example, the Eclipse IDE environment with the Eclipse Yocto Plug-in installed allows you
to use QEMU to boot under NFS.
Another example is if you want to develop your target application using the
root filesystem as the target sysroot.
</para>
<para>
To extract the root filesystem, first <filename>source</filename>
the cross-development environment setup script.
If you built the toolchain in the Build Directory, you will find
the toolchain environment script in the
<filename>tmp</filename> directory.
If you installed the toolchain by hand, the environment setup
script is located in <filename>/opt/poky/&DISTRO;</filename>.
</para>
<para>
After sourcing the environment script, use the
<filename>runqemu-extract-sdk</filename> command and provide the
the cross-development environment setup script and then
use the <filename>runqemu-extract-sdk</filename> command on the
filesystem image.
</para>
<para>
Following is an example.
The second command sets up the environment.
In this case, the setup script is located in the
<filename>/opt/poky/&DISTRO;</filename> directory.
The third command extracts the root filesystem from a previously
built filesystem that is located in the
<filename>~/Downloads</filename> directory.
Furthermore, this command extracts the root filesystem into the
<filename>qemux86-sato</filename> directory:
For example, the following commands set up the environment and then extract
the root filesystem from a previously built filesystem image tarball named
<filename>core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2</filename>.
The example extracts the root filesystem into the <filename>$HOME/qemux86-sato</filename>
directory:
<literallayout class='monospaced'>
$ cd ~
$ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
$ source $HOME/toolchain_dir/environment-setup-i586-poky-linux
$ runqemu-extract-sdk \
~/Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2 \
~Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2 \
$HOME/qemux86-sato
</literallayout>
You could now point to the target sysroot at
<filename>qemux86-sato</filename>.
In this case, you could now point to the target sysroot at
<filename>$HOME/qemux86-sato</filename>.
</para>
</section>
</section>
@@ -582,26 +528,30 @@
<para>
As an alternative to locating and downloading a toolchain installer,
you can build the toolchain installer one of two ways if you have a
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>:
<itemizedlist>
<listitem><para>Use <filename>bitbake meta-toolchain</filename>.
This method requires you to still install the target
sysroot by installing and extracting it separately.
For information on how to install the sysroot, see the
"<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>"
section.</para></listitem>
<listitem><para>Use
<filename>bitbake image -c populate_sdk</filename>.
This method has significant advantages over the previous method
because it results in a toolchain installer that contains the
sysroot that matches your target root filesystem.
</para></listitem>
</itemizedlist>
you can build the toolchain installer if you have a
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
</para>
<para>
Remember, before using any BitBake command, you
You can build the toolchain
installer using <filename>bitbake meta-toolchain</filename>.
This method requires you to still install the target
sysroot by installing and extracting it separately.
For information on how to install the sysroot, see the
"<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" section.
</para>
<para>
A final method of building the toolchain installer exists that has
significant advantages over the previous method.
This method results in a toolchain installer that contains the sysroot
that matches your target root filesystem.
To build this installer, use the
<filename>bitbake image -c populate_sdk</filename> command.
</para>
<para>
Remember, before using any <filename>bitbake</filename> command, you
must source the build environment setup script
(i.e.
<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
@@ -617,27 +567,12 @@
variable is correctly set if you are building a toolchain designed to
run on an architecture that differs from your current development host
machine (i.e. the build machine).
</para>
</para>
<para>
When the BitBake command completes, the toolchain installer will be in
<filename>tmp/deploy/sdk</filename> in the Build Directory.
<note>
By default, this toolchain does not build static binaries.
If you want to use the toolchain to build these types of libraries,
you need to be sure your image has the appropriate static
development libraries.
Use the
<ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>
variable inside your <filename>local.conf</filename> file to
install the appropriate library packages.
Following is an example using <filename>eglibc</filename> static
development libraries:
<literallayout class='monospaced'>
IMAGE_INSTALL_append = " eglibc-staticdev"
</literallayout>
</note>
</para>
<para>
When the BitBake command completes, the toolchain installer will be in
<filename>tmp/deploy/sdk</filename> in the Build Directory.
</para>
</section>
</chapter>

View File

@@ -78,11 +78,6 @@
<date>October 2013</date>
<revremark>Released with the Yocto Project 1.5 Release.</revremark>
</revision>
<revision>
<revnumber>1.5.1</revnumber>
<date>Sometime in 2013</date>
<revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
</revision>
</revhistory>
<copyright>
@@ -96,10 +91,11 @@
the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">Creative Commons Attribution-Non-Commercial-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
</para>
<note>
For the latest version of this manual associated with this
Yocto Project release, see the
<ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>
from the Yocto Project website.
Due to production processes, there could be differences between the Yocto Project
documentation bundled in the release tarball and the
<ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink> on
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
For the latest version of this manual, see the manual on the website.
</note>
</legalnotice>

View File

@@ -394,13 +394,12 @@
<para>
To use an include file, you simply include them in the machine configuration file.
For example, the Crown Bay BSP <filename>crownbay.conf</filename> contains the
For example, the Crown Bay BSP <filename>crownbay.conf</filename> has the
following statements:
<literallayout class='monospaced'>
require conf/machine/include/tune-atom.inc
require conf/machine/include/ia32-base.inc
require conf/machine/include/meta-intel.inc
require conf/machine/include/meta-intel-emgd.inc
</literallayout>
</para>
</section>
@@ -421,7 +420,7 @@
<filename>formfactor_0.0.bbappend</filename> file, which is an
append file used to augment the recipe that starts the build.
Furthermore, there are machine-specific settings used during the
build that are defined by the <filename>machconfig</filename> file.
build that are defined by the <filename>machconfig</filename>.
In the Crown Bay example, two <filename>machconfig</filename> files
exist: one that supports the Intel® Embedded Media and Graphics
Driver (Intel® EMGD) and one that does not:
@@ -461,7 +460,7 @@
(VESA) graphics):
<literallayout class='monospaced'>
meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/xorg.conf
meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay-noemgd/xorg.conf
</literallayout>
</para>
</section>
@@ -562,7 +561,7 @@
<para>
For example, suppose you had some configuration options in a file called
<filename>network_configs.cfg</filename>.
You can place that file inside a directory named <filename>linux-yocto</filename> and then add
You can place that file inside a directory named <filename>/linux-yocto</filename> and then add
a <filename>SRC_URI</filename> statement such as the following to the append file.
When the OpenEmbedded build system builds the kernel, the configuration options are
picked up and applied.
@@ -748,7 +747,7 @@
<listitem><para>Instructions on how to boot the BSP build from
the BSP layer.</para></listitem>
<listitem><para>Instructions on how to boot the binary images
contained in the <filename>binary</filename> directory,
contained in the <filename>/binary</filename> directory,
if present.</para></listitem>
<listitem><para>Information on any known bugs or issues that users
should know about when either building or booting the BSP
@@ -759,7 +758,7 @@
<filename>meta-&lt;bsp_name&gt;</filename> directory.
This file specifies exactly where you can find the sources used to
generate the binary images contained in the
<filename>binary</filename> directory, if present.
<filename>/binary</filename> directory, if present.
See the
<ulink url='&YOCTO_GIT_URL;/cgit.cgi/meta-intel/tree/meta-fri2/README.sources'><filename>README.sources</filename></ulink>
file for the Fish River Island 2 BSP in the <filename>meta-fri2</filename> BSP layer

File diff suppressed because it is too large Load Diff

View File

@@ -155,11 +155,10 @@
For more information on BSP layers, see the
"<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>" section in the
Yocto Project Board Support Package (BSP) Developer's Guide.</para>
<note>Five BSPs exist that are part of the
Yocto Project release: <filename>genericx86</filename>, <filename>genericx86-64</filename>,
<filename>beagleboard</filename>,
<note>Four BSPs exist that are part of the
Yocto Project release: <filename>genericx86</filename>, <filename>beagleboard</filename>,
<filename>mpc8315e</filename>, and <filename>routerstationpro</filename>.
The recipes and configurations for these five BSPs are located and dispersed
The recipes and configurations for these four BSPs are located and dispersed
within the <link linkend='source-directory'>Source Directory</link>.
On the other hand, BSP layers for Chief River, Crown Bay,
Crystal Forest, Emenlow, Fish River Island 2, Jasper Forest, N450, NUC DC3217IYE,
@@ -219,10 +218,10 @@
<para>
You can view a video presentation on "Building Custom Embedded Images with Yocto"
at <ulink url='http://free-electrons.com/blog/elc-2011-videos'>Free Electrons</ulink>.
You can also find supplemental information in the
You can also find supplemental information in
<ulink url='&YOCTO_DOCS_BSP_URL;'>
Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
Finally, there is a wiki page write up of the example also located
The Board Support Package (BSP) Development Guide</ulink>.
Finally, there is wiki page write up of the example also located
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>
here</ulink> that you might find helpful.
</para>
@@ -1425,6 +1424,9 @@
"<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-perf'>perf</ulink>"
section in the Yocto Project Profiling and Tracing
Manual.
For information on LatencyTOP, see the
<ulink url='https://latencytop.org/'>LatencyTOP</ulink>
website.
</para></listitem>
</itemizedlist>
</para>
@@ -1468,14 +1470,7 @@
the "Clone from Yocto Git Repository" box, which
would execute a <filename>git clone</filename>
command to get the project's Metadata files.
<note>
Do not specify your BitBake Commander project
location as your Eclipse workspace.
Doing so causes an error indicating that the
current project overlaps the location of
another project.
This error occurs even if no such project exits.
</note></para></listitem>
</para></listitem>
<listitem><para>Select <filename>Finish</filename> to
create the project.</para></listitem>
</orderedlist>
@@ -1644,7 +1639,7 @@
<filename>meta/conf/bitbake.conf</filename> configuration file in the
<link linkend='source-directory'>Source Directory</link>:
<literallayout class='monospaced'>
S = "${WORKDIR}/${BP}"
S = ${WORKDIR}/${BP}
</literallayout>
You should be aware that many recipes override the <filename>S</filename> variable.
For example, recipes that fetch their source from Git usually set
@@ -1654,7 +1649,7 @@
<ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink>
represents the base recipe name, which consists of the name and version:
<literallayout class='monospaced'>
BP = "${BPN}-${PV}"
BP = ${BPN}-${PV}
</literallayout>
</note>
</para>
@@ -1675,7 +1670,7 @@
the following is the work directory for the <filename>acl</filename> recipe that
creates the <filename>acl</filename> package:
<literallayout class='monospaced'>
poky/build/tmp/work/i586-poky-linux/acl/2.2.51-r3/
~/poky/build/tmp/work/i586-poky-linux/acl/2.2.51-r3/
</literallayout>
</para>
@@ -1691,8 +1686,8 @@
for the <filename>acl</filename> package that is being
built for a MIPS-based device:
<literallayout class='monospaced'>
poky/build/tmp/work/mips-poky-linux/acl/2.2.51-r2
poky/build/tmp/work/mips-poky-linux/acl/2.2.51-r2/acl-2.2.51
~/poky/build/tmp/work/mips-poky-linux/acl/2.2.51-r2
~/poky/build/tmp/work/mips-poky-linux/acl/2.2.51-r2/acl-2.2.51
</literallayout>
</para>
@@ -1703,7 +1698,6 @@
<ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-TOPDIR'><filename>TOPDIR</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-TARGET_OS'><filename>TARGET_OS</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>,
<ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>,

View File

@@ -429,17 +429,15 @@
<para>
For any supported release of Yocto Project, you can go to the
<ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> and
select the "Downloads" tab and get a released tarball of the
<filename>poky</filename> repository or any supported BSP tarballs.
Unpacking these tarballs gives you a snapshot of the released
files.
<note>
The recommended method for setting up the Yocto Project
<link linkend='source-directory'>Source Directory</link> and the
files for supported BSPs (e.g., <filename>meta-intel</filename>) is to
use <link linkend='git'>Git</link> to create a local copy of the
upstream repositories.
</note>
select the "Downloads" tab and get a tarball of the release.
You can also go to this site to download any supported BSP tarballs.
Unpacking the tarball gives you a hierarchical Source Directory that lets you develop
using the Yocto Project.
</para>
<para>
Once you are set up through either tarball extraction or a checkout of Git repositories,
you are ready to develop.
</para>
<para>
@@ -516,40 +514,27 @@
The <ulink url='&YOCTO_DOCS_REF_URL;#var-TOPDIR'><filename>TOPDIR</filename></ulink>
variable points to the Build Directory.</para>
<para>
You have a lot of flexibility when creating the Build
Directory.
Following are some examples that show how to create the
directory.
The examples assume your
<link linkend='source-directory'>Source Directory</link> is
named <filename>poky</filename>:
<para>You have a lot of flexibility when creating the Build Directory.
Following are some examples that show how to create the directory:
<itemizedlist>
<listitem><para>Create the Build Directory inside your
Source Directory and let the name of the Build
Directory default to <filename>build</filename>:
<listitem><para>Create the Build Directory in your current working directory
and name it <filename>build</filename>.
This is the default behavior.
<literallayout class='monospaced'>
$ cd $HOME/poky
$ source &OE_INIT_FILE;
$ source &OE_INIT_PATH;
</literallayout></para></listitem>
<listitem><para>Create the Build Directory inside your
home directory and specifically name it
<filename>test-builds</filename>:
<listitem><para>Provide a directory path and specifically name the build
directory.
This next example creates a Build Directory named <filename>YP-&POKYVERSION;</filename>
in your home directory within the directory <filename>mybuilds</filename>.
If <filename>mybuilds</filename> does not exist, the directory is created for you:
<literallayout class='monospaced'>
$ cd $HOME
$ source poky/&OE_INIT_FILE; test-builds
$ source &OE_INIT_PATH; $HOME/mybuilds/YP-&POKYVERSION;
</literallayout></para></listitem>
<listitem><para>Provide a directory path and
specifically name the build directory.
Any intermediate folders in the pathname must
exist.
This next example creates a Build Directory named
<filename>YP-&POKYVERSION;</filename>
in your home directory within the existing
directory <filename>mybuilds</filename>:
<listitem><para>Provide an existing directory to use as the Build Directory
and use the default <filename>build</filename> name.
<literallayout class='monospaced'>
$cd $HOME
$ source $HOME/poky/&OE_INIT_FILE; $HOME/mybuilds/YP-&POKYVERSION;
$ source &OE_INIT_PATH; $HOME/mybuilds/
</literallayout></para></listitem>
</itemizedlist>
</para></listitem>
@@ -662,17 +647,6 @@
<ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>, and
<ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>).
</para></listitem>
<listitem><para><emphasis>Package Groups:</emphasis>
Arbitrary groups of software Recipes.
You use package groups to hold recipes that, when built,
usually accomplish a single task.
For example, a package group could contain the recipes for a
companys proprietary or value-add software.
Or, the package group could contain the recipes that enable
graphics.
A package group is really just another recipe.
Because package group files are recipes, they end with the
<filename>.bb</filename> filename extension.</para></listitem>
<listitem><para id='poky'><emphasis>Poky:</emphasis> The term "poky" can mean several things.
In its most general sense, it is an open-source project that was initially developed
by OpenedHand. With OpenedHand, poky was developed off of the existing OpenEmbedded
@@ -742,12 +716,13 @@
see the
"<link linkend='repositories-tags-and-branches'>Repositories, Tags, and Branches</link>"
section.</para></listitem>
<listitem><para><emphasis>Task:</emphasis>
A unit of execution for BitBake (e.g.
<filename>do_compile</filename>,
<filename>do_fetch</filename>, <filename>do_patch</filename>,
and so forth).
</para></listitem>
<listitem><para><emphasis>Tasks:</emphasis> Arbitrary groups of software Recipes.
You use tasks to hold recipes that, when built, usually accomplish a single task.
For example, a task could contain the recipes for a companys proprietary or value-add software.
Or, the task could contain the recipes that enable graphics.
A task is really just another recipe.
Because task files are recipes, they end with the <filename>.bb</filename> filename
extension.</para></listitem>
<listitem><para><emphasis>Upstream:</emphasis> A reference to source code or repositories
that are not local to the development system but located in a master area that is controlled
by the maintainer of the source code.
@@ -832,8 +807,7 @@
<title>Git</title>
<para>
The Yocto Project makes extensive use of Git,
which is a free, open source distributed version control system.
The Yocto Project uses Git, which is a free, open source distributed version control system.
Git supports distributed development, non-linear development, and can handle large projects.
It is best that you have some fundamental understanding of how Git tracks projects and
how to work with Git if you are going to use the Yocto Project for development.
@@ -937,7 +911,7 @@
local working branch based on a branch name,
your local environment matches the "tip" of that development branch
at the time you created your local branch, which could be
different from the files at the time of a similarly named release.
different than the files at the time of a similarly named release.
In other words, creating and checking out a local branch based on the
<filename>&DISTRO_NAME;</filename> branch name is not the same as
cloning and checking out the <filename>master</filename> branch.
@@ -1030,7 +1004,7 @@
will allow the change, and for ultimately pushing the change from your local Git repository
into the projects upstream (or master) repository.</para></listitem>
<listitem><para><emphasis><filename>git status</filename>:</emphasis> Reports any modified files that
possibly need to be staged and committed.</para></listitem>
possibly need staged and committed.</para></listitem>
<listitem><para><emphasis><filename>git checkout &lt;branch-name&gt;</filename>:</emphasis> Changes
your working branch.
This command is analogous to "cd".</para></listitem>
@@ -1307,9 +1281,10 @@
<listitem><para><emphasis>Board Support Package (BSP) README Files:</emphasis>
For BSP maintainers of supported BSPs, you can examine
individual BSP <filename>README</filename> files.
In addition, some layers (such as the <filename>meta-intel</filename> layer),
include a <filename>MAINTAINERS</filename> file which contains
a list of all supported BSP maintainers for that layer.
Alternatively, you can examine the
<filename>MAINTAINERS</filename> file, which is found in the
<filename>meta-intel</filename>, for a list of all supported
BSP maintainers.
</para></listitem>
<listitem><para><emphasis>Search by File:</emphasis>
Using <link linkend='git'>Git</link>, you can enter the
@@ -1484,8 +1459,8 @@
<para>For help on using these scripts, simply provide the
<filename>-h</filename> argument as follows:
<literallayout class='monospaced'>
$ poky/scripts/create-pull-request -h
$ poky/scripts/send-pull-request -h
$ ~/poky/scripts/create-pull-request -h
$ ~/poky/scripts/send-pull-request -h
</literallayout></para></listitem>
</itemizedlist>
</para>

View File

@@ -55,12 +55,12 @@
<title>Getting Set Up</title>
<para>
Here is what you need to use the Yocto Project:
Here is what you need to get set up to use the Yocto Project:
<itemizedlist>
<listitem><para><emphasis>Host System:</emphasis>
You should have a reasonably current Linux-based host system.
<listitem><para><emphasis>Host System:</emphasis> You should have a reasonably current
Linux-based host system.
You will have the best results with a recent release of Fedora,
openSUSE, Debian, Ubuntu, or CentOS as these releases are frequently tested against the Yocto Project
OpenSUSE, Debian, Ubuntu, or CentOS as these releases are frequently tested against the Yocto Project
and officially supported.
For a list of the distributions under validation and their status, see the
"<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
@@ -69,35 +69,23 @@
<para>
You should also have about 100 gigabytes of free disk space for building images.
</para></listitem>
<listitem><para><emphasis>Packages:</emphasis>
The OpenEmbedded build system requires that certain packages
exist on your development system (e.g. Python 2.6 or 2.7).
<listitem><para><emphasis>Packages:</emphasis> The OpenEmbedded build system
requires certain packages exist on your development system (e.g. Python 2.6 or 2.7).
See "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>"
section in the Yocto Project Quick Start and the
"<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
section in the Yocto Project Reference Manual for the exact
package requirements and the installation commands to install
them for the supported distributions.</para></listitem>
them for the supported distributions.
</para></listitem>
<listitem id='local-yp-release'><para><emphasis>Yocto Project Release:</emphasis>
You need a release of the Yocto Project installed locally on
your development system.
This local area is referred to as the
<link linkend='source-directory'>Source Directory</link>
and is created when you use
<link linkend='git'>Git</link> to clone a local copy
of the upstream <filename>poky</filename> repository,
or when you download an official release of the corresponding
tarball.</para>
<para>Working from a copy of the upstream repository allows you
to contribute back into the Yocto Project or simply work with
the latest software on a development branch.
Because Git maintains and creates an upstream repository with
a complete history of changes and you are working with a local
clone of that repository, you have access to all the Yocto
Project development branches and tag names used in the upstream
repository.
<note>You can view the Yocto Project Source Repositories at
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>
You need a release of the Yocto Project.
You set that up with a local <link linkend='source-directory'>Source Directory</link>
one of two ways depending on whether you
are going to contribute back into the Yocto Project or not.
<note>
Regardless of the method you use, this manual refers to the resulting local
hierarchical set of files as the "Source Directory."
</note>
<itemizedlist>
<listitem><para><emphasis>Tarball Extraction:</emphasis>
@@ -109,40 +97,27 @@
directory of your choice.</para>
<para>For example, the following command extracts the
Yocto Project &DISTRO; release tarball
into the current working directory and sets up the local
Source Directory
with a top-level folder named
<filename>&YOCTO_POKY;</filename>:
into the current working directory and sets up the local Source Directory
with a top-level folder named <filename>&YOCTO_POKY;</filename>:
<literallayout class='monospaced'>
$ tar xfj &YOCTO_POKY_TARBALL;
</literallayout></para>
<para>This method does not produce a local Git
repository.
Instead, you simply end up with a snapshot of the
release.</para></listitem>
<listitem><para><emphasis>Git Repository Method:</emphasis>
If you are going to be contributing back into the Yocto
Project or you simply want to keep up with the latest
developments, you should use Git commands to set up a
local Git repository of the upstream
<filename>poky</filename> source repository.
Doing so creates a repository with a complete history
of changes and allows you to easily submit your changes
upstream to the project.
Because you clone the repository, you have access to all
the Yocto Project development branches and tag names
used in the upstream repository.
<note>You can view the Yocto Project Source Repositories
at
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>
</note></para>
<para>The following transcript shows how to clone the
<filename>poky</filename> Git repository into the
current working directory.
The command creates the local repository in a directory
named <filename>poky</filename>.
For information on Git used within the Yocto Project,
see the
<para>This method does not produce a local Git repository.
Instead, you simply end up with a snapshot of the release.</para></listitem>
<listitem><para><emphasis>Git Repository Method:</emphasis> If you are going to be contributing
back into the Yocto Project or you simply want to keep up
with the latest developments, you should use Git commands to set up a local
Git repository of the upstream <filename>poky</filename> source repository.
Doing so creates a repository with a complete history of changes and allows
you to easily submit your changes upstream to the project.
Because you clone the repository, you have access to all the Yocto Project development
branches and tag names used in the upstream repository.</para>
<note>You can view the Yocto Project Source Repositories at
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink></note>
<para>The following transcript shows how to clone the <filename>poky</filename>
Git repository into the current working directory.
The command creates the local repository in a directory named <filename>poky</filename>.
For information on Git used within the Yocto Project, see the
"<link linkend='git'>Git</link>" section.
<literallayout class='monospaced'>
$ git clone git://git.yoctoproject.org/poky
@@ -152,19 +127,16 @@
remote: Total 203728 (delta 147444), reused 202891 (delta 146614)
Receiving objects: 100% (203728/203728), 95.54 MiB | 308 KiB/s, done.
Resolving deltas: 100% (147444/147444), done.
</literallayout>
For another example of how to set up your own local
Git repositories, see this
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>wiki page</ulink>,
which describes how to create both
<filename>poky</filename> and
<filename>meta-intel</filename> Git repositories.
</para></listitem>
</literallayout></para>
<para>For another example of how to set up your own local Git repositories, see this
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>
wiki page</ulink>, which describes how to create both <filename>poky</filename>
and <filename>meta-intel</filename> Git repositories.</para></listitem>
</itemizedlist></para></listitem>
<listitem id='local-kernel-files'><para><emphasis>Yocto Project Kernel:</emphasis>
If you are going to be making modifications to a supported Yocto Project kernel, you
need to establish local copies of the source.
You can find Git repositories of supported Yocto Project kernels organized under
You can find Git repositories of supported Yocto Project Kernels organized under
"Yocto Linux Kernel" in the Yocto Project Source Repositories at
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
<para>This setup can involve creating a bare clone of the Yocto Project kernel and then
@@ -183,7 +155,7 @@
<filename>linux-yocto-3.10.git</filename>, while the
copy is named <filename>my-linux-yocto-3.10-work</filename>:
<literallayout class='monospaced'>
$ git clone &dash;&dash;bare git://git.yoctoproject.org/linux-yocto-3.10 linux-yocto-3.10.git
$ git clone --bare git://git.yoctoproject.org/linux-yocto-3.10 linux-yocto-3.10.git
Cloning into bare repository 'linux-yocto-3.10.git'...
remote: Counting objects: 3364487, done.
remote: Compressing objects: 100% (507178/507178), done.
@@ -249,39 +221,29 @@
</literallayout>
See the
"<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
section in the Yocto Project Board Support Package (BSP)
Developer's Guide for more information on BSP Layers.
section in the Yocto Project Board Support Package (BSP) Developer's Guide for more
information on BSP Layers.
<itemizedlist>
<listitem><para><emphasis>Tarball Extraction:</emphasis>
You can download any released BSP tarball from the same
"Downloads" page of the Yocto Project
<ulink url='https://www.yoctoproject.org/downloads'>Website</ulink>
<listitem><para><emphasis>Tarball Extraction:</emphasis> You can download any released
BSP tarball from the same "Downloads" page of the
<ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
to get the Yocto Project release.
Once on the "Download" page, look to the right of the
page and scroll down to find the BSP tarballs.</para>
<para>Once you have the tarball, just extract it into a
directory of your choice.
Again, this method just produces a snapshot of the BSP
layer in the form of a hierarchical directory
structure.</para></listitem>
<listitem><para><emphasis>Git Repository Method:</emphasis>
If you are working with a local Git repository for your
Source Directory, you should also use this method to
set up the <filename>meta-intel</filename> Git
repository.
You can locate the <filename>meta-intel</filename> Git
repository in the "Yocto Metadata Layers" area of the
Yocto Project Source Repositories at
<para>Once you have the tarball, just extract it into a directory of your choice.
Again, this method just produces a snapshot of the BSP layer in the form
of a hierarchical directory structure.</para></listitem>
<listitem><para><emphasis>Git Repository Method:</emphasis> If you are working
with a local Git repository for your Source Directory, you should also use this method
to set up the <filename>meta-intel</filename> Git repository.
You can locate the <filename>meta-intel</filename> Git repository in the
"Yocto Metadata Layers" area of the Yocto Project Source Repositories at
<ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para>
<para>Using
<link linkend='git'>Git</link> to create a local clone
of the upstream repository can be helpful if you are
working with BSPs.
Typically, you set up the
<filename>meta-intel</filename> Git repository inside
<para>Typically, you set up the <filename>meta-intel</filename> Git repository inside
the Source Directory.
For example, the following transcript shows the steps
to clone <filename>meta-intel</filename>.
For example, the following transcript shows the steps to clone the
<filename>meta-intel</filename>
Git repository inside the local <filename>poky</filename> Git repository.
<literallayout class='monospaced'>
$ cd ~/poky
$ git clone git://git.yoctoproject.org/meta-intel.git
@@ -291,12 +253,12 @@
remote: Total 7366 (delta 3997), reused 7299 (delta 3930)
Receiving objects: 100% (7366/7366), 2.31 MiB | 95 KiB/s, done.
Resolving deltas: 100% (3997/3997), done.
</literallayout>
The same
</literallayout></para>
<para>The same
<ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>wiki page</ulink>
referenced earlier covers how to
set up the <filename>meta-intel</filename> Git
repository.</para></listitem>
set up the <filename>meta-intel</filename> Git repository.
</para></listitem>
</itemizedlist></para></listitem>
<listitem><para><emphasis>Eclipse Yocto Plug-in:</emphasis> If you are developing
applications using the Eclipse Integrated Development Environment (IDE),

View File

@@ -56,11 +56,6 @@
<date>October 2013</date>
<revremark>Released with the Yocto Project 1.5 Release.</revremark>
</revision>
<revision>
<revnumber>1.5.1</revnumber>
<date>Sometime in 2013</date>
<revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
</revision>
</revhistory>
<copyright>
@@ -77,10 +72,11 @@
</para>
<note>
For the latest version of this manual associated with this
Yocto Project release, see the
<ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Manual</ulink>
from the Yocto Project website.
Due to production processes, there could be differences between the Yocto Project
documentation bundled in the release tarball and the
<ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Manual</ulink> on
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
For the latest version of this manual, see the manual on the website.
</note>
</legalnotice>

View File

@@ -95,7 +95,7 @@
<ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
variable as follows:
<literallayout class='monospaced'>
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}"
</literallayout>
The path <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>
expands to "linux-yocto" in the current directory for this

View File

@@ -45,7 +45,7 @@
Here is an example that assumes the local Git repository for the kernel is in
a top-level directory named <filename>linux-yocto-3.4</filename>:
<literallayout class='monospaced'>
$ cd linux-yocto-3.4
$ cd ~/linux-yocto-3.4
$ git checkout -b meta origin/meta
</literallayout>
Once you have checked out and switched to the <filename>meta</filename> branch,
@@ -208,7 +208,7 @@
the build tree directory.
The files include the final <filename>.config</filename> file, all the <filename>.o</filename>
files, the <filename>.a</filename> files, and so forth.
Since each machine or BSP has its own separate
Since each machine or BSP has its own separate
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
in its own separate branch
of the Git repository, you can easily switch between different builds.

View File

@@ -41,11 +41,6 @@
<date>October 2013</date>
<revremark>Released with the Yocto Project 1.5 Release.</revremark>
</revision>
<revision>
<revnumber>1.5.1</revnumber>
<date>Sometime in 2013</date>
<revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
</revision>
</revhistory>
<copyright>
@@ -59,10 +54,11 @@
the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
</para>
<note>
For the latest version of this manual associated with this
Yocto Project release, see the
<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>
from the Yocto Project website.
Due to production processes, there could be differences between the Yocto Project
documentation bundled in the release tarball and the
<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink> on
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
For the latest version of this manual, see the manual on the website.
</note>
</legalnotice>

View File

@@ -1,9 +1,9 @@
<!ENTITY DISTRO "1.5.1">
<!ENTITY DISTRO_COMPRESSED "151">
<!ENTITY DISTRO "1.5">
<!ENTITY DISTRO_COMPRESSED "15">
<!ENTITY DISTRO_NAME "dora">
<!ENTITY YOCTO_DOC_VERSION "1.5.1">
<!ENTITY POKYVERSION "10.0.1">
<!ENTITY POKYVERSION_COMPRESSED "1001">
<!ENTITY YOCTO_DOC_VERSION "1.5">
<!ENTITY POKYVERSION "10.0.0">
<!ENTITY POKYVERSION_COMPRESSED "1000">
<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME;-&POKYVERSION;">
<!ENTITY COPYRIGHT_YEAR "2010-2013">
<!ENTITY YOCTO_DL_URL "http://downloads.yoctoproject.org">
@@ -54,7 +54,7 @@
<!ENTITY YOCTO_POKY_TARBALL "&YOCTO_POKY;.tar.bz2">
<!ENTITY OE_INIT_PATH "&YOCTO_POKY;/oe-init-build-env">
<!ENTITY OE_INIT_FILE "oe-init-build-env">
<!ENTITY UBUNTU_HOST_PACKAGES_ESSENTIAL "gawk wget git-core diffstat unzip texinfo gcc-multilib \
<!ENTITY UBUNTU_HOST_PACKAGES_ESSENTIAL "gawk wget git-core diffstat unzip texinfo \
build-essential chrpath">
<!ENTITY FEDORA_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \

View File

@@ -78,7 +78,7 @@
</para>
<para>
If you've already built a stripped image, you can generate
If you've already build a stripped image, you can generate
debug packages (xxx-dbg) which you can manually install as
needed.
</para>

View File

@@ -22,7 +22,7 @@
<para>
Don't let the fact that it's part of the kernel fool you into thinking
that it's only for tracing and profiling the kernel - you can indeed
use it to trace and profile just the kernel, but you can also use it
use it to trace and profile just the kernel , but you can also use it
to profile specific applications separately (with or without kernel
context), and you can also use it to trace and profile the kernel
and all applications on the system simultaneously to gain a system-wide
@@ -30,10 +30,10 @@
</para>
<para>
In many ways, perf aims to be a superset of all the tracing and profiling
In many ways, it aims to be a superset of all the tracing and profiling
tools available in Linux today, including all the other tools covered
in this HOWTO. The past couple of years have seen perf subsume a lot
of the functionality of those other tools and, at the same time, those
of the functionality of those other tools, and at the same time those
other tools have removed large portions of their previous functionality
and replaced it with calls to the equivalent functionality now
implemented by the perf subsystem. Extrapolation suggests that at
@@ -126,7 +126,7 @@
wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
</literallayout>
The quickest and easiest way to get some basic overall data about
what's going on for a particular workload is to profile it using
what's going on for a particular workload it to profile it using
'perf stat'. 'perf stat' basically profiles using a few default
counters and displays the summed counts at the end of the run:
<literallayout class='monospaced'>
@@ -201,7 +201,7 @@
As our first attempt at profiling this workload, we'll simply
run 'perf record', handing it the workload we want to profile
(everything after 'perf record' and any perf options we hand
it - here none - will be executed in a new shell). perf collects
it - here none - will be executedin a new shell). perf collects
samples until the process exits and records them in a file named
'perf.data' in the current working directory.
<literallayout class='monospaced'>
@@ -241,7 +241,7 @@
Notice also that the above report shows an entry for 'busybox',
which is the executable that implements 'wget' in Yocto, but that
instead of a useful function name in that entry, it displays
a not-so-friendly hex value instead. The steps below will show
an not-so-friendly hex value instead. The steps below will show
how to fix that problem.
</para>
@@ -308,7 +308,7 @@
</para>
<para>
Notice also that here there's also a case where the hex value
Notice also that here there's also a case where the a hex value
is displayed in the callstack, here in the expanded
sys_clock_gettime() function. Later we'll see it resolve to a
userspace function call in busybox.
@@ -367,7 +367,7 @@
<para>
To generate the debug info for the packages in the image, we can
add dbg-pkgs to EXTRA_IMAGE_FEATURES in local.conf. For example:
to add dbg-pkgs to EXTRA_IMAGE_FEATURES in local.conf. For example:
<literallayout class='monospaced'>
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs"
</literallayout>
@@ -462,7 +462,7 @@
The tracing and profiling infrastructure in Linux has become
unified in a way that allows us to use the same tool with a
completely different set of counters, not just the standard
hardware counters that traditional tools have had to restrict
hardware counters that traditionally tools have had to restrict
themselves to (of course the traditional tools can also make use
of the expanded possibilities now available to them, and in some
cases have, as mentioned previously).
@@ -828,7 +828,7 @@
</para>
<para>
Luckily, there is a general-purpose way to handle such needs,
Luckily, there is general-purpose way to handle such needs,
called 'programming languages'. Making programming languages
easily available to apply to such problems given the specific
format of data is called a 'programming language binding' for
@@ -925,9 +925,9 @@
</literallayout>
Each event handler function in the generated code is modified
to do this. For convenience, we define a common function called
inc_counts() that each handler calls; inc_counts() simply tallies
inc_counts() that each handler calls; inc_counts simply tallies
a count for each event using the 'counts' hash, which is a
specialized hash function that does Perl-like autovivification, a
specialized has function that does Perl-like autovivification, a
capability that's extremely useful for kinds of multi-level
aggregation commonly used in processing traces (see perf's
documentation on the Python language binding for details):
@@ -1377,7 +1377,7 @@
the /tracing directory of the mounted debugfs filesystem
(Yocto follows the standard convention and mounts it
at /sys/kernel/debug). Here's a listing of all the files
found in /sys/kernel/debug/tracing on a Yocto system:
found in /sys/kernel/debug/tracing on a Yocto system.:
<literallayout class='monospaced'>
root@sugarbay:/sys/kernel/debug/tracing# ls
README kprobe_events trace
@@ -1634,7 +1634,7 @@
Also notice that there are various annotations on the left
hand side of the display. For example if the total time it
took for a given function to execute is above a certain
threshold, an exclamation point or plus sign appears on the
threshold, and exclamation point or plus sign appears on the
left hand side. Please see the ftrace documentation for
details on all these fields.
</para>
@@ -1842,7 +1842,7 @@
</literallayout>
You can enable any number of events or complete subsystems
(by using the 'enable' file in the subsystem directory) and
get an arbitrarily fine-grained idea of what's going on in the
get am arbitrarily fine-grained idea of what's going on in the
system by enabling as many of the appropriate tracepoints
as applicable.
</para>
@@ -1878,14 +1878,14 @@
in /sys/kernel/debug/tracing, allowing users to specify
specific particular events within the
/sys/kernel/debug/tracing/events/ subdirectory and to collect
traces and avoid having to deal with those details directly.
traces and avoiding having to deal with those details directly.
</para>
<para>
As yet another layer on top of that, kernelshark provides a GUI
that allows users to start and stop traces and specify sets
of events using an intuitive interface, and view the
output as both trace events and as a per-CPU graphical
output as both trace events and as a per-cpu graphical
display. It directly uses 'trace-cmd' as the plumbing
that accomplishes all that underneath the covers (and
actually displays the trace-cmd command it uses, as we'll see).
@@ -1896,13 +1896,13 @@
<literallayout class='monospaced'>
root@sugarbay:~# kernelshark
</literallayout>
Then bring up the 'Capture' dialog by choosing from the
The bring up the 'Capture' dialog by choosing from the
kernelshark menu:
<literallayout class='monospaced'>
Capture | Record
</literallayout>
That will display the following dialog, which allows you to
choose one or more events (or even one or more complete
choose on or more events (or even one or more complete
subsystems) to trace:
</para>
@@ -1911,7 +1911,7 @@
</para>
<para>
Note that these are exactly the same sets of events described
Note that these are exactly the same set of events described
in the previous trace events subsystem section, and in fact
is where trace-cmd gets them for kernelshark.
</para>
@@ -1980,15 +1980,13 @@
<literallayout class='monospaced'>
Documentation/trace/events.txt
</literallayout>
There is a nice series of articles on using
There are a nice series of articles on using
ftrace and trace-cmd at LWN:
<itemizedlist>
<listitem><para><ulink url='http://lwn.net/Articles/365835/'>Debugging the kernel using Ftrace - part 1</ulink>
</para></listitem>
<listitem><para><ulink url='http://lwn.net/Articles/366796/'>Debugging the kernel using Ftrace - part 2</ulink>
</para></listitem>
<listitem><para><ulink url='http://lwn.net/Articles/370423/'>Secrets of the Ftrace function tracer</ulink>
</para></listitem>
<listitem><para><ulink url='https://lwn.net/Articles/410200/'>trace-cmd: A front-end for Ftrace</ulink>
</para></listitem>
</itemizedlist>
@@ -2024,7 +2022,7 @@
<ulink url='http://sourceware.org/systemtap/tutorial/'>SystemTap tutorial</ulink>
simply prints a line every time any process on the system open()s
a file. For each line, it prints the executable name of the
program that opened the file, along with its PID, and the name
program that opened the file, along with its pid, and the name
of the file it opened (or tried to open), which it extracts
from the open syscall's argstr.
<literallayout class='monospaced'>
@@ -2098,15 +2096,6 @@
booted. The 'crosstap' script provides details on how
to do this if you run the script on the host without having
done a build:
<note>
SystemTap, which uses 'crosstap', assumes you can establish an
ssh connection to the remote target.
Please refer to the crosstap wiki page for details on verifying
ssh connections at
<ulink url='https://wiki.yoctoproject.org/wiki/Tracing_and_Profiling#systemtap'></ulink>.
Also, the ability to ssh into the target system is not enabled
by default in *-minimal images.
</note>
<literallayout class='monospaced'>
$ crosstap root@192.168.1.88 trace_open.stp
@@ -2133,6 +2122,9 @@
the EXTRA_IMAGE_FEATURES variable ]
$ bitbake core-image-sato
[ NOTE that 'crosstap' needs to be able to ssh into the target
system, which isn't enabled by default in -minimal images. ]
Once you've build the image on the host system, you're ready to
boot it (or the equivalent pre-built image) and use 'crosstap'
to probe it (you need to source the environment as usual first):
@@ -2203,7 +2195,7 @@
<para>
If everything worked as planned, you should see something
like this (enter the password when prompted, or press enter
if it's set up to use no password):
if its set up to use no password):
<literallayout class='monospaced'>
$ crosstap root@192.168.7.2 trace_open.stp
root@192.168.7.2's password:
@@ -2248,7 +2240,7 @@
</para>
<para>
For the section that deals with running oprofile from the command-line,
For the the section that deals with oprofile from the command-line,
we assume you've ssh'ed to the host and will be running
oprofile on the target.
</para>
@@ -2268,7 +2260,7 @@
Oprofile as configured in Yocto is a system-wide profiler
(i.e. the version in Yocto doesn't yet make use of the
perf_events interface which would allow it to profile
specific processes and workloads). It relies on hardware
specific processes and workloads). It's relies on hardware
counter support in the hardware (but can fall back to a
timer-based mode), which means that it doesn't take
advantage of tracepoints or other event sources for example.
@@ -2289,8 +2281,8 @@
<para>
The oprofile daemon should already be running, but before
you start profiling, you may need to change some settings
and some of these settings may require the daemon to not
be running. One of these settings is the path to the
and some of these settings may require the daemon not
be running. One of these settings is the path the the
vmlinux file, which you'll want to set using the --vmlinux
option if you want the kernel profiled:
<literallayout class='monospaced'>
@@ -2321,7 +2313,7 @@
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
</literallayout>
If we check the status again we now see our updated settings:
If we get the status again we now see our updated settings:
<literallayout class='monospaced'>
root@crownbay:~# opcontrol --status
Daemon paused: pid 1649
@@ -2330,7 +2322,7 @@
Image filter: none
Call-graph depth: 6
</literallayout>
We're now in a position to run a profile. For that we use
We're now in a position to run a profile. For that we used
'opcontrol --start':
<literallayout class='monospaced'>
root@crownbay:~# opcontrol --start
@@ -2342,10 +2334,10 @@
Connecting to downloads.yoctoproject.org (140.211.169.59:80)
linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA
</literallayout>
To stop the profile we use 'opcontrol --shutdown', which not
To stop the profile we use 'opcontrol --shudown', which not
only stops the profile but shuts down the daemon as well:
<literallayout class='monospaced'>
root@crownbay:~# opcontrol --shutdown
root@crownbay:~# opcontrol --start
Stopping profiling.
Killing daemon.
</literallayout>
@@ -2904,7 +2896,7 @@
<para>
Once you've applied the above commits and built and booted your
image (you need to build the core-image-sato-sdk image or use one of the
image (you need to build the core-image-sato-sdk image or the
other methods described in the General Setup section), you're
ready to start tracing.
</para>
@@ -2913,7 +2905,7 @@
<title>Collecting and viewing a trace on the target (inside a shell)</title>
<para>
First, from the host, ssh to the target:
First, from the target, ssh to the target:
<literallayout class='monospaced'>
$ ssh -l root 192.168.1.47
The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established.
@@ -3014,7 +3006,7 @@
<title>Collecting and viewing a userspace trace on the target (inside a shell)</title>
<para>
For LTTng userspace tracing, you need to have a properly
For lttng userspace tracing, you need to have a properly
instrumented userspace program. For this example, we'll use
the 'hello' test program generated by the lttng-ust build.
</para>
@@ -3036,7 +3028,7 @@
</para>
<para>
First, from the host, ssh to the target:
First, from the target, ssh to the target:
<literallayout class='monospaced'>
$ ssh -l root 192.168.1.47
The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established.
@@ -3602,7 +3594,7 @@
It's also possible to trace block I/O using only
<link linkend='the-trace-events-subsystem'>trace events subsystem</link>,
which can be useful for casual tracing
if you don't want to bother dealing with the userspace tools.
if you don't want bother dealing with the userspace tools.
</para>
<para>

View File

@@ -41,11 +41,6 @@
<date>October 2013</date>
<revremark>Released with the Yocto Project 1.5 Release.</revremark>
</revision>
<revision>
<revnumber>1.5.1</revnumber>
<date>Sometime in 2013</date>
<revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
</revision>
</revhistory>
<copyright>
@@ -62,10 +57,11 @@
</para>
<note>
For the latest version of this manual associated with this
Yocto Project release, see the
<ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink>
from the Yocto Project website.
Due to production processes, there could be differences between the Yocto Project
documentation bundled in the release tarball and the
<ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Tracing and Profiling Manual</ulink> on
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
For the latest version of this manual, see the manual on the website.
</note>
</legalnotice>

View File

@@ -267,7 +267,7 @@
<para>
The previous section described the user configurations that
define BitBake's global behavior.
define the BitBake's global behavior.
This section takes a closer look at the layers the build system
uses to further control the build.
These layers provide Metadata for the software, machine, and
@@ -363,7 +363,7 @@
for what you typically find in the distribution layer:
<itemizedlist>
<listitem><para><emphasis>classes:</emphasis>
Class files (<filename>.bbclass</filename>) hold
Class files (<filename>.bbclass</filename>) holds
common functionality that can be shared among
recipes in the distribution.
When your recipes inherit a class, they take on the
@@ -381,7 +381,7 @@
<listitem><para><emphasis>recipes-*:</emphasis>
Recipes and append files that affect common
functionality across the distribution.
This area could include recipes and append files
This area could include recipes and append files to
to add distribution-specific configuration,
initialization scripts, custom image recipes,
and so forth.</para></listitem>
@@ -421,7 +421,7 @@
Metadata can exist for multiple formfactors, graphics
support systems, and so forth.
<note>
While the figure shows several <filename>recipes-*</filename>
While the figure shows several <filename>recipe-*</filename>
directories, not all these directories appear in all
BSP layers.
</note>
@@ -487,7 +487,7 @@
<para>
Another area that plays a significant role in where source files
come from is pointed to by the
comes from is pointed to by the
<link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
variable.
This area is a cache that can hold previously downloaded source.
@@ -546,7 +546,7 @@
The canonical method through which to include a local project
is to use the
<link linkend='ref-classes-externalsrc'><filename>externalsrc.bbclass</filename></link>
class to include that local project.
class to include local project.
You use either the <filename>local.conf</filename> or a
recipe's append file to override or set the
recipe to point to the local directory on your disk to pull
@@ -693,7 +693,7 @@
<para>
The <filename>do_fetch</filename> and
<filename>do_unpack</filename> tasks fetch the source files
and unpack them into the work directory.
and unpack them into a working directory.
By default, everything is accomplished in the
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
which has a defined structure.
@@ -704,11 +704,11 @@
</para>
<para>
Unpacked source files are pointed to by the
Unpacked source source files are pointed to by the
<link linkend='var-S'><filename>S</filename></link> variable.
Each recipe has an area in the Build Directory where the
unpacked source code resides.
The name of that directory for any given recipe is defined from
The name of directory for any given recipe is defined from
several different variables.
You can see the variables that define these directories
by looking at the figure:
@@ -809,7 +809,7 @@
variable.
For information on how this variable works within
that class, see the
<filename>meta/classes/autotools.bbclass</filename> file.
<filename>meta/classes/autotools.bbclass</filename>.
</para></listitem>
<listitem><para><emphasis><filename>do_compile</filename>:</emphasis>
Once a configuration task has been satisfied, BitBake
@@ -818,8 +818,8 @@
Compilation occurs in the directory pointed to by the
<link linkend='var-B'><filename>B</filename></link>
variable.
Realize that the <filename>B</filename> directory is, by
default, the same as the
Realize that the <filename>B</filename> directory, by
default, is the same as the
<link linkend='var-S'><filename>S</filename></link>
directory.</para></listitem>
<listitem><para><emphasis><filename>do_install</filename>:</emphasis>
@@ -948,7 +948,7 @@
<para>
During image generation, the build system attempts to run
all post-installation scripts.
all post installation scripts.
Any that fail to run on the build host are run on the
target when the target system is first booted.
If you are using a
@@ -1052,7 +1052,7 @@
<para>
The images produced by the OpenEmbedded build system
are compressed forms of the
root filesystem that are ready to boot on a target device.
root filesystems that are ready to boot on a target device.
You can see from the
<link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link>
that BitBake output in part consists of images.
@@ -1062,14 +1062,14 @@
<para>
For a list of example images that the Yocto Project provides,
see the
the
"<link linkend='ref-images'>Images</link>" chapter.
</para>
<para>
Images are written out to the
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
inside the <filename>tmp/deploy/images/&lt;machine&gt;/</filename>
inside the <filename>deploy/images/&lt;machine&gt;/</filename>
folder as shown in the figure.
This folder contains any files expected to be loaded on the
target device.

View File

@@ -31,19 +31,31 @@
<qandaentry>
<question>
<para>
My development system does not have Python 2.7.3 or greater,
which the Yocto Project requires.
I only have Python 2.4 or 2.5 but BitBake requires Python 2.6 or 2.7.
Can I still use the Yocto Project?
</para>
</question>
<answer>
<para>
You can get the required tools on your host development
system a couple different ways (i.e. building a tarball or
downloading a tarball).
See the
"<link linkend='required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</link>"
section for steps on how to update your build tools.
You can use a stand-alone tarball to provide Python 2.6.
You can find pre-built 32 and 64-bit versions of Python 2.6 at the following locations:
<itemizedlist>
<listitem><para><ulink url='&YOCTO_PYTHON-i686_DL_URL;'>32-bit tarball</ulink></para></listitem>
<listitem><para><ulink url='&YOCTO_PYTHON-x86_64_DL_URL;'>64-bit tarball</ulink></para></listitem>
</itemizedlist>
</para>
<para>
These tarballs are self-contained with all required libraries and should work
on most Linux systems.
To use the tarballs extract them into the root
directory and run the appropriate command:
<literallayout class='monospaced'>
$ export PATH=/opt/poky/sysroots/i586-pokysdk-linux/usr/bin/:$PATH
$ export PATH=/opt/poky/sysroots/x86_64-pokysdk-linux/usr/bin/:$PATH
</literallayout>
</para>
<para>
Once you run the command, BitBake uses Python 2.6.
</para>
</answer>
</qandaentry>
@@ -199,7 +211,7 @@
</answer>
</qandaentry>
<!-- <qandaentry>
<qandaentry>
<question>
<para>
How do I make the Yocto Project work in RHEL/CentOS?
@@ -246,7 +258,7 @@
Wiki page.</para>
</note>
</answer>
</qandaentry> -->
</qandaentry>
<qandaentry>
<question>
@@ -670,7 +682,7 @@
<para>
Yes - you can easily do this.
When you use BitBake to build an image, all the build output
goes into the directory created when you run the
goes into the directory created when you run the
build environment setup script (i.e.
<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
or

View File

@@ -121,6 +121,11 @@
</para>
<para>
Refer to
<ulink url='&OE_HOME_URL;/index.php?title=OEandYourDistro'>OE and Your Distro</ulink> and
<ulink url='&OE_HOME_URL;/index.php?title=Required_software'>Required Software</ulink>
for information for information about dependencies and
requirements.
If you encounter problems, please go to
<ulink url='&YOCTO_BUGZILLA_URL;'>Yocto Project Bugzilla</ulink>
and submit a bug.
@@ -246,11 +251,11 @@
</section>
<section id='opensuse-packages'>
<title>openSUSE Packages</title>
<title>OpenSUSE Packages</title>
<para>
The following list shows the required packages by function
given a supported openSUSE Linux distribution:
given a supported OpenSUSE Linux distribution:
<itemizedlist>
<listitem><para><emphasis>Essentials:</emphasis>
Packages needed to build an image for a headless
@@ -341,8 +346,8 @@
you can resolve this by either downloading a pre-built tarball
containing these tools, or building such a tarball on another
system.
Regardless of the method, once you have the tarball, you simply
install it somewhere on your system, such as a directory in your
Regardless of the method, once you have the tarball you simply
install it somewhere on you system, such as a directory in your
home directory, and then source the environment script provided,
which adds the tools into <filename>PATH</filename> and sets
any other environment variables required to run the tools.
@@ -353,7 +358,7 @@
<para>
If downloading a pre-built tarball, locate the
<filename>*.sh</filename> at
<ulink url='&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;/buildtools/'></ulink>.
<ulink url='&YOCTO_DL_URL;/releases/yocto/yocto-1.5/buildtools/'></ulink>.
</para>
<para>
@@ -366,7 +371,7 @@
variable determines whether you build tools for a 32-bit
or 64-bit system.
</note>
Once the build completes, you can find the file that installs
Once the build completes, you can find the file that installs the
the tools in the <filename>tmp/deploy/sdk</filename> subdirectory
of the
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.

View File

@@ -34,7 +34,7 @@
<para>
The shared state cache (sstate-cache), as pointed to by
<link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link>, by default
now has two-character subdirectories to prevent issues arising
now has two-character subdirectories to prevent issues rising
from too many files in the same directory.
Also, native sstate-cache packages will go into a subdirectory named using
the distro ID string.
@@ -157,7 +157,7 @@
<link linkend='var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></link>,
and so forth.
See the
"<link linkend='ref-classes-packagegroup'><filename>packagegroup.bbclass</filename></link>"
"<link linkend='ref-classes-packagegroup'>Package Groups - packagegroup.bbclass</link>"
section for further details.
</para>
</section>
@@ -755,7 +755,7 @@
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
rather than
<link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>.
Doing so makes it easier to delete
Doing so makes it a easier to delete
<filename>TMPDIR</filename> and preserve the build history.
Additionally, data for produced SDKs is now split by
<link linkend='var-IMAGE_NAME'><filename>IMAGE_NAME</filename></link>.
@@ -829,10 +829,10 @@
</section>
<section id='migration-1.5-run'>
<title><filename>run</filename></title>
<title><filename>/run</filename></title>
<para>
The <filename>run</filename> directory from the Filesystem
The <filename>/run</filename> directory from the Filesystem
Hierarchy Standard 3.0 has been introduced.
You can find some of the implications for this change
<ulink url='http://cgit.openembedded.org/openembedded-core/commit/?id=0e326280a15b0f2c4ef2ef4ec441f63f55b75873'>here</ulink>.
@@ -886,7 +886,7 @@
<para>
For more information, see the
"<link linkend='ref-classes-packagegroup'><filename>packagegroup.bbclass</filename></link>"
"<link linkend='ref-classes-packagegroup'>Package Groups - <filename>packagegroup.bbclass</filename></link>"
section.
</para>
</section>
@@ -1033,7 +1033,7 @@
</para></listitem>
<listitem><para>
<filename>base-files</filename>: Remove the unnecessary
<filename>media/xxx</filename> directories.
<filename>/media/xxx</filename> directories.
</para></listitem>
<listitem><para>
<filename>alsa-state</filename>: Provide an empty

View File

@@ -222,7 +222,7 @@
<para>
As each task completes, a timestamp is written to the directory specified by the
<filename><link linkend='var-STAMP'>STAMP</link></filename> variable.
On subsequent runs, BitBake looks within the <filename>build/tmp/stamps</filename>
On subsequent runs, BitBake looks within the <filename>/build/tmp/stamps</filename>
directory and does not rerun
tasks that are already completed unless a timestamp is found to be invalid.
Currently, invalid timestamps are only considered on a per

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
<chapter id='ref-features'>
<title>Features</title>
<title>Reference: Features</title>
<para>
This chapter provides a reference of shipped machine and distro features
@@ -38,34 +38,23 @@
Here is an example that discovers the recipes whose build is potentially
changed based on a given feature:
<literallayout class='monospaced'>
$ cd poky
$ cd $HOME/poky
$ git grep 'contains.*MACHINE_FEATURES.*&lt;feature&gt;'
</literallayout>
</para>
<section id='ref-features-distro'>
<title>Distro Features</title>
<title>Distro</title>
<para>
The items below are features you can use with
<link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
to enable features across your distribution.
Features do not have a one-to-one correspondence to packages,
and they can go beyond simply controlling the installation of a
package or packages.
In most cases, the presence or absence of a feature translates to
the appropriate option supplied to the configure script during
<filename>do_configure</filename> for the recipes that optionally
support the feature.
</para>
<para>
Some distro features are also machine features.
These select features make sense to be controlled both at
the machine and distribution configuration level.
See the
<ulink url='&YOCTO_DOCS_REF_URL;#var-COMBINED_FEATURES'><filename>COMBINED_FEATURES</filename></ulink>
variable for more information.
<link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
Features do not have a one-to-one correspondence to packages, and they can
go beyond simply controlling the installation of a package or packages.
Sometimes a feature can influence how certain recipes are built.
For example, a feature might determine whether a particular configure option
is specified within <filename>do_configure</filename> for a particular
recipe.
</para>
<para>
@@ -86,7 +75,7 @@
support.</para></listitem>
<listitem><para><emphasis>ipv6:</emphasis> Include IPv6 support.
</para></listitem>
<listitem><para><emphasis>irda:</emphasis> Include IrDA support.
<listitem><para><emphasis>irda:</emphasis> Include Irda support.
</para></listitem>
<listitem><para><emphasis>keyboard:</emphasis> Include keyboard
support (e.g. keymaps will be loaded during boot).
@@ -131,7 +120,7 @@
</section>
<section id='ref-features-machine'>
<title>Machine Features</title>
<title>Machine</title>
<para>
The items below are features you can use with
@@ -157,7 +146,7 @@
</para></listitem>
<listitem><para><emphasis>ext2:</emphasis> Hardware HDD or Microdrive
</para></listitem>
<listitem><para><emphasis>irda:</emphasis> Hardware has IrDA support
<listitem><para><emphasis>irda:</emphasis> Hardware has Irda support
</para></listitem>
<listitem><para><emphasis>keyboard:</emphasis> Hardware has a keyboard
</para></listitem>
@@ -182,7 +171,7 @@
</section>
<section id='ref-features-image'>
<title>Image Features</title>
<title>Images</title>
<para>
The contents of images generated by the OpenEmbedded build system can be controlled by the

View File

@@ -90,18 +90,14 @@
<listitem><para><emphasis><filename>core-image-clutter</filename>:</emphasis>
An image with support for the Open GL-based toolkit Clutter, which enables development of
rich and animated graphical user interfaces.</para></listitem>
<listitem><para><emphasis><filename>core-image-directfb</filename>:</emphasis>
An image that uses <filename>directfb</filename> instead of X11.
</para></listitem>
<listitem><para><emphasis><filename>core-image-gtk-directfb</filename>:</emphasis>
An image that uses <filename>gtk+</filename> over <filename>directfb</filename>
instead of X11.
In order to build, this image requires specific distro configuration that enables
<filename>gtk</filename> over <filename>directfb</filename>.</para></listitem>
<listitem><para><emphasis><filename>core-image-x11</filename>:</emphasis>
A very basic X11 image with a terminal.
</para></listitem>
<listitem><para><emphasis><filename>core-image-weston</filename>:</emphasis>
An image that provides the Wayland protocol libraries and the
reference Weston compositor.
For more information, see the
"<link linkend='wayland'>Wayland</link>" section.
</para></listitem>
<listitem><para><emphasis><filename>qt4e-demo-image</filename>:</emphasis>
An image that launches into the demo application for the embedded
(not based on X11) version of Qt.</para></listitem>

View File

@@ -72,11 +72,6 @@
<date>October 2013</date>
<revremark>Released with the Yocto Project 1.5 Release.</revremark>
</revision>
<revision>
<revnumber>1.5.1</revnumber>
<date>Sometime in 2013</date>
<revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
</revision>
</revhistory>
<copyright>
@@ -90,10 +85,11 @@
the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
</para>
<note>
For the latest version of this manual associated with this
Yocto Project release, see the
<ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>
from the Yocto Project website.
Due to production processes, there could be differences between the Yocto Project
documentation bundled in the release tarball and the
<ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink> on
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
For the latest version of this manual, see the manual on the website.
</note>
</legalnotice>

View File

@@ -39,27 +39,23 @@
<para>
This directory includes a copy of BitBake for ease of use.
The copy usually matches the current stable BitBake release from
the BitBake project.
The copy usually matches the current stable BitBake release from the BitBake project.
BitBake, a
<ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
interpreter, reads the Yocto Project Metadata and runs the tasks
interpreter, reads the Yocto Project metadata and runs the tasks
defined by that data.
Failures are usually from the Metadata and not from BitBake itself.
Failures are usually from the metadata and not from BitBake itself.
Consequently, most users do not need to worry about BitBake.
</para>
<para>
When you run the <filename>bitbake</filename> command, the
main BitBake executable, which resides in the
<filename>bitbake/bin/</filename> directory, starts.
Sourcing an environment setup script (e.g.
<link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link>
or
<link linkend="structure-memres-core-script"><filename>oe-init-build-env-memres</filename></link>)
places the <filename>scripts</filename> and
<filename>bitbake/bin</filename> directories (in that order) into
the shell's <filename>PATH</filename> environment variable.
When you run the <filename>bitbake</filename> command, the wrapper script in
<filename>scripts/</filename> is executed to run the main BitBake executable,
which resides in the <filename>bitbake/bin/</filename> directory.
Sourcing the <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link>
script places the <filename>scripts</filename> and <filename>bitbake/bin</filename>
directories (in that order) into the shell's <filename>PATH</filename> environment
variable.
</para>
<para>
@@ -78,7 +74,7 @@
the source tree is combined with the output.
The <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
is created initially when you <filename>source</filename>
the OpenEmbedded build environment setup script
the OpenEmbedded build environment setup script
(i.e.
<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
or
@@ -101,7 +97,7 @@
</section>
<section id='handbook'>
<title><filename>documentation/</filename></title>
<title><filename>documentation</filename></title>
<para>
This directory holds the source for the Yocto Project documentation
@@ -109,7 +105,7 @@
versions of the manuals.
Each manual is contained in a sub-folder.
For example, the files for this manual reside in
the <filename>ref-manual/</filename> directory.
<filename>ref-manual</filename>.
</para>
</section>
@@ -179,9 +175,9 @@
</para>
<para>
The <filename>scripts</filename> directory has useful scripts that assist in contributing
back to the Yocto Project, such as <filename>create-pull-request</filename> and
<filename>send-pull-request</filename>.
The <filename>scripts</filename> directory has useful scripts that assist contributing
back to the Yocto Project, such as <filename>create_pull_request</filename> and
<filename>send_pull_request</filename>.
</para>
</section>
@@ -189,9 +185,9 @@
<title><filename>&OE_INIT_FILE;</filename></title>
<para>
This script is one of two scripts that set up the OpenEmbedded build
This script is one of two scripts that set up the OpenEmbedded build
environment.
For information on the other script, see the
For information on the other script, see the
"<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>"
section.
</para>
@@ -200,7 +196,7 @@
Running this script with the <filename>source</filename> command in
a shell makes changes to <filename>PATH</filename> and sets other
core BitBake variables based on the current working directory.
You need to run an environment setup script before running BitBake
You need to run an environment setup script before running BitBake
commands.
The script uses other scripts within the
<filename>scripts</filename> directory to do the bulk of the work.
@@ -209,8 +205,7 @@
<para>
By default, running this script without a
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
argument creates the <filename>build</filename> directory
in your current working directory.
argument creates the <filename>build</filename> directory.
If you provide a Build Directory argument when you
<filename>source</filename> the script, you direct the OpenEmbedded
build system to create a Build Directory of your choice.
@@ -236,11 +231,11 @@
<title><filename>oe-init-build-env-memres</filename></title>
<para>
This script is one of two scripts that set up the OpenEmbedded
build environment.
Aside from setting up the environment, this script starts a
memory-resident BitBake server.
For information on the other setup script, see the
This script is one of two scripts that set up the OpenEmbedded build
environment.
Setting up the environment with this script uses a
memory-resident BitBake.
For information on the other setup script, see the
"<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>"
section.
</para>
@@ -257,14 +252,14 @@
Running this script with the <filename>source</filename> command in
a shell makes changes to <filename>PATH</filename> and sets other
core BitBake variables based on the current working directory.
One of these variables is the
One of these variables is the
<link linkend='var-BBSERVER'><filename>BBSERVER</filename></link>
variable, which allows the OpenEmbedded build system to locate
variable, which allows the OpenEmbedded build system to locate
the server that is running BitBake.
</para>
<para>
You need to run an environment setup script before using BitBake
You need to run an environment setup script before running BitBake
commands.
Following is the script syntax:
<literallayout class='monospaced'>
@@ -275,34 +270,33 @@
</para>
<para>
If you do not provide a port number with the script, the
BitBake server at port "12345" is started.
If you do not provide a port number with the script, the default
port "12345" is used.
</para>
<para>
By default, running this script without a
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
argument creates a build directory named
<filename>build</filename>.
argument creates the <filename>build</filename> directory.
If you provide a Build Directory argument when you
<filename>source</filename> the script, the Build Directory is
created using that name.
For example, the following command starts the BitBake server using
the default port "12345" and creates a Build Directory named
<filename>source</filename> the script, you direct the OpenEmbedded
build system to create a Build Directory of your choice.
For example, the following command uses the default port number
"12345" and creates a Build Directory named
<filename>mybuilds</filename> that is outside of the
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>:
<literallayout class='monospaced'>
$ source oe-init-build-env-memres ~/mybuilds
</literallayout>
<note>
The OpenEmbedded build system does not support file or
The OpenEmbedded build system does not support file or
directory names that contain spaces.
If you attempt to run the
If you attempt to run the
<filename>oe-init-build-env-memres</filename> script
from a Source Directory that contains spaces in either the
filenames or directory names, the script returns an error
from a Source Directory that contains spaces in either the
filenames or directory names, the script returns an error
indicating no such file or directory.
Be sure to use a Source Directory free of names containing
Be sure to use a Source Directory free of names containing
spaces.
</note>
</para>
@@ -327,72 +321,81 @@
By default, this directory is named <filename>build</filename>.
</para>
<section id='structure-build-pseudodone'>
<title><filename>build/pseudodone</filename></title>
<para>
This tag file indicates that the initial pseudo binary was created.
The file is built the first time BitBake is invoked.
</para>
</section>
<section id='structure-build-conf-local.conf'>
<title><filename>build/conf/local.conf</filename></title>
<para>
This configuration file contains all the local user configurations
This configuration file contains all the local user configurations
for your build environment.
The <filename>local.conf</filename> file contains documentation on
The <filename>local.conf</filename> file contains documentation on
the various configuration options.
Any variable set here overrides any variable set elsewhere within
the environment unless that variable is hard-coded within a file
Any variable set here overrides any variable set elsewhere within
the environment unless that variable is hard-coded within a file
(e.g. by using '=' instead of '?=').
Some variables are hard-coded for various reasons but these
Some variables are hard-coded for various reasons but these
variables are relatively rare.
</para>
<para>
Edit this file to set the
Edit this file to set the
<filename><link linkend='var-MACHINE'>MACHINE</link></filename>
for which you want to build, which package types you wish to use
(<link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>),
the location from which you want to access downloaded files
the location from which you want to downloaded files
(<filename><link linkend='var-DL_DIR'>DL_DIR</link></filename>),
and how you want your host machine to use resources
(<link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link>
(<link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link>
and
<link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>).
</para>
<para>
If <filename>local.conf</filename> is not present when you
start the build, the OpenEmbedded build system creates it from
If <filename>local.conf</filename> is not present when you
start the build, the OpenEmbedded build system creates it from
<filename>local.conf.sample</filename> when
you <filename>source</filename> the top-level build environment
you <filename>source</filename> the top-level build environment
setup script (i.e.
<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
or
or
<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
</para>
<para>
The source <filename>local.conf.sample</filename> file used
The source <filename>local.conf.sample</filename> file used
depends on the <filename>$TEMPLATECONF</filename> script variable,
which defaults to <filename>meta-yocto/conf</filename>
when you are building from the Yocto Project development
environment and defaults to <filename>meta/conf</filename> when
which defaults to <filename>/meta-yocto/conf</filename>
when you are building from the Yocto Project development
environment and defaults to <filename>/meta/conf</filename> when
you are building from the OpenEmbedded Core environment.
Because the script variable points to the source of the
<filename>local.conf.sample</filename> file, this implies that
you can configure your build environment from any layer by setting
the variable in the top-level build environment setup script as
Because the script variable points to the source of the
<filename>local.conf.sample</filename> file, this implies that
you can configure your build environment from any layer by setting
the variable in the top-level build environment setup script as
follows:
<literallayout class='monospaced'>
TEMPLATECONF=&lt;your_layer&gt;/conf
</literallayout>
Once the build process gets the sample file, it uses
<filename>sed</filename> to substitute final
<filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename>
Once the build process gets the sample file, it uses
<filename>sed</filename> to substitute final
<filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename>
values for all <filename>##OEROOT##</filename> values.
<note>
You can see how the <filename>TEMPLATECONF</filename> variable
is used by looking at the
<filename>scripts/oe-setup-builddir</filename> script in the
is used by looking at the
<filename>/scripts/oe-setup-builddir</filename> script in the
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
You can find the Yocto Project version of the
<filename>local.conf.sample</filename> file in the
<filename>meta-yocto/conf</filename> directory.
You can find the Yocto Project version of the
<filename>local.conf.sample</filename> file in the
<filename>/meta-yocto/conf</filename> directory.
</note>
</para>
</section>
@@ -405,48 +408,48 @@
<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>layers</ulink>,
which are directory trees, traversed (or walked) by BitBake.
The <filename>bblayers.conf</filename> file uses the
<link linkend='var-BBLAYERS'><filename>BBLAYERS</filename></link>
<link linkend='var-BBLAYERS'><filename>BBLAYERS</filename></link>
variable to list the layers BitBake tries to find, and uses the
<link linkend='var-BBLAYERS_NON_REMOVABLE'><filename>BBLAYERS_NON_REMOVABLE</filename></link>
variable to list layers that must not be removed.
</para>
<para>
If <filename>bblayers.conf</filename> is not present when you
start the build, the OpenEmbedded build system creates it from
If <filename>bblayers.conf</filename> is not present when you
start the build, the OpenEmbedded build system creates it from
<filename>bblayers.conf.sample</filename> when
you <filename>source</filename> the top-level build environment
you <filename>source</filename> the top-level build environment
setup script (i.e.
<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
or
or
<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>).
</para>
<para>
The source <filename>bblayers.conf.sample</filename> file used
The source <filename>bblayers.conf.sample</filename> file used
depends on the <filename>$TEMPLATECONF</filename> script variable,
which defaults to <filename>meta-yocto/conf</filename>
when you are building from the Yocto Project development
environment and defaults to <filename>meta/conf</filename> when
which defaults to <filename>/meta-yocto/conf</filename>
when you are building from the Yocto Project development
environment and defaults to <filename>/meta/conf</filename> when
you are building from the OpenEmbedded Core environment.
Because the script variable points to the source of the
<filename>bblayers.conf.sample</filename> file, this implies that
Because the script variable points to the source of the
<filename>bblayers.conf.sample</filename> file, this implies that
you can base your build from any layer by setting the variable in
the top-level build environment setup script as follows:
<literallayout class='monospaced'>
TEMPLATECONF=&lt;your_layer&gt;/conf
</literallayout>
Once the build process gets the sample file, it uses
<filename>sed</filename> to substitute final
<filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename>
Once the build process gets the sample file, it uses
<filename>sed</filename> to substitute final
<filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename>
values for all <filename>##OEROOT##</filename> values.
<note>
You can see how the <filename>TEMPLATECONF</filename> variable
<filename>scripts/oe-setup-builddir</filename> script in the
<filename>/scripts/oe-setup-builddir</filename> script in the
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
You can find the Yocto Project version of the
<filename>bblayers.conf.sample</filename> file in the
<filename>meta-yocto/conf</filename> directory.
You can find the Yocto Project version of the
<filename>bblayers.conf.sample</filename> file in the
<filename>/meta-yocto/conf</filename> directory.
</note>
</para>
</section>
@@ -488,7 +491,7 @@
<title><filename>build/tmp/</filename></title>
<para>
This directory receives all of the OpenEmbedded build system's output.
This directory receives all the OpenEmbedded build system's output.
BitBake creates this directory if it does not exist.
As a last resort, to clean up a build and start it from scratch (other than the downloads),
you can remove everything in the <filename>tmp</filename> directory or get rid of the
@@ -552,15 +555,6 @@
</para>
</section>
<section id='structure-build-tmp-deploy-ipk'>
<title><filename>build/tmp/deploy/ipk/</filename></title>
<para>
This directory receives <filename>.ipk</filename> packages produced by
the build process.
</para>
</section>
<section id='structure-build-tmp-deploy-licenses'>
<title><filename>build/tmp/deploy/licenses/</filename></title>
@@ -607,6 +601,14 @@
</para>
</section>
<section id='structure-build-tmp-deploy-ipk'>
<title><filename>build/tmp/deploy/ipk/</filename></title>
<para>
This directory receives <filename>.ipk</filename> packages produced by
the build process.</para>
</section>
<section id='structure-build-tmp-sysroots'>
<title><filename>build/tmp/sysroots/</filename></title>
@@ -648,6 +650,15 @@
</para>
</section>
<section id='structure-build-tmp-pkgdata'>
<title><filename>build/tmp/pkgdata/</filename></title>
<para>
This directory contains intermediate packaging data that is used later in the packaging process.
For more information, see the "<link linkend='ref-classes-package'>Packaging - package*.bbclass</link>" section.
</para>
</section>
<section id='structure-build-tmp-work'>
<title><filename>build/tmp/work/</filename></title>
@@ -779,7 +790,7 @@
This directory contains common license files and several text files
used by the build system.
The text files contain minimal device information and
lists of files and directories with known permissions.
lists of files and directories with knows permissions.
</para>
</section>

File diff suppressed because it is too large Load Diff

View File

@@ -60,10 +60,9 @@
and is responsible for parsing the
<ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>,
generating a list of tasks from it, and then executing those tasks.
To see a list of the options BitBake supports, use either of
the following commands:
To see a list of the options BitBake supports, use the following
help command:
<literallayout class='monospaced'>
$ bitbake -h
$ bitbake --help
</literallayout>
</para>
@@ -73,7 +72,7 @@
<filename>packagename</filename> is the name of the package you want to build
(referred to as the "target" in this manual).
The target often equates to the first part of a <filename>.bb</filename> filename.
So, to process the <filename>matchbox-desktop_1.2.3.bb</filename> recipe file, you
So, to run the <filename>matchbox-desktop_1.2.3.bb</filename> file, you
might type the following:
<literallayout class='monospaced'>
$ bitbake matchbox-desktop
@@ -112,15 +111,14 @@
<para>
The <filename>.bb</filename> files are usually referred to as "recipes."
In general, a recipe contains information about a single piece of software.
This information includes the location from which to download the
unaltered source, any source patches to be applied to that source
(if needed), which special configuration options to apply,
The information includes the location from which to download the source patches
(if any are needed), which special configuration options to apply,
how to compile the source files, and how to package the compiled output.
</para>
<para>
The term "package" is sometimes used to refer to recipes. However,
since the word "package" is used for the packaged output from the OpenEmbedded
The term "package" can also be used to describe recipes.
However, since the same word is used for the packaged output from the OpenEmbedded
build system (i.e. <filename>.ipk</filename> or <filename>.deb</filename> files),
this document avoids using the term "package" when referring to recipes.
</para>
@@ -164,7 +162,7 @@
<ulink url='&YOCTO_DOCS_DEV_URL;#cross-development-toolchain'>cross-development toolchains</ulink>.
This section provides some technical background information on how
cross-development toolchains are created and used.
For more information on toolchains, you can also see the
For more information on these toolchain, you can also see the
<ulink url='&YOCTO_DOCS_ADT_URL;'>the Yocto Project Application Developer's Guide</ulink>.
</para>
@@ -349,7 +347,7 @@
As mentioned in the previous paragraph, building from scratch ensures that
everything is current and starts from a known state.
However, building from scratch also takes much longer as it generally means
rebuilding things that do not necessarily need to be rebuilt.
rebuilding things that do not necessarily need rebuilt.
</para>
<para>
@@ -357,11 +355,10 @@
The implementation of the shared state code answers the following questions that
were fundamental roadblocks within the OpenEmbedded incremental build support system:
<itemizedlist>
<listitem><para>What pieces of the system have changed and what pieces have
not changed?</para></listitem>
<listitem><para>How are changed pieces of software removed and replaced?</para></listitem>
<listitem><para>How are pre-built components that do not need to be rebuilt from scratch
used when they are available?</para></listitem>
<listitem>What pieces of the system have changed and what pieces have not changed?</listitem>
<listitem>How are changed pieces of software removed and replaced?</listitem>
<listitem>How are pre-built components that do not need to be rebuilt from scratch
used when they are available?</listitem>
</itemizedlist>
</para>
@@ -400,16 +397,16 @@
<para>
When determining what parts of the system need to be built, BitBake
works on a per-task basis rather than a per-recipe basis.
uses a per-task basis and does not use a per-recipe basis.
You might wonder why using a per-task basis is preferred over a per-recipe basis.
To help explain, consider having the IPK packaging backend enabled and then switching to DEB.
In this case, <filename>do_install</filename> and <filename>do_package</filename>
outputs are still valid.
output are still valid.
However, with a per-recipe approach, the build would not include the
<filename>.deb</filename> files.
Consequently, you would have to invalidate the whole build and rerun it.
Rerunning everything is not the best solution.
Also, in this case, the core must be "taught" much about specific tasks.
Rerunning everything is not the best situation.
Also in this case, the core must be "taught" much about specific tasks.
This methodology does not scale well and does not allow users to easily add new tasks
in layers or as external recipes without touching the packaged-staging core.
</para>
@@ -434,11 +431,11 @@
the checksum.
First, there is the actual specific build path of a given task -
the <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>.
It does not matter if the work directory changes because it should not
It does not matter if the working directory changes because it should not
affect the output for target packages.
Also, the build process has the objective of making native or cross packages relocatable.
The checksum therefore needs to exclude <filename>WORKDIR</filename>.
The simplistic approach for excluding the work directory is to set
The simplistic approach for excluding the working directory is to set
<filename>WORKDIR</filename> to some fixed value and create the checksum
for the "run" script.
</para>
@@ -515,18 +512,17 @@
dependent task hashes can be influenced.
Within the BitBake configuration file, we can give BitBake some extra information
to help it construct the basehash.
The following statement effectively results in a list of global variable
The following statements effectively result in a list of global variable
dependency excludes - variables never included in any checksum:
<literallayout class='monospaced'>
BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \
SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE LICENSE_PATH SDKPKGSUFFIX"
BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH"
BB_HASHBASE_WHITELIST += "DL_DIR SSTATE_DIR THISDIR FILESEXTRAPATHS"
BB_HASHBASE_WHITELIST += "FILE_DIRNAME HOME LOGNAME SHELL TERM USER"
BB_HASHBASE_WHITELIST += "FILESPATH USERNAME STAGING_DIR_HOST STAGING_DIR_TARGET"
</literallayout>
The previous example excludes
The previous example actually excludes
<link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
since that variable is actually constructed as a path within
since it is actually constructed as a path within
<link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>, which is on
the whitelist.
</para>
@@ -545,7 +541,7 @@
<filename>OE-Core</filename> uses the "OEBasicHash" signature handler by default
through this setting in the <filename>bitbake.conf</filename> file:
<literallayout class='monospaced'>
BB_SIGNATURE_HANDLER ?= "OEBasicHash"
BB_SIGNATURE_HANDLER ?= "OEBasicHash"
</literallayout>
The "OEBasicHash" <filename>BB_SIGNATURE_HANDLER</filename> is the same as the
"OEBasic" version but adds the task hash to the stamp files.
@@ -554,7 +550,7 @@
change that changes the task hash, automatically
causing the task to be run again.
This removes the need to bump <link linkend='var-PR'><filename>PR</filename></link>
values, and changes to Metadata automatically ripple across the build.
values and changes to Metadata automatically ripple across the build.
</para>
<para>
@@ -562,10 +558,10 @@
make some dependency and hash information available to the build.
This information includes:
<literallayout class='monospaced'>
BB_BASEHASH_task-&lt;taskname&gt; - the base hashes for each task in the recipe
BB_BASEHASH_&lt;filename:taskname&gt; - the base hashes for each dependent task
BBHASHDEPS_&lt;filename:taskname&gt; - The task dependencies for each task
BB_TASKHASH - the hash of the currently running task
BB_BASEHASH_task-&lt;taskname&gt; - the base hashes for each task in the recipe
BB_BASEHASH_&lt;filename:taskname&gt; - the base hashes for each dependent task
BBHASHDEPS_&lt;filename:taskname&gt; - The task dependencies for each task
BB_TASKHASH - the hash of the currently running task
</literallayout>
</para>
</section>
@@ -575,7 +571,7 @@
<para>
Checksums and dependencies, as discussed in the previous section, solve half the
problem of supporting a shared state.
problem.
The other part of the problem is being able to use checksum information during the build
and being able to reuse or rebuild specific components.
</para>
@@ -585,7 +581,7 @@
is a relatively generic implementation of how to "capture" a snapshot of a given task.
The idea is that the build process does not care about the source of a task's output.
Output could be freshly built or it could be downloaded and unpacked from
somewhere - the build process does not need to worry about its origin.
somewhere - the build process does not need to worry about its source.
</para>
<para>
@@ -602,7 +598,7 @@
<filename>sstate.bbclass</filename>.
From a user's perspective, adding shared state wrapping to a task
is as simple as this <filename>do_deploy</filename> example taken from
<filename>deploy.bbclass</filename>:
<filename>do_deploy.bbclass</filename>:
<literallayout class='monospaced'>
DEPLOYDIR = "${WORKDIR}/deploy-${PN}"
SSTATETASKS += "do_deploy"
@@ -614,9 +610,8 @@
sstate_setscene(d)
}
addtask do_deploy_setscene
do_deploy[dirs] = "${DEPLOYDIR} ${B}"
</literallayout>
In this example, we add some extra flags to the task, a name field ("deploy"), an
In the example, we add some extra flags to the task, a name field ("deploy"), an
input directory where the task sends data, and the output
directory where the data from the task should eventually be copied.
We also add a <filename>_setscene</filename> variant of the task and add the task
@@ -735,61 +730,43 @@
<title>Invalidating Shared State</title>
<para>
The OpenEmbedded build system uses checksums and shared state
The shared state code uses checksums and shared state
cache to avoid unnecessarily rebuilding tasks.
Collectively, this scheme is known as "shared state code."
</para>
<para>
As with all schemes, this one has some drawbacks.
It is possible that you could make implicit changes to your
code that the checksum calculations do not take into
account (i.e. implicit changes).
These implicit changes affect a task's output but do not trigger
the shared state code into rebuilding a recipe.
Consider an example during which a tool changes its output.
Assume that the output of <filename>rpmdeps</filename> changes.
It is possible that you could make implicit changes that are not factored
into the checksum calculation, but do affect a task's output.
A good example is perhaps when a tool changes its output.
Assume that the output of <filename>rpmdeps</filename> needed to change.
The result of the change should be that all the
<filename>package</filename> and
<filename>package_write_rpm</filename> shared state cache
items become invalid.
However, because the change to the output is
external to the code and therefore implicit,
the associated shared state cache items do not become
invalidated.
In this case, the build process uses the cached items rather
than running the task again.
<filename>package</filename>, <filename>package_write_rpm</filename>,
and <filename>package_deploy-rpm</filename> shared state cache
items would become invalid.
But, because this is a change that is external to the code and therefore implicit,
the associated shared state cache items do not become invalidated.
In this case, the build process uses the cached items rather than running the
task again.
Obviously, these types of implicit changes can cause problems.
</para>
<para>
To avoid these problems during the build, you need to
understand the effects of any changes you make.
Realize that changes you make directly to a function
are automatically factored into the checksum calculation.
Thus, these explicit changes invalidate the associated area of
sstate cache.
However, you need to be aware of any implicit changes that
are not obvious changes to the code and could affect the output
of a given task.
</para>
<para>
When you identify an implicit change, you can easily take steps
to invalidate the cache and force the tasks to run.
The steps you can take are as simple as changing a function's
comments in the source code.
For example, to invalidate package shared state files, change
the comment statements of <filename>do_package</filename> or
the comments of one of the functions it calls.
Even though the change is purely cosmetic, it causes the
checksum to be recalculated and forces the OpenEmbedded build
system to run the task again.
To avoid these problems during the build, you need to understand the effects of any
change you make.
Note that any changes you make directly to a function automatically are factored into
the checksum calculation and thus, will invalidate the associated area of sstate cache.
You need to be aware of any implicit changes that are not obvious changes to the
code and could affect the output of a given task.
Once you are aware of such changes, you can take steps to invalidate the cache
and force the tasks to run.
The steps to take are as simple as changing function's comments in the source code.
For example, to invalidate package shared state files, change the comment statements
of <filename>do_package</filename> or the comments of one of the functions it calls.
The change is purely cosmetic, but it causes the checksum to be recalculated and
forces the task to be run again.
</para>
<note>
For an example of a commit that makes a cosmetic change to
invalidate shared state, see this
For an example of a commit that makes a cosmetic change to invalidate
a shared state, see this
<ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/commit/meta/classes/package.bbclass?id=737f8bbb4f27b4837047cb9b4fbfe01dfde36d54'>commit</ulink>.
</note>
</section>
@@ -891,7 +868,7 @@
<para>
<ulink url='http://en.wikipedia.org/wiki/Wayland_(display_server_protocol)#Weston'>Wayland</ulink>
is a computer display server protocol that
is a computer display server protocol that when implemented
provides a method for compositing window managers to communicate
directly with applications and video hardware and expects them to
communicate with input hardware using other libraries.
@@ -902,7 +879,7 @@
<para>
The Yocto Project provides the Wayland protocol libraries and the
reference Weston compositor as part of its release.
reference Weston compositor as part of it release.
This section describes what you need to do to implement Wayland and
use the compositor when building an image for a supporting target.
</para>
@@ -997,7 +974,7 @@
<para>
Alternatively, you can run Weston through the command-line
interpretor (CLI), which is better suited for development work.
To run Weston under the CLI, you need to do the following after
To run Weston under the CLI you need to do the following after
your image is built:
<orderedlist>
<listitem><para>Run these commands to export
@@ -1149,7 +1126,7 @@
recipe-by-recipe basis through the <filename>LICENSE_FLAGS</filename> variable
definition in the affected recipe.
For instance, the
<filename>poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly</filename>
<filename>$HOME/poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly</filename>
recipe contains the following statement:
<literallayout class='monospaced'>
LICENSE_FLAGS = "commercial"
@@ -1165,7 +1142,7 @@
<filename>LICENSE_FLAGS_WHITELIST</filename> variable, which is a variable
typically defined in your <filename>local.conf</filename> file.
For example, to enable
the <filename>poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly</filename>
the <filename>$HOME/poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly</filename>
package, you could add either the string
"commercial_gst-plugins-ugly" or the more general string
"commercial" to <filename>LICENSE_FLAGS_WHITELIST</filename>.
@@ -1186,7 +1163,7 @@
</literallayout>
As a convenience, you do not need to specify the complete license string
in the whitelist for every package.
You can use an abbreviated form, which consists
you can use an abbreviated form, which consists
of just the first portion or portions of the license string before
the initial underscore character or characters.
A partial string will match
@@ -1208,10 +1185,10 @@
License flag matching allows you to control what recipes the
OpenEmbedded build system includes in the build.
Fundamentally, the build system attempts to match
<filename>LICENSE_FLAGS</filename> strings found in
<filename>LICENSE_FLAG</filename> strings found in
recipes against <filename>LICENSE_FLAGS_WHITELIST</filename>
strings found in the whitelist.
A match causes the build system to include a recipe in the
A match, causes the build system to include a recipe in the
build, while failure to find a match causes the build system to
exclude a recipe.
</para>
@@ -1272,7 +1249,7 @@
<para>
This scheme works even if the
<filename>LICENSE_FLAGS</filename> string already
<filename>LICENSE_FLAG</filename> string already
has <filename>_${PN}</filename> appended.
For example, the build system turns the license flag
"commercial_1.2_foo" into "commercial_1.2_foo_foo" and would
@@ -1312,7 +1289,7 @@
<para>
Other helpful variables related to commercial
license handling exist and are defined in the
<filename>poky/meta/conf/distro/include/default-distrovars.inc</filename> file:
<filename>$HOME/poky/meta/conf/distro/include/default-distrovars.inc</filename> file:
<literallayout class='monospaced'>
COMMERCIAL_AUDIO_PLUGINS ?= ""
COMMERCIAL_VIDEO_PLUGINS ?= ""

View File

@@ -40,7 +40,7 @@
</para>
<para>
The <filename>build_dir</filename> argument is optional and specifies the directory the
The <filename>build_dir</filename> is optional and specifies the directory the
OpenEmbedded build system uses for the build -
the <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
If you do not specify a Build Directory, it defaults to a directory
@@ -62,7 +62,7 @@
<para>
The <filename>target</filename> is the name of the recipe you want to build.
Common targets are the images in <filename>meta/recipes-core/images</filename>,
<filename>meta/recipes-sato/images</filename>, etc. all found in the
<filename>/meta/recipes-sato/images</filename>, etc. all found in the
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
Or, the target can be the name of a recipe for a specific piece of software such as
BusyBox.
@@ -72,7 +72,7 @@
<note>
Building an image without GNU General Public License Version 3 (GPLv3) components
is supported for only minimal and base images.
is only supported for minimal and base images.
See the "<link linkend='ref-images'>Images</link>" chapter for more information.
</note>
</section>
@@ -158,7 +158,7 @@
<filename>package_write</filename>, and <filename>build</filename>.
The default task is <filename>build</filename> and any tasks on which it depends
build first.
Some tasks, such as <filename>devshell</filename>, are not part of the
Some tasks exist, such as <filename>devshell</filename>, that are not part of the
default build chain.
If you wish to run a task that is not part of the default build chain, you can use the
<filename>-c</filename> option in BitBake.
@@ -169,15 +169,14 @@
</para>
<para>
If you wish to rerun a task, use the <filename>-f</filename> force
option.
For example, the following sequence forces recompilation after
changing files in the work directory.
If you wish to rerun a task, use the <filename>-f</filename> force option.
For example, the following sequence forces recompilation after changing files in the
working directory.
<literallayout class='monospaced'>
$ bitbake matchbox-desktop
.
.
[make some changes to the source code in the work directory]
[make some changes to the source code in the working directory]
.
.
$ bitbake matchbox-desktop -c compile -f
@@ -207,19 +206,14 @@
<title>Dependency Graphs</title>
<para>
Sometimes it can be hard to see why BitBake wants to build
other packages before building a given package you have specified.
The <filename>bitbake -g &lt;targetname&gt;</filename> command
creates the <filename>pn-buildlist</filename>,
<filename>pn-depends.dot</filename>,
<filename>package-depends.dot</filename>, and
<filename>task-depends.dot</filename> files in the current
directory.
These files show what will be built and the package and task
dependencies, which are useful for debugging problems.
You can use the
<filename>bitbake -g -u depexp &lt;targetname&gt;</filename>
command to display the results in a more human-readable form.
Sometimes it can be hard to see why BitBake wants to build some other packages before a given
package you have specified.
The <filename>bitbake -g targetname</filename> command creates the
<filename>depends.dot</filename>, <filename>package-depends.dot</filename>,
and <filename>task-depends.dot</filename> files in the current directory.
These files show the package and task dependencies and are useful for debugging problems.
You can use the <filename>bitbake -g -u depexp targetname</filename> command to
display the results in a more human-readable form.
</para>
</section>
@@ -277,18 +271,12 @@
<section id='usingpoky-debugging-buildfile'>
<title>Building with No Dependencies</title>
<para>
To build a specific recipe (<filename>.bb</filename> file),
you can use the following command form:
<literallayout class='monospaced'>
$ bitbake -b &lt;somepath/somerecipe.bb&gt;
</literallayout>
This command form does not check for dependencies.
Consequently, you should use it
only when you know dependencies already exist.
<note>
You can also specify fragments of the filename.
In this case, BitBake checks for a unique match.
</note>
If you really want to build a specific <filename>.bb</filename> file, you can use
the command form <filename>bitbake -b &lt;somepath/somefile.bb&gt;</filename>.
This command form does not check for dependencies so you should use it
only when you know its dependencies already exist.
You can also specify fragments of the filename.
In this case, BitBake checks for a unique match.
</para>
</section>
@@ -296,16 +284,11 @@
<title>Variables</title>
<para>
You can use the <filename>-e</filename> BitBake option to
display the parsing environment for a configuration.
The following displays the general parsing environment:
<literallayout class='monospaced'>
$ bitbake -e
</literallayout>
This next example shows the parsing environment for a specific
recipe:
<literallayout class='monospaced'>
$ bitbake -e &lt;recipename&gt;
</literallayout>
display the resulting environment for a configuration
when you do not specify a package or for a specific package when
you do specify the package.
If you want to show the environment resulting from parsing a single
recipe, use the <filename>-b recipename</filename> form.
</para>
</section>
@@ -496,11 +479,11 @@
from your <filename>conf/local.conf</filename> file.
However, you should realize that enabling and disabling
build history in this manner can change the
<filename>do_package</filename> task checksums which, if you
<filename>do_package</filename> task checksums, which if you
are using the OEBasicHash signature generator (the default
for many current distro configurations including
<filename>DISTRO = "poky"</filename> and
<filename>DISTRO = ""</filename>) will result in the packaging
<filename>DISTRO = ""</filename>) and will result in the packaging
tasks being re-run during the subsequent build.
</para>

View File

@@ -1,13 +1,13 @@
# Processes ref-manual and yocto-project-qs manual (<word>-<word>-<word> style)
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5.1\/[a-z]*-[a-z]*-[a-z]*\/[a-z]*-[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5\/[a-z]*-[a-z]*-[a-z]*\/[a-z]*-[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
# Processes all other manuals (<word>-<word> style)
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5.1\/[a-z]*-[a-z]*\/[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5\/[a-z]*-[a-z]*\/[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
# Process cases where just an external manual is referenced without an id anchor
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5.1\/yocto-project-qs\/yocto-project-qs.html\" target=\"_top\">Yocto Project Quick Start<\/a>/Yocto Project Quick Start/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5.1\/dev-manual\/dev-manual.html\" target=\"_top\">Yocto Project Development Manual<\/a>/Yocto Project Development Manual/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5.1\/adt-manual\/adt-manual.html\" target=\"_top\">Yocto Project Application Developer's Guide<\/a>/Yocto Project Application Developer's Guide/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5.1\/bsp-guide\/bsp-guide.html\" target=\"_top\">Yocto Project Board Support Package (BSP) Developer's Guide<\/a>/Yocto Project Board Support Package (BSP) Developer's Guide/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5.1\/kernel-dev\/kernel-dev.html\" target=\"_top\">Yocto Project Linux Kernel Development Manual<\/a>/Yocto Project Linux Kernel Development Manual/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5.1\/ref-manual\/ref-manual.html\" target=\"_top\">Yocto Project Reference Manual<\/a>/Yocto Project Reference Manual/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5\/yocto-project-qs\/yocto-project-qs.html\" target=\"_top\">Yocto Project Quick Start<\/a>/Yocto Project Quick Start/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5\/dev-manual\/dev-manual.html\" target=\"_top\">Yocto Project Development Manual<\/a>/Yocto Project Development Manual/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5\/adt-manual\/adt-manual.html\" target=\"_top\">Yocto Project Application Developer's Guide<\/a>/Yocto Project Application Developer's Guide/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5\/bsp-guide\/bsp-guide.html\" target=\"_top\">Yocto Project Board Support Package (BSP) Developer's Guide<\/a>/Yocto Project Board Support Package (BSP) Developer's Guide/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5\/kernel-dev\/kernel-dev.html\" target=\"_top\">Yocto Project Linux Kernel Development Manual<\/a>/Yocto Project Linux Kernel Development Manual/g
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.5\/ref-manual\/ref-manual.html\" target=\"_top\">Yocto Project Reference Manual<\/a>/Yocto Project Reference Manual/g

View File

@@ -17,10 +17,11 @@
the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
</para>
<note>
For the latest version of this manual associated with this
Yocto Project release, see the
<ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>
from the Yocto Project website.
Due to production processes, there could be differences between the Yocto Project
documentation bundled in the release tarball and the
<ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink> on
the <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website.
For the latest version of this manual, see the manual on the website.
</note>
</legalnotice>
@@ -231,6 +232,11 @@
distributions listed in the
"<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
section of the Yocto Project Reference Manual.
Refer to
<ulink url='&OE_HOME_URL;/index.php?title=OEandYourDistro'>OE and Your Distro</ulink> and
<ulink url='&OE_HOME_URL;/index.php?title=Required_software'>Required Software</ulink>
for information for information about dependencies and
requirements.
If you encounter problems, please go to
<ulink url='&YOCTO_BUGZILLA_URL;'>Yocto Project Bugzilla</ulink>
and submit a bug.
@@ -585,7 +591,7 @@
</para>
<literallayout class='monospaced'>
poky-eglibc-&lt;<emphasis>host_system</emphasis>&gt;-&lt;<emphasis>image_type</emphasis>&gt;-&lt;<emphasis>arch</emphasis>&gt;-toolchain-&lt;<emphasis>release_version</emphasis>&gt;.sh
poky-eglibc-&lt;<emphasis>host_system</emphasis>&gt;-&lt;<emphasis>image_type</emphasis>&gt;-&lt;<emphasis>arch</emphasis>&gt;-&lt;<emphasis>release_version</emphasis>&gt;.sh
Where:
&lt;<emphasis>host_system</emphasis>&gt; is a string representing your development system:
@@ -614,7 +620,7 @@
development host system and a i586-tuned target architecture
based off the SDK for <filename>core-image-sato</filename>:
<literallayout class='monospaced'>
poky-eglibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
poky-eglibc-x86_64-core-image-sato-i586-&DISTRO;.sh
</literallayout>
</para>
@@ -643,7 +649,7 @@
<para>
<literallayout class='monospaced'>
$ ~/Downloads/poky-eglibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
$ ~/Downloads/poky-eglibc-x86_64-core-image-sato-i586-&DISTRO;.sh
</literallayout>
</para>
@@ -716,6 +722,11 @@
&lt;<emphasis>arch</emphasis>&gt; is a string representing the target architecture:
x86, x86-64, ppc, mips, or arm.
</literallayout>
<note>
For the <filename>qemu</filename> architecture,
<filename>ext3</filename> and <filename>tar</filename>
files start with the "lib32" string.
</note>
</para>
</section>

View File

@@ -7,11 +7,11 @@ KBRANCH_beagleboard = "standard/beagleboard"
KMACHINE_genericx86 ?= "common-pc"
KMACHINE_genericx86-64 ?= "common-pc-64"
SRCREV_machine_genericx86 ?= "c03195ed6e3066494e3fb4be69154a57066e845b"
SRCREV_machine_genericx86-64 ?= "c03195ed6e3066494e3fb4be69154a57066e845b"
SRCREV_machine_routerstationpro ?= "2d91e201018c15e24fb83336dcb4029b8569eb9d"
SRCREV_machine_mpc8315e-rdb ?= "ac071526ffac37c907532933b628e4f64070f155"
SRCREV_machine_beagleboard ?= "3d9b0d130a00dd32e6061ac708eaaaed69e35c3d"
SRCREV_machine_genericx86 ?= "702040ac7c7ec66a29b4d147665ccdd0ff015577"
SRCREV_machine_genericx86-64 ?= "702040ac7c7ec66a29b4d147665ccdd0ff015577"
SRCREV_machine_routerstationpro ?= "d4e6adefaf92a1e7b6539d371ba49b78bd194a84"
SRCREV_machine_mpc8315e-rdb ?= "12dc46ba4efb80e135fec4dce913eeb87ee671b3"
SRCREV_machine_beagleboard ?= "702040ac7c7ec66a29b4d147665ccdd0ff015577"
COMPATIBLE_MACHINE_genericx86 = "genericx86"
COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"

View File

@@ -216,7 +216,7 @@ REGEX_URI_pn-psmisc = "http://sourceforge.net/projects/psmisc/files/psmisc/"
REGEX_pn-psmisc = "[hH][rR][eE][fF]=\"http://sourceforge.net/projects/psmisc/files/psmisc/psmisc\-(?P<pver>((\d+[\.\-_]*)+))\.tar\.gz/download\""
REGEX_URI_pn-python-argparse = "https://code.google.com/p/argparse/downloads/list"
REGEX_URI_pn-python-docutils = "http://sourceforge.net/projects/docutils/files/docutils/"
REGEX_pn-python-docutils = "[hH][rR][eE][fF]=\"/projects/docutils/files/docutils/(?P<pver>((\d+[\.\-_]*)+)).*/\""
REGEX_pn-python-docutils = "[hH][rR][eE][fF]=\"/projects/docutils/files/docutils/docutils\-(?P<pver>((\d+[\.\-_]*)+)).*/\""
REGEX_URI_pn-python-pycurl = "http://pycurl.sourceforge.net/download/"
REGEX_pn-python-pycurl = "[hH][rR][eE][fF]=\"pycurl-(?P<pver>((\d+[\.\-_]*)+)).tar.gz\""
REGEX_URI_pn-python-scons = "http://sourceforge.net/projects/scons/files/scons/"

View File

@@ -1,6 +1,6 @@
DISTRO = "poky"
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
DISTRO_VERSION = "1.5.1"
DISTRO_VERSION = "1.5"
DISTRO_CODENAME = "next"
SDK_VENDOR = "-pokysdk"
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"

View File

@@ -210,7 +210,7 @@ def preferred_ml_updates(d):
virt = "virtual/"
for p in prefixes:
if pkg != "kernel":
newval = p + "-" + val
val = p + "-" + val
# implement variable keys
localdata = bb.data.createCopy(d)
@@ -219,12 +219,12 @@ def preferred_ml_updates(d):
bb.data.update_data(localdata)
newname = localdata.expand(prov)
if newname != prov and not d.getVar(newname, False):
d.setVar(newname, localdata.expand(newval))
d.setVar(newname, localdata.expand(val))
# implement alternative multilib name
newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg)
if not d.getVar(newname, False):
d.setVar(newname, newval)
d.setVar(newname, val)
# Avoid future variable key expansion
provexp = d.expand(prov)
if prov != provexp and d.getVar(prov, False):
@@ -433,7 +433,7 @@ python () {
extradeps = []
extrardeps = []
extraconf = []
for flag, flagval in sorted(pkgconfigflags.items()):
for flag, flagval in pkgconfigflags.items():
if flag == "defaultval":
continue
items = flagval.split(",")

View File

@@ -15,30 +15,12 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S
# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
#
PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
CANADIANEXTRAOS = ""
python () {
archs = d.getVar('PACKAGE_ARCHS', True).split()
sdkarchs = []
for arch in archs:
sdkarchs.append(arch + '-${SDKPKGSUFFIX}')
d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs))
# PowerPC can build "linux" and "linux-gnuspe"
tarch = d.getVar("TARGET_ARCH", True)
if tarch == "powerpc":
tos = d.getVar("TARGET_OS", True)
if (tos != "linux" and tos != "linux-gnuspe"):
bb.fatal("Building cross-candian powerpc for an unknown TARGET_SYS (%s), please update cross-canadian.bbclass" % d.getVar("TARGET_SYS", True))
# Have to expand DEPENDS before we change the extensions
d.setVar("DEPENDS", d.getVar("DEPENDS", True))
d.setVar("STAGING_BINDIR_TOOLCHAIN", d.getVar("STAGING_BINDIR_TOOLCHAIN", True))
for prefix in ["AR", "AS", "DLLTOOL", "CC", "CXX", "GCC", "LD", "LIPO", "NM", "OBJDUMP", "RANLIB", "STRIP", "WINDRES"]:
n = prefix + "_FOR_TARGET"
d.setVar(n, d.getVar(n, True))
d.setVar("LIBCEXTENSION", "")
d.setVar("ABIEXTENSION", "")
d.setVar("CANADIANEXTRAOS", "linux-gnuspe")
}
MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
@@ -113,21 +95,3 @@ USE_NLS = "${SDKUSE_NLS}"
# We have to us TARGET_ARCH but we care about the absolute value
# and not any particular tune that is enabled.
TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
# If MLPREFIX is set by multilib code, shlibs
# points to the wrong place so force it
SHLIBSDIRS = "${PKGDATA_DIR}/nativesdk-shlibs"
SHLIBSWORKDIR = "${PKGDATA_DIR}/nativesdk-shlibs"
cross_canadian_bindirlinks () {
for i in ${CANADIANEXTRAOS}
do
d=${D}${bindir}/../${TARGET_ARCH}${TARGET_VENDOR}-$i
install -d $d
for j in `ls ${D}${bindir}`
do
p=${TARGET_ARCH}${TARGET_VENDOR}-$i-`echo $j | sed -e s,${TARGET_PREFIX},,`
ln -s ../${TARGET_SYS}/$j $d/$p
done
done
}

View File

@@ -54,10 +54,6 @@ set_user_group () {
bbfatal "Invalid command in EXTRA_USERS_PARAMS: $cmd"
;;
esac
# Avoid infinite loop if the last parameter doesn't end with ';'
if [ "$setting" = "$remaining" ]; then
break
fi
# iterate to the next setting
setting=`echo $remaining | cut -d ';' -f1`
remaining=`echo $remaining | cut -d ';' -f2-`

View File

@@ -16,7 +16,6 @@
# ${GRUB_TIMEOUT} - timeout before executing the deault label (optional)
do_bootimg[depends] += "grub-efi-${TRANSLATED_TARGET_ARCH}-native:do_deploy"
do_bootdirectdisk[depends] += "grub-efi-${TRANSLATED_TARGET_ARCH}-native:do_deploy"
GRUB_SERIAL ?= "console=ttyS0,115200"
GRUBCFG = "${S}/grub.cfg"
@@ -49,7 +48,7 @@ grubefi_iso_populate() {
mkdir -p ${EFIIMGDIR}/${EFIDIR}
cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
cp $iso_dir/vmlinuz ${EFIIMGDIR}
echo "${GRUB_IMAGE}" > ${EFIIMGDIR}/startup.nsh
echo "EFI\\BOOT\\${GRUB_IMAGE}" > ${EFIIMGDIR}/startup.nsh
if [ -f "$iso_dir/initrd" ] ; then
cp $iso_dir/initrd ${EFIIMGDIR}
fi

View File

@@ -9,7 +9,7 @@ mklibs_optimize_image_doit() {
du -bs > ${WORKDIR}/mklibs/du.before.mklibs.txt
for i in `find .`; do file $i; done \
| grep ELF \
| grep "LSB *executable" \
| grep "LSB executable" \
| grep "dynamically linked" \
| sed "s/:.*//" \
| sed "s+^\./++" \
@@ -40,7 +40,6 @@ mklibs_optimize_image_doit() {
--ldlib ${dynamic_loader} \
--libdir ${baselib} \
--sysroot ${PKG_CONFIG_SYSROOT_DIR} \
--gcc-options "--sysroot=${PKG_CONFIG_SYSROOT_DIR}" \
--root ${IMAGE_ROOTFS} \
--target `echo ${TARGET_PREFIX} | sed 's/-$//' ` \
-d ${WORKDIR}/mklibs/dest \

View File

@@ -161,7 +161,6 @@ IMAGE_CMD_ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}"
IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}"
IMAGE_CMD_btrfs () {
touch ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs
mkfs.btrfs -b `expr ${ROOTFS_SIZE} \* 1024` ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs
}

View File

@@ -298,7 +298,7 @@ do_validate_branches() {
set +e
# if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to
# check and we can exit early
if [ "${SRCREV_machine}" = "AUTOINC" ] || [ "${SRCREV_machine}" = "INVALID" ] ||
if [ "${SRCREV_machine}" = "AUTOINC" ] || "${SRCREV_machine}" = "INVALID" ] ||
[ "${SRCREV_machine}" = "" ]; then
return
fi

View File

@@ -147,12 +147,7 @@ do_bundle_initramfs () {
fi
}
do_bundle_initramfs[nostamp] = "1"
python do_devshell_prepend () {
os.environ["LDFLAGS"] = ''
}
addtask bundle_initramfs after do_kernel_link_vmlinux before do_build
addtask bundle_initramfs after do_compile
kernel_do_compile() {
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE

View File

@@ -96,14 +96,14 @@ do_prep_locale_tree() {
treedir=${WORKDIR}/locale-tree
rm -rf $treedir
mkdir -p $treedir/${base_bindir} $treedir/${base_libdir} $treedir/${datadir} $treedir/${localedir}
tar -cf - -C ${LOCALETREESRC}${datadir} -p i18n | tar -xf - -C $treedir/${datadir}
tar -cf - -C ${LOCALETREESRC}${datadir} -ps i18n | tar -xf - -C $treedir/${datadir}
# unzip to avoid parsing errors
for i in $treedir/${datadir}/i18n/charmaps/*gz; do
gunzip $i
done
tar -cf - -C ${LOCALETREESRC}${base_libdir} -p . | tar -xf - -C $treedir/${base_libdir}
tar -cf - -C ${LOCALETREESRC}${base_libdir} -ps . | tar -xf - -C $treedir/${base_libdir}
if [ -f ${STAGING_DIR_NATIVE}${prefix_native}/lib/libgcc_s.* ]; then
tar -cf - -C ${STAGING_DIR_NATIVE}/${prefix_native}/${base_libdir} -p libgcc_s.* | tar -xf - -C $treedir/${base_libdir}
tar -cf - -C ${STAGING_DIR_NATIVE}/${prefix_native}/${base_libdir} -ps libgcc_s.* | tar -xf - -C $treedir/${base_libdir}
fi
install -m 0755 ${LOCALETREESRC}${bindir}/localedef $treedir/${base_bindir}
}
@@ -113,7 +113,7 @@ do_collect_bins_from_locale_tree() {
parent=$(dirname ${localedir})
mkdir -p ${PKGD}/$parent
tar -cf - -C $treedir/$parent -p $(basename ${localedir}) | tar -xf - -C ${PKGD}$parent
tar -cf - -C $treedir/$parent -ps $(basename ${localedir}) | tar -xf - -C ${PKGD}$parent
}
inherit qemu

View File

@@ -72,9 +72,9 @@ license_create_manifest() {
# Really don't need to copy the generics as they're
# represented in the manifest and in the actual pkg licenses
# Doing so would make your image quite a bit larger
if [ "${lic#generic_}" = "${lic}" ]; then
if [[ "${lic}" != "generic_"* ]]; then
cp ${LICENSE_DIRECTORY}/${pkg}/${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}/${lic}
else
elif [[ "${lic}" == "generic_"* ]]; then
if [ ! -f ${IMAGE_ROOTFS}/usr/share/common-licenses/${lic} ]; then
cp ${LICENSE_DIRECTORY}/${pkg}/${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/
fi

View File

@@ -59,7 +59,7 @@ export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
python nativesdk_virtclass_handler () {
pn = e.data.getVar("PN", True)
if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
if not pn.endswith("-nativesdk") or pn.startswith("nativesdk-"):
return
e.data.setVar("MLPREFIX", "nativesdk-")

View File

@@ -458,7 +458,7 @@ python perform_packagecopy () {
# Start by package population by taking a copy of the installed
# files to operate on
# Preserve sparse files and hard links
cmd = 'tar -cf - -C %s -p . | tar -xf - -C %s' % (dest, dvar)
cmd = 'tar -cf - -C %s -ps . | tar -xf - -C %s' % (dest, dvar)
(retval, output) = oe.utils.getstatusoutput(cmd)
if retval:
bb.fatal("file copy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))

View File

@@ -296,7 +296,11 @@ package_install_internal_rpm () {
if [ ! -z "$INSTALL_PLATFORM_EXTRA_RPM" ]; then
for pt in $INSTALL_PLATFORM_EXTRA_RPM ; do
channel_priority=$(expr $channel_priority + 5)
pt=$(echo $pt | sed "s,-linux.*$,-linux\.*,")
case $pt in
noarch-* | any-* | all-*)
pt=$(echo $pt | sed "s,-linux.*$,-linux\.*,")
;;
esac
echo "$pt" >> ${target_rootfs}/etc/rpm/platform
done
fi

View File

@@ -65,5 +65,5 @@ pixbufcache_sstate_postinst() {
# Packages that use this class should extend this variable with their runtime
# dependencies.
PIXBUFCACHE_SYSROOT_DEPS = ""
PIXBUFCACHE_SYSROOT_DEPS_class-native = "${@['gdk-pixbuf-native:do_populate_sysroot_setscene', '']['${BPN}' == 'gdk-pixbuf']} glib-2.0-native:do_populate_sysroot_setscene libffi-native:do_populate_sysroot_setscene libpng-native:do_populate_sysroot_setscene zlib-native:do_populate_sysroot_setscene"
PIXBUFCACHE_SYSROOT_DEPS_class-native = "${@['gdk-pixbuf-native:do_populate_sysroot_setscene', '']['${BPN}' == 'gdk-pixbuf']} glib-2.0-native:do_populate_sysroot_setscene libffi-native:do_populate_sysroot_setscene libpng-native:do_populate_sysroot_setscene"
do_populate_sysroot_setscene[depends] += "${PIXBUFCACHE_SYSROOT_DEPS}"

View File

@@ -13,7 +13,7 @@ populate_sdk_post_deb () {
local target_rootfs=$1
mkdir -p ${target_rootfs}/etc
tar -cf - -C ${STAGING_ETCDIR_NATIVE} -p apt | tar -xf - -C ${target_rootfs}/etc
tar -cf - -C ${STAGING_ETCDIR_NATIVE} -ps apt | tar -xf - -C ${target_rootfs}/etc
}
populate_sdk_deb () {

View File

@@ -10,7 +10,7 @@ PTEST_PATH ?= "${libdir}/${PN}/ptest"
FILES_${PN}-ptest = "${PTEST_PATH}"
SECTION_${PN}-ptest = "devel"
ALLOW_EMPTY_${PN}-ptest = "1"
PTEST_ENABLED = "${@base_contains('DISTRO_FEATURES', 'ptest', '1', '0', d)}"
PTEST_ENABLED = "${@base_contains("DISTRO_FEATURES", "ptest", "1", "0", d)}"
RDEPENDS_${PN}-ptest_virtclass-native = ""
RDEPENDS_${PN}-ptest_virtclass-nativesdk = ""

View File

@@ -91,9 +91,8 @@ fakeroot rootfs_deb_do_rootfs () {
${ROOTFS_POSTPROCESS_COMMAND}
if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
delayed_postinsts="$(delayed_postinsts)"
if [ -n "$delayed_postinsts" ]; then
bberror "The following packages could not be configured offline and rootfs is read-only: $delayed_postinsts"
if [ -n "$(delayed_postinsts)" ]; then
bberror "Some packages could not be configured offline and rootfs is read-only."
exit 1
fi
fi

View File

@@ -89,9 +89,8 @@ fakeroot rootfs_ipk_do_rootfs () {
${ROOTFS_POSTPROCESS_COMMAND}
if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
delayed_postinsts="$(delayed_postinsts)"
if [ -n "$delayed_postinsts" ]; then
bberror "The following packages could not be configured offline and rootfs is read-only: $delayed_postinsts"
if [ -n "$(delayed_postinsts)" ]; then
bberror "Some packages could not be configured offline and rootfs is read-only."
exit 1
fi
fi

Some files were not shown because too many files have changed in this diff Show More