diff options
Diffstat (limited to 'yocto-poky/scripts/contrib')
-rwxr-xr-x | yocto-poky/scripts/contrib/build-perf-test.sh | 45 | ||||
-rwxr-xr-x | yocto-poky/scripts/contrib/devtool-stress.py | 5 | ||||
-rwxr-xr-x | yocto-poky/scripts/contrib/mkefidisk.sh | 7 | ||||
-rwxr-xr-x | yocto-poky/scripts/contrib/python/generate-manifest-2.7.py | 15 | ||||
-rwxr-xr-x | yocto-poky/scripts/contrib/python/generate-manifest-3.5.py (renamed from yocto-poky/scripts/contrib/python/generate-manifest-3.4.py) | 14 | ||||
-rwxr-xr-x | yocto-poky/scripts/contrib/verify-homepage.py | 65 |
6 files changed, 90 insertions, 61 deletions
diff --git a/yocto-poky/scripts/contrib/build-perf-test.sh b/yocto-poky/scripts/contrib/build-perf-test.sh index cdd7885dc..7d99228c7 100755 --- a/yocto-poky/scripts/contrib/build-perf-test.sh +++ b/yocto-poky/scripts/contrib/build-perf-test.sh @@ -128,7 +128,7 @@ rev=$(git rev-parse --short HEAD) || exit 1 OUTDIR="$clonedir/build-perf-test/results-$rev-`date "+%Y%m%d%H%M%S"`" BUILDDIR="$OUTDIR/build" resultsfile="$OUTDIR/results.log" -bboutput="$OUTDIR/bitbake.log" +cmdoutput="$OUTDIR/commands.log" myoutput="$OUTDIR/output.log" globalres="$clonedir/build-perf-test/globalres.log" @@ -180,14 +180,13 @@ time_count=0 declare -a SIZES size_count=0 -bbtime () { - local arg="$@" - log " Timing: bitbake ${arg}" +time_cmd () { + log " Timing: $*" if [ $verbose -eq 0 ]; then - /usr/bin/time -v -o $resultsfile bitbake ${arg} >> $bboutput + /usr/bin/time -v -o $resultsfile "$@" >> $cmdoutput else - /usr/bin/time -v -o $resultsfile bitbake ${arg} + /usr/bin/time -v -o $resultsfile "$@" fi ret=$? if [ $ret -eq 0 ]; then @@ -206,12 +205,16 @@ bbtime () { log "More stats can be found in ${resultsfile}.${i}" } +bbtime () { + time_cmd bitbake "$@" +} + #we don't time bitbake here bbnotime () { local arg="$@" log " Running: bitbake ${arg}" if [ $verbose -eq 0 ]; then - bitbake ${arg} >> $bboutput + bitbake ${arg} >> $cmdoutput else bitbake ${arg} fi @@ -350,6 +353,33 @@ test3 () { bbtime -p } +# +# Test 4 - eSDK +# Measure: eSDK size and installation time +test4 () { + log "Running Test 4: eSDK size and installation time" + bbnotime $IMAGE -c do_populate_sdk_ext + + esdk_installer=(tmp/deploy/sdk/*-toolchain-ext-*.sh) + + if [ ${#esdk_installer[*]} -eq 1 ]; then + s=$((`stat -c %s "$esdk_installer"` / 1024)) + SIZES[(( size_count++ ))]="$s" + log "Download SIZE of eSDK is: $s kB" + + do_sync + time_cmd "$esdk_installer" -y -d "tmp/esdk-deploy" + + s=$((`du -sb "tmp/esdk-deploy" | cut -f1` / 1024)) + SIZES[(( size_count++ ))]="$s" + log "Install SIZE of eSDK is: $s kB" + else + log "ERROR: other than one sdk found (${esdk_installer[*]}), reporting size and time as 0." + SIZES[(( size_count++ ))]="0" + TIMES[(( time_count++ ))]="0" + fi + +} # RUN! @@ -359,6 +389,7 @@ test1_p2 test1_p3 test2 test3 +test4 # if we got til here write to global results write_results diff --git a/yocto-poky/scripts/contrib/devtool-stress.py b/yocto-poky/scripts/contrib/devtool-stress.py index 4b35fc9d0..8cf92ca2f 100755 --- a/yocto-poky/scripts/contrib/devtool-stress.py +++ b/yocto-poky/scripts/contrib/devtool-stress.py @@ -35,6 +35,7 @@ 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 +import argparse_oe logger = scriptutils.logger_create('devtool-stress') def select_recipes(args): @@ -204,8 +205,8 @@ def stress_modify(args): def main(): - parser = argparse.ArgumentParser(description="devtool stress tester", - epilog="Use %(prog)s <subcommand> --help to get help on a specific command") + parser = argparse_oe.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') diff --git a/yocto-poky/scripts/contrib/mkefidisk.sh b/yocto-poky/scripts/contrib/mkefidisk.sh index cd4de0533..333284ff5 100755 --- a/yocto-poky/scripts/contrib/mkefidisk.sh +++ b/yocto-poky/scripts/contrib/mkefidisk.sh @@ -402,7 +402,7 @@ if [ -e "$GRUB_CFG" ]; then sed -i "s/ LABEL=[^ ]*/ /" $GRUB_CFG sed -i "s@ root=[^ ]*@ @" $GRUB_CFG - sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait quiet @" $GRUB_CFG + sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GRUB_CFG fi # Look for a gummiboot installation @@ -419,7 +419,7 @@ if [ -d "$GUMMI_ENTRIES" ]; then sed -i "/initrd /d" $GUMMI_CFG sed -i "s@ root=[^ ]*@ @" $GUMMI_CFG - sed -i "s@options *LABEL=boot @options LABEL=Boot root=$TARGET_ROOTFS ro rootwait quiet @" $GUMMI_CFG + sed -i "s@options *LABEL=boot @options LABEL=Boot root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GUMMI_CFG fi # Ensure we have at least one EFI bootloader configured @@ -438,6 +438,9 @@ if [ -d $ROOTFS_MNT/etc/udev/ ] ; then echo "$TARGET_DEVICE" >> $ROOTFS_MNT/etc/udev/mount.blacklist fi +# Add startup.nsh script for automated boot +echo "fs0:\EFI\BOOT\bootx64.efi" > $BOOTFS_MNT/startup.nsh + # Call cleanup to unmount devices and images and remove the TMPDIR cleanup diff --git a/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py b/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py index 936522efc..d93c943c6 100755 --- a/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py +++ b/yocto-poky/scripts/contrib/python/generate-manifest-2.7.py @@ -164,7 +164,7 @@ if __name__ == "__main__": # m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re", - "__future__.* _abcoll.* abc.* copy.* copy_reg.* ConfigParser.* " + + "__future__.* _abcoll.* abc.* ast.* copy.* copy_reg.* ConfigParser.* " + "genericpath.* getopt.* linecache.* new.* " + "os.* posixpath.* struct.* " + "warnings.* site.* stat.* " + @@ -244,16 +244,12 @@ if __name__ == "__main__": m.addPackage( "${PN}-distutils-staticdev", "Python distribution utilities (static libraries)", "${PN}-distutils", "config/lib*.a" ) # package - m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core", + m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core ${PN}-email", "config distutils" ) # package m.addPackage( "${PN}-doctest", "Python framework for running examples in docstrings", "${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib", "doctest.*" ) - # FIXME consider adding to some higher level package - m.addPackage( "${PN}-elementtree", "Python elementree", "${PN}-core", - "lib-dynload/_elementtree.so" ) - m.addPackage( "${PN}-email", "Python email support", "${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient", "imaplib.* email" ) # package @@ -322,6 +318,9 @@ if __name__ == "__main__": m.addPackage( "${PN}-pkgutil", "Python package extension utility support", "${PN}-core", "pkgutil.*") + m.addPackage( "${PN}-plistlib", "Generate and parse Mac OS X .plist files", "${PN}-core ${PN}-datetime ${PN}-io", + "plistlib.*") + m.addPackage( "${PN}-pprint", "Python pretty-print support", "${PN}-core ${PN}-io", "pprint.*" ) @@ -376,8 +375,8 @@ if __name__ == "__main__": m.addPackage( "${PN}-unixadmin", "Python Unix administration support", "${PN}-core", "lib-dynload/nis.so lib-dynload/grp.so lib-dynload/pwd.so getpass.*" ) - m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-elementtree ${PN}-re", - "lib-dynload/pyexpat.so xml xmllib.*" ) # package + m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-re", + "lib-dynload/_elementtree.so lib-dynload/pyexpat.so xml xmllib.*" ) # package m.addPackage( "${PN}-xmlrpc", "Python XML-RPC support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang", "xmlrpclib.* SimpleXMLRPCServer.* DocXMLRPCServer.*" ) diff --git a/yocto-poky/scripts/contrib/python/generate-manifest-3.4.py b/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py index ca2fa6117..367b4b8b4 100755 --- a/yocto-poky/scripts/contrib/python/generate-manifest-3.4.py +++ b/yocto-poky/scripts/contrib/python/generate-manifest-3.5.py @@ -17,7 +17,7 @@ import os import sys import time -VERSION = "3.4.2" +VERSION = "3.5.0" __author__ = "Michael 'Mickey' Lauer <mlauer@vanille-media.de>" __version__ = "20140131" @@ -167,7 +167,7 @@ if __name__ == "__main__": # m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math", - "__future__.* _abcoll.* abc.* copy.* copyreg.* ConfigParser.* " + + "__future__.* _abcoll.* abc.* ast.* copy.* copyreg.* ConfigParser.* " + "genericpath.* getopt.* linecache.* new.* " + "os.* posixpath.* struct.* " + "warnings.* site.* stat.* " + @@ -247,16 +247,12 @@ if __name__ == "__main__": m.addPackage( "${PN}-distutils-staticdev", "Python distribution utilities (static libraries)", "${PN}-distutils", "config/lib*.a" ) # package - m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core", + m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core ${PN}-email", "config distutils" ) # package m.addPackage( "${PN}-doctest", "Python framework for running examples in docstrings", "${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib", "doctest.*" ) - # FIXME consider adding to some higher level package - m.addPackage( "${PN}-elementtree", "Python elementree", "${PN}-core", - "lib-dynload/_elementtree.*.so" ) - m.addPackage( "${PN}-email", "Python email support", "${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient", "imaplib.* email" ) # package @@ -376,8 +372,8 @@ if __name__ == "__main__": m.addPackage( "${PN}-unixadmin", "Python Unix administration support", "${PN}-core", "lib-dynload/nis.*.so lib-dynload/grp.*.so lib-dynload/pwd.*.so getpass.*" ) - m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-elementtree ${PN}-re", - "lib-dynload/pyexpat.*.so xml xmllib.*" ) # package + m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-re", + "lib-dynload/_elementtree.*.so lib-dynload/pyexpat.*.so xml xmllib.*" ) # package m.addPackage( "${PN}-xmlrpc", "Python XML-RPC support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang", "xmlrpclib.* SimpleXMLRPCServer.* DocXMLRPCServer.* xmlrpc" ) diff --git a/yocto-poky/scripts/contrib/verify-homepage.py b/yocto-poky/scripts/contrib/verify-homepage.py index 86cc82bca..265ff65d3 100755 --- a/yocto-poky/scripts/contrib/verify-homepage.py +++ b/yocto-poky/scripts/contrib/verify-homepage.py @@ -1,6 +1,7 @@ #!/usr/bin/env python -# This script is used for verify HOMEPAGE. +# This script can be used to verify HOMEPAGE values for all recipes in +# the current configuration. # The result is influenced by network environment, since the timeout of connect url is 5 seconds as default. import sys @@ -8,32 +9,25 @@ import os import subprocess import urllib2 -def search_bitbakepath(): - bitbakepath = "" - # Search path to bitbake lib dir in order to load bb modules - if os.path.exists(os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib/bb')): - bitbakepath = os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib') - bitbakepath = os.path.abspath(bitbakepath) - else: - # Look for bitbake/bin dir in PATH - for pth in os.environ['PATH'].split(':'): - if os.path.exists(os.path.join(pth, '../lib/bb')): - bitbakepath = os.path.abspath(os.path.join(pth, '../lib')) - break - if not bitbakepath: - sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n") - sys.exit(1) - return bitbakepath - -# For importing the following modules -sys.path.insert(0, search_bitbakepath()) +# Allow importing scripts/lib modules +scripts_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/..') +lib_path = scripts_path + '/lib' +sys.path = sys.path + [lib_path] +import scriptpath +import scriptutils + +# Allow importing bitbake modules +bitbakepath = scriptpath.add_bitbake_lib_path() + import bb.tinfoil +logger = scriptutils.logger_create('verify_homepage') + def wgetHomepage(pn, homepage): result = subprocess.call('wget ' + '-q -T 5 -t 1 --spider ' + homepage, shell = True) if result: - bb.warn("Failed to verify HOMEPAGE (%s) of %s" % (homepage, pn)) + logger.warn("%s: failed to verify HOMEPAGE: %s " % (pn, homepage)) return 1 else: return 0 @@ -42,22 +36,27 @@ def verifyHomepage(bbhandler): pkg_pn = bbhandler.cooker.recipecache.pkg_pn pnlist = sorted(pkg_pn) count = 0 + checked = [] for pn in pnlist: - fn = pkg_pn[pn].pop() - data = bb.cache.Cache.loadDataFull(fn, bbhandler.cooker.collection.get_file_appends(fn), bbhandler.config_data) - homepage = data.getVar("HOMEPAGE") - if homepage: - try: - urllib2.urlopen(homepage, timeout=5) - except Exception: - count = count + wgetHomepage(pn, homepage) + for fn in pkg_pn[pn]: + # There's no point checking multiple BBCLASSEXTENDed variants of the same recipe + realfn, _ = bb.cache.Cache.virtualfn2realfn(fn) + if realfn in checked: + continue + data = bb.cache.Cache.loadDataFull(realfn, bbhandler.cooker.collection.get_file_appends(realfn), bbhandler.config_data) + homepage = data.getVar("HOMEPAGE", True) + if homepage: + try: + urllib2.urlopen(homepage, timeout=5) + except Exception: + count = count + wgetHomepage(os.path.basename(realfn), homepage) + checked.append(realfn) return count if __name__=='__main__': - failcount = 0 bbhandler = bb.tinfoil.Tinfoil() bbhandler.prepare() - print "Start to verify HOMEPAGE:" + logger.info("Start verifying HOMEPAGE:") failcount = verifyHomepage(bbhandler) - print "finish to verify HOMEPAGE." - print "Summary: %s failed" % failcount + logger.info("Finished verifying HOMEPAGE.") + logger.info("Summary: %s failed" % failcount) |