All of lore.kernel.org
 help / color / mirror / Atom feed
From: Piotr Hosowicz <piotr@hosowicz.com>
To: Randy Dunlap <rdunlap@xenotime.net>
Cc: linux-kbuild@vger.kernel.org
Subject: Re: Maybe my frequent kernel building could be of some help to the community? And how to build?
Date: Wed, 24 Mar 2010 02:12:31 +0100	[thread overview]
Message-ID: <4BA966FF.2080903@example.com> (raw)
In-Reply-To: <4BA76852.8000506@example.com>

Piotr Hosowicz wrote:

 > But it seems that it works, but I do not understand why. Needs rewrite,
 > better config template line parsing.

I made it with Python, the scripts follow:

--- main try-build.sh

#!/bin/bash

RCPT=phz@localhost

function tidy(){
   rm ../results/.config 2>/dev/null
   rm ../results/build.log 2>/dev/null
   rm ../BUILDING-NOW 2>/dev/null
}

cd ~/kernel/linux
if test -f ../BUILDING-NOW ; then
   exit 0
else
   touch ../BUILDING-NOW
   make mrproper
   cat ../config.all | ../randomize-conf.py > ./.config
   make prepare
   cp .config ../results/
   make -j 10 2>&1 > ../results/build.log
   if test $? -ne 0 ; then
     (cat ../results/.config && cat ../results/build.log) | mail -s 
'Build failed at kernel phase' $RCPT
     mv ../results/.config ../results/.config.kf.$(date +%y%m%d-%H%M%S)
     tidy
     exit 0
   fi
   make -j 10 modules 2>&1 >> ../results/build.log
   if test $? -ne 0 ; then
     (cat ../results/.config && cat ../results/build.log) | mail -s 
'Build failed at modules phase' $RCPT
     mv ../results/.config ../results/.config.mf.$(date +%y%m%d-%H%M%S)
     tidy
     exit 0
   fi
   echo OK | mail -s 'ok' $RCPT
   tidy
fi

--- the randomizer:

#!/usr/bin/python

import sys
import re
import random

netenabled = 0
token = ""

def yesno():
	if random.random()>0.5:
		return 1
	else:
		return 0


def enable_or_not(atoken):
	if yesno():
		if atoken=="CONFIG_NET":
			netenabled = 1
			print atoken+"=y"
		else:
			if atoken=="CONFIG_INET":
				if yesno():
					print atoken+"=y"
				else:
					print "# "+atoken+" is not set" ;
			else:
				print atoken+"=y"
	else:
		print "# "+atoken+" is not set" ;

switch = {
	"CONFIG_SMP": enable_or_not("CONFIG_SMP"),
	"CONFIG_SYSFS": enable_or_not("CONFIG_SYSFS"),
	"CONFIG_PROC_FS": enable_or_not("CONFIG_PROC_FS"),
	"CONFIG_PM": enable_or_not("CONFIG_PM"),
	"CONFIG_PCI": enable_or_not("CONFIG_PCI"),
	"CONFIG_BLOCK": enable_or_not("CONFIG_BLOCK"),
	"CONFIG_NET": enable_or_not("CONFIG_NET"),
	"CONFIG_INET": enable_or_not("CONFIG_INET"),
	"CONFIG_HOTPLUG": enable_or_not("CONFIG_HOTPLUG")
	}

for line in sys.stdin:
	mo = re.match("(\w+)=(.*)", line)
	if mo:
		token = mo.group(1)
	else:
		mo = re.match("# (\w+) is not set", line)
		if mo:
			token = mo.group(1)
	if token!="CONFIG_MODULES":
		switch.get(token, enable_or_not(token))
	else:
		sys.stdout.write("CONFIG_MODULES=y\n")


-- 
Janusz Korwin-Mikke:
"Idiota z dyplomem to taki sam idiota,
jak przedtem - tylko z pretensjami."
NP: Mark Knopfler - Cleaning My Gun
NB: 2.6.34-rc2-nx-20100323-next-20100323+



-- 
Wzór Einsteina-Pitagorasa: E = mc2 = m(a2 + b2)
NP: Mark Knopfler - The Car Was The One
NB: 2.6.34-rc2-nx-20100323-next-20100323+

  reply	other threads:[~2010-03-24  1:19 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 19:02 Maybe my frequent kernel building could be of some help to the community? And how to build? Piotr Hosowicz
2010-03-16 19:24 ` Randy Dunlap
2010-03-16 19:33   ` Piotr Hosowicz
2010-03-16 19:42     ` Randy Dunlap
2010-03-17  3:24   ` Piotr Hosowicz
2010-03-17 15:07     ` Randy Dunlap
     [not found]       ` <4BA0F8DE.1050006@example.com>
2010-03-17 15:54         ` Randy Dunlap
2010-03-17 16:03           ` Piotr Hosowicz
2010-03-17 17:49           ` Piotr Hosowicz
2010-03-17 17:53             ` Randy Dunlap
2010-03-18 15:40   ` Randy Dunlap
2010-03-22  3:31     ` Piotr Hosowicz
2010-03-22  3:48       ` Randy Dunlap
2010-03-22 12:42         ` Piotr Hosowicz
2010-03-22 12:53           ` Piotr Hosowicz
2010-03-24  1:12             ` Piotr Hosowicz [this message]
2010-03-24 21:43               ` Randy Dunlap
2010-03-25 11:38                 ` Piotr Hosowicz
2010-03-25 17:29     ` Randy Dunlap
2010-03-25 17:37       ` Piotr Hosowicz
2010-03-25 17:40         ` Randy Dunlap
2010-03-25 17:48           ` Piotr Hosowicz
2010-03-25 17:54             ` Randy Dunlap
2010-03-25 18:35               ` Piotr Hosowicz
2010-03-25 22:04                 ` Randy Dunlap
2010-03-25 22:15                   ` Piotr Hosowicz
2010-03-26 16:46                     ` Piotr Hosowicz
2010-03-27 16:37                       ` Piotr Hosowicz
2010-03-27 16:39                         ` Piotr Hosowicz
2010-04-01 16:02       ` Randy Dunlap
2010-04-01 17:24         ` Piotr Hosowicz
2010-04-01 17:44           ` Piotr Hosowicz
2010-03-29 20:16   ` Is root kernel parameter expected to be the first one or something? Piotr Hosowicz
2010-03-29 20:38     ` Randy Dunlap
2010-03-29 20:41       ` Piotr Hosowicz
2010-03-29 21:33         ` Randy Dunlap
2010-03-29 22:32           ` Piotr Hosowicz
2010-03-29 22:39             ` Randy Dunlap
2010-03-29 22:44               ` Piotr Hosowicz
2010-03-29 22:48                 ` Randy Dunlap
2010-03-29 22:55                   ` Piotr Hosowicz
2010-03-29 23:06                     ` Randy Dunlap
2010-03-29 23:44                       ` Piotr Hosowicz
2010-03-30 16:37                   ` Piotr Hosowicz
2010-03-30 18:03                     ` Piotr Hosowicz
2010-03-30 19:00                       ` Piotr Hosowicz
2010-03-31  9:15                         ` Piotr Hosowicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BA966FF.2080903@example.com \
    --to=piotr@hosowicz.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.