Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Aug 2010 14:10:48 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Nathan Whitehorn <nwhitehorn@freebsd.org>
Cc:        powerpc@freebsd.org, FreeBSD Tinderbox <tinderbox@freebsd.org>, current@freebsd.org
Subject:   Re: [head tinderbox] failure on powerpc64/powerpc
Message-ID:  <86bp8ukfuf.fsf@ds4.des.no>
In-Reply-To: <4C704CD2.9040604@freebsd.org> (Nathan Whitehorn's message of "Sat, 21 Aug 2010 17:01:54 -0500")
References:  <201008190304.o7J34Wa4089466@freebsd-current.sentex.ca> <86occzdmhg.fsf@ds4.des.no> <4C6D557E.6080406@freebsd.org> <86sk29ws6u.fsf@ds4.des.no> <4C6E825C.5060509@freebsd.org> <86fwy9f5vj.fsf@ds4.des.no> <4C6F0813.9030007@freebsd.org> <86aaofpr7j.fsf@ds4.des.no> <4C704CD2.9040604@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Nathan Whitehorn <nwhitehorn@freebsd.org> writes:
> Dag-Erling Sm=C3=B8rgrav <des@des.no> writes:
> > I'm not sure I understand what you mean (or rather, how it would
> > help the tinderbox).  What *would* help would be an easy way to
> > determine, *before* trying to build it, whether a specific kernel
> > config is appropriate for a specific target.  Can you think of an
> > easier way to do this than to scan the config for the "machine"
> > line?
> That's exactly what I proposed. You use config, before trying the
> build, to look up the machine specification for the config file. I
> sent you a 5 line patch to tinderbox.pl that does this by private
> email.

Here's a solution that works regadless of config(8) version, though I'm
not sure it qualifies as either easy or clean:

Index: tinderbox.pl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/projcvs/projects/tinderbox/tinderbox.pl,v
retrieving revision 1.68
diff -u -r1.68 tinderbox.pl
--- tinderbox.pl	25 Aug 2009 17:28:14 -0000	1.68
+++ tinderbox.pl	22 Aug 2010 12:08:46 -0000
@@ -722,10 +722,29 @@
     }
=20
     # Build additional kernels
+  kernel:
     foreach my $kernel (sort(keys(%kernels))) {
 	if (! -f "$srcdir/sys/$machine/conf/$kernel") {
 	    warning("no kernel config for $kernel");
-	    next;
+	    next kernel;
+	}
+	# Hack: check that the config is appropriate for this target.
+	# If no "machine" declaration is present, assume that it is.
+	local *KERNCONF;
+	if (open(KERNCONF, "<", "$srcdir/sys/$machine/conf/$kernel")) {
+	    while (<KERNCONF>) {
+		next unless m/^machine\s+(\w+(?:\s+\w+)?)\s*(?:\#.*)?$/;
+		if ($1 !~ m/^\Q$machine\E(\s+\Q$arch\E)?$/) {
+		    warning("skipping $kernel");
+		    close(KERNCONF);
+		    next kernel;
+		}
+		last;
+	    }
+	    close(KERNCONF);
+	} else {
+	    warning("$kernel: $!");
+	    next kernel;
 	}
 	logstage("building $kernel kernel");
 	logenv();

It will break if the "machine" declaration ever moves into an included
file, since it does not follow include statements, but it will do for
now.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86bp8ukfuf.fsf>