summaryrefslogtreecommitdiff
path: root/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/mic/bootstrap.py279
1 files changed, 0 insertions, 279 deletions
diff --git a/scripts/lib/mic/bootstrap.py b/scripts/lib/mic/bootstrap.py
deleted file mode 100644
index 66c291b0a8..0000000000
--- a/scripts/lib/mic/bootstrap.py
+++ /dev/null
@@ -1,279 +0,0 @@
-#!/usr/bin/python -tt
-#
-# Copyright (c) 2009, 2010, 2011 Intel, Inc.
-#
-# 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; version 2 of the License
-#
-# 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.
-
-from __future__ import with_statement
-import os
-import sys
-import tempfile
-import shutil
-import subprocess
-import rpm
-from mic import msger
-from mic.utils import errors, proxy, misc
-from mic.utils.rpmmisc import readRpmHeader, RPMInstallCallback
-from mic.chroot import cleanup_mounts, setup_chrootenv, cleanup_chrootenv
-
-PATH_BOOTSTRAP = "/usr/sbin:/usr/bin:/sbin:/bin"
-
-RPMTRANS_FLAGS = [
- rpm.RPMTRANS_FLAG_ALLFILES,
- rpm.RPMTRANS_FLAG_NOSCRIPTS,
- rpm.RPMTRANS_FLAG_NOTRIGGERS,
- ]
-
-RPMVSF_FLAGS = [
- rpm._RPMVSF_NOSIGNATURES,
- rpm._RPMVSF_NODIGESTS
- ]
-
-RPMPROB_FLAGS = [
- rpm.RPMPROB_FILTER_OLDPACKAGE,
- rpm.RPMPROB_FILTER_REPLACEPKG,
- rpm.RPMPROB_FILTER_IGNOREARCH
- ]
-
-class MiniBackend(object):
- def __init__(self, rootdir, arch=None, repomd=None):
- self._ts = None
- self.rootdir = os.path.abspath(rootdir)
- self.arch = arch
- self.repomd = repomd
- self.dlpkgs = []
- self.localpkgs = {}
- self.optionals = []
- self.preins = {}
- self.postins = {}
- self.scriptlets = False
-
- def __del__(self):
- try:
- del self.ts
- except:
- pass
-
- def get_ts(self):
- if not self._ts:
- self._ts = rpm.TransactionSet(self.rootdir)
- self._ts.setFlags(reduce(lambda x, y: x|y, RPMTRANS_FLAGS))
- self._ts.setVSFlags(reduce(lambda x, y: x|y, RPMVSF_FLAGS))
- self._ts.setProbFilter(reduce(lambda x, y: x|y, RPMPROB_FLAGS))
-
- return self._ts
-
- def del_ts(self):
- if self._ts:
- self._ts.closeDB()
- self._ts = None
-
- ts = property(fget = lambda self: self.get_ts(),
- fdel = lambda self: self.del_ts(),
- doc="TransactionSet object")
-
- def selectPackage(self, pkg):
- if not pkg in self.dlpkgs:
- self.dlpkgs.append(pkg)
-
- def runInstall(self):
- # FIXME: check space
- self.downloadPkgs()
- self.installPkgs()
-
- if not self.scriptlets:
- return
-
- for pkg in self.preins.keys():
- prog, script = self.preins[pkg]
- self.run_pkg_script(pkg, prog, script, '0')
- for pkg in self.postins.keys():
- prog, script = self.postins[pkg]
- self.run_pkg_script(pkg, prog, script, '1')
-
- def downloadPkgs(self):
- nonexist = []
- for pkg in self.dlpkgs:
- localpth = misc.get_package(pkg, self.repomd, self.arch)
- if localpth:
- self.localpkgs[pkg] = localpth
- elif pkg in self.optionals:
- # skip optional rpm
- continue
- else:
- # mark nonexist rpm
- nonexist.append(pkg)
-
- if nonexist:
- raise errors.BootstrapError("Can't get rpm binary: %s" %
- ','.join(nonexist))
-
- def installPkgs(self):
- for pkg in self.localpkgs.keys():
- rpmpath = self.localpkgs[pkg]
-
- hdr = readRpmHeader(self.ts, rpmpath)
-
- # save prein and postin scripts
- self.preins[pkg] = (hdr['PREINPROG'], hdr['PREIN'])
- self.postins[pkg] = (hdr['POSTINPROG'], hdr['POSTIN'])
-
- # mark pkg as install
- self.ts.addInstall(hdr, rpmpath, 'u')
-
- # run transaction
- self.ts.order()
- cb = RPMInstallCallback(self.ts)
- self.ts.run(cb.callback, '')
-
- def run_pkg_script(self, pkg, prog, script, arg):
- mychroot = lambda: os.chroot(self.rootdir)
-
- if not script:
- return
-
- if prog == "<lua>":
- prog = "/usr/bin/lua"
-
- tmpdir = os.path.join(self.rootdir, "tmp")
- if not os.path.exists(tmpdir):
- os.makedirs(tmpdir)
- tmpfd, tmpfp = tempfile.mkstemp(dir=tmpdir, prefix="%s.pre-" % pkg)
- script = script.replace('\r', '')
- os.write(tmpfd, script)
- os.close(tmpfd)
- os.chmod(tmpfp, 0700)
-
- try:
- script_fp = os.path.join('/tmp', os.path.basename(tmpfp))
- subprocess.call([prog, script_fp, arg], preexec_fn=mychroot)
- except (OSError, IOError), err:
- msger.warning(str(err))
- finally:
- os.unlink(tmpfp)
-
-class Bootstrap(object):
- def __init__(self, rootdir, distro, arch=None):
- self.rootdir = misc.mkdtemp(dir=rootdir, prefix=distro)
- self.distro = distro
- self.arch = arch
- self.logfile = None
- self.pkgslist = []
- self.repomd = None
-
- def __del__(self):
- self.cleanup()
-
- def get_rootdir(self):
- if os.path.exists(self.rootdir):
- shutil.rmtree(self.rootdir, ignore_errors=True)
- os.makedirs(self.rootdir)
- return self.rootdir
-
- def dirsetup(self, rootdir=None):
- _path = lambda pth: os.path.join(rootdir, pth.lstrip('/'))
-
- if not rootdir:
- rootdir = self.rootdir
-
- try:
- # make /tmp and /etc path
- tmpdir = _path('/tmp')
- if not os.path.exists(tmpdir):
- os.makedirs(tmpdir)
- etcdir = _path('/etc')
- if not os.path.exists(etcdir):
- os.makedirs(etcdir)
-
- # touch distro file
- tzdist = _path('/etc/%s-release' % self.distro)
- if not os.path.exists(tzdist):
- with open(tzdist, 'w') as wf:
- wf.write("bootstrap")
- except:
- pass
-
- def create(self, repomd, pkglist, optlist=()):
- try:
- pkgmgr = MiniBackend(self.get_rootdir())
- pkgmgr.arch = self.arch
- pkgmgr.repomd = repomd
- pkgmgr.optionals = list(optlist)
- map(pkgmgr.selectPackage, pkglist + list(optlist))
- pkgmgr.runInstall()
- except (OSError, IOError, errors.CreatorError), err:
- raise errors.BootstrapError("%s" % err)
-
- def run(self, cmd, chdir, rootdir=None, bindmounts=None):
- def mychroot():
- os.chroot(rootdir)
- os.chdir(chdir)
-
- def sync_timesetting(rootdir):
- try:
- # sync time and zone info to bootstrap
- if os.path.exists(rootdir + "/etc/localtime"):
- os.unlink(rootdir + "/etc/localtime")
- shutil.copyfile("/etc/localtime", rootdir + "/etc/localtime")
- except:
- pass
-
- def sync_passwdfile(rootdir):
- try:
- # sync passwd file to bootstrap, saving the user info
- if os.path.exists(rootdir + "/etc/passwd"):
- os.unlink(rootdir + "/etc/passwd")
- shutil.copyfile("/etc/passwd", rootdir + "/etc/passwd")
- except:
- pass
-
- if not rootdir:
- rootdir = self.rootdir
-
- if isinstance(cmd, list):
- shell = False
- else:
- shell = True
-
- env = os.environ
- env['PATH'] = "%s:%s" % (PATH_BOOTSTRAP, env['PATH'])
-
- retcode = 0
- gloablmounts = None
- try:
- proxy.set_proxy_environ()
- gloablmounts = setup_chrootenv(rootdir, bindmounts, False)
- sync_timesetting(rootdir)
- sync_passwdfile(rootdir)
- retcode = subprocess.call(cmd, preexec_fn=mychroot, env=env, shell=shell)
- except (OSError, IOError):
- # add additional information to original exception
- value, tb = sys.exc_info()[1:]
- value = '%s: %s' % (value, ' '.join(cmd))
- raise RuntimeError, value, tb
- finally:
- if self.logfile and os.path.isfile(self.logfile):
- msger.log(file(self.logfile).read())
- cleanup_chrootenv(rootdir, bindmounts, gloablmounts)
- proxy.unset_proxy_environ()
- return retcode
-
- def cleanup(self):
- try:
- # clean mounts
- cleanup_mounts(self.rootdir)
- # remove rootdir
- shutil.rmtree(self.rootdir, ignore_errors=True)
- except:
- pass
fetch/repo.py105
-rw-r--r--bitbake/lib/bb/fetch/ssh.py118
-rw-r--r--bitbake/lib/bb/fetch/svk.py108
-rw-r--r--bitbake/lib/bb/fetch/svn.py203
-rw-r--r--bitbake/lib/bb/fetch/wget.py93
-rw-r--r--bitbake/lib/bb/methodpool.py84
-rw-r--r--bitbake/lib/bb/msg.py164
-rw-r--r--bitbake/lib/bb/parse/__init__.py123
-rw-r--r--bitbake/lib/bb/parse/ast.py449
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py243
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py139
-rw-r--r--bitbake/lib/bb/parse/parse_py/__init__.py33
-rw-r--r--bitbake/lib/bb/persist_data.py137
-rw-r--r--bitbake/lib/bb/providers.py326
-rw-r--r--bitbake/lib/bb/runqueue.py1678
-rw-r--r--bitbake/lib/bb/server/none.py186
-rw-r--r--bitbake/lib/bb/server/xmlrpc.py258
-rw-r--r--bitbake/lib/bb/shell.py822
-rw-r--r--bitbake/lib/bb/siggen.py264
-rw-r--r--bitbake/lib/bb/taskdata.py590
-rw-r--r--bitbake/lib/bb/ui/__init__.py17
-rw-r--r--bitbake/lib/bb/ui/crumbs/__init__.py17
-rw-r--r--bitbake/lib/bb/ui/crumbs/buildmanager.py455
-rw-r--r--bitbake/lib/bb/ui/crumbs/progress.py17
-rw-r--r--bitbake/lib/bb/ui/crumbs/puccho.glade606
-rw-r--r--bitbake/lib/bb/ui/crumbs/runningbuild.py186
-rw-r--r--bitbake/lib/bb/ui/depexp.py260
-rw-r--r--bitbake/lib/bb/ui/goggle.py85
-rw-r--r--bitbake/lib/bb/ui/knotty.py202
-rw-r--r--bitbake/lib/bb/ui/ncurses.py336
-rw-r--r--bitbake/lib/bb/ui/puccho.py425
-rw-r--r--bitbake/lib/bb/ui/uievent.py124
-rw-r--r--bitbake/lib/bb/ui/uihelper.py50
-rw-r--r--bitbake/lib/bb/utils.py809
-rw-r--r--bitbake/lib/codegen.py570
-rw-r--r--bitbake/lib/ply/__init__.py4
-rw-r--r--bitbake/lib/ply/lex.py1058
-rw-r--r--bitbake/lib/ply/yacc.py3276
-rw-r--r--bitbake/lib/pysh/builtin.py710
-rw-r--r--bitbake/lib/pysh/interp.py1367
-rw-r--r--bitbake/lib/pysh/lsprof.py116
-rw-r--r--bitbake/lib/pysh/pysh.py167
-rw-r--r--bitbake/lib/pysh/pyshlex.py888
-rw-r--r--bitbake/lib/pysh/pyshyacc.py772
-rw-r--r--bitbake/lib/pysh/sherrors.py41
-rw-r--r--bitbake/lib/pysh/subprocess_fix.py77
-rw-r--r--documentation/bsp-guide/Makefile35
-rw-r--r--documentation/bsp-guide/bsp-guide-customization.xsl6
-rw-r--r--documentation/bsp-guide/bsp-guide.xml62
-rw-r--r--documentation/bsp-guide/bsp.xml644
-rwxr-xr-xdocumentation/bsp-guide/figures/bsp-title.pngbin15226 -> 0 bytes-rw-r--r--documentation/bsp-guide/figures/poky-ref-manual.pngbin17829 -> 0 bytes-rw-r--r--documentation/bsp-guide/style.css952
-rw-r--r--documentation/kernel-manual/Makefile42
-rwxr-xr-xdocumentation/kernel-manual/figures/kernel-architecture-overview.pngbin40748 -> 0 bytes-rwxr-xr-xdocumentation/kernel-manual/figures/kernel-big-picture.pngbin173130 -> 0 bytes-rwxr-xr-xdocumentation/kernel-manual/figures/kernel-title.pngbin14549 -> 0 bytes-rwxr-xr-xdocumentation/kernel-manual/figures/yocto-project-transp.pngbin8626 -> 0 bytes-rw-r--r--documentation/kernel-manual/kernel-concepts.xml335
-rw-r--r--documentation/kernel-manual/kernel-doc-intro.xml57
-rw-r--r--documentation/kernel-manual/kernel-how-to.xml2130
-rw-r--r--documentation/kernel-manual/kernel-manual.xml66
-rw-r--r--documentation/kernel-manual/style.css968
-rw-r--r--documentation/kernel-manual/yocto-project-kernel-manual-customization.xsl8
-rw-r--r--documentation/poky-ref-manual/Makefile36
-rw-r--r--documentation/poky-ref-manual/TODO11
-rw-r--r--documentation/poky-ref-manual/development.xml1098
-rw-r--r--documentation/poky-ref-manual/examples/hello-autotools/hello_2.3.bb7
-rw-r--r--documentation/poky-ref-manual/examples/hello-single/files/helloworld.c8
-rw-r--r--documentation/poky-ref-manual/examples/hello-single/hello.bb16
-rw-r--r--documentation/poky-ref-manual/examples/libxpm/libxpm_3.5.6.bb13
-rw-r--r--documentation/poky-ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb13
-rw-r--r--documentation/poky-ref-manual/extendpoky.xml1011
-rw-r--r--documentation/poky-ref-manual/faq.xml314
-rwxr-xr-xdocumentation/poky-ref-manual/figures/cropped-yocto-project-bw.pngbin5453 -> 0 bytes-rw-r--r--documentation/poky-ref-manual/figures/poky-ref-manual.pngbin17829 -> 0 bytes-rwxr-xr-xdocumentation/poky-ref-manual/figures/yocto-project-transp.pngbin8626 -> 0 bytes-rw-r--r--documentation/poky-ref-manual/introduction.xml170
-rw-r--r--documentation/poky-ref-manual/poky-beaver.pngbin26252 -> 0 bytes-rw-r--r--documentation/poky-ref-manual/poky-logo.svg117
-rw-r--r--documentation/poky-ref-manual/poky-ref-manual-customization.xsl6
-rw-r--r--documentation/poky-ref-manual/poky-ref-manual.xml102
-rw-r--r--documentation/poky-ref-manual/ref-bitbake.xml349
-rw-r--r--documentation/poky-ref-manual/ref-classes.xml455
-rw-r--r--documentation/poky-ref-manual/ref-features.xml302
-rw-r--r--documentation/poky-ref-manual/ref-images.xml71
-rw-r--r--documentation/poky-ref-manual/ref-structure.xml531
-rw-r--r--documentation/poky-ref-manual/ref-variables.xml946
-rw-r--r--documentation/poky-ref-manual/ref-varlocality.xml211
-rw-r--r--documentation/poky-ref-manual/resources.xml163
-rw-r--r--documentation/poky-ref-manual/screenshots/ss-anjuta-poky-1.pngbin96531 -> 0 bytes-rw-r--r--documentation/poky-ref-manual/screenshots/ss-anjuta-poky-2.pngbin76419 -> 0 bytes-rw-r--r--documentation/poky-ref-manual/screenshots/ss-oprofile-viewer.pngbin51240 -> 0 bytes-rw-r--r--documentation/poky-ref-manual/screenshots/ss-sato.pngbin38689 -> 0 bytes-rw-r--r--documentation/poky-ref-manual/style.css952
-rw-r--r--documentation/poky-ref-manual/usingpoky.xml337
-rwxr-xr-xdocumentation/poky-ref-manual/white-on-black-yp.pngbin9584 -> 0 bytes-rw-r--r--documentation/template/Vera.ttfbin65932 -> 0 bytes-rw-r--r--documentation/template/Vera.xml1
-rw-r--r--documentation/template/VeraMoBd.ttfbin49052 -> 0 bytes-rw-r--r--documentation/template/VeraMoBd.xml1
-rw-r--r--