summaryrefslogtreecommitdiffstats
path: root/yocto-poky/scripts
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-03-30 15:21:19 -0500
committerPatrick Williams <patrick@stwcx.xyz>2016-03-30 15:21:19 -0500
commitb4a027550acf2c1051c34f997b8e7e845017af4b (patch)
tree9e38d3c17b42cb1e6765620a87e908973a93c821 /yocto-poky/scripts
parent2fe86d90044af218ced8f42fdded6b136f1046d2 (diff)
parentf1e5d6968976c2341c6d554bfcc8895f1b33c26b (diff)
downloadtalos-openbmc-b4a027550acf2c1051c34f997b8e7e845017af4b.tar.gz
talos-openbmc-b4a027550acf2c1051c34f997b8e7e845017af4b.zip
Merge commit 'f1e5d6968976c2341c6d554bfcc8895f1b33c26b' from yocto-2.0.1
Diffstat (limited to 'yocto-poky/scripts')
-rwxr-xr-xyocto-poky/scripts/contrib/devtool-stress.py241
-rwxr-xr-xyocto-poky/scripts/contrib/python/generate-manifest-3.4.py2
-rwxr-xr-xyocto-poky/scripts/devtool5
-rwxr-xr-xyocto-poky/scripts/gen-lockedsig-cache19
-rw-r--r--yocto-poky/scripts/lib/bsp/engine.py6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall4
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend1
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.19.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf4
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall4
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend1
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.19.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall4
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend1
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.19.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall4
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend1
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.14.bbappend5
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.19.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf2
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall4
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend1
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.19.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall4
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend1
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend62
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.19.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend61
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc3
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall2
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend1
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend6
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend33
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.19.bbappend7
-rw-r--r--yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend32
-rw-r--r--yocto-poky/scripts/lib/devtool/__init__.py65
-rw-r--r--yocto-poky/scripts/lib/devtool/build-image.py94
-rw-r--r--yocto-poky/scripts/lib/devtool/build.py6
-rw-r--r--yocto-poky/scripts/lib/devtool/deploy.py9
-rw-r--r--yocto-poky/scripts/lib/devtool/package.py8
-rw-r--r--yocto-poky/scripts/lib/devtool/runqemu.py64
-rw-r--r--yocto-poky/scripts/lib/devtool/sdk.py56
-rw-r--r--yocto-poky/scripts/lib/devtool/search.py80
-rw-r--r--yocto-poky/scripts/lib/devtool/standard.py590
-rw-r--r--yocto-poky/scripts/lib/devtool/upgrade.py70
-rw-r--r--yocto-poky/scripts/lib/recipetool/create.py74
-rw-r--r--yocto-poky/scripts/lib/recipetool/create_buildsys.py2
-rw-r--r--yocto-poky/scripts/lib/scriptutils.py4
-rw-r--r--yocto-poky/scripts/lib/wic/imager/direct.py3
-rw-r--r--yocto-poky/scripts/lib/wic/utils/oe/misc.py20
-rwxr-xr-xyocto-poky/scripts/oe-git-proxy12
-rwxr-xr-xyocto-poky/scripts/oe-pkgdata-util7
-rwxr-xr-xyocto-poky/scripts/oe-publish-sdk4
-rw-r--r--yocto-poky/scripts/postinst-intercepts/update_font_cache4
-rw-r--r--yocto-poky/scripts/postinst-intercepts/update_icon_cache3
-rw-r--r--yocto-poky/scripts/postinst-intercepts/update_pixbuf_cache4
-rwxr-xr-xyocto-poky/scripts/runqemu33
-rwxr-xr-xyocto-poky/scripts/runqemu-export-rootfs8
-rwxr-xr-xyocto-poky/scripts/runqemu-ifup15
-rwxr-xr-xyocto-poky/scripts/runqemu-internal89
-rwxr-xr-xyocto-poky/scripts/yocto-bsp2
117 files changed, 1879 insertions, 557 deletions
diff --git a/yocto-poky/scripts/contrib/devtool-stress.py b/yocto-poky/scripts/contrib/devtool-stress.py
new file mode 100755
index 000000000..4b35fc9d0
--- /dev/null
+++ b/yocto-poky/scripts/contrib/devtool-stress.py
@@ -0,0 +1,241 @@
+#!/usr/bin/env python
+
+# devtool stress tester
+#
+# Written by: Paul Eggleton <paul.eggleton@linux.intel.com>
+#
+# Copyright 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import sys
+import os
+import os.path
+import subprocess
+import re
+import argparse
+import logging
+import tempfile
+import shutil
+import signal
+import fnmatch
+
+scripts_lib_path = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'lib'))
+sys.path.insert(0, scripts_lib_path)
+import scriptutils
+logger = scriptutils.logger_create('devtool-stress')
+
+def select_recipes(args):
+ import bb.tinfoil
+ tinfoil = bb.tinfoil.Tinfoil()
+ tinfoil.prepare(False)
+
+ pkg_pn = tinfoil.cooker.recipecache.pkg_pn
+ (latest_versions, preferred_versions) = bb.providers.findProviders(tinfoil.config_data, tinfoil.cooker.recipecache, pkg_pn)
+
+ skip_classes = args.skip_classes.split(',')
+
+ recipelist = []
+ for pn in sorted(pkg_pn):
+ pref = preferred_versions[pn]
+ inherits = [os.path.splitext(os.path.basename(f))[0] for f in tinfoil.cooker.recipecache.inherits[pref[1]]]
+ for cls in skip_classes:
+ if cls in inherits:
+ break
+ else:
+ recipelist.append(pn)
+
+ tinfoil.shutdown()
+
+ resume_from = args.resume_from
+ if resume_from:
+ if not resume_from in recipelist:
+ print('%s is not a testable recipe' % resume_from)
+ return 1
+ if args.only:
+ only = args.only.split(',')
+ for onlyitem in only:
+ for pn in recipelist:
+ if fnmatch.fnmatch(pn, onlyitem):
+ break
+ else:
+ print('%s does not match any testable recipe' % onlyitem)
+ return 1
+ else:
+ only = None
+ if args.skip:
+ skip = args.skip.split(',')
+ else:
+ skip = []
+
+ recipes = []
+ for pn in recipelist:
+ if resume_from:
+ if pn == resume_from:
+ resume_from = None
+ else:
+ continue
+
+ if args.only:
+ for item in only:
+ if fnmatch.fnmatch(pn, item):
+ break
+ else:
+ continue
+
+ skipit = False
+ for item in skip:
+ if fnmatch.fnmatch(pn, item):
+ skipit = True
+ if skipit:
+ continue
+
+ recipes.append(pn)
+
+ return recipes
+
+
+def stress_extract(args):
+ import bb.process
+
+ recipes = select_recipes(args)
+
+ failures = 0
+ tmpdir = tempfile.mkdtemp()
+ os.setpgrp()
+ try:
+ for pn in recipes:
+ sys.stdout.write('Testing %s ' % (pn + ' ').ljust(40, '.'))
+ sys.stdout.flush()
+ failed = False
+
+ srctree = os.path.join(tmpdir, pn)
+ try:
+ bb.process.run('devtool extract %s %s' % (pn, srctree))
+ except bb.process.CmdError as exc:
+ failed = True
+ with open('stress_%s_extract.log' % pn, 'w') as f:
+ f.write(str(exc))
+
+ if os.path.exists(srctree):
+ shutil.rmtree(srctree)
+
+ if failed:
+ print('failed')
+ failures += 1
+ else:
+ print('ok')
+ except KeyboardInterrupt:
+ # We want any child processes killed. This is crude, but effective.
+ os.killpg(0, signal.SIGTERM)
+
+ if failures:
+ return 1
+ else:
+ return 0
+
+
+def stress_modify(args):
+ import bb.process
+
+ recipes = select_recipes(args)
+
+ failures = 0
+ tmpdir = tempfile.mkdtemp()
+ os.setpgrp()
+ try:
+ for pn in recipes:
+ sys.stdout.write('Testing %s ' % (pn + ' ').ljust(40, '.'))
+ sys.stdout.flush()
+ failed = False
+ reset = True
+
+ srctree = os.path.join(tmpdir, pn)
+ try:
+ bb.process.run('devtool modify -x %s %s' % (pn, srctree))
+ except bb.process.CmdError as exc:
+ with open('stress_%s_modify.log' % pn, 'w') as f:
+ f.write(str(exc))
+ failed = 'modify'
+ reset = False
+
+ if not failed:
+ try:
+ bb.process.run('bitbake -c install %s' % pn)
+ except bb.process.CmdError as exc:
+ with open('stress_%s_install.log' % pn, 'w') as f:
+ f.write(str(exc))
+ failed = 'build'
+ if reset:
+ try:
+ bb.process.run('devtool reset %s' % pn)
+ except bb.process.CmdError as exc:
+ print('devtool reset failed: %s' % str(exc))
+ break
+
+ if os.path.exists(srctree):
+ shutil.rmtree(srctree)
+
+ if failed:
+ print('failed (%s)' % failed)
+ failures += 1
+ else:
+ print('ok')
+ except KeyboardInterrupt:
+ # We want any child processes killed. This is crude, but effective.
+ os.killpg(0, signal.SIGTERM)
+
+ if failures:
+ return 1
+ else:
+ return 0
+
+
+def main():
+ parser = argparse.ArgumentParser(description="devtool stress tester",
+ epilog="Use %(prog)s <subcommand> --help to get help on a specific command")
+ parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
+ parser.add_argument('-r', '--resume-from', help='Resume from specified recipe', metavar='PN')
+ parser.add_argument('-o', '--only', help='Only test specified recipes (comma-separated without spaces, wildcards allowed)', metavar='PNLIST')
+ parser.add_argument('-s', '--skip', help='Skip specified recipes (comma-separated without spaces, wildcards allowed)', metavar='PNLIST')
+ parser.add_argument('-c', '--skip-classes', help='Skip recipes inheriting specified classes (comma-separated) - default %(default)s', metavar='CLASSLIST', default='native,nativesdk,cross,cross-canadian,image,populate_sdk,meta,packagegroup')
+ subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
+
+ parser_modify = subparsers.add_parser('modify',
+ help='Run "devtool modify" followed by a build with bitbake on matching recipes',
+ description='Runs "devtool modify" followed by a build with bitbake on matching recipes')
+ parser_modify.set_defaults(func=stress_modify)
+
+ parser_extract = subparsers.add_parser('extract',
+ help='Run "devtool extract" on matching recipes',
+ description='Runs "devtool extract" on matching recipes')
+ parser_extract.set_defaults(func=stress_extract)
+
+ args = parser.parse_args()
+
+ if args.debug:
+ logger.setLevel(logging.DEBUG)
+
+ import scriptpath
+ bitbakepath = scriptpath.add_bitbake_lib_path()
+ if not bitbakepath:
+ logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
+ return 1
+ logger.debug('Found bitbake path: %s' % bitbakepath)
+
+ ret = args.func(args)
+
+if __name__ == "__main__":
+ main()
diff --git a/yocto-poky/scripts/contrib/python/generate-manifest-3.4.py b/yocto-poky/scripts/contrib/python/generate-manifest-3.4.py
index 06eecdc5d..ca2fa6117 100755
--- a/yocto-poky/scripts/contrib/python/generate-manifest-3.4.py
+++ b/yocto-poky/scripts/contrib/python/generate-manifest-3.4.py
@@ -238,7 +238,7 @@ if __name__ == "__main__":
m.addPackage( "${PN}-db", "Python file-based database support", "${PN}-core",
"anydbm.* dumbdbm.* whichdb.* dbm lib-dynload/_dbm.*.so" )
- m.addPackage( "${PN}-debugger", "Python debugger", "${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint",
+ m.addPackage( "${PN}-debugger", "Python debugger", "${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint ${PN}-importlib ${PN}-pkgutil",
"bdb.* pdb.*" )
m.addPackage( "${PN}-difflib", "Python helpers for computing deltas between objects", "${PN}-lang ${PN}-re",
diff --git a/yocto-poky/scripts/devtool b/yocto-poky/scripts/devtool
index 87df951dc..e4d9db301 100755
--- a/yocto-poky/scripts/devtool
+++ b/yocto-poky/scripts/devtool
@@ -221,9 +221,6 @@ def main():
if not config.read():
return -1
- # We need to be in this directory or we won't be able to initialise tinfoil
- os.chdir(basepath)
-
bitbake_subdir = config.get('General', 'bitbake_subdir', '')
if bitbake_subdir:
# Normally set for use within the SDK
@@ -244,7 +241,7 @@ def main():
scriptutils.logger_setup_color(logger, global_args.color)
if global_args.bbpath is None:
- tinfoil = setup_tinfoil(config_only=True)
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
global_args.bbpath = tinfoil.config_data.getVar('BBPATH', True)
else:
tinfoil = None
diff --git a/yocto-poky/scripts/gen-lockedsig-cache b/yocto-poky/scripts/gen-lockedsig-cache
index c93b2c0b9..6aa361400 100755
--- a/yocto-poky/scripts/gen-lockedsig-cache
+++ b/yocto-poky/scripts/gen-lockedsig-cache
@@ -1,7 +1,4 @@
#!/usr/bin/env python
-#
-# gen-lockedsig-cache <locked-sigs.inc> <input-cachedir> <output-cachedir>
-#
import os
import sys
@@ -18,14 +15,17 @@ def mkdir(d):
if len(sys.argv) < 3:
print("Incorrect number of arguments specified")
+ print("syntax: gen-lockedsig-cache <locked-sigs.inc> <input-cachedir> <output-cachedir>")
sys.exit(1)
+print('Reading %s' % sys.argv[1])
sigs = []
with open(sys.argv[1]) as f:
for l in f.readlines():
if ":" in l:
sigs.append(l.split(":")[2].split()[0])
+print('Gathering file list')
files = set()
for s in sigs:
p = sys.argv[2] + "/" + s[:2] + "/*" + s + "*"
@@ -33,14 +33,25 @@ for s in sigs:
p = sys.argv[2] + "/*/" + s[:2] + "/*" + s + "*"
files |= set(glob.glob(p))
+print('Processing files')
for f in files:
- dst = f.replace(sys.argv[2], sys.argv[3])
+ sys.stdout.write('Processing %s... ' % f)
+ _, ext = os.path.splitext(f)
+ if not ext in ['.tgz', '.siginfo', '.sig']:
+ # Most likely a temp file, skip it
+ print('skipping')
+ continue
+ dst = os.path.join(sys.argv[3], os.path.relpath(f, sys.argv[2]))
destdir = os.path.dirname(dst)
mkdir(destdir)
if os.path.exists(dst):
os.remove(dst)
if (os.stat(f).st_dev == os.stat(destdir).st_dev):
+ print('linking')
os.link(f, dst)
else:
+ print('copying')
shutil.copyfile(f, dst)
+
+print('Done!')
diff --git a/yocto-poky/scripts/lib/bsp/engine.py b/yocto-poky/scripts/lib/bsp/engine.py
index 7d6be239d..d0d5d726a 100644
--- a/yocto-poky/scripts/lib/bsp/engine.py
+++ b/yocto-poky/scripts/lib/bsp/engine.py
@@ -1684,9 +1684,9 @@ def yocto_layer_list_properties(arch, scripts_path, properties_file, expand_comm
print "Couldn't open properties file %s for writing, exiting" % properties_file
sys.exit(1)
- json.dump(properties, of)
-
- print_dict(properties)
+ json.dump(properties, of, indent=1)
+ else:
+ print_dict(properties)
def split_nested_property(property):
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc
index ca5f3b5be..ea6966ca4 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-preempt-rt.scc
define KMACHINE {{=machine}}
-define KTYPE preempt-rt
+
define KARCH arm
include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc
index 9014c2c97..405972d98 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-standard.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-standard.scc
define KMACHINE {{=machine}}
-define KTYPE standard
+
define KARCH arm
include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc
index 3f1c25223..921b7e7e9 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/machine-tiny.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-tiny.scc
define KMACHINE {{=machine}}
-define KTYPE tiny
+
define KARCH arm
include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
index 811d69547..7676ca883 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
{{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.19) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.1) kernel? (y/n)" default:"y"}}
{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.19"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.1"}}
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend
index 2fa6231cb..c336007eb 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -21,6 +21,5 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
index 5f8db03c6..c56e9e56f 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-preempt-rt.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb"
-#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f"
+SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
index 471ccbcc3..15b9b1b92 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
index 4de82fad0..caefcfc26 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend
index 1e1cc5131..5af490dc5 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.14.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.19.bbappend
index 97e1bb843..c327d16d7 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_3.19.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..2d3d073f7
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# 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" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf
index 718934190..1739ab3cf 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/machine.conf
@@ -33,7 +33,7 @@ MACHINE_FEATURES += "wifi efi pcbios"
{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (y/n)" default:"y" }}
-{{ if xserver == "y" and (kernel_choice == "linux-yocto_3.19" or kernel_choice == "linux-yocto_3.14"): }}
+{{ if xserver == "y" and (kernel_choice == "linux-yocto_4.1" or kernel_choice == "linux-yocto_3.19" or kernel_choice == "linux-yocto_3.14"): }}
{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" default:"xserver_vesa" }}
{{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }}
{{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }}
@@ -49,7 +49,7 @@ MACHINE_FEATURES += "wifi efi pcbios"
{{ input type:"choice" val:"xserver_fbdev" msg:"fbdev xserver support" }}
{{ input type:"choice" val:"xserver_modesetting" msg:"modesetting xserver support" }}
-{{ if xserver == "y" and kernel_choice != "linux-yocto_3.19" and kernel_choice != "linux-yocto_3.14" and kernel_choice != "custom": xserver_choice = "xserver_i915" }}
+{{ if xserver == "y" and kernel_choice != "linux-yocto_4.1" and kernel_choice != "linux-yocto_3.19" and kernel_choice != "linux-yocto_3.14" and kernel_choice != "custom": xserver_choice = "xserver_i915" }}
{{ if xserver == "y": }}
XSERVER ?= "${XSERVER_X86_BASE} \
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc
index 619ee3f36..7146e235a 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-preempt-rt.scc
define KMACHINE {{=machine}}
-define KTYPE preempt-rt
+
define KARCH i386
include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc
index 682012faf..67a54be87 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-standard.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-standard.scc
define KMACHINE {{=machine}}
-define KTYPE standard
+
define KARCH i386
include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc
index cc7519699..91373b3a5 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/machine-tiny.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-tiny.scc
define KMACHINE {{=machine}}
-define KTYPE tiny
+
define KARCH i386
include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
index 811d69547..7676ca883 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
{{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.19) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.1) kernel? (y/n)" default:"y"}}
{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.19"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.1"}}
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend
index 2fa6231cb..c336007eb 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -21,6 +21,5 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
index 5f8db03c6..c56e9e56f 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-preempt-rt.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb"
-#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f"
+SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
index 471ccbcc3..15b9b1b92 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
index 4de82fad0..caefcfc26 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend
index fbb49edb2..41325ca80 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.14.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.19.bbappend
index 0c2cb5af6..b471742dc 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_3.19.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..761b9c66c
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# 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"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc
index 176190cd2..a128255b3 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-preempt-rt.scc
define KMACHINE {{=machine}}
-define KTYPE preempt-rt
+
define KARCH mips
include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc
index f05dd851d..7c9dc52d2 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-standard.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-standard.scc
define KMACHINE {{=machine}}
-define KTYPE standard
+
define KARCH mips
include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc
index f71c77539..64f395bbc 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/machine-tiny.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-tiny.scc
define KMACHINE {{=machine}}
-define KTYPE tiny
+
define KARCH mips
include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
index 811d69547..7676ca883 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
{{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.19) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.1) kernel? (y/n)" default:"y"}}
{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.19"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.1"}}
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend
index 2fa6231cb..c336007eb 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -21,6 +21,5 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
index 5f8db03c6..c56e9e56f 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-preempt-rt.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb"
-#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f"
+SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
index c7e798982..7c6bc7fdf 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
index a9ba0ae45..7f203794e 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend
index 1e1cc5131..5af490dc5 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.14.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.19.bbappend
index 97e1bb843..c327d16d7 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_3.19.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..1e99a04dc
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# 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"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc
index 176190cd2..a128255b3 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-preempt-rt.scc
define KMACHINE {{=machine}}
-define KTYPE preempt-rt
+
define KARCH mips
include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc
index f05dd851d..7c9dc52d2 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-standard.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-standard.scc
define KMACHINE {{=machine}}
-define KTYPE standard
+
define KARCH mips
include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc
index f71c77539..64f395bbc 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/files/machine-tiny.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-tiny.scc
define KMACHINE {{=machine}}
-define KTYPE tiny
+
define KARCH mips
include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall
index a04e6c785..7676ca883 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
{{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.14) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.1) kernel? (y/n)" default:"y"}}
{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.14"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.1"}}
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend
index 2fa6231cb..c336007eb 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -21,6 +21,5 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
index 5f8db03c6..c56e9e56f 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-preempt-rt.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb"
-#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f"
+SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
index c7e798982..7c6bc7fdf 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
index a9ba0ae45..7f203794e 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.14.bbappend
index fb6cdef18..858d5fcaa 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.14.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "dbe5b52e93ff114b2c0f5da6f6af91f52c18f2b8"
SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "6eddbf47875ef48ddc5864957a7b63363100782b"
-#LINUX_VERSION = "3.14" \ No newline at end of file
+#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.19.bbappend
index 134aeecc5..f08453147 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_3.19.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..01a046c75
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/mips64/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/edgerouter" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/edgerouter" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# 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"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf
index c94f7f9e3..018146fc0 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/machine.conf
@@ -74,7 +74,7 @@ XSERVER ?= "xserver-xorg \
xf86-input-evdev \
xf86-video-fbdev"
-PREFERRED_VERSION_u-boot ?= "v2015.01%"
+PREFERRED_VERSION_u-boot ?= "v2015.07%"
{{ input type:"edit" name:"uboot_entrypoint" prio:"40" msg:"Please specify a value for UBOOT_ENTRYPOINT:" default:"0x00000000" }}
UBOOT_ENTRYPOINT = "{{=uboot_entrypoint}}"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc
index 40c926783..91ccfb830 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-preempt-rt.scc
define KMACHINE {{=machine}}
-define KTYPE preempt-rt
+
define KARCH powerpc
include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc
index 7a1d35be1..89b344fea 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-standard.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-standard.scc
define KMACHINE {{=machine}}
-define KTYPE standard
+
define KARCH powerpc
include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc
index 1bf94b2d0..2701fd8b5 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/machine-tiny.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-tiny.scc
define KMACHINE {{=machine}}
-define KTYPE tiny
+
define KARCH powerpc
include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
index 811d69547..7676ca883 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
{{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.19) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.1) kernel? (y/n)" default:"y"}}
{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.19"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.1"}}
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend
index 2fa6231cb..c336007eb 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -21,6 +21,5 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
index 7a2544617..4700d9802 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-preempt-rt.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb"
-#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f"
+SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
index 471ccbcc3..15b9b1b92 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
index 4de82fad0..caefcfc26 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend
index e68838402..6f1e7b0a4 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.14.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.19.bbappend
index ded9e85db..44086af80 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_3.19.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..1e99a04dc
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# 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"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc
index 6aaffb818..a81b858c0 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-preempt-rt.scc
define KMACHINE {{=machine}}
-define KTYPE preempt-rt
+
define KARCH {{=qemuarch}}
include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc
index d2a03ec20..14554da28 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-standard.scc
@@ -1,6 +1,6 @@
# yocto-bsp-filename {{=machine}}-standard.scc
define KMACHINE {{=machine}}
-define KTYPE standard
+
define KARCH {{=qemuarch}}
{{ if qemuarch == "i386" or qemuarch == "x86_64": }}
@@ -14,6 +14,7 @@ include bsp/mti-malta32/mti-malta32-be-standard
{{ if qemuarch == "mips64": }}
include bsp/mti-malta64/mti-malta64-be-standard
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc
index 6c098fed2..41d4c6f40 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/machine-tiny.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-tiny.scc
define KMACHINE {{=machine}}
-define KTYPE tiny
+
define KARCH {{=qemuarch}}
include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
index 811d69547..7676ca883 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
{{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.19) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.1) kernel? (y/n)" default:"y"}}
{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
-{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.19"}}
+{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_4.1"}}
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend
index be479bee6..355528595 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -51,6 +51,5 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
index ce5e1a09b..9e5aa976c 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
@@ -55,8 +55,8 @@ SRC_URI += "file://{{=machine}}-preempt-rt.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb"
-#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f"
+SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
index 7879ce205..1faac4443 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
@@ -55,8 +55,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "8f55bee2403176a50cc0dd41811aa60fcf07243c"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
index f7ef4bb4a..51fc7d0aa 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
@@ -55,8 +55,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "8f55bee2403176a50cc0dd41811aa60fcf07243c"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..14ee16f32
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,62 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"arm" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/common-pc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend
index 626019c40..fbaed33b1 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.14.bbappend
@@ -51,12 +51,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "8f55bee2403176a50cc0dd41811aa60fcf07243c"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.19.bbappend
index b4798b7d6..7b590ad3d 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_3.19.bbappend
@@ -51,12 +51,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "0143c6ebb4a2d63b241df5f608b19f483f7eb9e0"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "8f55bee2403176a50cc0dd41811aa60fcf07243c"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..82bb970cf
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,61 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "arm": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose an existing machine branch to use for this BSP:" default:"standard/arm-versatile-926ejs" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "powerpc": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"powerpc" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/qemuppc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "i386": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"i386" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "x86_64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"x86_64" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta32" }}
+
+{{ if need_new_kbranch == "n" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"existing_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/mti-malta64" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "y" and qemuarch == "mips64": }}
+{{ input type:"choicelist" name:"new_kbranch" nameappend:"mips64" gen:"bsp.kernel.all_branches" branches_base:"standard" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Would you like SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# 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"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc
index fd5320ba1..bbeeecd6b 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-preempt-rt.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-preempt-rt.scc
define KMACHINE {{=machine}}
-define KTYPE preempt-rt
+
define KARCH x86_64
include {{=map_preempt_rt_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc
index 569f967c6..9c9cc9025 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-standard.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-standard.scc
define KMACHINE {{=machine}}
-define KTYPE standard
+
define KARCH x86_64
include {{=map_standard_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc
index fb21432a4..b53706f8c 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/machine-tiny.scc
@@ -1,10 +1,11 @@
# yocto-bsp-filename {{=machine}}-tiny.scc
define KMACHINE {{=machine}}
-define KTYPE tiny
+
define KARCH x86_64
include {{=map_tiny_kbranch(need_new_kbranch, new_kbranch, existing_kbranch)}}
{{ if need_new_kbranch == "y": }}
+define KTYPE {{=new_kbranch}}
branch {{=machine}}
include {{=machine}}.scc
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
index 811d69547..dbbe9342f 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
@@ -1,5 +1,5 @@
{{ if kernel_choice != "custom": }}
-{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.19) kernel? (y/n)" default:"y"}}
+{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (4.1) kernel? (y/n)" default:"y"}}
{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.19"}}
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend
index 2fa6231cb..c336007eb 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -21,6 +21,5 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
index 7a2544617..4700d9802 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-rt_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-preempt-rt.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "f35992f80c81dc5fa1a97165dfd5cbb84661f7cb"
-#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "1b534b2f8bbe9b8a773268cfa30a4850346f6f5f"
+SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14" \ No newline at end of file
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
index 471ccbcc3..15b9b1b92 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.14.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
index 4de82fad0..caefcfc26 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_3.19.bbappend
@@ -26,8 +26,8 @@ SRC_URI += "file://{{=machine}}-tiny.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
new file mode 100644
index 000000000..0a47a4e37
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto-tiny_4.1.bbappend
@@ -0,0 +1,33 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto-tiny_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard/tiny" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/tiny/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-tiny.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-patches.scc \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# the appropriate changes committed to the upstream linux-yocto repo
+SRCREV_machine_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto-tiny_{{=machine}} ?= "${AUTOREV}"
+#LINUX_VERSION = "4.1"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend
index ca0b497ff..62a99d54b 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.14.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.14"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.19.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.19.bbappend
index dba63c3df..a5dd37da9 100644
--- a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.19.bbappend
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_3.19.bbappend
@@ -22,12 +22,11 @@ KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
SRC_URI += "file://{{=machine}}-standard.scc \
file://{{=machine}}-user-config.cfg \
- file://{{=machine}}-user-patches.scc \
file://{{=machine}}-user-features.scc \
"
-# uncomment and replace these SRCREVs with the real commit ids once you've had
+# replace these SRCREVs with the real commit ids once you've had
# the appropriate changes committed to the upstream linux-yocto repo
-#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "840bb8c059418c4753415df56c9aff1c0d5354c8"
-#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "4fd76cc4f33e0afd8f906b1e8f231b6d13b6c993"
+SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
+SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "${AUTOREV}"
#LINUX_VERSION = "3.19"
diff --git a/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
new file mode 100644
index 000000000..8d0bc9713
--- /dev/null
+++ b/yocto-poky/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/linux-yocto_4.1.bbappend
@@ -0,0 +1,32 @@
+# yocto-bsp-filename {{ if kernel_choice == "linux-yocto_4.1": }} this
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
+
+{{ input type:"boolean" name:"need_new_kbranch" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n]" default:"y" }}
+
+{{ if need_new_kbranch == "y": }}
+{{ input type:"choicelist" name:"new_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }}
+
+{{ if need_new_kbranch == "n": }}
+{{ input type:"choicelist" name:"existing_kbranch" gen:"bsp.kernel.all_branches" branches_base:"standard:standard/common-pc-64" prio:"20" msg:"Please choose a machine branch to base this BSP on:" default:"standard/common-pc-64/base" }}
+
+{{ if need_new_kbranch == "n": }}
+KBRANCH_{{=machine}} = "{{=existing_kbranch}}"
+
+{{ input type:"boolean" name:"smp" prio:"30" msg:"Do you need SMP support? (y/n)" default:"y"}}
+{{ if smp == "y": }}
+KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc"
+
+SRC_URI += "file://{{=machine}}-standard.scc \
+ file://{{=machine}}-user-config.cfg \
+ file://{{=machine}}-user-features.scc \
+ "
+
+# replace these SRCREVs with the real commit ids once you've had
+# 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"
diff --git a/yocto-poky/scripts/lib/devtool/__init__.py b/yocto-poky/scripts/lib/devtool/__init__.py
index 404d3e664..50604e6e0 100644
--- a/yocto-poky/scripts/lib/devtool/__init__.py
+++ b/yocto-poky/scripts/lib/devtool/__init__.py
@@ -96,18 +96,22 @@ def exec_fakeroot(d, cmd, **kwargs):
newenv[splitval[0]] = splitval[1]
return subprocess.call("%s %s" % (fakerootcmd, cmd), env=newenv, **kwargs)
-def setup_tinfoil(config_only=False):
+def setup_tinfoil(config_only=False, basepath=None, tracking=False):
"""Initialize tinfoil api from bitbake"""
import scriptpath
+ orig_cwd = os.path.abspath(os.curdir)
+ if basepath:
+ os.chdir(basepath)
bitbakepath = scriptpath.add_bitbake_lib_path()
if not bitbakepath:
logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
sys.exit(1)
import bb.tinfoil
- tinfoil = bb.tinfoil.Tinfoil()
+ tinfoil = bb.tinfoil.Tinfoil(tracking=tracking)
tinfoil.prepare(config_only)
tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ os.chdir(orig_cwd)
return tinfoil
def get_recipe_file(cooker, pn):
@@ -134,5 +138,62 @@ def parse_recipe(config, tinfoil, pn, appends):
# Filter out appends from the workspace
append_files = [path for path in append_files if
not path.startswith(config.workspace_path)]
+ else:
+ append_files = None
return oe.recipeutils.parse_recipe(recipefile, append_files,
tinfoil.config_data)
+
+def check_workspace_recipe(workspace, pn, checksrc=True):
+ """
+ Check that a recipe is in the workspace and (optionally) that source
+ is present.
+ """
+ if not pn in workspace:
+ raise DevtoolError("No recipe named '%s' in your workspace" % pn)
+ if checksrc:
+ srctree = workspace[pn]['srctree']
+ if not os.path.exists(srctree):
+ raise DevtoolError("Source tree %s for recipe %s does not exist" % (srctree, pn))
+ if not os.listdir(srctree):
+ raise DevtoolError("Source tree %s for recipe %s is empty" % (srctree, pn))
+
+def use_external_build(same_dir, no_same_dir, d):
+ """
+ Determine if we should use B!=S (separate build and source directories) or not
+ """
+ b_is_s = True
+ if no_same_dir:
+ logger.info('Using separate build directory since --no-same-dir specified')
+ b_is_s = False
+ elif same_dir:
+ logger.info('Using source tree as build directory since --same-dir specified')
+ elif bb.data.inherits_class('autotools-brokensep', d):
+ logger.info('Using source tree as build directory since recipe inherits autotools-brokensep')
+ elif d.getVar('B', True) == os.path.abspath(d.getVar('S', True)):
+ logger.info('Using source tree as build directory since that would be the default for this recipe')
+ else:
+ b_is_s = False
+ return b_is_s
+
+def setup_git_repo(repodir, version, devbranch, basetag='devtool-base'):
+ """
+ Set up the git repository for the source tree
+ """
+ import bb.process
+ if not os.path.exists(os.path.join(repodir, '.git')):
+ bb.process.run('git init', cwd=repodir)
+ bb.process.run('git add .', cwd=repodir)
+ commit_cmd = ['git', 'commit', '-q']
+ stdout, _ = bb.process.run('git status --porcelain', cwd=repodir)
+ if not stdout:
+ commit_cmd.append('--allow-empty')
+ commitmsg = "Initial empty commit with no upstream sources"
+ elif version:
+ commitmsg = "Initial commit from upstream at version %s" % version
+ else:
+ commitmsg = "Initial commit from upstream"
+ commit_cmd += ['-m', commitmsg]
+ bb.process.run(commit_cmd, cwd=repodir)
+
+ bb.process.run('git checkout -b %s' % devbranch, cwd=repodir)
+ bb.process.run('git tag -f %s' % basetag, cwd=repodir)
diff --git a/yocto-poky/scripts/lib/devtool/build-image.py b/yocto-poky/scripts/lib/devtool/build-image.py
index 2c014289f..e53239dd2 100644
--- a/yocto-poky/scripts/lib/devtool/build-image.py
+++ b/yocto-poky/scripts/lib/devtool/build-image.py
@@ -21,65 +21,85 @@ import os
import logging
from bb.process import ExecutionError
-from devtool import exec_build_env_command, setup_tinfoil, parse_recipe
+from devtool import exec_build_env_command, setup_tinfoil, parse_recipe, DevtoolError
logger = logging.getLogger('devtool')
-def _get_recipes(workspace, config):
- """Get list of target recipes from the workspace."""
+def _get_packages(tinfoil, workspace, config):
+ """Get list of packages from recipes in the workspace."""
result = []
- tinfoil = setup_tinfoil()
for recipe in workspace:
data = parse_recipe(config, tinfoil, recipe, True)
if 'class-target' in data.getVar('OVERRIDES', True).split(':'):
if recipe in data.getVar('PACKAGES', True):
result.append(recipe)
else:
- logger.warning("Skipping recipe %s as it doesn't produce "
+ logger.warning("Skipping recipe %s as it doesn't produce a "
"package with the same name", recipe)
- tinfoil.shutdown()
return result
def build_image(args, config, basepath, workspace):
"""Entry point for the devtool 'build-image' subcommand."""
- image = args.recipe
+
+ image = args.imagename
+ auto_image = False
+ if not image:
+ sdk_targets = config.get('SDK', 'sdk_targets', '').split()
+ if sdk_targets:
+ image = sdk_targets[0]
+ auto_image = True
+ if not image:
+ raise DevtoolError('Unable to determine image to build, please specify one')
+
appendfile = os.path.join(config.workspace_path, 'appends',
'%s.bbappend' % image)
- # remove <image>.bbapend to make sure setup_tinfoil doesn't
- # breake because of it
+ # remove <image>.bbappend to make sure setup_tinfoil doesn't
+ # break because of it
if os.path.isfile(appendfile):
os.unlink(appendfile)
- recipes = _get_recipes(workspace, config)
- if recipes:
- with open(appendfile, 'w') as afile:
- # include selected recipes into the image
- afile.write('IMAGE_INSTALL_append = " %s"\n' % ' '.join(recipes))
-
- # Generate notification callback devtool_warn_image_extended
- afile.write('do_rootfs[prefuncs] += "devtool_warn_image_extended"\n\n')
- afile.write("python devtool_warn_image_extended() {\n")
- afile.write(" bb.plain('NOTE: %%s: building with additional '\n"
- " 'packages due to \"devtool build-image\"'"
- " %% d.getVar('PN', True))\n"
- " bb.plain('NOTE: delete %%s to clear this' %% \\\n"
- " '%s')\n" % os.path.relpath(appendfile, basepath))
- afile.write("}\n")
-
- logger.info('Building image %s with the following '
- 'additional packages: %s', image, ' '.join(recipes))
- else:
- logger.warning('No recipes in workspace, building image %s unmodified', image)
-
- # run bitbake to build image
+ tinfoil = setup_tinfoil(basepath=basepath)
+ rd = parse_recipe(config, tinfoil, image, True)
+ if not rd:
+ # Error already shown
+ return 1
+ if not bb.data.inherits_class('image', rd):
+ if auto_image:
+ raise DevtoolError('Unable to determine image to build, please specify one')
+ else:
+ raise DevtoolError('Specified recipe %s is not an image recipe' % image)
+
try:
- exec_build_env_command(config.init_path, basepath,
- 'bitbake %s' % image, watch=True)
- except ExecutionError as err:
- return err.exitcode
+ if workspace:
+ packages = _get_packages(tinfoil, workspace, config)
+ if packages:
+ with open(appendfile, 'w') as afile:
+ # include packages from workspace recipes into the image
+ afile.write('IMAGE_INSTALL_append = " %s"\n' % ' '.join(packages))
+ logger.info('Building image %s with the following '
+ 'additional packages: %s', image, ' '.join(packages))
+ else:
+ logger.warning('No packages to add, building image %s unmodified', image)
+ else:
+ logger.warning('No recipes in workspace, building image %s unmodified', image)
+
+ deploy_dir_image = tinfoil.config_data.getVar('DEPLOY_DIR_IMAGE', True)
+
+ tinfoil.shutdown()
+
+ # run bitbake to build image
+ try:
+ exec_build_env_command(config.init_path, basepath,
+ 'bitbake %s' % image, watch=True)
+ except ExecutionError as err:
+ return err.exitcode
+ finally:
+ if os.path.isfile(appendfile):
+ os.unlink(appendfile)
- logger.info('Successfully built %s', image)
+ logger.info('Successfully built %s. You can find output files in %s'
+ % (image, deploy_dir_image))
def register_commands(subparsers, context):
"""Register devtool subcommands from the build-image plugin"""
@@ -87,5 +107,5 @@ def register_commands(subparsers, context):
help='Build image including workspace recipe packages',
description='Builds an image, extending it to include '
'packages from recipes in the workspace')
- parser.add_argument('recipe', help='Image recipe to build')
+ parser.add_argument('imagename', help='Image recipe to build', nargs='?')
parser.set_defaults(func=build_image)
diff --git a/yocto-poky/scripts/lib/devtool/build.py b/yocto-poky/scripts/lib/devtool/build.py
index 335aff549..9b58858a6 100644
--- a/yocto-poky/scripts/lib/devtool/build.py
+++ b/yocto-poky/scripts/lib/devtool/build.py
@@ -21,7 +21,7 @@ import bb
import logging
import argparse
import tempfile
-from devtool import exec_build_env_command, DevtoolError
+from devtool import exec_build_env_command, check_workspace_recipe, DevtoolError
logger = logging.getLogger('devtool')
@@ -42,9 +42,7 @@ def _create_conf_file(values, conf_file=None):
def build(args, config, basepath, workspace):
"""Entry point for the devtool 'build' subcommand"""
- if not args.recipename in workspace:
- raise DevtoolError("no recipe named %s in your workspace" %
- args.recipename)
+ check_workspace_recipe(workspace, args.recipename)
build_task = config.get('Build', 'build_task', 'populate_sysroot')
diff --git a/yocto-poky/scripts/lib/devtool/deploy.py b/yocto-poky/scripts/lib/devtool/deploy.py
index fa93adf18..c90c6b1f7 100644
--- a/yocto-poky/scripts/lib/devtool/deploy.py
+++ b/yocto-poky/scripts/lib/devtool/deploy.py
@@ -19,7 +19,7 @@
import os
import subprocess
import logging
-from devtool import exec_fakeroot, setup_tinfoil, DevtoolError
+from devtool import exec_fakeroot, setup_tinfoil, check_workspace_recipe, DevtoolError
logger = logging.getLogger('devtool')
@@ -28,9 +28,8 @@ def deploy(args, config, basepath, workspace):
import re
import oe.recipeutils
- if not args.recipename in workspace:
- raise DevtoolError("no recipe named %s in your workspace" %
- args.recipename)
+ check_workspace_recipe(workspace, args.recipename, checksrc=False)
+
try:
host, destdir = args.target.split(':')
except ValueError:
@@ -41,7 +40,7 @@ def deploy(args, config, basepath, workspace):
deploy_dir = os.path.join(basepath, 'target_deploy', args.target)
deploy_file = os.path.join(deploy_dir, args.recipename + '.list')
- tinfoil = setup_tinfoil()
+ tinfoil = setup_tinfoil(basepath=basepath)
try:
rd = oe.recipeutils.parse_recipe_simple(tinfoil.cooker, args.recipename, tinfoil.config_data)
except Exception as e:
diff --git a/yocto-poky/scripts/lib/devtool/package.py b/yocto-poky/scripts/lib/devtool/package.py
index 3a7a36b60..b8d84235c 100644
--- a/yocto-poky/scripts/lib/devtool/package.py
+++ b/yocto-poky/scripts/lib/devtool/package.py
@@ -20,7 +20,7 @@ import os
import subprocess
import logging
from bb.process import ExecutionError
-from devtool import exec_build_env_command, setup_tinfoil, DevtoolError
+from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, DevtoolError
logger = logging.getLogger('devtool')
@@ -30,13 +30,11 @@ def plugin_init(pluginlist):
def package(args, config, basepath, workspace):
"""Entry point for the devtool 'package' subcommand"""
- if not args.recipename in workspace:
- raise DevtoolError("no recipe named %s in your workspace" %
- args.recipename)
+ check_workspace_recipe(workspace, args.recipename)
image_pkgtype = config.get('Package', 'image_pkgtype', '')
if not image_pkgtype:
- tinfoil = setup_tinfoil()
+ tinfoil = setup_tinfoil(basepath=basepath)
try:
tinfoil.prepare(config_only=True)
image_pkgtype = tinfoil.config_data.getVar('IMAGE_PKGTYPE', True)
diff --git a/yocto-poky/scripts/lib/devtool/runqemu.py b/yocto-poky/scripts/lib/devtool/runqemu.py
new file mode 100644
index 000000000..5282afba6
--- /dev/null
+++ b/yocto-poky/scripts/lib/devtool/runqemu.py
@@ -0,0 +1,64 @@
+# Development tool - runqemu command plugin
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""Devtool runqemu plugin"""
+
+import os
+import bb
+import logging
+import argparse
+import glob
+from devtool import exec_build_env_command, setup_tinfoil, DevtoolError
+
+logger = logging.getLogger('devtool')
+
+def runqemu(args, config, basepath, workspace):
+ """Entry point for the devtool 'runqemu' subcommand"""
+
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ machine = tinfoil.config_data.getVar('MACHINE', True)
+ bindir_native = tinfoil.config_data.getVar('STAGING_BINDIR_NATIVE', True)
+ tinfoil.shutdown()
+
+ if not glob.glob(os.path.join(bindir_native, 'qemu-system-*')):
+ raise DevtoolError('QEMU is not available within this SDK')
+
+ imagename = args.imagename
+ if not imagename:
+ sdk_targets = config.get('SDK', 'sdk_targets', '').split()
+ if sdk_targets:
+ imagename = sdk_targets[0]
+ if not imagename:
+ raise DevtoolError('Unable to determine image name to run, please specify one')
+
+ try:
+ exec_build_env_command(config.init_path, basepath, 'runqemu %s %s %s' % (machine, imagename, " ".join(args.args)), watch=True)
+ except bb.process.ExecutionError as e:
+ # We've already seen the output since watch=True, so just ensure we return something to the user
+ return e.exitcode
+
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from this plugin"""
+ if context.fixed_setup:
+ parser_runqemu = subparsers.add_parser('runqemu', help='Run QEMU on the specified image',
+ description='Runs QEMU to boot the specified image')
+ parser_runqemu.add_argument('imagename', help='Name of built image to boot within QEMU', nargs='?')
+ parser_runqemu.add_argument('args', help='Any remaining arguments are passed to the runqemu script (pass --help after imagename to see what these are)',
+ nargs=argparse.REMAINDER)
+ parser_runqemu.set_defaults(func=runqemu)
diff --git a/yocto-poky/scripts/lib/devtool/sdk.py b/yocto-poky/scripts/lib/devtool/sdk.py
index 2f416b36f..f15a6a9ed 100644
--- a/yocto-poky/scripts/lib/devtool/sdk.py
+++ b/yocto-poky/scripts/lib/devtool/sdk.py
@@ -40,14 +40,9 @@ def generate_update_dict(sigfile_new, sigfile_old):
continue
return update_dict
-def get_sstate_objects(update_dict, newsdk_path):
+def get_sstate_objects(update_dict, sstate_dir):
"""Return a list containing sstate objects which are to be installed"""
sstate_objects = []
- # Ensure newsdk_path points to an extensible SDK
- sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
- if not os.path.exists(sstate_dir):
- logger.error("sstate-cache directory not found under %s" % newsdk_path)
- raise
for k in update_dict:
files = set()
hashval = update_dict[k]
@@ -85,16 +80,12 @@ def install_sstate_objects(sstate_objects, src_sdk, dest_sdk):
def sdk_update(args, config, basepath, workspace):
# Fetch locked-sigs.inc file from remote/local destination
- from ConfigParser import NoSectionError
updateserver = args.updateserver
if not updateserver:
- try:
- updateserver = config.get('SDK', 'updateserver', None)
- except NoSectionError:
- pass
+ updateserver = config.get('SDK', 'updateserver', '')
if not updateserver:
raise DevtoolError("Update server not specified in config file, you must specify it on the command line")
- logger.debug("updateserver: %s" % args.updateserver)
+ logger.debug("updateserver: %s" % updateserver)
# Make sure we are using sdk-update from within SDK
logger.debug("basepath = %s" % basepath)
@@ -105,38 +96,45 @@ def sdk_update(args, config, basepath, workspace):
else:
logger.debug("Found conf/locked-sigs.inc in %s" % basepath)
- if ':' in args.updateserver:
+ if ':' in updateserver:
is_remote = True
else:
is_remote = False
if not is_remote:
# devtool sdk-update /local/path/to/latest/sdk
- new_locked_sig_file_path = os.path.join(args.updateserver, 'conf/locked-sigs.inc')
+ new_locked_sig_file_path = os.path.join(updateserver, 'conf/locked-sigs.inc')
if not os.path.exists(new_locked_sig_file_path):
- logger.error("%s doesn't exist or is not an extensible SDK" % args.updateserver)
+ logger.error("%s doesn't exist or is not an extensible SDK" % updateserver)
return -1
else:
- logger.debug("Found conf/locked-sigs.inc in %s" % args.updateserver)
+ logger.debug("Found conf/locked-sigs.inc in %s" % updateserver)
update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path)
logger.debug("update_dict = %s" % update_dict)
- sstate_objects = get_sstate_objects(update_dict, args.updateserver)
+ sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
+ if not os.path.exists(sstate_dir):
+ logger.error("sstate-cache directory not found under %s" % newsdk_path)
+ return 1
+ sstate_objects = get_sstate_objects(update_dict, sstate_dir)
logger.debug("sstate_objects = %s" % sstate_objects)
if len(sstate_objects) == 0:
logger.info("No need to update.")
return 0
logger.info("Installing sstate objects into %s", basepath)
- install_sstate_objects(sstate_objects, args.updateserver.rstrip('/'), basepath)
+ install_sstate_objects(sstate_objects, updateserver.rstrip('/'), basepath)
logger.info("Updating configuration files")
- new_conf_dir = os.path.join(args.updateserver, 'conf')
+ new_conf_dir = os.path.join(updateserver, 'conf')
old_conf_dir = os.path.join(basepath, 'conf')
shutil.rmtree(old_conf_dir)
shutil.copytree(new_conf_dir, old_conf_dir)
logger.info("Updating layers")
- new_layers_dir = os.path.join(args.updateserver, 'layers')
+ new_layers_dir = os.path.join(updateserver, 'layers')
old_layers_dir = os.path.join(basepath, 'layers')
shutil.rmtree(old_layers_dir)
- shutil.copytree(new_layers_dir, old_layers_dir)
+ ret = subprocess.call("cp -a %s %s" % (new_layers_dir, old_layers_dir), shell=True)
+ if ret != 0:
+ logger.error("Copying %s to %s failed" % (new_layers_dir, old_layers_dir))
+ return ret
else:
# devtool sdk-update http://myhost/sdk
tmpsdk_dir = '/tmp/sdk-ext'
@@ -145,12 +143,12 @@ def sdk_update(args, config, basepath, workspace):
os.makedirs(tmpsdk_dir)
os.makedirs(os.path.join(tmpsdk_dir, 'conf'))
# Fetch locked-sigs.inc from update server
- ret = subprocess.call("wget -q -O - %s/conf/locked-sigs.inc > %s/locked-sigs.inc" % (args.updateserver, os.path.join(tmpsdk_dir, 'conf')), shell=True)
+ ret = subprocess.call("wget -q -O - %s/conf/locked-sigs.inc > %s/locked-sigs.inc" % (updateserver, os.path.join(tmpsdk_dir, 'conf')), shell=True)
if ret != 0:
- logger.error("Fetching conf/locked-sigs.inc from %s to %s/locked-sigs.inc failed" % (args.updateserver, os.path.join(tmpsdk_dir, 'conf')))
+ logger.error("Fetching conf/locked-sigs.inc from %s to %s/locked-sigs.inc failed" % (updateserver, os.path.join(tmpsdk_dir, 'conf')))
return ret
else:
- logger.info("Fetching conf/locked-sigs.inc from %s to %s/locked-sigs.inc succeeded" % (args.updateserver, os.path.join(tmpsdk_dir, 'conf')))
+ logger.info("Fetching conf/locked-sigs.inc from %s to %s/locked-sigs.inc succeeded" % (updateserver, os.path.join(tmpsdk_dir, 'conf')))
new_locked_sig_file_path = os.path.join(tmpsdk_dir, 'conf/locked-sigs.inc')
update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path)
logger.debug("update_dict = %s" % update_dict)
@@ -161,23 +159,23 @@ def sdk_update(args, config, basepath, workspace):
logger.debug("Updating meta data via git ...")
# Try using 'git pull', if failed, use 'git clone'
if os.path.exists(os.path.join(basepath, 'layers/.git')):
- ret = subprocess.call("cd layers && git pull", shell=True)
+ ret = subprocess.call("cd layers && git pull %s/layers/.git" % updateserver, shell=True)
else:
ret = -1
if ret != 0:
- ret = subprocess.call("rm -rf layers && git clone %s/layers" % args.updateserver, shell=True)
+ ret = subprocess.call("rm -rf layers && git clone %s/layers/.git" % updateserver, shell=True)
if ret != 0:
logger.error("Updating meta data via git failed")
return ret
logger.debug("Updating conf files ...")
- conf_files = ['local.conf', 'bblayers.conf', 'devtool.conf', 'work-config.inc', 'locked-sigs.inc']
+ conf_files = ['local.conf', 'bblayers.conf', 'devtool.conf', 'locked-sigs.inc']
for conf in conf_files:
- ret = subprocess.call("wget -q -O - %s/conf/%s > conf/%s" % (args.updateserver, conf, conf), shell=True)
+ ret = subprocess.call("wget -q -O - %s/conf/%s > conf/%s" % (updateserver, conf, conf), shell=True)
if ret != 0:
logger.error("Update %s failed" % conf)
return ret
with open(os.path.join(basepath, 'conf/local.conf'), 'a') as f:
- f.write('SSTATE_MIRRORS_append = " file://.* %s/sstate-cache/PATH \\n "\n' % args.updateserver)
+ f.write('SSTATE_MIRRORS_append = " file://.* %s/sstate-cache/PATH \\n "\n' % updateserver)
# Run bitbake command for the whole SDK
sdk_targets = config.get('SDK', 'sdk_targets')
diff --git a/yocto-poky/scripts/lib/devtool/search.py b/yocto-poky/scripts/lib/devtool/search.py
new file mode 100644
index 000000000..c2f420c33
--- /dev/null
+++ b/yocto-poky/scripts/lib/devtool/search.py
@@ -0,0 +1,80 @@
+# Development tool - search command plugin
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""Devtool search plugin"""
+
+import os
+import bb
+import logging
+import argparse
+import re
+from devtool import setup_tinfoil, DevtoolError
+
+logger = logging.getLogger('devtool')
+
+def search(args, config, basepath, workspace):
+ """Entry point for the devtool 'search' subcommand"""
+
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR', True)
+ tinfoil.shutdown()
+
+ keyword_rc = re.compile(args.keyword)
+
+ for fn in os.listdir(pkgdata_dir):
+ pfn = os.path.join(pkgdata_dir, fn)
+ if not os.path.isfile(pfn):
+ continue
+
+ packages = []
+ match = False
+ if keyword_rc.search(fn):
+ match = True
+
+ if not match:
+ with open(pfn, 'r') as f:
+ for line in f:
+ if line.startswith('PACKAGES:'):
+ packages = line.split(':', 1)[1].strip().split()
+
+ for pkg in packages:
+ if keyword_rc.search(pkg):
+ match = True
+ break
+ if os.path.exists(os.path.join(pkgdata_dir, 'runtime', pkg + '.packaged')):
+ with open(os.path.join(pkgdata_dir, 'runtime', pkg), 'r') as f:
+ for line in f:
+ if ': ' in line:
+ splitline = line.split(':', 1)
+ key = splitline[0]
+ value = splitline[1].strip()
+ if key in ['PKG_%s' % pkg, 'DESCRIPTION', 'FILES_INFO'] or key.startswith('FILERPROVIDES_'):
+ if keyword_rc.search(value):
+ match = True
+ break
+
+ if match:
+ print(fn)
+
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from this plugin"""
+ parser_search = subparsers.add_parser('search', help='Search available recipes',
+ description='Searches for available target recipes. Matches on recipe name, package name, description and installed files, and prints the recipe name on match.')
+ parser_search.add_argument('keyword', help='Keyword to search for (regular expression syntax allowed)')
+ parser_search.set_defaults(func=search)
diff --git a/yocto-poky/scripts/lib/devtool/standard.py b/yocto-poky/scripts/lib/devtool/standard.py
index d5900b4f8..5464d7b1f 100644
--- a/yocto-poky/scripts/lib/devtool/standard.py
+++ b/yocto-poky/scripts/lib/devtool/standard.py
@@ -25,7 +25,8 @@ import logging
import argparse
import scriptutils
import errno
-from devtool import exec_build_env_command, setup_tinfoil, DevtoolError
+from collections import OrderedDict
+from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, use_external_build, setup_git_repo, DevtoolError
from devtool import parse_recipe
logger = logging.getLogger('devtool')
@@ -44,6 +45,10 @@ def add(args, config, basepath, workspace):
if reason:
raise DevtoolError(reason)
+ # FIXME this ought to be in validate_pn but we're using that in other contexts
+ if '/' in args.recipename:
+ raise DevtoolError('"/" is not a valid character in recipe names')
+
srctree = os.path.abspath(args.srctree)
if os.path.exists(srctree):
if args.fetch:
@@ -82,7 +87,7 @@ def add(args, config, basepath, workspace):
else:
bp = args.recipename
recipefile = os.path.join(recipedir, "%s.bb" % bp)
- if sys.stdout.isatty():
+ if args.color == 'auto' and sys.stdout.isatty():
color = 'always'
else:
color = args.color
@@ -94,30 +99,51 @@ def add(args, config, basepath, workspace):
source = srctree
if args.version:
extracmdopts += ' -V %s' % args.version
+ if args.binary:
+ extracmdopts += ' -b'
try:
stdout, _ = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create -o %s "%s" %s' % (color, recipefile, source, extracmdopts))
- logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile)
except bb.process.ExecutionError as e:
raise DevtoolError('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
_add_md5(config, args.recipename, recipefile)
+ if args.fetch and not args.no_git:
+ setup_git_repo(srctree, args.version, 'devtool')
+
initial_rev = None
if os.path.exists(os.path.join(srctree, '.git')):
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
initial_rev = stdout.rstrip()
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ rd = oe.recipeutils.parse_recipe(recipefile, None, tinfoil.config_data)
+ if not rd:
+ return 1
+
appendfile = os.path.join(appendpath, '%s.bbappend' % bp)
with open(appendfile, 'w') as f:
f.write('inherit externalsrc\n')
f.write('EXTERNALSRC = "%s"\n' % srctree)
- if args.same_dir:
+
+ b_is_s = use_external_build(args.same_dir, args.no_same_dir, rd)
+ if b_is_s:
f.write('EXTERNALSRC_BUILD = "%s"\n' % srctree)
if initial_rev:
f.write('\n# initial_rev: %s\n' % initial_rev)
+ if args.binary:
+ f.write('do_install_append() {\n')
+ f.write(' rm -rf ${D}/.git\n')
+ f.write(' rm -f ${D}/singletask.lock\n')
+ f.write('}\n')
+
_add_md5(config, args.recipename, appendfile)
+ logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile)
+
+ tinfoil.shutdown()
+
return 0
@@ -152,6 +178,43 @@ def _check_compatible_recipe(pn, d):
"from working. You will need to disable this "
"first." % pn)
+def _move_file(src, dst):
+ """Move a file. Creates all the directory components of destination path."""
+ dst_d = os.path.dirname(dst)
+ if dst_d:
+ bb.utils.mkdirhier(dst_d)
+ shutil.move(src, dst)
+
+def _git_ls_tree(repodir, treeish='HEAD', recursive=False):
+ """List contents of a git treeish"""
+ import bb
+ cmd = ['git', 'ls-tree', '-z', treeish]
+ if recursive:
+ cmd.append('-r')
+ out, _ = bb.process.run(cmd, cwd=repodir)
+ ret = {}
+ for line in out.split('\0'):
+ if line:
+ split = line.split(None, 4)
+ ret[split[3]] = split[0:3]
+ return ret
+
+def _git_exclude_path(srctree, path):
+ """Return pathspec (list of paths) that excludes certain path"""
+ # NOTE: "Filtering out" files/paths in this way is not entirely reliable -
+ # we don't catch files that are deleted, for example. A more reliable way
+ # to implement this would be to use "negative pathspecs" which were
+ # introduced in Git v1.9.0. Revisit this when/if the required Git version
+ # becomes greater than that.
+ path = os.path.normpath(path)
+ recurse = True if len(path.split(os.path.sep)) > 1 else False
+ git_files = _git_ls_tree(srctree, 'HEAD', recurse).keys()
+ if path in git_files:
+ git_files.remove(path)
+ return git_files
+ else:
+ return ['.']
+
def _ls_tree(directory):
"""Recursive listing of files in a directory"""
ret = []
@@ -166,6 +229,9 @@ def extract(args, config, basepath, workspace):
import bb
tinfoil = _prep_extract_operation(config, basepath, args.recipename)
+ if not tinfoil:
+ # Error already shown
+ return 1
rd = parse_recipe(config, tinfoil, args.recipename, True)
if not rd:
@@ -210,15 +276,17 @@ class BbTaskExecutor(object):
def _prep_extract_operation(config, basepath, recipename):
"""HACK: Ugly workaround for making sure that requirements are met when
trying to extract a package. Returns the tinfoil instance to be used."""
- tinfoil = setup_tinfoil()
+ tinfoil = setup_tinfoil(basepath=basepath)
rd = parse_recipe(config, tinfoil, recipename, True)
+ if not rd:
+ return None
if bb.data.inherits_class('kernel-yocto', rd):
tinfoil.shutdown()
try:
stdout, _ = exec_build_env_command(config.init_path, basepath,
'bitbake kern-tools-native')
- tinfoil = setup_tinfoil()
+ tinfoil = setup_tinfoil(basepath=basepath)
except bb.process.ExecutionError as err:
raise DevtoolError("Failed to build kern-tools-native:\n%s" %
err.stdout)
@@ -252,6 +320,10 @@ def _extract_source(srctree, keep_temp, devbranch, d):
raise DevtoolError("output path %s already exists and is "
"non-empty" % srctree)
+ if 'noexec' in (d.getVarFlags('do_unpack', False) or []):
+ raise DevtoolError("The %s recipe has do_unpack disabled, unable to "
+ "extract source" % pn)
+
# Prepare for shutil.move later on
bb.utils.mkdirhier(srctree)
os.rmdir(srctree)
@@ -275,7 +347,7 @@ def _extract_source(srctree, keep_temp, devbranch, d):
if bb.data.inherits_class('kernel', d):
crd.setVar('S', '${WORKDIR}/source')
else:
- crd.setVar('S', '${WORKDIR}/${BP}')
+ crd.setVar('S', '${WORKDIR}/%s' % os.path.basename(d.getVar('S', True)))
if bb.data.inherits_class('kernel', d):
# We don't want to move the source to STAGING_KERNEL_DIR here
crd.setVar('STAGING_KERNEL_DIR', '${S}')
@@ -293,10 +365,25 @@ def _extract_source(srctree, keep_temp, devbranch, d):
logger.info('Doing kernel checkout...')
task_executor.exec_func('do_kernel_checkout', False)
srcsubdir = crd.getVar('S', True)
+
+ # Move local source files into separate subdir
+ recipe_patches = [os.path.basename(patch) for patch in
+ oe.recipeutils.get_recipe_patches(crd)]
+ local_files = oe.recipeutils.get_recipe_local_files(crd)
+ local_files = [fname for fname in local_files if
+ os.path.exists(os.path.join(workdir, fname))]
+ if local_files:
+ for fname in local_files:
+ _move_file(os.path.join(workdir, fname),
+ os.path.join(tempdir, 'oe-local-files', fname))
+ with open(os.path.join(tempdir, 'oe-local-files', '.gitignore'),
+ 'w') as f:
+ f.write('# Ignore local files, by default. Remove this file '
+ 'if you want to commit the directory to Git\n*\n')
+
if srcsubdir == workdir:
- # Find non-patch sources that were "unpacked" to srctree directory
- recipe_patches = [os.path.basename(patch) for patch in
- oe.recipeutils.get_recipe_patches(crd)]
+ # Find non-patch non-local sources that were "unpacked" to srctree
+ # directory
src_files = [fname for fname in _ls_tree(workdir) if
os.path.basename(fname) not in recipe_patches]
# Force separate S so that patch files can be left out from srctree
@@ -304,9 +391,8 @@ def _extract_source(srctree, keep_temp, devbranch, d):
crd.setVar('S', srcsubdir)
# Move source files to S
for path in src_files:
- tgt_dir = os.path.join(srcsubdir, os.path.dirname(path))
- bb.utils.mkdirhier(tgt_dir)
- shutil.move(os.path.join(workdir, path), tgt_dir)
+ _move_file(os.path.join(workdir, path),
+ os.path.join(srcsubdir, path))
elif os.path.dirname(srcsubdir) != workdir:
# Handle if S is set to a subdirectory of the source
srcsubdir = os.path.join(workdir, os.path.relpath(srcsubdir, workdir).split(os.sep)[0])
@@ -320,21 +406,18 @@ def _extract_source(srctree, keep_temp, devbranch, d):
haspatches = True
else:
os.rmdir(patchdir)
+ # Make sure that srcsubdir exists
+ bb.utils.mkdirhier(srcsubdir)
+ if not os.path.exists(srcsubdir) or not os.listdir(srcsubdir):
+ logger.warning("no source unpacked to S, either the %s recipe "
+ "doesn't use any source or the correct source "
+ "directory could not be determined" % pn)
- if not os.listdir(srcsubdir):
- raise DevtoolError("no source unpacked to S, perhaps the %s "
- "recipe doesn't use any source?" % pn)
-
- if not os.path.exists(os.path.join(srcsubdir, '.git')):
- bb.process.run('git init', cwd=srcsubdir)
- bb.process.run('git add .', cwd=srcsubdir)
- bb.process.run('git commit -q -m "Initial commit from upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir)
+ setup_git_repo(srcsubdir, crd.getVar('PV', True), devbranch)
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
initial_rev = stdout.rstrip()
- bb.process.run('git checkout -b %s' % devbranch, cwd=srcsubdir)
- bb.process.run('git tag -f devtool-base', cwd=srcsubdir)
crd.setVar('PATCHTOOL', 'git')
logger.info('Patching...')
@@ -347,6 +430,12 @@ def _extract_source(srctree, keep_temp, devbranch, d):
if haspatches:
bb.process.run('git checkout patches', cwd=srcsubdir)
+ # Move oe-local-files directory to srctree
+ if os.path.exists(os.path.join(tempdir, 'oe-local-files')):
+ logger.info('Adding local source files to srctree...')
+ shutil.move(os.path.join(tempdir, 'oe-local-files'), srcsubdir)
+
+
shutil.move(srcsubdir, srctree)
finally:
bb.logger.setLevel(origlevel)
@@ -367,7 +456,7 @@ def _add_md5(config, recipename, filename):
f.write('%s|%s|%s\n' % (recipename, os.path.relpath(fn, config.workspace_path), md5))
if os.path.isdir(filename):
- for root, _, files in os.walk(os.path.dirname(filename)):
+ for root, _, files in os.walk(filename):
for f in files:
addfile(os.path.join(root, f))
else:
@@ -420,12 +509,23 @@ def modify(args, config, basepath, workspace):
args.srctree)
if args.extract:
tinfoil = _prep_extract_operation(config, basepath, args.recipename)
+ if not tinfoil:
+ # Error already shown
+ return 1
else:
- tinfoil = setup_tinfoil()
+ tinfoil = setup_tinfoil(basepath=basepath)
rd = parse_recipe(config, tinfoil, args.recipename, True)
if not rd:
return 1
+
+ pn = rd.getVar('PN', True)
+ if pn != args.recipename:
+ logger.info('Mapping %s to %s' % (args.recipename, pn))
+ if pn in workspace:
+ raise DevtoolError("recipe %s is already in your workspace" %
+ pn)
+
recipefile = rd.getVar('FILE', True)
appendname = os.path.splitext(os.path.basename(recipefile))[0]
if args.wildcard:
@@ -436,9 +536,9 @@ def modify(args, config, basepath, workspace):
raise DevtoolError("Another variant of recipe %s is already in your "
"workspace (only one variant of a recipe can "
"currently be worked on at once)"
- % args.recipename)
+ % pn)
- _check_compatible_recipe(args.recipename, rd)
+ _check_compatible_recipe(pn, rd)
initial_rev = None
commits = []
@@ -478,36 +578,30 @@ def modify(args, config, basepath, workspace):
if not os.path.exists(appendpath):
os.makedirs(appendpath)
with open(appendfile, 'w') as f:
- f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n\n')
- f.write('inherit externalsrc\n')
+ f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n')
+ # Local files can be modified/tracked in separate subdir under srctree
+ # Mostly useful for packages with S != WORKDIR
+ f.write('FILESPATH_prepend := "%s:"\n' %
+ os.path.join(srctree, 'oe-local-files'))
+
+ f.write('\ninherit externalsrc\n')
f.write('# NOTE: We use pn- overrides here to avoid affecting multiple variants in the case where the recipe uses BBCLASSEXTEND\n')
- f.write('EXTERNALSRC_pn-%s = "%s"\n' % (args.recipename, srctree))
-
- b_is_s = True
- if args.no_same_dir:
- logger.info('using separate build directory since --no-same-dir specified')
- b_is_s = False
- elif args.same_dir:
- logger.info('using source tree as build directory since --same-dir specified')
- elif bb.data.inherits_class('autotools-brokensep', rd):
- logger.info('using source tree as build directory since original recipe inherits autotools-brokensep')
- elif rd.getVar('B', True) == s:
- logger.info('using source tree as build directory since that is the default for this recipe')
- else:
- b_is_s = False
+ f.write('EXTERNALSRC_pn-%s = "%s"\n' % (pn, srctree))
+
+ b_is_s = use_external_build(args.same_dir, args.no_same_dir, rd)
if b_is_s:
- f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (args.recipename, srctree))
+ f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (pn, srctree))
if bb.data.inherits_class('kernel', rd):
- f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout do_fetch do_unpack"\n')
+ f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout do_fetch do_unpack do_patch"\n')
if initial_rev:
f.write('\n# initial_rev: %s\n' % initial_rev)
for commit in commits:
f.write('# commit: %s\n' % commit)
- _add_md5(config, args.recipename, appendfile)
+ _add_md5(config, pn, appendfile)
- logger.info('Recipe %s now set up to build from %s' % (args.recipename, srctree))
+ logger.info('Recipe %s now set up to build from %s' % (pn, srctree))
return 0
@@ -531,6 +625,7 @@ def _get_patchset_revs(args, srctree, recipe_path):
commits.append(line.split(':')[-1].strip())
update_rev = initial_rev
+ changed_revs = None
if initial_rev:
# Find first actually changed revision
stdout, _ = bb.process.run('git rev-list --reverse %s..HEAD' %
@@ -540,50 +635,156 @@ def _get_patchset_revs(args, srctree, recipe_path):
if newcommits[i] == commits[i]:
update_rev = commits[i]
- return initial_rev, update_rev
+ try:
+ stdout, _ = bb.process.run('git cherry devtool-patched',
+ cwd=srctree)
+ except bb.process.ExecutionError as err:
+ stdout = None
+
+ if stdout is not None:
+ changed_revs = []
+ for line in stdout.splitlines():
+ if line.startswith('+ '):
+ rev = line.split()[1]
+ if rev in newcommits:
+ changed_revs.append(rev)
+
+ return initial_rev, update_rev, changed_revs
-def _remove_patch_entries(srcuri, patchlist):
- """Remove patch entries from SRC_URI"""
- remaining = patchlist[:]
+def _remove_file_entries(srcuri, filelist):
+ """Remove file:// entries from SRC_URI"""
+ remaining = filelist[:]
entries = []
- for patch in patchlist:
- patchfile = os.path.basename(patch)
+ for fname in filelist:
+ basename = os.path.basename(fname)
for i in xrange(len(srcuri)):
- if srcuri[i].startswith('file://') and os.path.basename(srcuri[i].split(';')[0]) == patchfile:
+ if (srcuri[i].startswith('file://') and
+ os.path.basename(srcuri[i].split(';')[0]) == basename):
entries.append(srcuri[i])
- remaining.remove(patch)
+ remaining.remove(fname)
srcuri.pop(i)
break
return entries, remaining
-def _remove_patch_files(args, patches, destpath):
+def _remove_source_files(args, files, destpath):
"""Unlink existing patch files"""
- for patchfile in patches:
+ for path in files:
if args.append:
if not destpath:
raise Exception('destpath should be set here')
- patchfile = os.path.join(destpath, os.path.basename(patchfile))
+ path = os.path.join(destpath, os.path.basename(path))
- if os.path.exists(patchfile):
- logger.info('Removing patch %s' % patchfile)
+ if os.path.exists(path):
+ logger.info('Removing file %s' % path)
# FIXME "git rm" here would be nice if the file in question is
# tracked
# FIXME there's a chance that this file is referred to by
# another recipe, in which case deleting wouldn't be the
# right thing to do
- os.remove(patchfile)
+ os.remove(path)
# Remove directory if empty
try:
- os.rmdir(os.path.dirname(patchfile))
+ os.rmdir(os.path.dirname(path))
except OSError as ose:
if ose.errno != errno.ENOTEMPTY:
raise
+
+def _export_patches(srctree, rd, start_rev, destdir):
+ """Export patches from srctree to given location.
+ Returns three-tuple of dicts:
+ 1. updated - patches that already exist in SRCURI
+ 2. added - new patches that don't exist in SRCURI
+ 3 removed - patches that exist in SRCURI but not in exported patches
+ In each dict the key is the 'basepath' of the URI and value is the
+ absolute path to the existing file in recipe space (if any).
+ """
+ import oe.recipeutils
+ from oe.patch import GitApplyTree
+ updated = OrderedDict()
+ added = OrderedDict()
+ seqpatch_re = re.compile('^([0-9]{4}-)?(.+)')
+
+ existing_patches = dict((os.path.basename(path), path) for path in
+ oe.recipeutils.get_recipe_patches(rd))
+
+ # Generate patches from Git, exclude local files directory
+ patch_pathspec = _git_exclude_path(srctree, 'oe-local-files')
+ GitApplyTree.extractPatches(srctree, start_rev, destdir, patch_pathspec)
+
+ new_patches = sorted(os.listdir(destdir))
+ for new_patch in new_patches:
+ # Strip numbering from patch names. If it's a git sequence named patch,
+ # the numbers might not match up since we are starting from a different
+ # revision This does assume that people are using unique shortlog
+ # values, but they ought to be anyway...
+ new_basename = seqpatch_re.match(new_patch).group(2)
+ found = False
+ for old_patch in existing_patches:
+ old_basename = seqpatch_re.match(old_patch).group(2)
+ if new_basename == old_basename:
+ updated[new_patch] = existing_patches.pop(old_patch)
+ found = True
+ # Rename patch files
+ if new_patch != old_patch:
+ os.rename(os.path.join(destdir, new_patch),
+ os.path.join(destdir, old_patch))
+ break
+ if not found:
+ added[new_patch] = None
+ return (updated, added, existing_patches)
+
+
+def _export_local_files(srctree, rd, destdir):
+ """Copy local files from srctree to given location.
+ Returns three-tuple of dicts:
+ 1. updated - files that already exist in SRCURI
+ 2. added - new files files that don't exist in SRCURI
+ 3 removed - files that exist in SRCURI but not in exported files
+ In each dict the key is the 'basepath' of the URI and value is the
+ absolute path to the existing file in recipe space (if any).
+ """
+ import oe.recipeutils
+
+ # Find out local files (SRC_URI files that exist in the "recipe space").
+ # Local files that reside in srctree are not included in patch generation.
+ # Instead they are directly copied over the original source files (in
+ # recipe space).
+ existing_files = oe.recipeutils.get_recipe_local_files(rd)
+ new_set = None
+ updated = OrderedDict()
+ added = OrderedDict()
+ removed = OrderedDict()
+ git_files = _git_ls_tree(srctree)
+ if 'oe-local-files' in git_files:
+ # If tracked by Git, take the files from srctree HEAD. First get
+ # the tree object of the directory
+ tmp_index = os.path.join(srctree, '.git', 'index.tmp.devtool')
+ tree = git_files['oe-local-files'][2]
+ bb.process.run(['git', 'checkout', tree, '--', '.'], cwd=srctree,
+ env=dict(os.environ, GIT_WORK_TREE=destdir,
+ GIT_INDEX_FILE=tmp_index))
+ new_set = _git_ls_tree(srctree, tree, True).keys()
+ elif os.path.isdir(os.path.join(srctree, 'oe-local-files')):
+ # If not tracked by Git, just copy from working copy
+ new_set = _ls_tree(os.path.join(srctree, 'oe-local-files'))
+ bb.process.run(['cp', '-ax',
+ os.path.join(srctree, 'oe-local-files', '.'), destdir])
+ if new_set is not None:
+ for fname in new_set:
+ if fname in existing_files:
+ updated[fname] = existing_files.pop(fname)
+ elif fname != '.gitignore':
+ added[fname] = None
+
+ removed = existing_files
+ return (updated, added, removed)
+
+
def _update_recipe_srcrev(args, srctree, rd, config_data):
"""Implement the 'srcrev' mode of update-recipe"""
import bb
import oe.recipeutils
- from oe.patch import GitApplyTree
recipefile = rd.getVar('FILE', True)
logger.info('Updating SRCREV in recipe %s' % os.path.basename(recipefile))
@@ -599,51 +800,68 @@ def _update_recipe_srcrev(args, srctree, rd, config_data):
raise DevtoolError('Invalid hash returned by git: %s' % stdout)
destpath = None
- removepatches = []
+ remove_files = []
patchfields = {}
patchfields['SRCREV'] = srcrev
orig_src_uri = rd.getVar('SRC_URI', False) or ''
- if not args.no_remove:
- # Find list of existing patches in recipe file
- existing_patches = oe.recipeutils.get_recipe_patches(rd)
-
- old_srcrev = (rd.getVar('SRCREV', False) or '')
- tempdir = tempfile.mkdtemp(prefix='devtool')
- try:
- GitApplyTree.extractPatches(srctree, old_srcrev, tempdir)
- newpatches = os.listdir(tempdir)
- for patch in existing_patches:
- patchfile = os.path.basename(patch)
- if patchfile in newpatches:
- removepatches.append(patch)
- finally:
- shutil.rmtree(tempdir)
+ srcuri = orig_src_uri.split()
+ tempdir = tempfile.mkdtemp(prefix='devtool')
+ update_srcuri = False
+ try:
+ local_files_dir = tempfile.mkdtemp(dir=tempdir)
+ upd_f, new_f, del_f = _export_local_files(srctree, rd, local_files_dir)
+ if not args.no_remove:
+ # Find list of existing patches in recipe file
+ patches_dir = tempfile.mkdtemp(dir=tempdir)
+ old_srcrev = (rd.getVar('SRCREV', False) or '')
+ upd_p, new_p, del_p = _export_patches(srctree, rd, old_srcrev,
+ patches_dir)
+
+ # Remove deleted local files and "overlapping" patches
+ remove_files = del_f.values() + upd_p.values()
+ if remove_files:
+ removedentries = _remove_file_entries(srcuri, remove_files)[0]
+ update_srcuri = True
- if removepatches:
- srcuri = orig_src_uri.split()
- removedentries, _ = _remove_patch_entries(srcuri, removepatches)
- if removedentries:
+ if args.append:
+ files = dict((os.path.join(local_files_dir, key), val) for
+ key, val in upd_f.items() + new_f.items())
+ removevalues = {}
+ if update_srcuri:
+ removevalues = {'SRC_URI': removedentries}
+ patchfields['SRC_URI'] = '\\\n '.join(srcuri)
+ _, destpath = oe.recipeutils.bbappend_recipe(
+ rd, args.append, files, wildcardver=args.wildcard_version,
+ extralines=patchfields, removevalues=removevalues)
+ else:
+ files_dir = os.path.join(os.path.dirname(recipefile),
+ rd.getVar('BPN', True))
+ for basepath, path in upd_f.iteritems():
+ logger.info('Updating file %s' % basepath)
+ _move_file(os.path.join(local_files_dir, basepath), path)
+ update_srcuri= True
+ for basepath, path in new_f.iteritems():
+ logger.info('Adding new file %s' % basepath)
+ _move_file(os.path.join(local_files_dir, basepath),
+ os.path.join(files_dir, basepath))
+ srcuri.append('file://%s' % basepath)
+ update_srcuri = True
+ if update_srcuri:
patchfields['SRC_URI'] = ' '.join(srcuri)
-
- if args.append:
- _, destpath = oe.recipeutils.bbappend_recipe(
- rd, args.append, None, wildcardver=args.wildcard_version,
- extralines=patchfields)
- else:
- oe.recipeutils.patch_recipe(rd, recipefile, patchfields)
-
+ oe.recipeutils.patch_recipe(rd, recipefile, patchfields)
+ finally:
+ shutil.rmtree(tempdir)
if not 'git://' in orig_src_uri:
logger.info('You will need to update SRC_URI within the recipe to '
'point to a git repository where you have pushed your '
'changes')
- _remove_patch_files(args, removepatches, destpath)
+ _remove_source_files(args, remove_files, destpath)
def _update_recipe_patch(args, config, srctree, rd, config_data):
"""Implement the 'patch' mode of update-recipe"""
import bb
import oe.recipeutils
- from oe.patch import GitApplyTree
recipefile = rd.getVar('FILE', True)
append = os.path.join(config.workspace_path, 'appends', '%s.bbappend' %
@@ -652,105 +870,99 @@ def _update_recipe_patch(args, config, srctree, rd, config_data):
raise DevtoolError('unable to find workspace bbappend for recipe %s' %
args.recipename)
- initial_rev, update_rev = _get_patchset_revs(args, srctree, append)
+ initial_rev, update_rev, changed_revs = _get_patchset_revs(args, srctree, append)
if not initial_rev:
raise DevtoolError('Unable to find initial revision - please specify '
'it with --initial-rev')
- # Find list of existing patches in recipe file
- existing_patches = oe.recipeutils.get_recipe_patches(rd)
-
- removepatches = []
- seqpatch_re = re.compile('^([0-9]{4}-)?(.+)')
- if not args.no_remove:
- # Get all patches from source tree and check if any should be removed
- tempdir = tempfile.mkdtemp(prefix='devtool')
- try:
- GitApplyTree.extractPatches(srctree, initial_rev, tempdir)
- # Strip numbering from patch names. If it's a git sequence named
- # patch, the numbers might not match up since we are starting from
- # a different revision This does assume that people are using
- # unique shortlog values, but they ought to be anyway...
- newpatches = [seqpatch_re.match(fname).group(2) for fname in
- os.listdir(tempdir)]
- for patch in existing_patches:
- basename = seqpatch_re.match(
- os.path.basename(patch)).group(2)
- if basename not in newpatches:
- removepatches.append(patch)
- finally:
- shutil.rmtree(tempdir)
-
- # Get updated patches from source tree
tempdir = tempfile.mkdtemp(prefix='devtool')
try:
- GitApplyTree.extractPatches(srctree, update_rev, tempdir)
-
- # Match up and replace existing patches with corresponding new patches
- updatepatches = False
+ local_files_dir = tempfile.mkdtemp(dir=tempdir)
+ upd_f, new_f, del_f = _export_local_files(srctree, rd, local_files_dir)
+
+ remove_files = []
+ if not args.no_remove:
+ # Get all patches from source tree and check if any should be removed
+ all_patches_dir = tempfile.mkdtemp(dir=tempdir)
+ upd_p, new_p, del_p = _export_patches(srctree, rd, initial_rev,
+ all_patches_dir)
+ # Remove deleted local files and patches
+ remove_files = del_f.values() + del_p.values()
+
+ # Get updated patches from source tree
+ patches_dir = tempfile.mkdtemp(dir=tempdir)
+ upd_p, new_p, del_p = _export_patches(srctree, rd, update_rev,
+ patches_dir)
+ updatefiles = False
updaterecipe = False
destpath = None
- newpatches = os.listdir(tempdir)
+ srcuri = (rd.getVar('SRC_URI', False) or '').split()
if args.append:
- patchfiles = {}
- for patch in existing_patches:
- patchfile = os.path.basename(patch)
- if patchfile in newpatches:
- patchfiles[os.path.join(tempdir, patchfile)] = patchfile
- newpatches.remove(patchfile)
- for patchfile in newpatches:
- patchfiles[os.path.join(tempdir, patchfile)] = None
-
- if patchfiles or removepatches:
+ files = dict((os.path.join(local_files_dir, key), val) for
+ key, val in upd_f.items() + new_f.items())
+ files.update(dict((os.path.join(patches_dir, key), val) for
+ key, val in upd_p.items() + new_p.items()))
+ if files or remove_files:
removevalues = None
- if removepatches:
- srcuri = (rd.getVar('SRC_URI', False) or '').split()
- removedentries, remaining = _remove_patch_entries(
- srcuri, removepatches)
+ if remove_files:
+ removedentries, remaining = _remove_file_entries(
+ srcuri, remove_files)
if removedentries or remaining:
remaining = ['file://' + os.path.basename(item) for
item in remaining]
removevalues = {'SRC_URI': removedentries + remaining}
_, destpath = oe.recipeutils.bbappend_recipe(
- rd, args.append, patchfiles,
+ rd, args.append, files,
removevalues=removevalues)
else:
- logger.info('No patches needed updating')
+ logger.info('No patches or local source files needed updating')
else:
- for patch in existing_patches:
- patchfile = os.path.basename(patch)
- if patchfile in newpatches:
- logger.info('Updating patch %s' % patchfile)
- shutil.move(os.path.join(tempdir, patchfile), patch)
- newpatches.remove(patchfile)
- updatepatches = True
- srcuri = (rd.getVar('SRC_URI', False) or '').split()
- if newpatches:
- # Add any patches left over
- patchdir = os.path.join(os.path.dirname(recipefile),
- rd.getVar('BPN', True))
- bb.utils.mkdirhier(patchdir)
- for patchfile in newpatches:
- logger.info('Adding new patch %s' % patchfile)
- shutil.move(os.path.join(tempdir, patchfile),
- os.path.join(patchdir, patchfile))
- srcuri.append('file://%s' % patchfile)
- updaterecipe = True
- if removepatches:
- removedentries, _ = _remove_patch_entries(srcuri, removepatches)
- if removedentries:
- updaterecipe = True
+ # Update existing files
+ for basepath, path in upd_f.iteritems():
+ logger.info('Updating file %s' % basepath)
+ _move_file(os.path.join(local_files_dir, basepath), path)
+ updatefiles = True
+ for basepath, path in upd_p.iteritems():
+ patchfn = os.path.join(patches_dir, basepath)
+ if changed_revs is not None:
+ # Avoid updating patches that have not actually changed
+ with open(patchfn, 'r') as f:
+ firstlineitems = f.readline().split()
+ if len(firstlineitems) > 1 and len(firstlineitems[1]) == 40:
+ if not firstlineitems[1] in changed_revs:
+ continue
+ logger.info('Updating patch %s' % basepath)
+ _move_file(patchfn, path)
+ updatefiles = True
+ # Add any new files
+ files_dir = os.path.join(os.path.dirname(recipefile),
+ rd.getVar('BPN', True))
+ for basepath, path in new_f.iteritems():
+ logger.info('Adding new file %s' % basepath)
+ _move_file(os.path.join(local_files_dir, basepath),
+ os.path.join(files_dir, basepath))
+ srcuri.append('file://%s' % basepath)
+ updaterecipe = True
+ for basepath, path in new_p.iteritems():
+ logger.info('Adding new patch %s' % basepath)
+ _move_file(os.path.join(patches_dir, basepath),
+ os.path.join(files_dir, basepath))
+ srcuri.append('file://%s' % basepath)
+ updaterecipe = True
+ # Update recipe, if needed
+ if _remove_file_entries(srcuri, remove_files)[0]:
+ updaterecipe = True
if updaterecipe:
logger.info('Updating recipe %s' % os.path.basename(recipefile))
oe.recipeutils.patch_recipe(rd, recipefile,
{'SRC_URI': ' '.join(srcuri)})
- elif not updatepatches:
+ elif not updatefiles:
# Neither patches nor recipe were updated
- logger.info('No patches need updating')
+ logger.info('No patches or files need updating')
finally:
shutil.rmtree(tempdir)
- _remove_patch_files(args, removepatches, destpath)
+ _remove_source_files(args, remove_files, destpath)
def _guess_recipe_update_mode(srctree, rdata):
"""Guess the recipe update mode to use"""
@@ -776,9 +988,7 @@ def _guess_recipe_update_mode(srctree, rdata):
def update_recipe(args, config, basepath, workspace):
"""Entry point for the devtool 'update-recipe' subcommand"""
- if not args.recipename in workspace:
- raise DevtoolError("no recipe named %s in your workspace" %
- args.recipename)
+ check_workspace_recipe(workspace, args.recipename)
if args.append:
if not os.path.exists(args.append):
@@ -788,7 +998,7 @@ def update_recipe(args, config, basepath, workspace):
raise DevtoolError('conf/layer.conf not found in bbappend '
'destination layer "%s"' % args.append)
- tinfoil = setup_tinfoil()
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
rd = parse_recipe(config, tinfoil, args.recipename, True)
if not rd:
@@ -830,28 +1040,30 @@ def reset(args, config, basepath, workspace):
if args.recipename:
if args.all:
raise DevtoolError("Recipe cannot be specified if -a/--all is used")
- elif not args.recipename in workspace:
- raise DevtoolError("no recipe named %s in your workspace" %
- args.recipename)
+ else:
+ check_workspace_recipe(workspace, args.recipename, checksrc=False)
elif not args.all:
raise DevtoolError("Recipe must be specified, or specify -a/--all to "
"reset all recipes")
if args.all:
- recipes = workspace
+ recipes = workspace.keys()
else:
recipes = [args.recipename]
- for pn in recipes:
- if not args.no_clean:
- logger.info('Cleaning sysroot for recipe %s...' % pn)
- try:
- exec_build_env_command(config.init_path, basepath, 'bitbake -c clean %s' % pn)
- except bb.process.ExecutionError as e:
- raise DevtoolError('Command \'%s\' failed, output:\n%s\nIf you '
- 'wish, you may specify -n/--no-clean to '
- 'skip running this command when resetting' %
- (e.command, e.stdout))
+ if recipes and not args.no_clean:
+ if len(recipes) == 1:
+ logger.info('Cleaning sysroot for recipe %s...' % recipes[0])
+ else:
+ logger.info('Cleaning sysroot for recipes %s...' % ', '.join(recipes))
+ try:
+ exec_build_env_command(config.init_path, basepath, 'bitbake -c clean %s' % ' '.join(recipes))
+ except bb.process.ExecutionError as e:
+ raise DevtoolError('Command \'%s\' failed, output:\n%s\nIf you '
+ 'wish, you may specify -n/--no-clean to '
+ 'skip running this command when resetting' %
+ (e.command, e.stdout))
+ for pn in recipes:
_check_preserve(config, pn)
preservepath = os.path.join(config.workspace_path, 'attic', pn)
@@ -860,8 +1072,8 @@ def reset(args, config, basepath, workspace):
for root, dirs, files in os.walk(origdir):
for fn in files:
logger.warn('Preserving %s in %s' % (fn, preservepath))
- bb.utils.mkdirhier(preservepath)
- shutil.move(os.path.join(origdir, fn), os.path.join(preservepath, fn))
+ _move_file(os.path.join(origdir, fn),
+ os.path.join(preservepath, fn))
for dn in dirs:
os.rmdir(os.path.join(root, dn))
os.rmdir(origdir)
@@ -879,9 +1091,13 @@ def register_commands(subparsers, context):
description='Adds a new recipe')
parser_add.add_argument('recipename', help='Name for new recipe to add')
parser_add.add_argument('srctree', help='Path to external source tree')
- parser_add.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
+ group = parser_add.add_mutually_exclusive_group()
+ group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
+ group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")
parser_add.add_argument('--fetch', '-f', help='Fetch the specified URI and extract it to create the source tree', metavar='URI')
parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)')
+ parser_add.add_argument('--no-git', '-g', help='If -f/--fetch is specified, do not set up source tree as a git repository', action="store_true")
+ parser_add.add_argument('--binary', '-b', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure)', action='store_true')
parser_add.set_defaults(func=add)
parser_modify = subparsers.add_parser('modify', help='Modify the source for an existing recipe',
diff --git a/yocto-poky/scripts/lib/devtool/upgrade.py b/yocto-poky/scripts/lib/devtool/upgrade.py
index 86443b073..6bac44bb5 100644
--- a/yocto-poky/scripts/lib/devtool/upgrade.py
+++ b/yocto-poky/scripts/lib/devtool/upgrade.py
@@ -29,7 +29,7 @@ import errno
import bb
import oe.recipeutils
from devtool import standard
-from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe
+from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build
logger = logging.getLogger('devtool')
@@ -53,7 +53,7 @@ def _copy_source_code(orig, dest):
dest_dir = os.path.join(dest, os.path.dirname(path))
bb.utils.mkdirhier(dest_dir)
dest_path = os.path.join(dest, path)
- os.rename(os.path.join(orig, path), dest_path)
+ shutil.move(os.path.join(orig, path), dest_path)
def _get_checksums(rf):
import re
@@ -91,15 +91,13 @@ def _remove_patch_dirs(recipefolder):
for d in dirs:
shutil.rmtree(os.path.join(root,d))
-def _recipe_contains(rf, var):
- import re
- found = False
- with open(rf) as f:
- for line in f:
- if re.match("^%s.*=.*" % var, line):
- found = True
- break
- return found
+def _recipe_contains(rd, var):
+ rf = rd.getVar('FILE', True)
+ varfiles = oe.recipeutils.get_var_files(rf, [var], rd)
+ for var, fn in varfiles.iteritems():
+ if fn and fn.startswith(os.path.dirname(rf) + os.sep):
+ return True
+ return False
def _rename_recipe_dirs(oldpv, newpv, path):
for root, dirs, files in os.walk(path):
@@ -119,28 +117,12 @@ def _rename_recipe_file(bpn, oldpv, newpv, path):
recipe = "%s_git.bb" % bpn
if os.path.isfile(os.path.join(path, recipe)):
newrecipe = recipe
- raise DevtoolError("Original recipe not found on workspace")
return os.path.join(path, newrecipe)
def _rename_recipe_files(bpn, oldpv, newpv, path):
_rename_recipe_dirs(oldpv, newpv, path)
return _rename_recipe_file(bpn, oldpv, newpv, path)
-def _use_external_build(same_dir, no_same_dir, d):
- b_is_s = True
- if no_same_dir:
- logger.info('using separate build directory since --no-same-dir specified')
- b_is_s = False
- elif same_dir:
- logger.info('using source tree as build directory since --same-dir specified')
- elif bb.data.inherits_class('autotools-brokensep', d):
- logger.info('using source tree as build directory since original recipe inherits autotools-brokensep')
- elif d.getVar('B', True) == os.path.abspath(d.getVar('S', True)):
- logger.info('using source tree as build directory since that is the default for this recipe')
- else:
- b_is_s = False
- return b_is_s
-
def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d):
"""Writes an append file"""
if not os.path.exists(rc):
@@ -161,7 +143,8 @@ def _write_append(rc, srctree, same_dir, no_same_dir, rev, workspace, d):
f.write(('# NOTE: We use pn- overrides here to avoid affecting'
'multiple variants in the case where the recipe uses BBCLASSEXTEND\n'))
f.write('EXTERNALSRC_pn-%s = "%s"\n' % (pn, srctree))
- if _use_external_build(same_dir, no_same_dir, d):
+ b_is_s = use_external_build(same_dir, no_same_dir, d)
+ if b_is_s:
f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (pn, srctree))
if rev:
f.write('\n# initial_rev: %s\n' % rev)
@@ -216,6 +199,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin
if srcrev:
rev = srcrev
if uri.startswith('git://'):
+ __run('git fetch')
__run('git checkout %s' % rev)
__run('git tag -f devtool-base-new')
md5 = None
@@ -271,7 +255,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin
return (rev, md5, sha256)
-def _create_new_recipe(newpv, md5, sha256, workspace, rd):
+def _create_new_recipe(newpv, md5, sha256, srcrev, workspace, tinfoil, rd):
"""Creates the new recipe under workspace"""
crd = rd.createCopy()
@@ -285,8 +269,16 @@ def _create_new_recipe(newpv, md5, sha256, workspace, rd):
newpv = oldpv
fullpath = _rename_recipe_files(bpn, oldpv, newpv, path)
- if _recipe_contains(fullpath, 'PV') and newpv != oldpv:
- oe.recipeutils.patch_recipe(d, fullpath, {'PV':newpv})
+ newvalues = {}
+ if _recipe_contains(rd, 'PV') and newpv != oldpv:
+ newvalues['PV'] = newpv
+
+ if srcrev:
+ newvalues['SRCREV'] = srcrev
+
+ if newvalues:
+ rd = oe.recipeutils.parse_recipe(fullpath, None, tinfoil.config_data)
+ oe.recipeutils.patch_recipe(rd, fullpath, newvalues)
if md5 and sha256:
# Unfortunately, oe.recipeutils.patch_recipe cannot update flags.
@@ -308,13 +300,19 @@ def upgrade(args, config, basepath, workspace):
if reason:
raise DevtoolError(reason)
- tinfoil = setup_tinfoil()
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
rd = parse_recipe(config, tinfoil, args.recipename, True)
if not rd:
return 1
- standard._check_compatible_recipe(args.recipename, rd)
+ pn = rd.getVar('PN', True)
+ if pn != args.recipename:
+ logger.info('Mapping %s to %s' % (args.recipename, pn))
+ if pn in workspace:
+ raise DevtoolError("recipe %s is already in your workspace" % pn)
+
+ standard._check_compatible_recipe(pn, rd)
if rd.getVar('PV', True) == args.version and rd.getVar('SRCREV', True) == args.srcrev:
raise DevtoolError("Current and upgrade versions are the same version" % version)
@@ -324,16 +322,16 @@ def upgrade(args, config, basepath, workspace):
rev2, md5, sha256 = _extract_new_source(args.version, args.srctree, args.no_patch,
args.srcrev, args.branch, args.keep_temp,
tinfoil, rd)
- rf = _create_new_recipe(args.version, md5, sha256, config.workspace_path, rd)
+ rf = _create_new_recipe(args.version, md5, sha256, args.srcrev, config.workspace_path, tinfoil, rd)
except bb.process.CmdError as e:
_upgrade_error(e, rf, args.srctree)
except DevtoolError as e:
_upgrade_error(e, rf, args.srctree)
- standard._add_md5(config, args.recipename, os.path.dirname(rf))
+ standard._add_md5(config, pn, os.path.dirname(rf))
af = _write_append(rf, args.srctree, args.same_dir, args.no_same_dir, rev2,
config.workspace_path, rd)
- standard._add_md5(config, args.recipename, af)
+ standard._add_md5(config, pn, af)
logger.info('Upgraded source extracted to %s' % args.srctree)
return 0
diff --git a/yocto-poky/scripts/lib/recipetool/create.py b/yocto-poky/scripts/lib/recipetool/create.py
index c4754dbcd..8305e4364 100644
--- a/yocto-poky/scripts/lib/recipetool/create.py
+++ b/yocto-poky/scripts/lib/recipetool/create.py
@@ -23,6 +23,7 @@ import fnmatch
import re
import logging
import scriptutils
+import urlparse
logger = logging.getLogger('recipetool')
@@ -46,10 +47,26 @@ class RecipeHandler():
results.extend(glob.glob(os.path.join(path, spec)))
return results
- def genfunction(self, outlines, funcname, content):
- outlines.append('%s () {' % funcname)
+ def genfunction(self, outlines, funcname, content, python=False, forcespace=False):
+ if python:
+ prefix = 'python '
+ else:
+ prefix = ''
+ outlines.append('%s%s () {' % (prefix, funcname))
+ if python or forcespace:
+ indent = ' '
+ else:
+ indent = '\t'
+ addnoop = not python
for line in content:
- outlines.append('\t%s' % line)
+ outlines.append('%s%s' % (indent, line))
+ if addnoop:
+ strippedline = line.lstrip()
+ if strippedline and not strippedline.startswith('#'):
+ addnoop = False
+ if addnoop:
+ # Without this there'll be a syntax error
+ outlines.append('%s:' % indent)
outlines.append('}')
outlines.append('')
@@ -86,7 +103,17 @@ def create_recipe(args):
srcrev = '${AUTOREV}'
if '://' in args.source:
# Fetch a URL
- srcuri = args.source
+ fetchuri = urlparse.urldefrag(args.source)[0]
+ if args.binary:
+ # Assume the archive contains the directory structure verbatim
+ # so we need to extract to a subdirectory
+ fetchuri += ';subdir=%s' % os.path.splitext(os.path.basename(urlparse.urlsplit(fetchuri).path))[0]
+ git_re = re.compile('(https?)://([^;]+\.git)(;.*)?')
+ res = git_re.match(fetchuri)
+ if res:
+ # Need to switch the URI around so that the git fetcher is used
+ fetchuri = 'git://%s;protocol=%s%s' % (res.group(2), res.group(1), res.group(3) or '')
+ srcuri = fetchuri
rev_re = re.compile(';rev=([^;]+)')
res = rev_re.search(srcuri)
if res:
@@ -95,14 +122,25 @@ def create_recipe(args):
tempsrc = tempfile.mkdtemp(prefix='recipetool-')
srctree = tempsrc
logger.info('Fetching %s...' % srcuri)
- checksums = scriptutils.fetch_uri(tinfoil.config_data, args.source, srctree, srcrev)
+ try:
+ checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev)
+ except bb.fetch2.FetchError:
+ # Error already printed
+ sys.exit(1)
dirlist = os.listdir(srctree)
if 'git.indirectionsymlink' in dirlist:
dirlist.remove('git.indirectionsymlink')
- if len(dirlist) == 1 and os.path.isdir(os.path.join(srctree, dirlist[0])):
- # We unpacked a single directory, so we should use that
- srcsubdir = dirlist[0]
- srctree = os.path.join(srctree, srcsubdir)
+ if len(dirlist) == 1:
+ singleitem = os.path.join(srctree, dirlist[0])
+ if os.path.isdir(singleitem):
+ # We unpacked a single directory, so we should use that
+ srcsubdir = dirlist[0]
+ srctree = os.path.join(srctree, srcsubdir)
+ else:
+ with open(singleitem, 'r') as f:
+ if '<html' in f.read(100).lower():
+ logger.error('Fetching "%s" returned a single HTML page - check the URL is correct and functional' % fetchuri)
+ sys.exit(1)
else:
# Assume we're pointing to an existing source tree
if args.extract_to:
@@ -208,6 +246,10 @@ def create_recipe(args):
lines_after.append('PACKAGE_ARCH = "%s"' % pkgarch)
lines_after.append('')
+ if args.binary:
+ lines_after.append('INSANE_SKIP_${PN} += "already-stripped"')
+ lines_after.append('')
+
# Find all plugins that want to register handlers
handlers = []
for plugin in plugins:
@@ -217,6 +259,11 @@ def create_recipe(args):
# Apply the handlers
classes = []
handled = []
+
+ if args.binary:
+ classes.append('bin_package')
+ handled.append('buildsystem')
+
for handler in handlers:
handler.process(srctree, classes, lines_before, lines_after, handled)
@@ -229,7 +276,15 @@ def create_recipe(args):
if args.extract_to:
scriptutils.git_convert_standalone_clone(srctree)
+ if os.path.isdir(args.extract_to):
+ # If the directory exists we'll move the temp dir into it instead of
+ # its contents - of course, we could try to always move its contents
+ # but that is a pain if there are symlinks; the simplest solution is
+ # to just remove it first
+ os.rmdir(args.extract_to)
shutil.move(srctree, args.extract_to)
+ if tempsrc == srctree:
+ tempsrc = None
logger.info('Source extracted to %s' % args.extract_to)
if outfile == '-':
@@ -408,5 +463,6 @@ def register_command(subparsers):
parser_create.add_argument('-m', '--machine', help='Make recipe machine-specific as opposed to architecture-specific', action='store_true')
parser_create.add_argument('-x', '--extract-to', metavar='EXTRACTPATH', help='Assuming source is a URL, fetch it and extract it to the directory specified as %(metavar)s')
parser_create.add_argument('-V', '--version', help='Version to use within recipe (PV)')
+ parser_create.add_argument('-b', '--binary', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure)', action='store_true')
parser_create.set_defaults(func=create_recipe)
diff --git a/yocto-poky/scripts/lib/recipetool/create_buildsys.py b/yocto-poky/scripts/lib/recipetool/create_buildsys.py
index ed14a5330..931ef3b33 100644
--- a/yocto-poky/scripts/lib/recipetool/create_buildsys.py
+++ b/yocto-poky/scripts/lib/recipetool/create_buildsys.py
@@ -279,7 +279,7 @@ class MakefileRecipeHandler(RecipeHandler):
installtarget = True
try:
- stdout, stderr = bb.process.run('make -qn install', cwd=srctree, shell=True)
+ stdout, stderr = bb.process.run('make -n install', cwd=srctree, shell=True)
except bb.process.ExecutionError as e:
if e.exitcode != 1:
installtarget = False
diff --git a/yocto-poky/scripts/lib/scriptutils.py b/yocto-poky/scripts/lib/scriptutils.py
index 336688263..e79a195b1 100644
--- a/yocto-poky/scripts/lib/scriptutils.py
+++ b/yocto-poky/scripts/lib/scriptutils.py
@@ -85,6 +85,10 @@ def fetch_uri(d, uri, destdir, srcrev=None):
ud = fetcher.ud[u]
ud.ignore_checksums = True
fetcher.download()
+ for u in fetcher.ud:
+ ud = fetcher.ud[u]
+ if ud.localpath.rstrip(os.sep) == localdata.getVar('DL_DIR', True).rstrip(os.sep):
+ raise Exception('Local path is download directory - please check that the URI "%s" is correct' % uri)
fetcher.unpack(destdir)
for u in fetcher.ud:
ud = fetcher.ud[u]
diff --git a/yocto-poky/scripts/lib/wic/imager/direct.py b/yocto-poky/scripts/lib/wic/imager/direct.py
index 146a0d153..d5603fa91 100644
--- a/yocto-poky/scripts/lib/wic/imager/direct.py
+++ b/yocto-poky/scripts/lib/wic/imager/direct.py
@@ -241,8 +241,7 @@ class DirectImageCreator(BaseImageCreator):
# IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE
rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name)
if rsize_bb:
- # convert from Kb to Mb
- part.size = int(round(float(rsize_bb) / 1024.))
+ part.size = int(round(float(rsize_bb)))
# need to create the filesystems in order to get their
# sizes before we can add them and do the layout.
# Image.create() actually calls __format_disks() to create
diff --git a/yocto-poky/scripts/lib/wic/utils/oe/misc.py b/yocto-poky/scripts/lib/wic/utils/oe/misc.py
index 7370d9313..c6d2e5f20 100644
--- a/yocto-poky/scripts/lib/wic/utils/oe/misc.py
+++ b/yocto-poky/scripts/lib/wic/utils/oe/misc.py
@@ -82,6 +82,12 @@ def exec_cmd(cmd_and_args, as_shell=False, catch=3):
return out
+def cmd_in_path(cmd, path):
+ import scriptpath
+
+ scriptpath.add_bitbake_lib_path()
+
+ return bb.utils.which(path, cmd) != "" or False
def exec_native_cmd(cmd_and_args, native_sysroot, catch=3):
"""
@@ -92,15 +98,21 @@ def exec_native_cmd(cmd_and_args, native_sysroot, catch=3):
Always need to execute native commands as_shell
"""
native_paths = \
- "export PATH=%s/sbin:%s/usr/sbin:%s/usr/bin" % \
+ "%s/sbin:%s/usr/sbin:%s/usr/bin" % \
(native_sysroot, native_sysroot, native_sysroot)
- native_cmd_and_args = "%s;%s" % (native_paths, cmd_and_args)
+ native_cmd_and_args = "export PATH=%s:$PATH;%s" % \
+ (native_paths, cmd_and_args)
msger.debug("exec_native_cmd: %s" % cmd_and_args)
- args = cmd_and_args.split()
+ # The reason -1 is used is because there may be "export" commands.
+ args = cmd_and_args.split(';')[-1].split()
msger.debug(args)
- ret, out = _exec_cmd(native_cmd_and_args, True, catch)
+ # If the command isn't in the native sysroot say we failed.
+ if cmd_in_path(args[0], native_paths):
+ ret, out = _exec_cmd(native_cmd_and_args, True, catch)
+ else:
+ ret = 127
if ret == 127: # shell command-not-found
prog = args[0]
diff --git a/yocto-poky/scripts/oe-git-proxy b/yocto-poky/scripts/oe-git-proxy
index 48734556a..d2e9f925b 100755
--- a/yocto-poky/scripts/oe-git-proxy
+++ b/yocto-poky/scripts/oe-git-proxy
@@ -53,6 +53,7 @@ match_ipv4() {
# Determine the mask bitlength
BITS=${CIDR##*/}
+ [ "$BITS" != "$CIDR" ] || BITS=32
if [ -z "$BITS" ]; then
return 1
fi
@@ -112,16 +113,23 @@ done
# Proxy is necessary, determine protocol, server, and port
PROTO=$(echo $ALL_PROXY | sed -e 's/\([^:]*\):\/\/.*/\1/')
PROXY=$(echo $ALL_PROXY | sed -e 's/.*:\/\/\([^:]*\).*/\1/')
-PORT=$(echo $ALL_PROXY | sed -e 's/.*:\([0-9]*\)\/?$/\1/')
+# For backwards compatibility, this allows the port number to be followed by /?
+# in addition to the customary optional /
+PORT=$(echo $ALL_PROXY | sed -e 's/.*:\([0-9]*\)\(\/?\?\)\?$/\1/')
if [ "$PORT" = "$ALL_PROXY" ]; then
PORT=""
fi
-if [ "$PROTO" = "socks" ]; then
+if [ "$PROTO" = "socks" ] || [ "$PROTO" = "socks4a" ]; then
if [ -z "$PORT" ]; then
PORT="1080"
fi
METHOD="SOCKS4A:$PROXY:$1:$2,socksport=$PORT"
+elif [ "$PROTO" = "socks4" ]; then
+ if [ -z "$PORT" ]; then
+ PORT="1080"
+ fi
+ METHOD="SOCKS4:$PROXY:$1:$2,socksport=$PORT"
else
# Assume PROXY (http, https, etc)
if [ -z "$PORT" ]; then
diff --git a/yocto-poky/scripts/oe-pkgdata-util b/yocto-poky/scripts/oe-pkgdata-util
index b075775b8..cb19cc4ae 100755
--- a/yocto-poky/scripts/oe-pkgdata-util
+++ b/yocto-poky/scripts/oe-pkgdata-util
@@ -60,6 +60,7 @@ def glob(args):
skipval += "|" + args.exclude
skipregex = re.compile(skipval)
+ skippedpkgs = set()
mappedpkgs = set()
with open(args.pkglistfile, 'r') as f:
for line in f:
@@ -73,6 +74,7 @@ def glob(args):
# Skip packages for which there is no point applying globs
if skipregex.search(pkg):
logger.debug("%s -> !!" % pkg)
+ skippedpkgs.add(pkg)
continue
# Skip packages that already match the globs, so if e.g. a dev package
@@ -84,6 +86,7 @@ def glob(args):
already = True
break
if already:
+ skippedpkgs.add(pkg)
logger.debug("%s -> !" % pkg)
continue
@@ -152,7 +155,7 @@ def glob(args):
logger.debug("------")
- print("\n".join(mappedpkgs))
+ print("\n".join(mappedpkgs - skippedpkgs))
def read_value(args):
# Handle both multiple arguments and multiple values within an arg (old syntax)
@@ -493,7 +496,7 @@ def main():
sys.exit(1)
if not os.path.exists(args.pkgdata_dir):
- logger.error('Unable to find pkgdata directory %s' % pkgdata_dir)
+ logger.error('Unable to find pkgdata directory %s' % args.pkgdata_dir)
sys.exit(1)
ret = args.func(args)
diff --git a/yocto-poky/scripts/oe-publish-sdk b/yocto-poky/scripts/oe-publish-sdk
index 1737c9f3b..ee4169a00 100755
--- a/yocto-poky/scripts/oe-publish-sdk
+++ b/yocto-poky/scripts/oe-publish-sdk
@@ -101,9 +101,9 @@ def publish(args):
# Setting up the git repo
if not is_remote:
- cmd = 'set -e; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; fi; git add -A .; git commit -q -m "init repo" || true;' % destination
+ cmd = 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; fi; git add -A .; git commit -q -m "init repo" || true; git update-server-info' % (destination, destination)
else:
- cmd = "ssh %s 'set -e; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; fi; git add -A .; git commit -q -m \"init repo\" || true;'" % (host, destdir)
+ cmd = "ssh %s 'set -e; mkdir-p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; fi; git add -A .; git commit -q -m \"init repo\" || true; git update-server-info'" % (host, destdir, destdir)
ret = subprocess.call(cmd, shell=True)
if ret == 0:
logger.info('SDK published successfully')
diff --git a/yocto-poky/scripts/postinst-intercepts/update_font_cache b/yocto-poky/scripts/postinst-intercepts/update_font_cache
index c8c6018f2..0deab3c11 100644
--- a/yocto-poky/scripts/postinst-intercepts/update_font_cache
+++ b/yocto-poky/scripts/postinst-intercepts/update_font_cache
@@ -1,5 +1,5 @@
#!/bin/sh
-PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
- $D${bindir}/fc-cache --sysroot=$D
+PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir} \
+ -E ${fontconfigcacheenv} $D${bindir}/fc-cache --sysroot=$D ${fontconfigcacheparams}
chown -R root:root $D${fontconfigcachedir}
diff --git a/yocto-poky/scripts/postinst-intercepts/update_icon_cache b/yocto-poky/scripts/postinst-intercepts/update_icon_cache
index 8e17a6ac0..9cf2a72a0 100644
--- a/yocto-poky/scripts/postinst-intercepts/update_icon_cache
+++ b/yocto-poky/scripts/postinst-intercepts/update_icon_cache
@@ -1,8 +1,9 @@
#!/bin/sh
set -e
+
# update native pixbuf loaders
-gdk-pixbuf-query-loaders --update-cache
+$STAGING_DIR_NATIVE/${libdir_native}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache
for icondir in $D/usr/share/icons/*/ ; do
if [ -d $icondir ] ; then
diff --git a/yocto-poky/scripts/postinst-intercepts/update_pixbuf_cache b/yocto-poky/scripts/postinst-intercepts/update_pixbuf_cache
index 95bf4f90a..a8b400106 100644
--- a/yocto-poky/scripts/postinst-intercepts/update_pixbuf_cache
+++ b/yocto-poky/scripts/postinst-intercepts/update_pixbuf_cache
@@ -4,8 +4,6 @@ export GDK_PIXBUF_MODULEDIR=$D${libdir}/gdk-pixbuf-2.0/2.10.0/loaders
export GDK_PIXBUF_FATAL_LOADER=1
PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
- $D${bindir}/gdk-pixbuf-query-loaders \
+ $D${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
>$GDK_PIXBUF_MODULEDIR/../loaders.cache && \
sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache
-
-
diff --git a/yocto-poky/scripts/runqemu b/yocto-poky/scripts/runqemu
index 23cf5be16..e01d276f7 100755
--- a/yocto-poky/scripts/runqemu
+++ b/yocto-poky/scripts/runqemu
@@ -33,6 +33,7 @@ usage() {
echo " nographic - disables video console"
echo " serial - enables a serial console on /dev/ttyS0"
echo " kvm - enables KVM when running qemux86/qemux86-64 (VT-capable CPU required)"
+ echo " kvm-vhost - enables KVM with vhost support when running qemux86/qemux86-64 (VT-capable CPU required)"
echo " publicvnc - enable a VNC server open to all hosts"
echo " qemuparams=\"xyz\" - specify custom parameters to QEMU"
echo " bootparams=\"xyz\" - specify custom kernel parameters during boot"
@@ -71,6 +72,8 @@ SERIALSTDIO=""
TCPSERIAL_PORTNUM=""
KVM_ENABLED="no"
KVM_ACTIVE="no"
+VHOST_ENABLED="no"
+VHOST_ACTIVE="no"
# Determine whether the file is a kernel or QEMU image, and set the
# appropriate variables
@@ -111,7 +114,7 @@ while true; do
case "$arg" in
"qemux86" | "qemux86-64" | "qemuarm" | "qemuarm64" | "qemumips" | "qemumipsel" | \
"qemumips64" | "qemush4" | "qemuppc" | "qemumicroblaze" | "qemuzynq")
- [ -z "$MACHINE" ] && MACHINE=$arg || \
+ [ -z "$MACHINE" -o "$MACHINE" = "$arg" ] && MACHINE=$arg || \
error "conflicting MACHINE types [$MACHINE] and [$arg]"
;;
"ext2" | "ext3" | "ext4" | "jffs2" | "nfs" | "btrfs" | "hddimg" | "hdddirect" )
@@ -170,6 +173,11 @@ while true; do
KVM_ENABLED="yes"
KVM_CAPABLE=`grep -q 'vmx\|svm' /proc/cpuinfo && echo 1`
;;
+ "kvm-vhost")
+ KVM_ENABLED="yes"
+ KVM_CAPABLE=`grep -q 'vmx\|svm' /proc/cpuinfo && echo 1`
+ VHOST_ENABLED="yes"
+ ;;
"slirp")
SLIRP_ENABLED="yes"
;;
@@ -270,12 +278,6 @@ if [ "x$KVM_ENABLED" = "xyes" ]; then
echo "$YOCTO_KVM_WIKI";
exit 1;
fi
- if [ ! -e /dev/vhost-net ]; then
- echo "Missing virtio net device. Have you inserted vhost-net module?"
- echo "For further help see:"
- echo "$YOCTO_PARAVIRT_KVM_WIKI";
- exit 1;
- fi
if [ -w /dev/kvm -a -r /dev/kvm ]; then
SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm"
KVM_ACTIVE="yes"
@@ -285,13 +287,22 @@ if [ "x$KVM_ENABLED" = "xyes" ]; then
echo "$YOCTO_KVM_WIKI";
exit 1;
fi
- if [ ! -w /dev/vhost-net -o ! -r /dev/vhost-net ]; then
- if [ "$SLIRP_ENABLED" != "yes" ] ; then
+ if [ "x$VHOST_ENABLED" = "xyes" ]; then
+ if [ ! -e /dev/vhost-net ]; then
+ echo "Missing virtio net device. Have you inserted vhost-net module?"
+ echo "For further help see:"
+ echo "$YOCTO_PARAVIRT_KVM_WIKI";
+ exit 1;
+ fi
+
+ if [ -w /dev/vhost-net -a -r /dev/vhost-net ]; then
+ VHOST_ACTIVE="yes"
+ else
echo "You have no rights on /dev/vhost-net."
echo "Please change the ownership of this file as described at:"
- echo "$YOCTO_PARAVIRT_KVM_WIKI";
+ echo "$YOCTO_KVM_WIKI";
exit 1;
- fi
+ fi
fi
fi
diff --git a/yocto-poky/scripts/runqemu-export-rootfs b/yocto-poky/scripts/runqemu-export-rootfs
index 40ab20143..3dee13116 100755
--- a/yocto-poky/scripts/runqemu-export-rootfs
+++ b/yocto-poky/scripts/runqemu-export-rootfs
@@ -46,8 +46,8 @@ if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
fi
. $SYSROOT_SETUP_SCRIPT
-if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/sbin/unfsd" ]; then
- echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/sbin/"
+if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/unfsd" ]; then
+ echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin/"
if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then
echo "Have you run 'bitbake meta-ide-support'?"
@@ -115,8 +115,8 @@ case "$1" in
fi
echo "Starting User Mode nfsd"
- echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/unfsd $UNFSD_OPTS"
- $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/sbin/unfsd $UNFSD_OPTS
+ echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS"
+ $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS
if [ ! $? = 0 ]; then
echo "Error starting nfsd"
exit 1
diff --git a/yocto-poky/scripts/runqemu-ifup b/yocto-poky/scripts/runqemu-ifup
index b5a3db964..d9bd89412 100755
--- a/yocto-poky/scripts/runqemu-ifup
+++ b/yocto-poky/scripts/runqemu-ifup
@@ -91,10 +91,25 @@ fi
n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
$IFCONFIG addr add 192.168.7.$n/32 broadcast 192.168.7.255 dev $TAP
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+ echo "Failed to set up IP addressing on $TAP"
+ exit 1
+fi
$IFCONFIG link set dev $TAP up
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+ echo "Failed to bring up $TAP"
+ exit 1
+fi
dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
$IFCONFIG route add to 192.168.7.$dest dev $TAP
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+ echo "Failed to add route to 192.168.7.$dest using $TAP"
+ exit 1
+fi
# setup NAT for tap0 interface to have internet access in QEMU
$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$n/32
diff --git a/yocto-poky/scripts/runqemu-internal b/yocto-poky/scripts/runqemu-internal
index 15272683b..3b0e54c86 100755
--- a/yocto-poky/scripts/runqemu-internal
+++ b/yocto-poky/scripts/runqemu-internal
@@ -54,7 +54,7 @@ else
mem_size=512
;;
"qemumicroblaze")
- mem_size=64
+ mem_size=256
;;
"qemumips"|"qemumips64")
mem_size=256
@@ -120,16 +120,9 @@ if [ "$SLIRP_ENABLED" = "yes" ]; then
KERNEL_NETWORK_CMD="ip=dhcp"
QEMU_TAP_CMD=""
QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet"
- if [ "$KVM_ACTIVE" = "yes" ]; then
- QEMU_NETWORK_CMD=""
- DROOT="/dev/vda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
- else
- QEMU_NETWORK_CMD=""
- DROOT="/dev/hda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,if=ide,format=raw"
- fi
-
+ QEMU_NETWORK_CMD=""
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
else
acquire_lock() {
lockfile=$1
@@ -266,20 +259,13 @@ else
KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0"
QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no"
- if [ "$KVM_ACTIVE" = "yes" ]; then
+ if [ "$VHOST_ACTIVE" = "yes" ]; then
QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD,vhost=on"
- DROOT="/dev/vda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
else
- QEMU_NETWORK_CMD="-net nic,vlan=0 $QEMU_TAP_CMD"
- DROOT="/dev/hda"
- ROOTFS_OPTIONS="-drive file=$ROOTFS,if=ide,format=raw"
- fi
- if [ "$MACHINE" = "qemuarm64" ]; then
- QEMU_NETWORK_CMD="-netdev tap,id=net0,ifname=$TAP,script=no,downscript=no -device virtio-net-device,netdev=net0 "
- DROOT="/dev/vda"
- ROOTFS_OPTIONS="-drive id=disk0,file=$ROOTFS,if=none,format=raw -device virtio-blk-device,drive=disk0"
+ QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD"
fi
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio,format=raw"
KERNCMDLINE="mem=$QEMU_MEMORY"
QEMU_UI_OPTIONS="-show-cursor -usb -usbdevice wacom-tablet"
@@ -364,8 +350,8 @@ if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "qemuarmv6" -o "$MACHINE" = "qemuarm
QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
# QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -force-pointer"
if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
- KERNCMDLINE="root=/dev/sda rw console=ttyAMA0,115200 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY highres=off"
- QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS"
+ KERNCMDLINE="root=$DROOT rw console=ttyAMA0,115200 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY highres=off"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS"
fi
if [ "$FSTYPE" = "nfs" ]; then
if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
@@ -387,6 +373,10 @@ fi
if [ "$MACHINE" = "qemuarm64" ]; then
QEMU=qemu-system-aarch64
+ QEMU_NETWORK_CMD="-netdev tap,id=net0,ifname=$TAP,script=no,downscript=no -device virtio-net-device,netdev=net0 "
+ DROOT="/dev/vda"
+ ROOTFS_OPTIONS="-drive id=disk0,file=$ROOTFS,if=none,format=raw -device virtio-blk-device,drive=disk0"
+
export QEMU_AUDIO_DRV="none"
if [ "x$SERIALSTDIO" = "x" ] ; then
QEMU_UI_OPTIONS="-nographic"
@@ -394,7 +384,7 @@ if [ "$MACHINE" = "qemuarm64" ]; then
QEMU_UI_OPTIONS=""
fi
if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
- KERNCMDLINE="root=/dev/vda rw console=ttyAMA0,38400 mem=$QEMU_MEMORY highres=off $KERNEL_NETWORK_CMD"
+ KERNCMDLINE="root=$DROOT rw console=ttyAMA0,38400 mem=$QEMU_MEMORY highres=off $KERNEL_NETWORK_CMD"
# qemu-system-aarch64 only support '-machine virt -cpu cortex-a57' for now
QEMUOPTIONS="$QEMU_NETWORK_CMD -machine virt -cpu cortex-a57 $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
fi
@@ -409,7 +399,6 @@ if [ "$MACHINE" = "qemuarm64" ]; then
fi
fi
-
if [ "$MACHINE" = "qemux86" ]; then
QEMU=qemu-system-i386
if [ "$KVM_ACTIVE" = "yes" ]; then
@@ -508,8 +497,8 @@ if [ "$MACHINE" = "qemumips" -o "$MACHINE" = "qemumipsel" -o "$MACHINE" = "qemum
QEMU_UI_OPTIONS="-vga cirrus $QEMU_UI_OPTIONS"
if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
#KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
- KERNCMDLINE="root=/dev/hda rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
- QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS"
+ KERNCMDLINE="root=$DROOT rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS"
fi
if [ "$FSTYPE" = "nfs" ]; then
if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
@@ -533,8 +522,8 @@ if [ "$MACHINE" = "qemuppc" ]; then
QEMU_NETWORK_CMD="-net nic,model=pcnet $QEMU_TAP_CMD"
fi
if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
- KERNCMDLINE="root=/dev/hda rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
- QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS"
+ KERNCMDLINE="root=$DROOT rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+ QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE $ROOTFS_OPTIONS -no-reboot $QEMU_UI_OPTIONS"
fi
if [ "$FSTYPE" = "nfs" ]; then
if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
@@ -587,20 +576,20 @@ fi
if [ "$MACHINE" = "qemumicroblaze" ]; then
QEMU=qemu-system-microblazeel
- QEMU_SYSTEM_OPTIONS="-M petalogix-ml605 -serial mon:stdio -dtb $KERNEL-$MACHINE.dtb"
+ QEMU_SYSTEM_OPTIONS="$QEMU_NETWORK_CMD -M petalogix-ml605 -serial mon:stdio"
if [ "${FSTYPE:0:3}" = "ext" -o "${FSTYPE:0:4}" = "cpio" ]; then
- KERNCMDLINE="earlyprintk root=/dev/ram rw"
+ KERNCMDLINE="earlyprintk root=/dev/ram rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
QEMUOPTIONS="$QEMU_SYSTEM_OPTIONS -initrd $ROOTFS"
fi
fi
if [ "$MACHINE" = "qemuzynq" ]; then
QEMU=qemu-system-arm
- QEMU_SYSTEM_OPTIONS="-M xilinx-zynq-a9 -serial null -serial mon:stdio -dtb $KERNEL-$MACHINE.dtb"
+ QEMU_SYSTEM_OPTIONS="$QEMU_NETWORK_CMD -M xilinx-zynq-a9 -serial null -serial mon:stdio -dtb $KERNEL-$MACHINE.dtb"
# zynq serial ports are named 'ttyPS0' and 'ttyPS1', fixup the default values
SCRIPT_KERNEL_OPT=$(echo "$SCRIPT_KERNEL_OPT" | sed 's/console=ttyS/console=ttyPS/g')
if [ "${FSTYPE:0:3}" = "ext" -o "${FSTYPE:0:4}" = "cpio" ]; then
- KERNCMDLINE="earlyprintk root=/dev/ram rw"
+ KERNCMDLINE="earlyprintk root=/dev/ram rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
QEMUOPTIONS="$QEMU_SYSTEM_OPTIONS -initrd $ROOTFS"
fi
fi
@@ -700,6 +689,38 @@ if [ "x$SERIALSTDIO" = "x1" ]; then
stty intr ^]
fi
+
+# Preserve the multiplexing behavior for the monitor that would be there based
+# on whether nographic is used.
+if echo "$QEMUOPTIONS $SERIALOPTS $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT" | grep -- "-nographic"; then
+ FIRST_SERIAL_OPT="-serial mon:stdio"
+else
+ FIRST_SERIAL_OPT="-serial mon:vc"
+fi
+
+# qemuarm64 uses virtio for any additional serial ports so the normal mechanism
+# of using -serial will not work
+if [ "$MACHINE" = "qemuarm64" ]; then
+ SECOND_SERIAL_OPT="$SCRIPT_QEMU_EXTRA_OPT -device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
+else
+ SECOND_SERIAL_OPT="-serial null"
+fi
+
+# We always want a ttyS1. Since qemu by default adds a serial port when
+# nodefaults is not specified, it seems that all that would be needed is to
+# make sure a "-serial" is there. However, it appears that when "-serial" is
+# specified, it ignores the default serial port that is normally added.
+# So here we make sure to add two -serial if there are none. And only one
+# if there is one -serial already.
+NUM_SERIAL_OPTS=`echo $QEMUOPTIONS $SERIALOPTS $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT | sed -e 's/ /\n/g' | grep --count -- -serial`
+
+if [ "$NUM_SERIAL_OPTS" = "0" ]; then
+ SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT $FIRST_SERIAL_OPT $SECOND_SERIAL_OPT"
+elif [ "$NUM_SERIAL_OPTS" = "1" ]; then
+ SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT $SECOND_SERIAL_OPT"
+fi
+
+
echo "Running $QEMU..."
# -no-reboot is a mandatory option - see bug #100
if [ "$FSTYPE" = "vmdk" -o "$FSTYPE" = "hddimg" -o "$FSTYPE" = "hdddirect" ]; then
diff --git a/yocto-poky/scripts/yocto-bsp b/yocto-poky/scripts/yocto-bsp
index d26986176..2d9453fbe 100755
--- a/yocto-poky/scripts/yocto-bsp
+++ b/yocto-poky/scripts/yocto-bsp
@@ -140,7 +140,7 @@ def main():
if args[0] == "help":
if len(args) == 1:
parser.print_help()
- sys.exit(1)
+ sys.exit()
invoke_subcommand(args, parser, yocto_bsp_help_usage, subcommands)
OpenPOWER on IntegriCloud