Compare commits

...

23 Commits

Author SHA1 Message Date
Ross Burton
415b72ffcb dnf: remove systemd units in nativesdk builds
If the DISTRO_FEATURES contain systemd then the systemd class won't delete the
units for us. Until the class is fixed to do this automatically, delete them
explicitly.

(From OE-Core rev: d68a86d87aa017dd0fecb0f626d22711efefcd3f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 10:34:37 +01:00
Patrick Ohly
c76abc379e oeqa: allow persistent image writes in runqemu()
By default, QemuRunner avoids modifying the image files that it boots
into by enabling the qemu snapshot mode. However, some tests may want
to test changes that must persists across reboots, so this mode
should be optional.

This can be combined by copying the image file to a temporary location
first and then booting with that copy. It's also useful when testing
with additional drives attached to a virtual machine.

QemuTinyRunner doesn't use the snapshot parameter and therefore ignores
the new parameter.

Long term, a better way of passing these various configuration
parameters should be used, and perhaps QemuRunner and QemuTinyRunner
can be merged into one again to avoid code duplication. But for now
the patch follows the exiting style.

Also beware that QemuTarget.start() now acts in two different modes
(with or without explicit launch command), and depending on that mode
parameters like discard_writes must be ignored, i.e. not get passed to
launch().

(From OE-Core rev: 969d079a33a57f5a8f7af86d7bab04d35ab07584)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 10:34:37 +01:00
Patrick Ohly
9a94208600 oeqa: allow customizing image used by runqemu()
runqemu() takes all parameters for the virtual machine from the
variables of the given recipe. By allowing the caller to provide a
hash with variables that get applied locally, the caller gets more
control.

Here's the intended usage:

   <prepare internal-image in self.resultdir>
   overrides = {
        'DEPLOY_DIR_IMAGE': self.resultdir,
        'IMAGE_LINK_NAME': 'internal-image-%s' % self.image_arch,
   }
   with runqemu('refkit-installer-image', ssh=False,
                 overrides=overrides) as qemu:
       ....

This can be used to replace the image completely with something else
or to copy it before allowing runqemu() to write into it.

(From OE-Core rev: 4c6ba32abd6b9de33f4b8a0b87e8a56432ed7825)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 10:34:37 +01:00
Patrick Ohly
41b67f1176 oeqa: allow extending qemuparams="..."
Sometimes it is useful to reconfigure the qemu virtual machine
directly. runqemu has the "qemuparams" parameter for that, and the
underlying start() methods also supported modifying that via their
"params" parameter. Only the runqemu() wrapper function lacked
a way to specify additional parameters.

One potential usage is to attach additional disks.

(From OE-Core rev: b2a1cf09ea65ed6f561886b1b4241f9adf3e5709)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 10:34:36 +01:00
Andre McCurdy
9a3f10590b bitbake.conf: sort HOSTTOOLS and remove duplicates
Cleanup only, no functional changes.

(From OE-Core rev: 23dd96a3a175cecde258dc6d8263fbe7b308b58e)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:54:49 +01:00
Leonardo Sandoval
e6adeac7aa recipes-kernel: Skip kernel version check on kernel templates
Currently, SRCREV is set to AUTOREV, causing mismatch between PV and the kernel
version shown in the makefile (see below to see the bitbake log). The solution
is to skip this check, suggesting to remove it once SRCREV is locked.

ERROR: linux-yocto-4.10+gitAUTOINC+01f18cba44_53be19cad6-r0.1 do_kernel_version_sanity_check: Package Version (4.10+gitAUTOINC+01f18cba44_53be19cad6) does not match of kernel being built (4.10.5). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP="1" in your recipe.
ERROR: linux-yocto-4.10+gitAUTOINC+01f18cba44_53be19cad6-r0.1 do_kernel_version_sanity_check: Function failed: do_kernel_version_sanity_check (log file is located at /home/lsandov1/poky2/build/tmp/work/myqemu-poky-linux/linux-yocto/4.10+gitAUTOINC+01f18cba44_53be19cad6-r0.1/temp/log.do_kernel_version_sanity_check.26904)
ERROR: Logfile of failure stored in: /home/lsandov1/poky2/build/tmp/work/myqemu-poky-linux/linux-yocto/4.10+gitAUTOINC+01f18cba44_53be19cad6-r0.1/temp/log.do_kernel_version_sanity_check.26904
ERROR: Task (/home/lsandov1/poky2/meta/recipes-kernel/linux/linux-yocto_4.10.bb:do_kernel_version_sanity_check) failed with exit code '1

[YOCTO #11064]

(From meta-yocto rev: 79bfd911f826c6c7e26827bb200dd69e6f567b17)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:52:14 +01:00
Patrick Ohly
759fcd204f oeqa: QEMU_USE_KVM can list machines
Previously, QEMU_USE_KVM=True enabled the use of kvm only when "x86"
was in the MACHINE name. That is too limiting, because for example
intel-corei7-64 can also use kvm but it wasn't possible to enable that
without changing OE-core.

That traditional usage is still supported. In addition, QEMU_USE_KVM
can be set to a list of space-separated MACHINE names for which kvm is
to be enabled.

(From OE-Core rev: d5421dd00b9cf785fa77e77c6c739e8bd8822fa3)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:43:13 +01:00
Patrick Ohly
7f6b1cd2c1 oeqa: tolerate interrupted select() while waiting for qemu
Sometimes, the OEQA utility code aborts with:

   ...
   File ".../meta/lib/oeqa/utils/qemurunner.py", line 131, in start
     return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams)
   File ".../meta/lib/oeqa/utils/qemurunner.py", line 259, in launch
     sread, swrite, serror = select.select(socklist, [], [], 5)
  InterruptedError: [Errno 4] Interrupted system call

strace shows that this is because of a SIGWINCH:

   Connection from 127.0.0.1:52668
   select(21, [20], [], [], {5, 0})        = ? ERESTARTNOHAND (To be restarted if no handler)
   --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---

This is related to some special conditions:
 * whether qemu opens a graphical console window (enabled in Poky by default)
 * where that window gets opened
 * whether the window manager changes the size of the shell window (mine
   is a tiling window manager and reorders and resizes windows automatically)

Ignoring the interrupted system calls avoids the problem. Code elsewhere (for example,
run() in ssh.py) already does the same thing.

(From OE-Core rev: 44fe106baf5fd5aebe26c5f28004e2b18d839b7c)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:43:13 +01:00
Alexander Kanavin
8c1c392ca3 dnf: move the entire dnf/rpm4 stack to Python 3
[YOCTO #11180]

(From OE-Core rev: bedcdc4cf921b70a8cfb16c6684668d0ac9e1942)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:43:13 +01:00
Alexander Kanavin
3d29214b20 python3: do not hardcode "lib" into site-packages search path
This was not working in multilib or x32 setups and amazingly, was not
noticed until now.

The actual modification is in Lib/site.py, the rest is just devtool moving things around in the patch.

(From OE-Core rev: f60d261b682f1526fb7a754c425300954ef85042)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:43:13 +01:00
Stephano Cetola
b907e25fd9 insane.bbclass: error if file-rdeps not met
Missing runtime dependencies should result in an error rather than a
warning. Indeed, if RPM is listed in PACKAGE_CLASSES, it will throw
an error rather than install packages with missing dependencies. This
functionality should be consistent across package types. This patch
ensures that an error will be thrown.

[YOCTO #10949]

(From OE-Core rev: 90bc7bfa1b27cd5ea2480463f7631f179a296b10)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:43:13 +01:00
Stephano Cetola
243693be54 devtool: open kconfig fragment in binary mode
When devtool writes to the kconfig fragment, it writes the output of
the diff command returned from pipe.communicate(). This function
returns binary objects. We should open the kconfig fragment file in
binary mode if we expect to write binary objects to it.

[YOCTO #11171]

(From OE-Core rev: 72bec63ab0e78753fb6ed1794d11beef9485c014)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:43:12 +01:00
Lauren Post
020e35cfd9 eudev: restore userspace firmware loading support
This sycncs eudev with systemd. This is required for old kernels to
work and does same backport as did in:

,----
| commit 31163abc7bedd477c1aad10e6d1f47dbee194513
| Author: Jonathan Liu <net147@gmail.com>
| Date:   Thu Mar 19 15:38:32 2015 +1100
|
|     systemd: restore userspace firmware loading support
|
|     This changes the minimum required Linux version from 3.7 back to 3.0.
|
|     [YOCTO #7409]
|
|     Signed-off-by: Jonathan Liu <net147@gmail.com>
|     Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
`----

(From OE-Core rev: d6b139ef1b52ee4842f8706c1b8b950cc50a3d54)

Signed-off-by: Lauren Post <lauren.post@nxp.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:43:12 +01:00
Mariano Lopez
c711caae83 oeqa/core/loader.py: Do not import underscore modules by default
Underscore modules are meant to be run only when manually added to the test
suite, so far another mechanisms are in place to make this happen with
runtime, sdk, and esdk (mostly in test* bbclasses).

This will add such functionality in the core framework so other specific
frameworks can take use this without adding something else.

[YOCTO #10980]

(From OE-Core rev: 2c6eac774768aa610a8b3784483b9e90fb629c2d)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28 08:43:12 +01:00
Diana Thayer
71e48a3617 bitbake: main: Improve -v and -D option documentation
Expanded and clarify documentation for the -v, --verbose and -D, --debug
options.

[YOCTO #9962]

(Bitbake rev: 921592026c69287cdb40ffd90944d5944f28e2c3)

Signed-off-by: Diana Thayer <garbados@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 20:23:19 +01:00
Paul Eggleton
542eb4731c bitbake: tinfoil: enable client-side logger handling by default
If you had a script that uses tinfoil and it failed to connect to the
BitBake server, you did't see any of the expected messages - this was
because client-side logging wasn't being handled at all. Since you'll
almost always want this when using tinfoil, have it use the new
bb.msg.logger_create() function to enable client-side logging by
default.

Relates to [YOCTO #11185].

(Bitbake rev: 824e73e0f3eaa96b4d84da7e31f9a17ce5c5d7ee)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 20:23:19 +01:00
Paul Eggleton
614cbeddc8 bitbake: lib/bb/msg: introduce logger_create() function
We use this code to set up a logger with colour in a number of different
places, so create one function that does this and make some of bitbake's
utility scripts use it.

(Bitbake rev: b1ba7d1cc8ec33e2d081230287abd07f52136097)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 20:23:19 +01:00
Paul Eggleton
f41740ee8e bitbake: fetch2/git: prevent recursion on getting latest revision
We call git ls-remote to get the latest revision from a git repository,
however by calling runfetchcmd() we can end up recursively running
git ls-remote a number of times with OE e.g. if ${SRCPV} is in PV, ${PV}
is in WORKDIR, and ${WORKDIR} is in PATH (as a result of recipe-specific
sysroots), our call to runfetchcmd() exports PATH so _lsremote() will
get called again - with the end result that we run git ls-remote 30
times in quick succession (!). Prevent that from happening by using a
guard variable and returning a dummy value if it's called recursively.

Fixes [YOCTO #11185].

(Bitbake rev: ff1ccd1db5d70b3fc9ad0d3e8f3d7b804c22bf36)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 20:23:19 +01:00
Joshua Lock
58a02e73d0 oeqa/selftest: don't use cleanall in selftests
* devtool: oeqa.selftest.devtool.DevtoolTests is taking 4 or more hours on the
  autobuilder because the cleanall call deletes the tarball of the kernel
  source, forcing a large clone which is especially long on an NFS mount.

  The cleanall invocation isn't really required here and switching to clean
  instead should avoid hours of re-cloning the same repository each time we
  run oe-selftest on the autobuilder.
* buildoptions: We only need to ensure the first image isn't an incremental
  image, clean will suffice here.
* runtime-test: no need to clean up the artefacts generated during the test,
  let's leave that to a higher level process rather than using the cleanall
  hammer.

(From OE-Core rev: 9c948d3de08f158387e08a17cdc0cedc7d26bb54)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 20:22:51 +01:00
David Vincent
8fdbf9fcf2 ifupdown: Fix initscript
ifupdown does not provide an initscript so this recipe should not
inherit update-rc.d class. Instead, we rely on init-ifupdown recipe to
startup networking.

(From OE-Core rev: 4e6bf6ea766a0d47f96b3c4682d4f7e81a5763e7)

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 20:22:51 +01:00
Robert Yang
94ffc8e017 rpm: change PROVIDES rpm-build to RPROVIDES
The rpm 5 has a rpm-build package, so here should use RPROVIDES rather
than PROVIDES to keep compatibility.

(From OE-Core rev: de2ee88f9cc0fc8d6d92ac2a79364e79a99ae98e)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 20:22:50 +01:00
Otavio Salvador
fd8d814027 mesa: Add Etnaviv and i.MX Gallium backend PACKAGECONFIG options
The MESA 17.0 has Etnaviv and i.MX support. Expose them in
PACKAGECONFIG for use.

(From OE-Core rev: b77c0355e272e9e7a7ab625eef27a8717225b132)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 20:22:50 +01:00
Otavio Salvador
633564b017 mesa: Update to 17.0.2
This is a bugfix only release.

,----
| Bug fixes
|
| Bug 68504 - 9.2-rc1 workaround for clover build failure on ppc/altivec: cannot convert 'bool' to '__vector(4) __bool int' in return
| Bug 97988 - [radeonsi] playing back videos with VDPAU exhibits deinterlacing/anti-aliasing issues not visible with VA-API
| Bug 99484 - Crusader Kings 2 - Loading bars, siege bars, morale bars, etc. do not render correctly
| Bug 99715 - Don't print: "Note: Buggy applications may crash, if they do please report to vendor"
| Bug 100049 - "ralloc: Make sure ralloc() allocations match malloc()'s alignment." causes seg fault in 32bit build
`----

(From OE-Core rev: 7559db30e161851ea944763ee4c1adb17ef6a797)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27 20:22:50 +01:00
100 changed files with 1523 additions and 430 deletions

View File

@@ -30,19 +30,9 @@ sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), '
import bb.tinfoil
import bb.siggen
import bb.msg
def logger_create(name, output=sys.stderr):
logger = logging.getLogger(name)
console = logging.StreamHandler(output)
format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
if output.isatty():
format.enable_color()
console.setFormatter(format)
logger.addHandler(console)
logger.setLevel(logging.INFO)
return logger
logger = logger_create('bitbake-diffsigs')
logger = bb.msg.logger_create('bitbake-diffsigs')
def find_compare_task(bbhandler, pn, taskname):
""" Find the most recent signature files for the specified PN/task and compare them """

View File

@@ -29,19 +29,9 @@ sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), '
import bb.tinfoil
import bb.siggen
import bb.msg
def logger_create(name, output=sys.stderr):
logger = logging.getLogger(name)
console = logging.StreamHandler(output)
format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
if output.isatty():
format.enable_color()
console.setFormatter(format)
logger.addHandler(console)
logger.setLevel(logging.INFO)
return logger
logger = logger_create('bitbake-dumpsig')
logger = bb.msg.logger_create('bitbake-dumpsig')
def find_siginfo_task(bbhandler, pn, taskname):
""" Find the most recent signature file for the specified PN/task """

View File

@@ -30,26 +30,9 @@ topdir = os.path.dirname(bindir)
sys.path[0:0] = [os.path.join(topdir, 'lib')]
import bb.tinfoil
import bb.msg
def logger_create(name, output=sys.stderr):
logger = logging.getLogger(name)
loggerhandler = logging.StreamHandler(output)
loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
logger.addHandler(loggerhandler)
logger.setLevel(logging.INFO)
return logger
def logger_setup_color(logger, color='auto'):
from bb.msg import BBLogFormatter
console = logging.StreamHandler(sys.stdout)
formatter = BBLogFormatter("%(levelname)s: %(message)s")
console.setFormatter(formatter)
logger.handlers = [console]
if color == 'always' or (color == 'auto' and console.stream.isatty()):
formatter.enable_color()
logger = logger_create('bitbake-layers', sys.stdout)
logger = bb.msg.logger_create('bitbake-layers', sys.stdout)
def main():
parser = argparse.ArgumentParser(
@@ -74,7 +57,9 @@ def main():
elif global_args.quiet:
logger.setLevel(logging.ERROR)
logger_setup_color(logger, global_args.color)
# Need to re-run logger_create with color argument
# (will be the same logger since it has the same name)
bb.msg.logger_create('bitbake-layers', output=sys.stdout, color=global_args.color)
plugins = []
tinfoil = bb.tinfoil.Tinfoil(tracking=True)

View File

@@ -504,9 +504,19 @@
Read the specified file before bitbake.conf.
-R POSTFILE, --postread=POSTFILE
Read the specified file after bitbake.conf.
-v, --verbose Output more log message data to the terminal.
-D, --debug Increase the debug level. You can specify this more
than once.
-v, --verbose Enable tracing of shell tasks (with 'set -x').
Also print bb.note(...) messages to stdout (in
addition to writing them to ${T}/log.do_<task>).
-D, --debug Increase the debug level. You can specify this
more than once. -D sets the debug level to 1,
where only bb.debug(1, ...) messages are printed
to stdout; -DD sets the debug level to 2, where
both bb.debug(1, ...) and bb.debug(2, ...)
messages are printed; etc. Without -D, no debug
messages are printed. Note that -D only affects
output to stdout. All debug messages are written
to ${T}/log.do_taskname, regardless of the debug
level.
-n, --dry-run Don't execute, just go through the motions.
-S SIGNATURE_HANDLER, --dump-signatures=SIGNATURE_HANDLER
Dump out the signature construction information, with

View File

@@ -379,14 +379,26 @@ class Git(FetchMethod):
"""
Run git ls-remote with the specified search string
"""
repourl = self._get_repo_url(ud)
cmd = "%s ls-remote %s %s" % \
(ud.basecmd, repourl, search)
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, cmd, repourl)
output = runfetchcmd(cmd, d, True)
if not output:
raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
# Prevent recursion e.g. in OE if SRCPV is in PV, PV is in WORKDIR,
# and WORKDIR is in PATH (as a result of RSS), our call to
# runfetchcmd() exports PATH so this function will get called again (!)
# In this scenario the return call of the function isn't actually
# important - WORKDIR isn't needed in PATH to call git ls-remote
# anyway.
if d.getVar('_BB_GIT_IN_LSREMOTE', False):
return ''
d.setVar('_BB_GIT_IN_LSREMOTE', '1')
try:
repourl = self._get_repo_url(ud)
cmd = "%s ls-remote %s %s" % \
(ud.basecmd, repourl, search)
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, cmd, repourl)
output = runfetchcmd(cmd, d, True)
if not output:
raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
finally:
d.delVar('_BB_GIT_IN_LSREMOTE')
return output
def _latest_revision(self, ud, d, name):

View File

@@ -174,10 +174,21 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
help="Read the specified file after bitbake.conf.")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="Output more log message data to the terminal.")
help="Enable tracing of shell tasks (with 'set -x'). "
"Also print bb.note(...) messages to stdout (in "
"addition to writing them to ${T}/log.do_<task>).")
parser.add_option("-D", "--debug", action="count", dest="debug", default=0,
help="Increase the debug level. You can specify this more than once.")
help="Increase the debug level. You can specify this "
"more than once. -D sets the debug level to 1, "
"where only bb.debug(1, ...) messages are printed "
"to stdout; -DD sets the debug level to 2, where "
"both bb.debug(1, ...) and bb.debug(2, ...) "
"messages are printed; etc. Without -D, no debug "
"messages are printed. Note that -D only affects "
"output to stdout. All debug messages are written "
"to ${T}/log.do_taskname, regardless of the debug "
"level.")
parser.add_option("-q", "--quiet", action="count", dest="quiet", default=0,
help="Output less log message data to the terminal. You can specify this more than once.")

View File

@@ -201,3 +201,18 @@ def fatal(msgdomain, msg):
logger = logging.getLogger("BitBake")
logger.critical(msg)
sys.exit(1)
def logger_create(name, output=sys.stderr, level=logging.INFO, preserve_handlers=False, color='auto'):
"""Standalone logger creation function"""
logger = logging.getLogger(name)
console = logging.StreamHandler(output)
format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
if color == 'always' or (color == 'auto' and output.isatty()):
format.enable_color()
console.setFormatter(format)
if preserve_handlers:
logger.addHandler(console)
else:
logger.handlers = [console]
logger.setLevel(level)
return logger

View File

@@ -210,13 +210,17 @@ class TinfoilCookerAdapter:
class Tinfoil:
def __init__(self, output=sys.stdout, tracking=False):
def __init__(self, output=sys.stdout, tracking=False, setup_logging=True):
self.logger = logging.getLogger('BitBake')
self.config_data = None
self.cooker = None
self.tracking = tracking
self.ui_module = None
self.server_connection = None
if setup_logging:
# This is the *client-side* logger, nothing to do with
# logging messages from the server
bb.msg.logger_create('BitBake', output)
def __enter__(self):
return self

View File

@@ -30,7 +30,7 @@ QA_SANE = "True"
WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
textrel already-stripped incompatible-license files-invalid \
installed-vs-shipped compile-host-path install-host-path \
pn-overrides infodir build-deps file-rdeps \
pn-overrides infodir build-deps \
unknown-configure-option symlink-to-sysroot multilib \
invalid-packageconfig host-user-contaminated \
"
@@ -38,7 +38,7 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
split-strip packages-list pkgv-undefined var-undefined \
version-going-backwards expanded-d invalid-chars \
license-checksum dev-elf \
license-checksum dev-elf file-rdeps \
"
FAKEROOT_QA = "host-user-contaminated"
FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \

View File

@@ -11,8 +11,8 @@ export STAGING_LIBDIR
# Add 100Meg of extra space for dnf
IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("PACKAGE_INSTALL", "dnf", " + 102400", "" ,d)}"
# Dnf is python based, so be sure python-native is available to us.
EXTRANATIVEPATH += "python-native"
# Dnf is python based, so be sure python3-native is available to us.
EXTRANATIVEPATH += "python3-native"
# opkg is needed for update-alternatives
RPMROOTFSDEPENDS = "rpm-native:do_populate_sysroot \

View File

@@ -210,7 +210,9 @@ def testimage_main(d):
# Get use_kvm
qemu_use_kvm = d.getVar("QEMU_USE_KVM")
if qemu_use_kvm and qemu_use_kvm == 'True' and 'x86' in machine:
if qemu_use_kvm and \
(qemu_use_kvm == 'True' and 'x86' in machine or \
d.getVar('MACHINE') in qemu_use_kvm.split()):
kvm = True
else:
kvm = False

View File

@@ -455,21 +455,21 @@ export PATH
# Tools needed to run builds with OE-Core
HOSTTOOLS += " \
bash sh cut sed gcc ld git rm install which find xargs cat true mktemp \
grep tar gzip touch cp mv basename dirname tr getopt sort awk head tail \
mkdir patch uniq perl python chmod python3 ar strip expr ls make as \
ranlib egrep echo chown cpio tee wc wget bzip2 stat date rmdir od diff \
md5sum dd chrpath file pod2man gunzip python2.7 ln g++ [ false true \
uname test hostname nm objdump objcopy cmp printf env readlink gawk fgrep \
expand pwd sleep diffstat chgrp flock ldd strings rpcgen du makeinfo \
getconf mknod cpp readelf split \
[ ar as awk basename bash bzip2 cat chgrp chmod chown chrpath cmp cp cpio \
cpp cut date dd diff diffstat dirname du echo egrep env expand expr false \
fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip \
head hostname install ld ldd ln ls make makeinfo md5sum mkdir mknod \
mktemp mv nm objcopy objdump od patch perl pod2man printf pwd python \
python2.7 python3 ranlib readelf readlink rm rmdir rpcgen sed sh sleep \
sort split stat strings strip tail tar tee test touch tr true uname uniq \
wc wget which xargs \
"
# Tools needed to run testimage runtime image testing
HOSTTOOLS += "ps stty ip ssh scp ping"
HOSTTOOLS += "ip ping ps scp ssh stty"
# Link to these if present
HOSTTOOLS_NONFATAL += "ccache ld.bfd ld.gold gcc-ar gpg sftp nc socat sudo"
HOSTTOOLS_NONFATAL += "ccache gcc-ar gpg ld.bfd ld.gold nc sftp socat sudo"
# Temporary add few more detected in bitbake world
HOSTTOOLS_NONFATAL += "join nl size yes zcat"

View File

@@ -72,12 +72,11 @@ SECURITY_CFLAGS_pn-openssl = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-opensp = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-ppp = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python-backports-lzma = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python-pycurl = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python-pygpgme = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python-numpy = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python3-numpy = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python3-pycairo = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python3-pygpgme = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-python3 = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-syslinux = "${SECURITY_NO_PIE_CFLAGS}"
SECURITY_CFLAGS_pn-slang = "${SECURITY_NO_PIE_CFLAGS}"

View File

@@ -223,8 +223,21 @@ class OETestLoader(unittest.TestLoader):
msg = 'Tried to import %s test module but is a built-in'
raise ImportError(msg % module.__name__)
if not self.modules or "all" in self.modules or \
module.__name__ in self.modules:
# Normal test modules are loaded if no modules were specified,
# if module is in the specified module list or if 'all' is in
# module list.
# Underscore modules are loaded only if specified in module list.
load_module = True if not module.__name__.startswith('_') \
and (not self.modules \
or module.__name__ in self.modules \
or 'all' in self.modules) \
else False
load_underscore = True if module.__name__.startswith('_') \
and module.__name__ in self.modules \
else False
if load_module or load_underscore:
return super(OETestLoader, self).loadTestsFromModule(
module, *args, pattern=pattern, **kws)
else:
@@ -238,8 +251,21 @@ class OETestLoader(unittest.TestLoader):
msg = 'Tried to import %s test module but is a built-in'
raise ImportError(msg % module.__name__)
if not self.modules or "all" in self.modules or \
module.__name__ in self.modules:
# Normal test modules are loaded if no modules were specified,
# if module is in the specified module list or if 'all' is in
# module list.
# Underscore modules are loaded only if specified in module list.
load_module = True if not module.__name__.startswith('_') \
and (not self.modules \
or module.__name__ in self.modules \
or 'all' in self.modules) \
else False
load_underscore = True if module.__name__.startswith('_') \
and module.__name__ in self.modules \
else False
if load_module or load_underscore:
return super(OETestLoader, self).loadTestsFromModule(
module, use_load_tests)
else:

View File

@@ -16,7 +16,7 @@ class ImageOptionsTests(oeSelfTest):
image_pkgtype = get_bb_var("IMAGE_PKGTYPE")
if image_pkgtype != 'rpm':
self.skipTest('Not using RPM as main package format')
bitbake("-c cleanall core-image-minimal")
bitbake("-c clean core-image-minimal")
self.write_config('INC_RPM_IMAGE_GEN = "1"')
self.append_config('IMAGE_FEATURES += "ssh-server-openssh"')
bitbake("core-image-minimal")

View File

@@ -1654,7 +1654,7 @@ class DevtoolTests(DevtoolBase):
tmpconfig = os.path.join(buildir, '.config')
#Step 3
bitbake('linux-yocto -c cleanall')
bitbake('linux-yocto -c clean')
#Step 4.1
runCmd('devtool modify virtual/kernel -x %s' % tempdir)
self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')),

View File

@@ -193,8 +193,6 @@ postinst-delayed-t \
present on rootfs dir.
4. Boot the image created on qemu and verify that the file
created by postinst_boot recipe is present on image.
5. Clean the packages and image created to test with
different package managers
Expected: The files are successfully created during rootfs and boot
time for 3 different package managers: rpm,ipk,deb and
for initialization managers: sysvinit and systemd.
@@ -237,7 +235,3 @@ postinst-delayed-t \
sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
self.assertEqual(result.status, 0, 'File %s was not created at firts boot'% fileboot_name)
#Step 5
bitbake(' %s %s -c cleanall' % (rootfs_pkg, boot_pkg))
bitbake('core-image-minimal -c cleanall')

View File

@@ -131,9 +131,10 @@ class QemuTarget(BaseTarget):
dump_target_cmds = d.getVar("testimage_dump_target")
dump_host_cmds = d.getVar("testimage_dump_host")
dump_dir = d.getVar("TESTIMAGE_DUMP_DIR")
if d.getVar("QEMU_USE_KVM", False) is not None \
and d.getVar("QEMU_USE_KVM", False) == "True" \
and "x86" in d.getVar("MACHINE"):
qemu_use_kvm = d.getVar("QEMU_USE_KVM")
if qemu_use_kvm and \
(qemu_use_kvm == "True" and "x86" in d.getVar("MACHINE") or \
d.getVar("MACHINE") in qemu_use_kvm.split()):
use_kvm = True
else:
use_kvm = False
@@ -182,11 +183,11 @@ class QemuTarget(BaseTarget):
logger.info("Qemu log file: %s" % self.qemulog)
super(QemuTarget, self).deploy()
def start(self, params=None, ssh=True, extra_bootparams='', runqemuparams='', launch_cmd=''):
def start(self, params=None, ssh=True, extra_bootparams='', runqemuparams='', launch_cmd='', discard_writes=True):
if launch_cmd:
start = self.runner.launch(get_ip=ssh, launch_cmd=launch_cmd)
else:
start = self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams, runqemuparams=runqemuparams)
start = self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams, runqemuparams=runqemuparams, discard_writes=discard_writes)
if start:
if ssh:

View File

@@ -225,7 +225,7 @@ def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec=
@contextlib.contextmanager
def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None):
def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, discard_writes=True):
"""
launch_cmd means directly run the command, don't need set rootfs or env vars.
"""
@@ -247,6 +247,8 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None):
tinfoil.config_data.setVar("FIND_ROOTFS", '1')
recipedata = tinfoil.parse_recipe(pn)
for key, value in overrides.items():
recipedata.setVar(key, value)
# The QemuRunner log is saved out, but we need to ensure it is at the right
# log level (and then ensure that since it's a child of the BitBake logger,
@@ -276,7 +278,7 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None):
try:
qemu.deploy()
try:
qemu.start(ssh=ssh, runqemuparams=runqemuparams, launch_cmd=launch_cmd)
qemu.start(params=qemuparams, ssh=ssh, runqemuparams=runqemuparams, launch_cmd=launch_cmd, discard_writes=discard_writes)
except bb.build.FuncFailed:
raise Exception('Failed to start QEMU - see the logs in %s' % logdir)

View File

@@ -97,7 +97,7 @@ class QemuRunner:
self._dump_host()
raise SystemExit
def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None):
def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None, discard_writes=True):
if self.display:
os.environ["DISPLAY"] = self.display
# Set this flag so that Qemu doesn't do any grabs as SDL grabs
@@ -118,7 +118,7 @@ class QemuRunner:
os.environ["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image
if not launch_cmd:
launch_cmd = 'runqemu snapshot %s' % runqemuparams
launch_cmd = 'runqemu %s %s ' % ('snapshot' if discard_writes else '', runqemuparams)
if self.use_kvm:
logger.info('Using kvm for runqemu')
launch_cmd += ' kvm'
@@ -256,7 +256,10 @@ class QemuRunner:
bootlog = ''
data = b''
while time.time() < endtime and not stopread:
sread, swrite, serror = select.select(socklist, [], [], 5)
try:
sread, swrite, serror = select.select(socklist, [], [], 5)
except InterruptedError:
continue
for sock in sread:
if sock is self.server_socket:
qemusock, addr = self.server_socket.accept()
@@ -437,7 +440,10 @@ class QemuRunner:
if now >= end:
data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout
break
sread, _, _ = select.select([self.server_socket],[],[], end - now)
try:
sread, _, _ = select.select([self.server_socket],[],[], end - now)
except InterruptedError:
continue
if sread:
answer = self.server_socket.recv(1024)
if answer:

View File

@@ -60,7 +60,7 @@ class QemuTinyRunner(QemuRunner):
with open(self.logfile, "a") as f:
f.write("%s" % msg)
def start(self, qemuparams = None, ssh=True, extra_bootparams=None, runqemuparams=''):
def start(self, qemuparams = None, ssh=True, extra_bootparams=None, runqemuparams='', discard_writes=True):
if self.display:
os.environ["DISPLAY"] = self.display
@@ -114,7 +114,10 @@ class QemuTinyRunner(QemuRunner):
stopread = False
endtime = time.time()+timeout
while time.time()<endtime and not stopread:
sread, _, _ = select.select([self.server_socket],[],[],1)
try:
sread, _, _ = select.select([self.server_socket],[],[],1)
except InterruptedError:
continue
for sock in sread:
answer = sock.recv(1024)
if answer:

View File

@@ -16,7 +16,7 @@ SRCREV = "11b9f99f7ecc7052497e6786156cfed531f11823"
S = "${WORKDIR}/git"
inherit update-rc.d update-alternatives
inherit update-alternatives
do_compile () {
chmod a+rx *.pl *.sh
@@ -44,6 +44,3 @@ ALTERNATIVE_${PN} = "ifup ifdown"
ALTERNATIVE_LINK_NAME[ifup] = "${base_sbindir}/ifup"
ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown"
INITSCRIPT_NAME = "ifup"
INITSCRIPT_PARAMS = "start 39 S . stop 39 0 6 1 ."

View File

@@ -0,0 +1,28 @@
From 4f0a722489154da99e7f6b3051afde984eed2f74 Mon Sep 17 00:00:00 2001
From: Jonathan Liu <net147@gmail.com>
Date: Thu, 19 Mar 2015 15:01:29 +1100
Subject: [PATCH] Revert "rules: remove firmware loading rules"
This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19.
Userspace firmware loading support is needed for Linux < 3.7.
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Jonathan Liu <net147@gmail.com>
---
rules/50-firmware.rules | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 rules/50-firmware.rules
diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules
new file mode 100644
index 0000000..f0ae684
--- /dev/null
+++ b/rules/50-firmware.rules
@@ -0,0 +1,3 @@
+# do not edit this file, it will be overwritten on update
+
+SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
--
2.3.3

View File

@@ -0,0 +1,364 @@
From e415372cc7a2f52e70e1cfa8c6c1f633b411355d Mon Sep 17 00:00:00 2001
From: Lauren Post <lauren.post@nxp.com>
Date: Wed, 8 Jun 2016 06:51:56 -0500
Subject: [PATCH] Revert "udev: remove userspace firmware loading support"
This reverts commit 3b717594600fa717cdf9bcfd0c7c1b703b245482.
Conflicts:
configure.ac
src/udev/udevd.c
Upstream-Status: Inappropriate [OE specific]
Signed-off-by: Lauren Post <lauren.post@nxp.com>
---
configure.ac | 39 +++++++++-
rules/Makefile.am | 5 ++
src/udev/Makefile.am | 10 +++
src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
src/udev/udev-builtin.c | 3 +
src/udev/udev.h | 6 ++
src/udev/udevd.c | 13 ++++
7 files changed, 227 insertions(+), 3 deletions(-)
create mode 100644 src/udev/udev-builtin-firmware.c
diff --git a/configure.ac b/configure.ac
index 8691891..65028c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -238,9 +238,42 @@ AC_CHECK_DECL([unshare],
[#include <sched.h>])
# ------------------------------------------------------------------------------
-AC_PATH_TOOL(GPERF, gperf)
-if test -z "$GPERF" ; then
- AC_MSG_ERROR([*** gperf not found])
+AC_ARG_WITH(firmware-path,
+ AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
+ [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
+ [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
+OLD_IFS=$IFS
+IFS=:
+for i in $with_firmware_path; do
+ if test "x${FIRMWARE_PATH}" = "x"; then
+ FIRMWARE_PATH="\\\"${i}/\\\""
+ else
+ FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
+ fi
+done
+IFS=$OLD_IFS
+AC_SUBST(FIRMWARE_PATH)
+AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
+AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
+
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([gudev],
+ AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
+ [], [enable_gudev=yes])
+AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ])
+AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
+
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([keymap],
+ AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
+ [], [enable_keymap=yes])
+
+if test "x$enable_keymap" = "xyes"; then
+ AC_PATH_TOOL(GPERF, gperf)
+ if test -z "$GPERF" ; then
+ AC_MSG_ERROR([*** gperf not found])
+ fi
+ AC_DEFINE([ENABLE_KEYMAP], [1], [Define if we are enabling rule generator])
fi
# ------------------------------------------------------------------------------
diff --git a/rules/Makefile.am b/rules/Makefile.am
index 24c099c..d714ae3 100644
--- a/rules/Makefile.am
+++ b/rules/Makefile.am
@@ -22,6 +22,11 @@ dist_udevrules_DATA += \
80-net-name-slot.rules
endif
+if ENABLE_FIRMWARE
+dist_udevrules_DATA += \
+ 50-firmware.rules
+endif
+
if HAVE_BLKID
dist_udevrules_DATA += \
60-persistent-storage.rules
diff --git a/src/udev/Makefile.am b/src/udev/Makefile.am
index 401af01..742fbc8 100644
--- a/src/udev/Makefile.am
+++ b/src/udev/Makefile.am
@@ -53,12 +53,18 @@ libudev_core_la_SOURCES = \
udev-ctrl.c \
udev-builtin.c \
udev-builtin-btrfs.c \
+ udev-builtin-firmware.c \
udev-builtin-hwdb.c \
udev-builtin-input_id.c \
udev-builtin-net_id.c \
udev-builtin-path_id.c \
udev-builtin-usb_id.c
+if ENABLE_FIRMWARE
+libudev_core_la_SOURCES += \
+ udev-builtin-firmware.c
+endif
+
include_HEADERS = \
udev.h
@@ -86,6 +92,10 @@ libudev_core_la_LIBADD += \
$(KMOD_LIBS)
endif
+libudev_core_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
+
#
# Extras
#
diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c
new file mode 100644
index 0000000..bd8c2fb
--- /dev/null
+++ b/src/udev/udev-builtin-firmware.c
@@ -0,0 +1,154 @@
+/*
+ * firmware - Kernel firmware loader
+ *
+ * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
+ * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
+ *
+ * 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:*
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <getopt.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <sys/utsname.h>
+#include <sys/stat.h>
+
+#include "udev.h"
+
+static bool set_loading(struct udev *udev, char *loadpath, const char *state) {
+ FILE *ldfile;
+
+ ldfile = fopen(loadpath, "we");
+ if (ldfile == NULL) {
+ log_error("error: can not open '%s'", loadpath);
+ return false;
+ };
+ fprintf(ldfile, "%s\n", state);
+ fclose(ldfile);
+ return true;
+}
+
+static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) {
+ char *buf;
+ FILE *fsource = NULL, *ftarget = NULL;
+ bool ret = false;
+
+ buf = malloc(size);
+ if (buf == NULL) {
+ log_error("No memory available to load firmware file");
+ return false;
+ }
+
+ log_debug("writing '%s' (%zi) to '%s'", source, size, target);
+
+ fsource = fopen(source, "re");
+ if (fsource == NULL)
+ goto exit;
+ ftarget = fopen(target, "we");
+ if (ftarget == NULL)
+ goto exit;
+ if (fread(buf, size, 1, fsource) != 1)
+ goto exit;
+ if (fwrite(buf, size, 1, ftarget) == 1)
+ ret = true;
+exit:
+ if (ftarget != NULL)
+ fclose(ftarget);
+ if (fsource != NULL)
+ fclose(fsource);
+ free(buf);
+ return ret;
+}
+
+static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) {
+ struct udev *udev = udev_device_get_udev(dev);
+ static const char *searchpath[] = { FIRMWARE_PATH };
+ char loadpath[UTIL_PATH_SIZE];
+ char datapath[UTIL_PATH_SIZE];
+ char fwpath[UTIL_PATH_SIZE];
+ const char *firmware;
+ FILE *fwfile = NULL;
+ struct utsname kernel;
+ struct stat statbuf;
+ unsigned int i;
+ int rc = EXIT_SUCCESS;
+
+ firmware = udev_device_get_property_value(dev, "FIRMWARE");
+ if (firmware == NULL) {
+ log_error("firmware parameter missing");
+ rc = EXIT_FAILURE;
+ goto exit;
+ }
+
+ /* lookup firmware file */
+ uname(&kernel);
+ for (i = 0; i < ELEMENTSOF(searchpath); i++) {
+ strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
+ fwfile = fopen(fwpath, "re");
+ if (fwfile != NULL)
+ break;
+
+ strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL);
+ fwfile = fopen(fwpath, "re");
+ if (fwfile != NULL)
+ break;
+ }
+
+ strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
+
+ if (fwfile == NULL) {
+ log_debug("did not find firmware file '%s'", firmware);
+ rc = EXIT_FAILURE;
+ /*
+ * Do not cancel the request in the initrd, the real root might have
+ * the firmware file and the 'coldplug' run in the real root will find
+ * this pending request and fulfill or cancel it.
+ * */
+ if (!in_initrd())
+ set_loading(udev, loadpath, "-1");
+ goto exit;
+ }
+
+ if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) {
+ if (!in_initrd())
+ set_loading(udev, loadpath, "-1");
+ rc = EXIT_FAILURE;
+ goto exit;
+ }
+
+ if (!set_loading(udev, loadpath, "1"))
+ goto exit;
+
+ strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
+ if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
+ log_error("error sending firmware '%s' to device", firmware);
+ set_loading(udev, loadpath, "-1");
+ rc = EXIT_FAILURE;
+ goto exit;
+ };
+
+ set_loading(udev, loadpath, "0");
+exit:
+ if (fwfile)
+ fclose(fwfile);
+ return rc;
+}
+
+const struct udev_builtin udev_builtin_firmware = {
+ .name = "firmware",
+ .cmd = builtin_firmware,
+ .help = "kernel firmware loader",
+ .run_once = true,
+};
diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
index 74b3bdc..3657106 100644
--- a/src/udev/udev-builtin.c
+++ b/src/udev/udev-builtin.c
@@ -34,6 +34,9 @@ static const struct udev_builtin *builtins[] = {
[UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
#endif
[UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
+#ifdef HAVE_FIRMWARE
+ [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
+#endif
[UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
[UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
[UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
diff --git a/src/udev/udev.h b/src/udev/udev.h
index 198cb2c..01a1e9c 100644
--- a/src/udev/udev.h
+++ b/src/udev/udev.h
@@ -149,6 +149,9 @@ enum udev_builtin_cmd {
UDEV_BUILTIN_BLKID,
#endif
UDEV_BUILTIN_BTRFS,
+#ifdef HAVE_FIRMWARE
+ UDEV_BUILTIN_FIRMWARE,
+#endif
UDEV_BUILTIN_HWDB,
UDEV_BUILTIN_INPUT_ID,
UDEV_BUILTIN_KEYBOARD,
@@ -173,6 +176,9 @@ struct udev_builtin {
extern const struct udev_builtin udev_builtin_blkid;
#endif
extern const struct udev_builtin udev_builtin_btrfs;
+#ifdef HAVE_FIRMWARE
+extern const struct udev_builtin udev_builtin_firmware;
+#endif
extern const struct udev_builtin udev_builtin_hwdb;
extern const struct udev_builtin udev_builtin_input_id;
extern const struct udev_builtin udev_builtin_keyboard;
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index b1de97a..35655d8 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -101,6 +101,9 @@ struct event {
bool is_block;
usec_t start_usec;
bool warned;
+#ifdef HAVE_FIRMWARE
+ bool nodelay;
+#endif
};
static inline struct event *node_to_event(struct udev_list_node *node) {
@@ -491,6 +494,10 @@ static int event_queue_insert(struct udev_device *dev) {
event->devnum = udev_device_get_devnum(dev);
event->is_block = streq("block", udev_device_get_subsystem(dev));
event->ifindex = udev_device_get_ifindex(dev);
+#ifdef HAVE_FIRMWARE
+ if (streq(udev_device_get_subsystem(dev), "firmware"))
+ event->nodelay = true;
+#endif
log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
udev_device_get_action(dev), udev_device_get_subsystem(dev));
@@ -566,6 +573,12 @@ static bool is_devpath_busy(struct event *event) {
return true;
}
+#ifdef HAVE_FIRMWARE
+ /* allow to bypass the dependency tracking */
+ if (event->nodelay)
+ continue;
+#endif
+
/* parent device event found */
if (event->devpath[common] == '/') {
event->delaying_seqnum = loop_event->seqnum;
--
1.9.1

View File

@@ -8,6 +8,8 @@ DEPENDS = "glib-2.0 glib-2.0-native gperf-native kmod libxslt-native util-linux"
PROVIDES = "udev"
SRC_URI = "https://github.com/gentoo/${BPN}/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
file://0014-Revert-rules-remove-firmware-loading-rules.patch \
file://Revert-udev-remove-userspace-firmware-loading-suppor.patch \
file://devfs-udev.rules \
file://init \
file://links.conf \

View File

@@ -17,9 +17,9 @@ S = "${WORKDIR}/git"
DEPENDS = "expat curl glib-2.0 libxml2 openssl bzip2 zlib file sqlite3 xz rpm"
DEPENDS_append_class-native = " file-replacement-native"
inherit cmake pkgconfig bash-completion distutils-base
inherit cmake pkgconfig bash-completion distutils3-base
EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR}"
EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
BBCLASSEXTEND = "native"

View File

@@ -1,30 +0,0 @@
From 89af5c84d4b920d22ae882fcc5ab71ba09443cea Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Fri, 30 Dec 2016 18:28:18 +0200
Subject: [PATCH 28/30] Use backports.lzma, not lzma
This is needed when using Python 2.x and should be dropped
after moving to Python 3.x
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
dnf/yum/misc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dnf/yum/misc.py b/dnf/yum/misc.py
index 441b0148..6b4aea0a 100644
--- a/dnf/yum/misc.py
+++ b/dnf/yum/misc.py
@@ -37,7 +37,7 @@ import gpgme.editutil
import gzip
import hashlib
import io
-import lzma
+import backports.lzma
import os
import os.path
import pwd
--
2.11.0

View File

@@ -19,7 +19,7 @@ index 5b06aa26..9f6f703e 100755
+++ b/bin/dnf-automatic.in
@@ -1,4 +1,4 @@
-#!@PYTHON_EXECUTABLE@
+#!/usr/bin/env python
+#!/usr/bin/env python3
# dnf-automatic executable.
#
# Copyright (C) 2014-2016 Red Hat, Inc.
@@ -29,7 +29,7 @@ index 645d0f06..ab141abd 100755
+++ b/bin/dnf.in
@@ -1,4 +1,4 @@
-#!@PYTHON_EXECUTABLE@
+#!/usr/bin/env python
+#!/usr/bin/env python3
# The dnf executable script.
#
# Copyright (C) 2012-2016 Red Hat, Inc.
@@ -39,7 +39,7 @@ index f1fee071..013dc8c5 100755
+++ b/bin/yum.in
@@ -1,4 +1,4 @@
-#!@PYTHON_EXECUTABLE@
+#!/usr/bin/env python
+#!/usr/bin/env python3
# The dnf executable script.
#
# Copyright (C) 2016 Red Hat, Inc.

View File

@@ -5,7 +5,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
"
SRC_URI = "git://github.com/rpm-software-management/dnf.git \
file://0028-Use-backports.lzma-not-lzma.patch \
file://0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
file://0030-Run-python-scripts-using-env.patch \
file://0001-Do-not-prepend-installroot-to-logdir.patch \
@@ -18,24 +17,22 @@ SRCREV = "f0093d672d3069cfee8447973ae70ef615fd8886"
S = "${WORKDIR}/git"
inherit cmake gettext bash-completion distutils-base systemd
inherit cmake gettext bash-completion distutils3-base systemd
DEPENDS += "libdnf librepo libcomps python-pygpgme python-iniparse"
# python 2.x only, drop when moving to python 3.x
DEPENDS += "python-backports-lzma"
DEPENDS += "libdnf librepo libcomps python3-pygpgme python3-iniparse"
# manpages generation requires http://www.sphinx-doc.org/
EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR}"
EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
BBCLASSEXTEND = "native nativesdk"
RDEPENDS_${PN}_class-target += "python-core python-codecs python-netclient python-email python-threading python-distutils librepo python-shell python-subprocess libcomps libdnf python-sqlite3 python-compression python-pygpgme python-backports-lzma python-rpm python-iniparse python-json python-importlib python-curses python-argparse"
RDEPENDS_${PN}_class-target += "python3-core python3-codecs python3-netclient python3-email python3-threading python3-distutils librepo python3-shell python3-subprocess libcomps libdnf python3-sqlite3 python3-compression python3-pygpgme python3-rpm python3-iniparse python3-json python3-importlib python3-curses python3-argparse python3-misc"
# Create a symlink called 'dnf' as 'make install' does not do it, but
# .spec file in dnf source tree does (and then Fedora and dnf documentation
# says that dnf binary is plain 'dnf').
do_install_append() {
ln -s -r ${D}/${bindir}/dnf-2 ${D}/${bindir}/dnf
ln -s -r ${D}/${bindir}/dnf-automatic-2 ${D}/${bindir}/dnf-automatic
ln -s -r ${D}/${bindir}/dnf-3 ${D}/${bindir}/dnf
ln -s -r ${D}/${bindir}/dnf-automatic-3 ${D}/${bindir}/dnf-automatic
}
# Direct dnf-native to read rpm configuration from our sysroot, not the one it was compiled in
@@ -45,6 +42,12 @@ do_install_append_class-native() {
RPM_NO_CHROOT_FOR_SCRIPTS=1
}
# If the distro uses systemd then these won't be deleted by systemd.bbclass
do_install_append_class-nativesdk() {
rm -rf ${D}/${systemd_unitdir}
rmdir --ignore-fail-on-non-empty ${D}${nonarch_base_libdir}
}
SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \
dnf-automatic-download.service dnf-automatic-download.timer \
dnf-automatic-install.service dnf-automatic-install.timer \

View File

@@ -13,11 +13,11 @@ SRCREV = "01a4759894cccff64d2561614a58281adf5ce859"
S = "${WORKDIR}/git"
inherit cmake distutils-base
inherit cmake distutils3-base
DEPENDS = "libxml2 expat libcheck"
DEPENDS += "libxml2 expat libcheck"
EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR}"
EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
OECMAKE_SOURCEPATH = "${S}/libcomps"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -17,20 +17,9 @@ S = "${WORKDIR}/git"
DEPENDS = "glib-2.0 libsolv libcheck librepo rpm gtk-doc"
inherit gtk-doc gobject-introspection cmake pkgconfig
inherit gtk-doc gobject-introspection cmake pkgconfig distutils3-base
# We cannot inherit pythonnative (or descendant classes like distutils etc.)
# because that would conflict with inheriting python3native
# (which is done by inheriting gobject-introspection).
# But libdnf only needs the path to native Python 2.x binary
# so we simply set it explicitly here.
#
# These lines can be dropped when dnf stack is moved to python 3.x
EXTRANATIVEPATH += "python-native"
FILES_${PN} += " ${libdir}/python2.7/*"
DEPENDS += "python-native"
EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DWITH_MAN=OFF \
EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DWITH_MAN=OFF -DPYTHON_DESIRED=3 \
${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DWITH_GIR=ON', '-DWITH_GIR=OFF', d)} \
"
EXTRA_OECMAKE_append_class-native = " -DWITH_GIR=OFF"

View File

@@ -16,9 +16,9 @@ S = "${WORKDIR}/git"
DEPENDS = "curl expat glib-2.0 openssl attr libcheck gpgme"
inherit cmake distutils-base pkgconfig
inherit cmake distutils3-base pkgconfig
EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR}"
EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -1,32 +0,0 @@
From e5e3196cf69172b625c8c6ccca991c02fd18137c Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Fri, 30 Dec 2016 18:02:12 +0200
Subject: [PATCH] setup.py: do not add include and library directories from the
host
This avoids host contamination.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
setup.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/setup.py b/setup.py
index 7886cf7..9a0356a 100644
--- a/setup.py
+++ b/setup.py
@@ -31,9 +31,7 @@ packages = ["backports", "backports.lzma"]
home = os.path.expanduser("~")
extens = [Extension('backports/lzma/_lzma',
['backports/lzma/_lzmamodule.c'],
- libraries = ['lzma'],
- include_dirs = [os.path.join(home, 'include'), '/opt/local/include', '/usr/local/include'],
- library_dirs = [os.path.join(home, 'lib'), '/opt/local/lib', '/usr/local/lib']
+ libraries = ['lzma']
)]
descr = "Backport of Python 3.3's 'lzma' module for XZ/LZMA compressed files."
--
2.11.0

View File

@@ -1,21 +0,0 @@
HOMEPAGE = "https://github.com/peterjc/backports.lzma"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=846e05e7e9e1c886b2637c230cfcd5dd"
SRC_URI = "git://github.com/peterjc/backports.lzma.git \
file://0001-setup.py-do-not-add-include-and-library-directories-.patch \
"
PV = "0.0.6+git${SRCPV}"
SRCREV = "718b3316ae7aee8e03c02e7e110108779ce3aec8"
S = "${WORKDIR}/git"
inherit distutils
DEPENDS_append = " xz"
RDEPENDS_${PN} += "python-core python-io python-pkgutil"
RDEPENDS_${PN}_class-native += "python-core"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -0,0 +1,552 @@
From 8a98e4d44a5e59439a4b6bd95368cc362412c995 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Fri, 24 Mar 2017 18:06:08 +0200
Subject: [PATCH] Add python 3 compatibility.
Taken from
http://pkgs.fedoraproject.org/cgit/rpms/python-iniparse.git/tree/python-iniparse-python3-compat.patch
Upstream-Status: Inappropriate [upstream is defunct]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
iniparse/__init__.py | 20 ++++++++++----------
iniparse/compat.py | 30 ++++++++++++++++--------------
iniparse/config.py | 16 ++++++++--------
iniparse/configparser.py | 7 +++++++
iniparse/ini.py | 20 ++++++++++++--------
iniparse/utils.py | 4 ++--
tests/__init__.py | 14 +++++++-------
tests/test_compat.py | 23 +++++++++++++++--------
tests/test_fuzz.py | 18 +++++++++---------
tests/test_ini.py | 8 ++++----
tests/test_misc.py | 4 ++--
tests/test_tidy.py | 2 +-
tests/test_unicode.py | 10 +++++-----
13 files changed, 98 insertions(+), 78 deletions(-)
create mode 100644 iniparse/configparser.py
diff --git a/iniparse/__init__.py b/iniparse/__init__.py
index 8de756f..7193f92 100644
--- a/iniparse/__init__.py
+++ b/iniparse/__init__.py
@@ -3,17 +3,17 @@
# Copyright (c) 2007 Tim Lauridsen <tla@rasmil.dk>
# All Rights Reserved. See LICENSE-PSF & LICENSE for details.
-from ini import INIConfig, change_comment_syntax
-from config import BasicConfig, ConfigNamespace
-from compat import RawConfigParser, ConfigParser, SafeConfigParser
-from utils import tidy
+from .ini import INIConfig, change_comment_syntax
+from .config import BasicConfig, ConfigNamespace
+from .compat import RawConfigParser, ConfigParser, SafeConfigParser
+from .utils import tidy
-from ConfigParser import DuplicateSectionError, \
- NoSectionError, NoOptionError, \
- InterpolationMissingOptionError, \
- InterpolationDepthError, \
- InterpolationSyntaxError, \
- DEFAULTSECT, MAX_INTERPOLATION_DEPTH
+from .configparser import DuplicateSectionError, \
+ NoSectionError, NoOptionError, \
+ InterpolationMissingOptionError, \
+ InterpolationDepthError, \
+ InterpolationSyntaxError, \
+ DEFAULTSECT, MAX_INTERPOLATION_DEPTH
__all__ = [
'BasicConfig', 'ConfigNamespace',
diff --git a/iniparse/compat.py b/iniparse/compat.py
index db89ed8..f95c25c 100644
--- a/iniparse/compat.py
+++ b/iniparse/compat.py
@@ -12,19 +12,21 @@ The underlying INIConfig object can be accessed as cfg.data
"""
import re
-from ConfigParser import DuplicateSectionError, \
- NoSectionError, NoOptionError, \
- InterpolationMissingOptionError, \
- InterpolationDepthError, \
- InterpolationSyntaxError, \
- DEFAULTSECT, MAX_INTERPOLATION_DEPTH
+from .configparser import DuplicateSectionError, \
+ NoSectionError, NoOptionError, \
+ InterpolationMissingOptionError, \
+ InterpolationDepthError, \
+ InterpolationSyntaxError, \
+ DEFAULTSECT, MAX_INTERPOLATION_DEPTH
# These are imported only for compatiability.
# The code below does not reference them directly.
-from ConfigParser import Error, InterpolationError, \
- MissingSectionHeaderError, ParsingError
+from .configparser import Error, InterpolationError, \
+ MissingSectionHeaderError, ParsingError
-import ini
+import six
+
+from . import ini
class RawConfigParser(object):
def __init__(self, defaults=None, dict_type=dict):
@@ -56,7 +58,7 @@ class RawConfigParser(object):
# The default section is the only one that gets the case-insensitive
# treatment - so it is special-cased here.
if section.lower() == "default":
- raise ValueError, 'Invalid section name: %s' % section
+ raise ValueError('Invalid section name: %s' % section)
if self.has_section(section):
raise DuplicateSectionError(section)
@@ -88,7 +90,7 @@ class RawConfigParser(object):
filename may also be given.
"""
files_read = []
- if isinstance(filenames, basestring):
+ if isinstance(filenames, six.string_types):
filenames = [filenames]
for filename in filenames:
try:
@@ -143,7 +145,7 @@ class RawConfigParser(object):
def getboolean(self, section, option):
v = self.get(section, option)
if v.lower() not in self._boolean_states:
- raise ValueError, 'Not a boolean: %s' % v
+ raise ValueError('Not a boolean: %s' % v)
return self._boolean_states[v.lower()]
def has_option(self, section, option):
@@ -234,7 +236,7 @@ class ConfigParser(RawConfigParser):
if "%(" in value:
try:
value = value % vars
- except KeyError, e:
+ except KeyError as e:
raise InterpolationMissingOptionError(
option, section, rawval, e.args[0])
else:
@@ -283,7 +285,7 @@ class SafeConfigParser(ConfigParser):
_badpercent_re = re.compile(r"%[^%]|%$")
def set(self, section, option, value):
- if not isinstance(value, basestring):
+ if not isinstance(value, six.string_types):
raise TypeError("option values must be strings")
# check for bad percent signs:
# first, replace all "good" interpolations
diff --git a/iniparse/config.py b/iniparse/config.py
index 5cfa2ea..3b28549 100644
--- a/iniparse/config.py
+++ b/iniparse/config.py
@@ -143,7 +143,7 @@ class BasicConfig(ConfigNamespace):
>>> n.aaa = 42
>>> del n.x
- >>> print n
+ >>> print(n)
aaa = 42
name.first = paramjit
name.last = oberoi
@@ -152,7 +152,7 @@ class BasicConfig(ConfigNamespace):
>>> isinstance(n.name, ConfigNamespace)
True
- >>> print n.name
+ >>> print(n.name)
first = paramjit
last = oberoi
>>> sorted(list(n.name))
@@ -160,7 +160,7 @@ class BasicConfig(ConfigNamespace):
Finally, values can be read from a file as follows:
- >>> from StringIO import StringIO
+ >>> from six import StringIO
>>> sio = StringIO('''
... # comment
... ui.height = 100
@@ -171,7 +171,7 @@ class BasicConfig(ConfigNamespace):
... ''')
>>> n = BasicConfig()
>>> n._readfp(sio)
- >>> print n
+ >>> print(n)
complexity = medium
data.secret.password = goodness=gracious me
have_python
@@ -199,7 +199,7 @@ class BasicConfig(ConfigNamespace):
def __str__(self, prefix=''):
lines = []
- keys = self._data.keys()
+ keys = list(self._data.keys())
keys.sort()
for name in keys:
value = self._data[name]
@@ -258,7 +258,7 @@ def update_config(target, source):
>>> n.ui.display_clock = True
>>> n.ui.display_qlength = True
>>> n.ui.width = 150
- >>> print n
+ >>> print(n)
playlist.expand_playlist = True
ui.display_clock = True
ui.display_qlength = True
@@ -267,7 +267,7 @@ def update_config(target, source):
>>> from iniparse import ini
>>> i = ini.INIConfig()
>>> update_config(i, n)
- >>> print i
+ >>> print(i)
[playlist]
expand_playlist = True
<BLANKLINE>
@@ -277,7 +277,7 @@ def update_config(target, source):
width = 150
"""
- for name in source:
+ for name in sorted(source):
value = source[name]
if isinstance(value, ConfigNamespace):
if name in target:
diff --git a/iniparse/configparser.py b/iniparse/configparser.py
new file mode 100644
index 0000000..c543d50
--- /dev/null
+++ b/iniparse/configparser.py
@@ -0,0 +1,7 @@
+try:
+ from ConfigParser import *
+ # not all objects get imported with __all__
+ from ConfigParser import Error, InterpolationMissingOptionError
+except ImportError:
+ from configparser import *
+ from configparser import Error, InterpolationMissingOptionError
diff --git a/iniparse/ini.py b/iniparse/ini.py
index 408354d..052d9e9 100644
--- a/iniparse/ini.py
+++ b/iniparse/ini.py
@@ -7,7 +7,7 @@
Example:
- >>> from StringIO import StringIO
+ >>> from six import StringIO
>>> sio = StringIO('''# configure foo-application
... [foo]
... bar1 = qualia
@@ -16,14 +16,14 @@ Example:
... special = 1''')
>>> cfg = INIConfig(sio)
- >>> print cfg.foo.bar1
+ >>> print(cfg.foo.bar1)
qualia
- >>> print cfg['foo-ext'].special
+ >>> print(cfg['foo-ext'].special)
1
>>> cfg.foo.newopt = 'hi!'
>>> cfg.baz.enabled = 0
- >>> print cfg
+ >>> print(cfg)
# configure foo-application
[foo]
bar1 = qualia
@@ -42,9 +42,11 @@ Example:
# Backward-compatiable with ConfigParser
import re
-from ConfigParser import DEFAULTSECT, ParsingError, MissingSectionHeaderError
+from .configparser import DEFAULTSECT, ParsingError, MissingSectionHeaderError
-import config
+import six
+
+from . import config
class LineType(object):
line = None
@@ -278,6 +280,8 @@ class LineContainer(object):
value = property(get_value, set_value)
def __str__(self):
+ for c in self.contents:
+ pass#print(c.__str__())
s = [x.__str__() for x in self.contents]
return '\n'.join(s)
@@ -465,7 +469,7 @@ class INIConfig(config.ConfigNamespace):
self._sections = {}
if defaults is None: defaults = {}
self._defaults = INISection(LineContainer(), optionxformsource=self)
- for name, value in defaults.iteritems():
+ for name, value in defaults.items():
self._defaults[name] = value
if fp is not None:
self._readfp(fp)
@@ -551,7 +555,7 @@ class INIConfig(config.ConfigNamespace):
for line in readline_iterator(fp):
# Check for BOM on first line
- if linecount == 0 and isinstance(line, unicode):
+ if linecount == 0 and isinstance(line, six.text_type):
if line[0] == u'\ufeff':
line = line[1:]
self._bom = True
diff --git a/iniparse/utils.py b/iniparse/utils.py
index 829fc28..f8b773a 100644
--- a/iniparse/utils.py
+++ b/iniparse/utils.py
@@ -1,5 +1,5 @@
-import compat
-from ini import LineContainer, EmptyLine
+from . import compat
+from .ini import LineContainer, EmptyLine
def tidy(cfg):
"""Clean up blank lines.
diff --git a/tests/__init__.py b/tests/__init__.py
index f1fa321..88689fb 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,12 +1,12 @@
import unittest, doctest
-import test_ini
-import test_misc
-import test_fuzz
-import test_compat
-import test_unicode
-import test_tidy
-import test_multiprocessing
+from . import test_ini
+from . import test_misc
+from . import test_fuzz
+from . import test_compat
+from . import test_unicode
+from . import test_tidy
+from . import test_multiprocessing
from iniparse import config
from iniparse import ini
diff --git a/tests/test_compat.py b/tests/test_compat.py
index b8da3d5..b6dfb5c 100644
--- a/tests/test_compat.py
+++ b/tests/test_compat.py
@@ -1,9 +1,16 @@
from iniparse import compat as ConfigParser
-import StringIO
+from six import StringIO
+try:
+ import UserDict
+except ImportError:
+ import collections as UserDict
import unittest
-import UserDict
-from test import test_support
+import sys
+if sys.version_info[0] < 3:
+ from test import test_support
+else:
+ from test import support as test_support
class SortedDict(UserDict.UserDict):
def items(self):
@@ -35,7 +42,7 @@ class TestCaseBase(unittest.TestCase):
def fromstring(self, string, defaults=None):
cf = self.newconfig(defaults)
- sio = StringIO.StringIO(string)
+ sio = StringIO(string)
cf.readfp(sio)
return cf
@@ -161,7 +168,7 @@ class TestCaseBase(unittest.TestCase):
"No Section!\n")
def parse_error(self, exc, src):
- sio = StringIO.StringIO(src)
+ sio = StringIO(src)
self.assertRaises(exc, self.cf.readfp, sio)
def test_query_errors(self):
@@ -181,7 +188,7 @@ class TestCaseBase(unittest.TestCase):
def get_error(self, exc, section, option):
try:
self.cf.get(section, option)
- except exc, e:
+ except exc as e:
return e
else:
self.fail("expected exception type %s.%s"
@@ -227,7 +234,7 @@ class TestCaseBase(unittest.TestCase):
"foo: another very\n"
" long line"
)
- output = StringIO.StringIO()
+ output = StringIO()
cf.write(output)
self.assertEqual(
output.getvalue(),
@@ -465,7 +472,7 @@ class SortedTestCase(RawConfigParserTestCase):
"o1=4\n"
"[a]\n"
"k=v\n")
- output = StringIO.StringIO()
+ output = StringIO()
self.cf.write(output)
self.assertEquals(output.getvalue(),
"[a]\n"
diff --git a/tests/test_fuzz.py b/tests/test_fuzz.py
index 5420dcc..b219500 100644
--- a/tests/test_fuzz.py
+++ b/tests/test_fuzz.py
@@ -1,9 +1,10 @@
import re
import os
import random
+import sys
import unittest
-import ConfigParser
-from StringIO import StringIO
+from six import StringIO
+from six.moves import configparser
from iniparse import compat, ini, tidy
# TODO:
@@ -96,24 +97,25 @@ class test_fuzz(unittest.TestCase):
s = '\n'.join(good_lines)
cc = compat.RawConfigParser()
cc.readfp(StringIO(s))
- cc_py = ConfigParser.RawConfigParser()
+ cc_py = configparser.RawConfigParser()
cc_py.readfp(StringIO(s))
# compare the two configparsers
self.assertEqualConfig(cc_py, cc)
# check that tidy does not change semantics
tidy(cc)
- cc_tidy = ConfigParser.RawConfigParser()
+ cc_tidy = configparser.RawConfigParser()
cc_tidy.readfp(StringIO(str(cc.data)))
self.assertEqualConfig(cc_py, cc_tidy)
except AssertionError:
fname = 'fuzz-test-iter-%d.ini' % fuzz_iter
- print 'Fuzz test failed at iteration', fuzz_iter
- print 'Writing out failing INI file as', fname
+ print('Fuzz test failed at iteration', fuzz_iter)
+ print('Writing out failing INI file as', fname)
f = open(fname, 'w')
f.write(s)
f.close()
raise
+ @unittest.skipIf(sys.version_info[0] > 2, 'http://code.google.com/p/iniparse/issues/detail?id=22#c9')
def assertEqualConfig(self, c1, c2):
self.assertEqualSorted(c1.sections(), c2.sections())
self.assertEqualSorted(c1.defaults().items(), c2.defaults().items())
@@ -123,9 +125,7 @@ class test_fuzz(unittest.TestCase):
self.assertEqual(c1.get(sec, opt), c2.get(sec, opt))
def assertEqualSorted(self, l1, l2):
- l1.sort()
- l2.sort()
- self.assertEqual(l1, l2)
+ self.assertEqual(sorted(l1), sorted(l2))
class suite(unittest.TestSuite):
def __init__(self):
diff --git a/tests/test_ini.py b/tests/test_ini.py
index 6a76edb..07d4f4e 100644
--- a/tests/test_ini.py
+++ b/tests/test_ini.py
@@ -1,5 +1,5 @@
import unittest
-from StringIO import StringIO
+from six import StringIO
from iniparse import ini
from iniparse import compat
@@ -196,13 +196,13 @@ but = also me
self.assertEqual(p._data.find('section2').find('just').value, 'kidding')
itr = p._data.finditer('section1')
- v = itr.next()
+ v = next(itr)
self.assertEqual(v.find('help').value, 'yourself')
self.assertEqual(v.find('but').value, 'also me')
- v = itr.next()
+ v = next(itr)
self.assertEqual(v.find('help').value, 'me')
self.assertEqual(v.find('I\'m').value, 'desperate')
- self.assertRaises(StopIteration, itr.next)
+ self.assertRaises(StopIteration, next, itr)
self.assertRaises(KeyError, p._data.find, 'section')
self.assertRaises(KeyError, p._data.find('section2').find, 'ahem')
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 31cf4da..96ef035 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -1,9 +1,9 @@
import re
import unittest
import pickle
-import ConfigParser
+from six.moves import configparser
+from six import StringIO
from textwrap import dedent
-from StringIO import StringIO
from iniparse import compat, ini
class CaseSensitiveConfigParser(compat.ConfigParser):
diff --git a/tests/test_tidy.py b/tests/test_tidy.py
index 7304747..26b6cde 100644
--- a/tests/test_tidy.py
+++ b/tests/test_tidy.py
@@ -1,6 +1,6 @@
import unittest
from textwrap import dedent
-from StringIO import StringIO
+from six import StringIO
from iniparse import tidy,INIConfig
from iniparse.ini import EmptyLine
diff --git a/tests/test_unicode.py b/tests/test_unicode.py
index a56fcab..14d4fbd 100644
--- a/tests/test_unicode.py
+++ b/tests/test_unicode.py
@@ -1,5 +1,5 @@
import unittest
-from StringIO import StringIO
+import six
from iniparse import compat, ini
class test_unicode(unittest.TestCase):
@@ -17,14 +17,14 @@ baz = Marc-Andr\202
"""
def basic_tests(self, s, strable):
- f = StringIO(s)
+ f = six.StringIO(s)
i = ini.INIConfig(f)
- self.assertEqual(unicode(i), s)
- self.assertEqual(type(i.foo.bar), unicode)
+ self.assertEqual(six.text_type(i), s)
+ self.assertEqual(type(i.foo.bar), six.text_type)
if strable:
self.assertEqual(str(i), str(s))
else:
- self.assertRaises(UnicodeEncodeError, lambda: str(i))
+ self.assertRaises(UnicodeEncodeError, lambda: six.text_type(i).encode('ascii'))
return i
def test_ascii(self):
--
2.11.0

View File

@@ -4,13 +4,15 @@ LICENSE = "MIT & PSF"
LIC_FILES_CHKSUM = "file://LICENSE-PSF;md5=1c78a5bb3584b353496d5f6f34edb4b2 \
file://LICENSE;md5=52f28065af11d69382693b45b5a8eb54"
SRC_URI = "https://files.pythonhosted.org/packages/source/i/iniparse/iniparse-${PV}.tar.gz"
SRC_URI = "https://files.pythonhosted.org/packages/source/i/iniparse/iniparse-${PV}.tar.gz \
file://0001-Add-python-3-compatibility.patch "
SRC_URI[md5sum] = "5e573e9e9733d97623881ce9bbe5eca6"
SRC_URI[sha256sum] = "abc1ee12d2cfb2506109072d6c21e40b6c75a3fe90a9c924327d80bc0d99c054"
inherit distutils
inherit distutils3
RDEPENDS_${PN} += "python-core"
RDEPENDS_${PN} += "python3-core python3-six"
DEPENDS += "python3-six"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -9,10 +9,10 @@ SRC_URI[sha256sum] = "5fd887c407015296a8fd3f4b867fe0fcca3179de97ccde90449853a3df
S = "${WORKDIR}/pygpgme-${PV}"
inherit distutils
inherit distutils3
DEPENDS = "gpgme python"
DEPENDS = "gpgme python3"
RDEPENDS_${PN} += "python-core"
RDEPENDS_${PN} += "python3-core"
BBCLASSEXTEND = "native nativesdk"

View File

@@ -1,16 +1,34 @@
Upstream-Status: Pending
get the sys.lib from python itself and do not use hardcoded value of 'lib'
From 51fe6f22d0ba113674fb358bd11d75fe659bd26e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 14 May 2013 15:00:26 -0700
Subject: [PATCH 01/13] get the sys.lib from python itself and do not use
hardcoded value of 'lib'
02/2015 Rebased for 3.4.2
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Index: Python-3.5.2/Include/pythonrun.h
===================================================================
--- Python-3.5.2.orig/Include/pythonrun.h
+++ Python-3.5.2/Include/pythonrun.h
---
Include/pythonrun.h | 3 +++
Lib/distutils/command/install.py | 4 +++-
Lib/pydoc.py | 2 +-
Lib/site.py | 4 ++--
Lib/sysconfig.py | 18 +++++++++---------
Lib/trace.py | 4 ++--
Makefile.pre.in | 7 +++++--
Modules/getpath.c | 10 +++++++++-
Python/getplatform.c | 20 ++++++++++++++++++++
Python/sysmodule.c | 4 ++++
configure.ac | 35 +++++++++++++++++++++++++++++++++++
setup.py | 9 ++++-----
12 files changed, 97 insertions(+), 23 deletions(-)
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index 9c2e813..2f79cb6 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -23,6 +23,9 @@ typedef struct {
} PyCompilerFlags;
#endif
@@ -21,10 +39,10 @@ Index: Python-3.5.2/Include/pythonrun.h
#ifndef Py_LIMITED_API
PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
Index: Python-3.5.2/Lib/distutils/command/install.py
===================================================================
--- Python-3.5.2.orig/Lib/distutils/command/install.py
+++ Python-3.5.2/Lib/distutils/command/install.py
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 67db007..b46b45b 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -19,6 +19,8 @@ from site import USER_BASE
from site import USER_SITE
HAS_USER_SITE = True
@@ -43,10 +61,10 @@ Index: Python-3.5.2/Lib/distutils/command/install.py
'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
'scripts': '$base/bin',
'data' : '$base',
Index: Python-3.5.2/Lib/pydoc.py
===================================================================
--- Python-3.5.2.orig/Lib/pydoc.py
+++ Python-3.5.2/Lib/pydoc.py
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 3ca08c9..6528730 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -384,7 +384,7 @@ class Doc:
docmodule = docclass = docroutine = docother = docproperty = docdata = fail
@@ -56,181 +74,29 @@ Index: Python-3.5.2/Lib/pydoc.py
"python%d.%d" % sys.version_info[:2])):
"""Return the location of module docs or None"""
Index: Python-3.5.2/Lib/trace.py
===================================================================
--- Python-3.5.2.orig/Lib/trace.py
+++ Python-3.5.2/Lib/trace.py
@@ -749,10 +749,10 @@ def main(argv=None):
# should I also call expanduser? (after all, could use $HOME)
diff --git a/Lib/site.py b/Lib/site.py
index 3f78ef5..511931e 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -303,12 +303,12 @@ def getsitepackages(prefixes=None):
seen.add(prefix)
s = s.replace("$prefix",
- os.path.join(sys.base_prefix, "lib",
+ os.path.join(sys.base_prefix, sys.lib,
"python" + sys.version[:3]))
s = s.replace("$exec_prefix",
- os.path.join(sys.base_exec_prefix, "lib",
+ os.path.join(sys.base_exec_prefix, sys.lib,
"python" + sys.version[:3]))
s = os.path.normpath(s)
ignore_dirs.append(s)
Index: Python-3.5.2/Makefile.pre.in
===================================================================
--- Python-3.5.2.orig/Makefile.pre.in
+++ Python-3.5.2/Makefile.pre.in
@@ -106,6 +106,8 @@ PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS
# Machine-dependent subdirectories
MACHDEP= @MACHDEP@
+LIB= @LIB@
+ARCH= @ARCH@
# Multiarch directory (may be empty)
MULTIARCH= @MULTIARCH@
@@ -125,7 +127,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
-SCRIPTDIR= $(prefix)/lib
+SCRIPTDIR= @libdir@
ABIFLAGS= @ABIFLAGS@
# Detailed destination directories
@@ -755,6 +757,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
-DEXEC_PREFIX='"$(exec_prefix)"' \
-DVERSION='"$(VERSION)"' \
-DVPATH='"$(VPATH)"' \
+ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
-o $@ $(srcdir)/Modules/getpath.c
Programs/python.o: $(srcdir)/Programs/python.c
@@ -835,7 +838,7 @@ $(OPCODE_H): $(srcdir)/Lib/opcode.py $(O
Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
Python/getplatform.o: $(srcdir)/Python/getplatform.c
- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
+ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
Python/importdl.o: $(srcdir)/Python/importdl.c
$(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
Index: Python-3.5.2/Modules/getpath.c
===================================================================
--- Python-3.5.2.orig/Modules/getpath.c
+++ Python-3.5.2/Modules/getpath.c
@@ -105,6 +105,13 @@
#error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
#endif
+#define LIB_PYTHON LIB "/python" VERSION
+
+#ifndef PYTHONPATH
+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+#endif
+
#ifndef LANDMARK
#define LANDMARK L"os.py"
#endif
@@ -113,6 +120,7 @@ static wchar_t prefix[MAXPATHLEN+1];
static wchar_t exec_prefix[MAXPATHLEN+1];
static wchar_t progpath[MAXPATHLEN+1];
static wchar_t *module_search_path = NULL;
+static wchar_t *lib_python = L"" LIB_PYTHON;
/* Get file status. Encode the path to the locale encoding. */
@@ -494,7 +502,7 @@ calculate_path(void)
_pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
_prefix = Py_DecodeLocale(PREFIX, NULL);
_exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
+ lib_python = Py_DecodeLocale(LIB_PYTHON, NULL);
if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
Py_FatalError(
Index: Python-3.5.2/Python/getplatform.c
===================================================================
--- Python-3.5.2.orig/Python/getplatform.c
+++ Python-3.5.2/Python/getplatform.c
@@ -10,3 +10,23 @@ Py_GetPlatform(void)
{
return PLATFORM;
}
+
+#ifndef ARCH
+#define ARCH "unknown"
+#endif
+
+const char *
+Py_GetArch(void)
+{
+ return ARCH;
+}
+
+#ifndef LIB
+#define LIB "lib"
+#endif
+
+const char *
+Py_GetLib(void)
+{
+ return LIB;
+}
Index: Python-3.5.2/Python/sysmodule.c
===================================================================
--- Python-3.5.2.orig/Python/sysmodule.c
+++ Python-3.5.2/Python/sysmodule.c
@@ -1790,6 +1790,10 @@ _PySys_Init(void)
PyUnicode_FromString(Py_GetCopyright()));
SET_SYS_FROM_STRING("platform",
PyUnicode_FromString(Py_GetPlatform()));
+ SET_SYS_FROM_STRING("arch",
+ PyUnicode_FromString(Py_GetArch()));
+ SET_SYS_FROM_STRING("lib",
+ PyUnicode_FromString(Py_GetLib()));
SET_SYS_FROM_STRING("executable",
PyUnicode_FromWideChar(
Py_GetProgramFullPath(), -1));
Index: Python-3.5.2/setup.py
===================================================================
--- Python-3.5.2.orig/setup.py
+++ Python-3.5.2/setup.py
@@ -495,7 +495,7 @@ class PyBuildExt(build_ext):
# directories (i.e. '.' and 'Include') must be first. See issue
# 10520.
if not cross_compiling:
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
# only change this for cross builds for 3.3, issues on Mageia
if cross_compiling:
@@ -553,8 +553,7 @@ class PyBuildExt(build_ext):
# be assumed that no additional -I,-L directives are needed.
if not cross_compiling:
lib_dirs = self.compiler.library_dirs + [
- '/lib64', '/usr/lib64',
- '/lib', '/usr/lib',
+ '/' + sys.lib, '/usr/' + sys.lib,
]
inc_dirs = self.compiler.include_dirs + ['/usr/include']
if os.sep == '/':
- sitepackages.append(os.path.join(prefix, "lib",
+ sitepackages.append(os.path.join(prefix, sys.lib,
"python" + sys.version[:3],
"site-packages"))
else:
@@ -746,11 +745,11 @@ class PyBuildExt(build_ext):
elif curses_library:
readline_libs.append(curses_library)
elif self.compiler.find_library_file(lib_dirs +
- ['/usr/lib/termcap'],
+ ['/usr/'+sys.lib+'/termcap'],
'termcap'):
readline_libs.append('termcap')
exts.append( Extension('readline', ['readline.c'],
- library_dirs=['/usr/lib/termcap'],
+ library_dirs=['/usr/'+sys.lib+'/termcap'],
extra_link_args=readline_extra_link_args,
libraries=readline_libs) )
else:
Index: Python-3.5.2/Lib/sysconfig.py
===================================================================
--- Python-3.5.2.orig/Lib/sysconfig.py
+++ Python-3.5.2/Lib/sysconfig.py
sitepackages.append(prefix)
- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
if sys.platform == "darwin":
# for framework builds *only* we add the standard Apple
# locations.
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 9c34be0..3d1181a 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -20,10 +20,10 @@ __all__ = [
_INSTALL_SCHEMES = {
@@ -273,10 +139,144 @@ Index: Python-3.5.2/Lib/sysconfig.py
'include': '{userbase}/include/python{py_version_short}',
'scripts': '{userbase}/bin',
'data': '{userbase}',
Index: Python-3.5.2/configure.ac
===================================================================
--- Python-3.5.2.orig/configure.ac
+++ Python-3.5.2/configure.ac
diff --git a/Lib/trace.py b/Lib/trace.py
index f108266..7fd83f2 100755
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -749,10 +749,10 @@ def main(argv=None):
# should I also call expanduser? (after all, could use $HOME)
s = s.replace("$prefix",
- os.path.join(sys.base_prefix, "lib",
+ os.path.join(sys.base_prefix, sys.lib,
"python" + sys.version[:3]))
s = s.replace("$exec_prefix",
- os.path.join(sys.base_exec_prefix, "lib",
+ os.path.join(sys.base_exec_prefix, sys.lib,
"python" + sys.version[:3]))
s = os.path.normpath(s)
ignore_dirs.append(s)
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 109f402..61a41e2 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -106,6 +106,8 @@ PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARE
# Machine-dependent subdirectories
MACHDEP= @MACHDEP@
+LIB= @LIB@
+ARCH= @ARCH@
# Multiarch directory (may be empty)
MULTIARCH= @MULTIARCH@
@@ -125,7 +127,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
-SCRIPTDIR= $(prefix)/lib
+SCRIPTDIR= @libdir@
ABIFLAGS= @ABIFLAGS@
# Detailed destination directories
@@ -755,6 +757,7 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
-DEXEC_PREFIX='"$(exec_prefix)"' \
-DVERSION='"$(VERSION)"' \
-DVPATH='"$(VPATH)"' \
+ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
-o $@ $(srcdir)/Modules/getpath.c
Programs/python.o: $(srcdir)/Programs/python.c
@@ -835,7 +838,7 @@ $(OPCODE_H): $(srcdir)/Lib/opcode.py $(OPCODE_H_SCRIPT)
Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
Python/getplatform.o: $(srcdir)/Python/getplatform.c
- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
+ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
Python/importdl.o: $(srcdir)/Python/importdl.c
$(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 18deb60..a01c3f8 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -105,6 +105,13 @@
#error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
#endif
+#define LIB_PYTHON LIB "/python" VERSION
+
+#ifndef PYTHONPATH
+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+#endif
+
#ifndef LANDMARK
#define LANDMARK L"os.py"
#endif
@@ -113,6 +120,7 @@ static wchar_t prefix[MAXPATHLEN+1];
static wchar_t exec_prefix[MAXPATHLEN+1];
static wchar_t progpath[MAXPATHLEN+1];
static wchar_t *module_search_path = NULL;
+static wchar_t *lib_python = L"" LIB_PYTHON;
/* Get file status. Encode the path to the locale encoding. */
@@ -494,7 +502,7 @@ calculate_path(void)
_pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
_prefix = Py_DecodeLocale(PREFIX, NULL);
_exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
+ lib_python = Py_DecodeLocale(LIB_PYTHON, NULL);
if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
Py_FatalError(
diff --git a/Python/getplatform.c b/Python/getplatform.c
index 6899140..66a49c6 100644
--- a/Python/getplatform.c
+++ b/Python/getplatform.c
@@ -10,3 +10,23 @@ Py_GetPlatform(void)
{
return PLATFORM;
}
+
+#ifndef ARCH
+#define ARCH "unknown"
+#endif
+
+const char *
+Py_GetArch(void)
+{
+ return ARCH;
+}
+
+#ifndef LIB
+#define LIB "lib"
+#endif
+
+const char *
+Py_GetLib(void)
+{
+ return LIB;
+}
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 8d7e05a..d9dee0f 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1790,6 +1790,10 @@ _PySys_Init(void)
PyUnicode_FromString(Py_GetCopyright()));
SET_SYS_FROM_STRING("platform",
PyUnicode_FromString(Py_GetPlatform()));
+ SET_SYS_FROM_STRING("arch",
+ PyUnicode_FromString(Py_GetArch()));
+ SET_SYS_FROM_STRING("lib",
+ PyUnicode_FromString(Py_GetLib()));
SET_SYS_FROM_STRING("executable",
PyUnicode_FromWideChar(
Py_GetProgramFullPath(), -1));
diff --git a/configure.ac b/configure.ac
index 707324d..e8d59a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -883,6 +883,41 @@ PLATDIR=plat-$MACHDEP
AC_SUBST(PLATDIR)
AC_SUBST(PLATFORM_TRIPLET)
@@ -319,3 +319,43 @@ Index: Python-3.5.2/configure.ac
AC_MSG_CHECKING([for -Wl,--no-as-needed])
save_LDFLAGS="$LDFLAGS"
diff --git a/setup.py b/setup.py
index 6d26deb..7b14215 100644
--- a/setup.py
+++ b/setup.py
@@ -495,7 +495,7 @@ class PyBuildExt(build_ext):
# directories (i.e. '.' and 'Include') must be first. See issue
# 10520.
if not cross_compiling:
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
# only change this for cross builds for 3.3, issues on Mageia
if cross_compiling:
@@ -553,8 +553,7 @@ class PyBuildExt(build_ext):
# be assumed that no additional -I,-L directives are needed.
if not cross_compiling:
lib_dirs = self.compiler.library_dirs + [
- '/lib64', '/usr/lib64',
- '/lib', '/usr/lib',
+ '/' + sys.lib, '/usr/' + sys.lib,
]
inc_dirs = self.compiler.include_dirs + ['/usr/include']
else:
@@ -746,11 +745,11 @@ class PyBuildExt(build_ext):
elif curses_library:
readline_libs.append(curses_library)
elif self.compiler.find_library_file(lib_dirs +
- ['/usr/lib/termcap'],
+ ['/usr/'+sys.lib+'/termcap'],
'termcap'):
readline_libs.append('termcap')
exts.append( Extension('readline', ['readline.c'],
- library_dirs=['/usr/lib/termcap'],
+ library_dirs=['/usr/'+sys.lib+'/termcap'],
extra_link_args=readline_extra_link_args,
libraries=readline_libs) )
else:
--
2.11.0

View File

@@ -0,0 +1,30 @@
From 36cf0ff26ece53e529e8b4f2d2f09acd8794b055 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Fri, 24 Mar 2017 15:35:47 +0200
Subject: [PATCH] Add PYTHON_ABI when searching for python libraries.
It has a value of 'm' when using Python3, and so without it
configure will not find the libraries.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 9c58467c1..a506ec819 100644
--- a/configure.ac
+++ b/configure.ac
@@ -642,7 +642,7 @@ AS_IF([test "$enable_python" = yes],[
])
CPPFLAGS="$save_CPPFLAGS"
save_LIBS="$LIBS"
- AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[
+ AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION}${PYTHON_ABI} python],[
WITH_PYTHON_LIB="$ac_res"
],[AC_MSG_ERROR([missing python library])
])
--
2.11.0

View File

@@ -13,8 +13,8 @@ simplify the process of creating graphical package managers or any \
other tools that need an intimate knowledge of RPM packages in order \
to function."
SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages"
DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
SUMMARY_python3-rpm = "Python bindings for apps which will manupulate RPM packages"
DESCRIPTION_python3-rpm = "The python3-rpm package contains a module that permits applications \
written in the Python programming language to use the interface \
supplied by the RPM Package Manager libraries."
@@ -34,6 +34,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm \
file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
file://0001-Fix-build-with-musl-C-library.patch \
file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
file://0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch \
"
PV = "4.13.90+git${SRCPV}"
@@ -42,10 +43,11 @@ SRCREV = "a8e51b3bb05c6acb1d9b2e3d34f859ddda1677be"
S = "${WORKDIR}/git"
DEPENDS = "nss libarchive db file popt xz dbus elfutils python"
DEPENDS = "nss libarchive db file popt xz dbus elfutils python3"
DEPENDS_append_class-native = " file-replacement-native"
inherit autotools gettext pkgconfig pythonnative
inherit autotools gettext pkgconfig python3native
export PYTHON_ABI
# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
@@ -102,9 +104,9 @@ FILES_${PN} += "${libdir}/rpm-plugins/*.so \
FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
"
PACKAGES += "python-rpm"
PROVIDES += "python-rpm"
FILES_python-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
PACKAGES += "python3-rpm"
PROVIDES += "python3-rpm"
FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
# rpm 5.x was packaging the rpm build tools separately
PROVIDES += "rpm-build"
RPROVIDES_${PN} += "rpm-build"

View File

@@ -27,7 +27,6 @@ EXTRA_OECONF = "--enable-shared-glapi --with-llvm-prefix=${STAGING_BINDIR_NATIVE
PACKAGECONFIG ??= "gbm egl gles dri \
${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)} \
"
PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm"
X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
@@ -52,7 +51,12 @@ EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'x11', ',x11', '', d)}"
EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}"
PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
PACKAGECONFIG[etnaviv] = ""
PACKAGECONFIG[imx] = ""
GALLIUMDRIVERS = "swrast"
GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'imx', ',imx', '', d)}"
GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
PACKAGECONFIG[r600] = ""
GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"

View File

@@ -5,8 +5,9 @@ SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/mesa-${PV}.tar.xz \
file://disable-asm-on-non-gcc.patch \
file://0001-Use-wayland-scanner-in-the-path.patch \
"
SRC_URI[md5sum] = "6a7e768241846c8c69bbadbf904dcc58"
SRC_URI[sha256sum] = "96fd70ef5f31d276a17e424e7e1bb79447ccbbe822b56844213ef932e7ad1b0c"
SRC_URI[md5sum] = "8f808e92b893d412fbd6510e1d16f5c5"
SRC_URI[sha256sum] = "f8f191f909e01e65de38d5bdea5fb057f21649a3aed20948be02348e77a689d4"
#because we cannot rely on the fact that all apps will use pkgconfig,
#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -29,4 +29,6 @@ SRC_URI += "file://{{=machine}}-standard.scc \
# the appropriate changes committed to the upstream linux-yocto repo
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -60,3 +60,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -60,3 +60,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -60,3 +60,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -60,3 +60,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -59,3 +59,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -59,3 +59,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -59,3 +59,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -59,3 +59,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -31,3 +31,5 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.1"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.10"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.4"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -30,3 +30,5 @@ SRC_URI += "file://{{=machine}}-standard.scc \
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "4.8"
#Remove the following line once AUTOREV is locked to a certain SRCREV
KERNEL_VERSION_SANITY_SKIP = "1"

View File

@@ -1223,7 +1223,7 @@ def _create_kconfig_diff(srctree, rd, outfile):
stdout, stderr = pipe.communicate()
if pipe.returncode == 1:
logger.info("Updating config fragment %s" % outfile)
with open(outfile, 'w') as fobj:
with open(outfile, 'wb') as fobj:
fobj.write(stdout)
elif pipe.returncode == 0:
logger.info("Would remove config fragment %s" % outfile)