r4960 - developers/werner/bin

werner at docs.openmoko.org werner at docs.openmoko.org
Thu Mar 26 04:31:37 CET 2009


Author: werner
Date: 2009-03-26 04:31:37 +0100 (Thu, 26 Mar 2009)
New Revision: 4960

Added:
   developers/werner/bin/apply-kernel
   developers/werner/bin/noise.pl
   developers/werner/bin/test-build-kernel
Log:
Tools for processing kernel patch submissions:

- apply-kernel takes a patch from a mail, tentatively applies it, and tests it
- test-build-kernel test builds the kernel for a number of configurations
- noise.pl filters build output so that only new stuff (e.g., warnings) shows
  up



Added: developers/werner/bin/apply-kernel
===================================================================
--- developers/werner/bin/apply-kernel	                        (rev 0)
+++ developers/werner/bin/apply-kernel	2009-03-26 03:31:37 UTC (rev 4960)
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+#
+# apply-kernel - apply a patch and check if the kernel still builds
+#
+# test-build-kernel shows all the new build output the change introduced. For
+# this to work properly, "prime" the build system by running test-build-kernel
+# directly from the kernel top-level directory.
+#
+# If there's a problem, apply-kernel reverts the commit but leaves the changes
+# in the working tree, so that they can be edited and then manually committed
+# later.
+#
+
+# allow environment overrides
+
+KERNEL_DIR=${KERNEL_DIR:-/home/moko/git/kernel}
+
+cd $KERNEL_DIR
+git-am
+if ! test-build-kernel; then
+    # revert the commit but leave the changes in the working tree
+    git-reset --mixed HEAD^
+    exit 1
+fi


Property changes on: developers/werner/bin/apply-kernel
___________________________________________________________________
Name: svn:executable
   + *

Added: developers/werner/bin/noise.pl
===================================================================
--- developers/werner/bin/noise.pl	                        (rev 0)
+++ developers/werner/bin/noise.pl	2009-03-26 03:31:37 UTC (rev 4960)
@@ -0,0 +1,59 @@
+#!/usr/bin/perl
+#
+# noise.pl - filter the noise a program makes
+#
+# The output of the program is filtered line by line against the content of the
+# noise file. Each line that appears in the noise file is displayed only
+# briefly.
+#
+# All new lines are preserved and also recorded (along with the old noise) in
+# the new noise file. The new noise file has the name of the old file, with
+# .new appended. The new noise file is only written if the program ran
+# successfully.
+#
+# Known bug: long lines will leave a residue even if they're "ignored".
+#
+
+
+$DEL = "\e[K";	# VT100 delete to EOL
+
+
+sub usage
+{
+    print STDERR "usage: $0 noise-file command\n";
+    exit(1);
+}
+
+
+&usage if @ARGV != 2;
+$old = $ARGV[0];
+$new = "$old.new";
+$cmd = $ARGV[1];
+
+open(F, $old) || die "$old: $!";
+while (<F>) {
+    $o .= $_;
+    chop;
+    $o{$_} = 1;
+}
+close F;
+
+$| = 1;
+
+open(P, "$cmd 2>&1 |") || die "$cmd: $!";
+while (<P>) {
+    chop;
+    print "$_$DEL\r";
+    next if defined $o{$_};
+    print "\n";
+    $n .= "$_\n";
+}
+close P || die "$cmd: $!";
+
+print "$DEL\r";
+
+exit 0 unless defined $n;
+
+open(F, ">$new") || die "$new: $!";
+print F $o."-----\n".$n || die "$new: $!";
+close F;


Property changes on: developers/werner/bin/noise.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: developers/werner/bin/test-build-kernel
===================================================================
--- developers/werner/bin/test-build-kernel	                        (rev 0)
+++ developers/werner/bin/test-build-kernel	2009-03-26 03:31:37 UTC (rev 4960)
@@ -0,0 +1,30 @@
+#!/bin/sh -e
+#
+# Test-build a kernel against a set of configs
+#
+
+# 
+# Use of different object trees blatantly stolen from Andy's "build" script.
+#
+
+# allow environment overrides
+
+MAKES=${MAKES:-5}
+
+CONFIGS="gta02_packaging_defconfig \
+  gta01_moredrivers_defconfig \
+  om_3d7k_defconfig \
+  gta02_moredrivers_defconfig"
+
+for n in $CONFIGS; do
+    echo ===== $n =====
+    mkdir -p $n.d
+    cp arch/arm/configs/$n $n.d/.config
+    touch $n.d/.noise
+    if ! noise.pl $n.d/.noise "makek -j$MAKES O=$n.d zImage modules"; then
+	echo Failed at $n 1>&2
+	exit 1
+    fi
+    [ ! -f $n.d/.noise.new ] || mv $n.d/.noise.new $n.d/.noise
+done
+echo ===== Done =====


Property changes on: developers/werner/bin/test-build-kernel
___________________________________________________________________
Name: svn:executable
   + *




More information about the commitlog mailing list