From 25efcd45c83a81d78f73b5da852e575b108b3fb5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 20 Apr 2011 16:49:37 +0100 Subject: Remove obsolete scripts/classes Signed-off-by: Richard Purdie --- meta/classes/poky-autobuild-notifier.bbclass | 62 ------------ scripts/poky-nokia800-flashutil | 64 ------------- scripts/pstage-scanner | 136 --------------------------- 3 files changed, 262 deletions(-) delete mode 100644 meta/classes/poky-autobuild-notifier.bbclass delete mode 100755 scripts/poky-nokia800-flashutil delete mode 100755 scripts/pstage-scanner diff --git a/meta/classes/poky-autobuild-notifier.bbclass b/meta/classes/poky-autobuild-notifier.bbclass deleted file mode 100644 index 9ab3d064ed..0000000000 --- a/meta/classes/poky-autobuild-notifier.bbclass +++ /dev/null @@ -1,62 +0,0 @@ -# -# Copyright Openedhand Ltd 2008 -# Author: Richard Purdie -# - -# Designed for use with the Poky autobuilder only and provides custom hooks for -# certain specific events. - -def do_autobuilder_failure_report(event): - from bb.event import getName - from bb import data, mkdirhier, build - import os, glob - - if data.getVar('PN', event.data, True) != "clutter": - return - - import smtplib - import email.Message - - version = data.expand("${PN}: ${PV}-${PR}", event.data) - - recipients = ["richard@o-hand.com"] - COMMASPACE = ', ' - - message = email.Message.Message() - message["To"] = COMMASPACE.join(recipients) - message["From"] = "Poky Autobuilder Failure " - message["Subject"] = "Poky Autobuild Failure Report - " + version - - mesg = "Poky Build Failure for:\n\n" - - for var in ["DISTRO", "MACHINE", "PN", "PV", "PR"]: - mesg += var + ": " + data.getVar(var, event.data, True) + "\n" - - mesg += "\nLog of the failure follows:\n\n" - - log_file = glob.glob("%s/log.%s.*" % (data.getVar('T', event.data, True), event.task)) - if len(log_file) != 0: - mesg += "".join(open(log_file[0], 'r').readlines()) - - message.set_payload(mesg) - - mailServer = smtplib.SMTP("pug.o-hand.com") - mailServer.sendmail(message["From"], recipients, message.as_string()) - mailServer.quit() - -# we want to be an event handler -addhandler poky_autobuilder_notifier_eventhandler -python poky_autobuilder_notifier_eventhandler() { - from bb import note, error, data - from bb.event import getName - - if e.data is None: - return - - name = getName(e) - - if name == "TaskFailed": - do_autobuilder_failure_report(e) - - return -} diff --git a/scripts/poky-nokia800-flashutil b/scripts/poky-nokia800-flashutil deleted file mode 100755 index f1ffa5ae6f..0000000000 --- a/scripts/poky-nokia800-flashutil +++ /dev/null @@ -1,64 +0,0 @@ -#! /bin/sh -# Copyright (C) 2008 OpenedHand Ltd. -# Contact: andrew@openedhand.com -# -# Erase the partition given in $3 (default: rootfs) and flash the contents -# of image given in $1 into the image $2. - -if [ ! -r "$1" ]; then - echo "Usage: $0 []" - exit -1 -fi - -uboot_offset=0 -config_offset=64 -kernel_offset=256 -initfs_offset=1280 -rootfs_offset=2304 # chinook - -# This value should be selected for Diablo based firmwares -# It also require patching qemu to get proper size of flash partitions -# (by default qemu has Chinook split). -#rootfs_offset=3328 # diablo - -if [ ! -e "$2" ]; then - echo "foo" - # Making an empty/erased flash image. Need a correct echo behavior. - dd if=/dev/zero of=$2 bs=268435456 count=0 seek=1 - bash -c 'echo -en \\0377\\0377\\0377\\0377\\0377\\0377\\0377\\0377 > .8b' - cat .8b .8b > .16b # OOB is 16 bytes - cat .16b .16b .16b .16b .16b .16b .16b .16b > .8sec - cat .8sec .8sec .8sec .8sec .8sec .8sec .8sec .8sec > .64sec - cat .64sec .64sec .64sec .64sec .64sec .64sec .64sec .64sec > .512sec - cat .512sec .512sec .512sec .512sec > .2ksec - cat .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec > .16k - cat .16k .16k .16k .16k .16k .16k .16k .16k > .128k - # N800 NAND is 512k sectors big - cat .128k .128k .128k .128k >> $2 - rm -rf .8b .16b .8sec .64sec .512sec .2ksec .16k .128k -fi - -if [ "$3" != "" ]; then - case "$3" in - config) - partition=/dev/mtd1 - page=$config_offset - ;; - initfs) - partition=/dev/mtd3 - page=$initfs_offset - ;; - rootfs) - partition=/dev/mtd4 - page=$rootfs_offset - ;; - *) - echo "Unknown partition $2" - exit -1 - esac -else - partition=/dev/mtd4 - page=$rootfs_offset -fi - -dd if=$1 of=$2 conv=notrunc bs=2048 seek=$page diff --git a/scripts/pstage-scanner b/scripts/pstage-scanner deleted file mode 100755 index 4a27aa5d26..0000000000 --- a/scripts/pstage-scanner +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python - -## -## This script will scan all of the packages in PSTAGE_DIR (or argv[1]) -## in search of packages which install files outside of their native sysroot -## - -import os, sys, tarfile, shutil -import subprocess as sub - -logf = "" -pcount = 0 -ecount = 0 - -def main(): - """Generate a list of pstage packages and scan them for badness""" - package_list = [] - - try: - path = sysv.arg[1] - except: - # Assume pstage is a child of tmp, Poky's default - tmpdir = None - sub.Popen(["bitbake", "-e"], stdout=sub.PIPE,stderr=sub.PIPE) - err, out = p.communicate() - if (!out): - print("bitbake not in your environment, try pstage-scanner /some/path/to/pstage") - exit - for line in out: - if line.find("PSTAGE_DIR=") != -1: - tmpdir = line.partition("=")[2].strip("\"") - break - - if len(path) < 1 or not os.path.exists(path): - print ("No path defined and bitbake not in your environment, try pstage-scanner /some/path/to/pstage") - exit - - global logf - try: - logf = sys.argv[2] - except: - logf = os.path.join(path, "pstage-scanner.log") - - ## Create a working directory - tempdir = os.path.join(path, "tmp") - os.mkdir(tempdir) - - ## Iterate each child of the target directory looking for .ipk files and - ## building a list of files to process - for root, dirs, files in os.walk(path): - for d in dirs: - for f in os.listdir(os.path.join(root,d)): - if os.path.splitext(f)[1] == ".ipk" and f.find("native") == -1 and f.find("cross") == -1: - package_list.append(os.path.join(root,d,f)) - - ## Next we iterate our built list of files and process each package - for pkg in package_list: - tmp = os.path.join(tempdir, os.path.splitext(os.path.split(pkg)[1])[0]) - os.mkdir(tmp) - scan_package(pkg, tmp) - - ## Tidy up working directory - shutil.rmtree(tempdir) - - ## Report a summary - log("Finished scanning packaged staging. Scanned %i packages with %i errors" % (pcount, ecount)) - -def scan_package(filepath, parentdir): - """Helper method to do bookkeeping, passes all installable directories to - scan_dir which does the actual scanning.""" - os.chdir(parentdir) - - ## increment the package count, for the summary - global pcount - pcount += 1 - - ## An ipk file is an ar archive containing two gzipped tarball directories - ## data.tar.gz is inflated to / and contains the actual files - ## control.tar.gz is metadata and scripts for the package - ## The archive also contains a file, debian binary, which is unused - ## Python can't handle ar archives ootb. So we cheat and inflate with - ## the ar program on the host - sub.call(["ar", "x", filepath]) - - ## The things we care about are in data.tar.gz - tgz = tarfile.open(os.path.join(parentdir, "data.tar.gz")) - dest = os.path.join(parentdir, "inflate") - os.mkdir(dest) - tgz.extractall(dest) - - ## We want to know the target arch so that we can ensure the package is - ## only installing into its target sysroot - arch = os.path.splitext(os.path.basename(filepath))[0].split("_")[-1] - if arch == "64": - arch = "x86_64" - - ## The ignored list contains directories we don't care to scan - ignored = ["pkgdata", "stamps", "deploy"] - - ## Scan the package for badness - pname = os.path.split(filepath)[1] - for di in os.listdir(dest): - if di not in ignored: - scan_dir(os.path.join(dest, di), arch, pname) - -def scan_dir (directory, arch, package_name): - """Scan the contents of directory for things installing outside of native - sysroot""" - - global ecount - msg = "" - - head, tail = os.path.split(directory) - if not tail == "sysroots": - msg += "Tsk tsk, installing to " + tail + "\n" - for d in os.listdir(directory): - msg += "Installing %s in %s" % (d, tail) + "\n" - ecount += 1 - else: - for d in os.listdir(directory): - if not d.startswith(arch) and d.find("fixmepath") == -1: - msg += "Tsk tsk, installing into non-native sysroot " + os.path.join(directory, d) - ecount += 1 - - if len(msg) > 0: - log("Scanning package " + package_name + "\n" + msg) - -def log (message): - global logf - logfile = open (logf, 'a+') - logfile.write(message + "\n") - print "LOG: " + message - logfile.close() - -if __name__ == "__main__": - main() -- cgit 1.2.3-korg