diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-04-20 16:49:37 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-04-21 00:29:29 +0100 |
commit | 8ceb769eab14066c9a5fc6a68284de9c1f5637fe (patch) | |
tree | 46deb2d4478038f43d7af0c1c3902755eac72de6 | |
parent | 08127d444e05d8d33ce39abdce677655bd4766ea (diff) | |
download | poky-8ceb769eab14066c9a5fc6a68284de9c1f5637fe.tar.gz |
Remove obsolete scripts/classes
(From OE-Core rev: 25efcd45c83a81d78f73b5da852e575b108b3fb5)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/poky-autobuild-notifier.bbclass | 62 | ||||
-rwxr-xr-x | scripts/poky-nokia800-flashutil | 64 | ||||
-rwxr-xr-x | scripts/pstage-scanner | 136 |
3 files changed, 0 insertions, 262 deletions
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 @@ | |||
1 | # | ||
2 | # Copyright Openedhand Ltd 2008 | ||
3 | # Author: Richard Purdie | ||
4 | # | ||
5 | |||
6 | # Designed for use with the Poky autobuilder only and provides custom hooks for | ||
7 | # certain specific events. | ||
8 | |||
9 | def do_autobuilder_failure_report(event): | ||
10 | from bb.event import getName | ||
11 | from bb import data, mkdirhier, build | ||
12 | import os, glob | ||
13 | |||
14 | if data.getVar('PN', event.data, True) != "clutter": | ||
15 | return | ||
16 | |||
17 | import smtplib | ||
18 | import email.Message | ||
19 | |||
20 | version = data.expand("${PN}: ${PV}-${PR}", event.data) | ||
21 | |||
22 | recipients = ["richard@o-hand.com"] | ||
23 | COMMASPACE = ', ' | ||
24 | |||
25 | message = email.Message.Message() | ||
26 | message["To"] = COMMASPACE.join(recipients) | ||
27 | message["From"] = "Poky Autobuilder Failure <poky@o-hand.com>" | ||
28 | message["Subject"] = "Poky Autobuild Failure Report - " + version | ||
29 | |||
30 | mesg = "Poky Build Failure for:\n\n" | ||
31 | |||
32 | for var in ["DISTRO", "MACHINE", "PN", "PV", "PR"]: | ||
33 | mesg += var + ": " + data.getVar(var, event.data, True) + "\n" | ||
34 | |||
35 | mesg += "\nLog of the failure follows:\n\n" | ||
36 | |||
37 | log_file = glob.glob("%s/log.%s.*" % (data.getVar('T', event.data, True), event.task)) | ||
38 | if len(log_file) != 0: | ||
39 | mesg += "".join(open(log_file[0], 'r').readlines()) | ||
40 | |||
41 | message.set_payload(mesg) | ||
42 | |||
43 | mailServer = smtplib.SMTP("pug.o-hand.com") | ||
44 | mailServer.sendmail(message["From"], recipients, message.as_string()) | ||
45 | mailServer.quit() | ||
46 | |||
47 | # we want to be an event handler | ||
48 | addhandler poky_autobuilder_notifier_eventhandler | ||
49 | python poky_autobuilder_notifier_eventhandler() { | ||
50 | from bb import note, error, data | ||
51 | from bb.event import getName | ||
52 | |||
53 | if e.data is None: | ||
54 | return | ||
55 | |||
56 | name = getName(e) | ||
57 | |||
58 | if name == "TaskFailed": | ||
59 | do_autobuilder_failure_report(e) | ||
60 | |||
61 | return | ||
62 | } | ||
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 @@ | |||
1 | #! /bin/sh | ||
2 | # Copyright (C) 2008 OpenedHand Ltd. | ||
3 | # Contact: andrew@openedhand.com | ||
4 | # | ||
5 | # Erase the partition given in $3 (default: rootfs) and flash the contents | ||
6 | # of image given in $1 into the image $2. | ||
7 | |||
8 | if [ ! -r "$1" ]; then | ||
9 | echo "Usage: $0 <image> <destimage> [<partition>]" | ||
10 | exit -1 | ||
11 | fi | ||
12 | |||
13 | uboot_offset=0 | ||
14 | config_offset=64 | ||
15 | kernel_offset=256 | ||
16 | initfs_offset=1280 | ||
17 | rootfs_offset=2304 # chinook | ||
18 | |||
19 | # This value should be selected for Diablo based firmwares | ||
20 | # It also require patching qemu to get proper size of flash partitions | ||
21 | # (by default qemu has Chinook split). | ||
22 | #rootfs_offset=3328 # diablo | ||
23 | |||
24 | if [ ! -e "$2" ]; then | ||
25 | echo "foo" | ||
26 | # Making an empty/erased flash image. Need a correct echo behavior. | ||
27 | dd if=/dev/zero of=$2 bs=268435456 count=0 seek=1 | ||
28 | bash -c 'echo -en \\0377\\0377\\0377\\0377\\0377\\0377\\0377\\0377 > .8b' | ||
29 | cat .8b .8b > .16b # OOB is 16 bytes | ||
30 | cat .16b .16b .16b .16b .16b .16b .16b .16b > .8sec | ||
31 | cat .8sec .8sec .8sec .8sec .8sec .8sec .8sec .8sec > .64sec | ||
32 | cat .64sec .64sec .64sec .64sec .64sec .64sec .64sec .64sec > .512sec | ||
33 | cat .512sec .512sec .512sec .512sec > .2ksec | ||
34 | cat .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec > .16k | ||
35 | cat .16k .16k .16k .16k .16k .16k .16k .16k > .128k | ||
36 | # N800 NAND is 512k sectors big | ||
37 | cat .128k .128k .128k .128k >> $2 | ||
38 | rm -rf .8b .16b .8sec .64sec .512sec .2ksec .16k .128k | ||
39 | fi | ||
40 | |||
41 | if [ "$3" != "" ]; then | ||
42 | case "$3" in | ||
43 | config) | ||
44 | partition=/dev/mtd1 | ||
45 | page=$config_offset | ||
46 | ;; | ||
47 | initfs) | ||
48 | partition=/dev/mtd3 | ||
49 | page=$initfs_offset | ||
50 | ;; | ||
51 | rootfs) | ||
52 | partition=/dev/mtd4 | ||
53 | page=$rootfs_offset | ||
54 | ;; | ||
55 | *) | ||
56 | echo "Unknown partition $2" | ||
57 | exit -1 | ||
58 | esac | ||
59 | else | ||
60 | partition=/dev/mtd4 | ||
61 | page=$rootfs_offset | ||
62 | fi | ||
63 | |||
64 | 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 @@ | |||
1 | #!/usr/bin/env python | ||
2 | |||
3 | ## | ||
4 | ## This script will scan all of the packages in PSTAGE_DIR (or argv[1]) | ||
5 | ## in search of packages which install files outside of their native sysroot | ||
6 | ## | ||
7 | |||
8 | import os, sys, tarfile, shutil | ||
9 | import subprocess as sub | ||
10 | |||
11 | logf = "" | ||
12 | pcount = 0 | ||
13 | ecount = 0 | ||
14 | |||
15 | def main(): | ||
16 | """Generate a list of pstage packages and scan them for badness""" | ||
17 | package_list = [] | ||
18 | |||
19 | try: | ||
20 | path = sysv.arg[1] | ||
21 | except: | ||
22 | # Assume pstage is a child of tmp, Poky's default | ||
23 | tmpdir = None | ||
24 | sub.Popen(["bitbake", "-e"], stdout=sub.PIPE,stderr=sub.PIPE) | ||
25 | err, out = p.communicate() | ||
26 | if (!out): | ||
27 | print("bitbake not in your environment, try pstage-scanner /some/path/to/pstage") | ||
28 | exit | ||
29 | for line in out: | ||
30 | if line.find("PSTAGE_DIR=") != -1: | ||
31 | tmpdir = line.partition("=")[2].strip("\"") | ||
32 | break | ||
33 | |||
34 | if len(path) < 1 or not os.path.exists(path): | ||
35 | print ("No path defined and bitbake not in your environment, try pstage-scanner /some/path/to/pstage") | ||
36 | exit | ||
37 | |||
38 | global logf | ||
39 | try: | ||
40 | logf = sys.argv[2] | ||
41 | except: | ||
42 | logf = os.path.join(path, "pstage-scanner.log") | ||
43 | |||
44 | ## Create a working directory | ||
45 | tempdir = os.path.join(path, "tmp") | ||
46 | os.mkdir(tempdir) | ||
47 | |||
48 | ## Iterate each child of the target directory looking for .ipk files and | ||
49 | ## building a list of files to process | ||
50 | for root, dirs, files in os.walk(path): | ||
51 | for d in dirs: | ||
52 | for f in os.listdir(os.path.join(root,d)): | ||
53 | if os.path.splitext(f)[1] == ".ipk" and f.find("native") == -1 and f.find("cross") == -1: | ||
54 | package_list.append(os.path.join(root,d,f)) | ||
55 | |||
56 | ## Next we iterate our built list of files and process each package | ||
57 | for pkg in package_list: | ||
58 | tmp = os.path.join(tempdir, os.path.splitext(os.path.split(pkg)[1])[0]) | ||
59 | os.mkdir(tmp) | ||
60 | scan_package(pkg, tmp) | ||
61 | |||
62 | ## Tidy up working directory | ||
63 | shutil.rmtree(tempdir) | ||
64 | |||
65 | ## Report a summary | ||
66 | log("Finished scanning packaged staging. Scanned %i packages with %i errors" % (pcount, ecount)) | ||
67 | |||
68 | def scan_package(filepath, parentdir): | ||
69 | """Helper method to do bookkeeping, passes all installable directories to | ||
70 | scan_dir which does the actual scanning.""" | ||
71 | os.chdir(parentdir) | ||
72 | |||
73 | ## increment the package count, for the summary | ||
74 | global pcount | ||
75 | pcount += 1 | ||
76 | |||
77 | ## An ipk file is an ar archive containing two gzipped tarball directories | ||
78 | ## data.tar.gz is inflated to / and contains the actual files | ||
79 | ## control.tar.gz is metadata and scripts for the package | ||
80 | ## The archive also contains a file, debian binary, which is unused | ||
81 | ## Python can't handle ar archives ootb. So we cheat and inflate with | ||
82 | ## the ar program on the host | ||
83 | sub.call(["ar", "x", filepath]) | ||
84 | |||
85 | ## The things we care about are in data.tar.gz | ||
86 | tgz = tarfile.open(os.path.join(parentdir, "data.tar.gz")) | ||
87 | dest = os.path.join(parentdir, "inflate") | ||
88 | os.mkdir(dest) | ||
89 | tgz.extractall(dest) | ||
90 | |||
91 | ## We want to know the target arch so that we can ensure the package is | ||
92 | ## only installing into its target sysroot | ||
93 | arch = os.path.splitext(os.path.basename(filepath))[0].split("_")[-1] | ||
94 | if arch == "64": | ||
95 | arch = "x86_64" | ||
96 | |||
97 | ## The ignored list contains directories we don't care to scan | ||
98 | ignored = ["pkgdata", "stamps", "deploy"] | ||
99 | |||
100 | ## Scan the package for badness | ||
101 | pname = os.path.split(filepath)[1] | ||
102 | for di in os.listdir(dest): | ||
103 | if di not in ignored: | ||
104 | scan_dir(os.path.join(dest, di), arch, pname) | ||
105 | |||
106 | def scan_dir (directory, arch, package_name): | ||
107 | """Scan the contents of directory for things installing outside of native | ||
108 | sysroot""" | ||
109 | |||
110 | global ecount | ||
111 | msg = "" | ||
112 | |||
113 | head, tail = os.path.split(directory) | ||
114 | if not tail == "sysroots": | ||
115 | msg += "Tsk tsk, installing to " + tail + "\n" | ||
116 | for d in os.listdir(directory): | ||
117 | msg += "Installing %s in %s" % (d, tail) + "\n" | ||
118 | ecount += 1 | ||
119 | else: | ||
120 | for d in os.listdir(directory): | ||
121 | if not d.startswith(arch) and d.find("fixmepath") == -1: | ||
122 | msg += "Tsk tsk, installing into non-native sysroot " + os.path.join(directory, d) | ||
123 | ecount += 1 | ||
124 | |||
125 | if len(msg) > 0: | ||
126 | log("Scanning package " + package_name + "\n" + msg) | ||
127 | |||
128 | def log (message): | ||
129 | global logf | ||
130 | logfile = open (logf, 'a+') | ||
131 | logfile.write(message + "\n") | ||
132 | print "LOG: " + message | ||
133 | logfile.close() | ||
134 | |||
135 | if __name__ == "__main__": | ||
136 | main() | ||