####### CHANGESOURCES
home_dir = os.path.abspath(ini.get("general", "homedir"))
+tree_expire = 0
+
+if ini.has_option("general", "expire"):
+ tree_expire = ini.getint("general", "expire")
repo_url = ini.get("repo", "url")
# find targets
targets = [ ]
+if not os.path.isdir(home_dir+'/source.git'):
+ subprocess.call(["git", "clone", "--depth=1", repo_url, home_dir+'/source.git'])
+
findtargets = subprocess.Popen([home_dir+'/dumpinfo.pl', 'targets'],
stdout = subprocess.PIPE, cwd = home_dir+'/source.git')
from buildbot.process.properties import WithProperties
-MakeTargetMap = {
- "^tools/": "tools/clean",
- "^toolchain/": "toolchain/clean",
- "^target/linux/": "target/linux/clean",
- "^(config|include)/": "dirclean"
-}
+CleanTargetMap = [
+ [ "tools", "tools/clean" ],
+ [ "chain", "toolchain/clean" ],
+ [ "linux", "target/linux/clean" ],
+ [ "dir", "dirclean" ],
+ [ "dist", "distclean" ]
+]
-def IsAffected(pattern):
- def CheckAffected(change):
- for request in change.build.requests:
- for source in request.sources:
- for change in source.changes:
- for file in change.files:
- if re.match(pattern, file):
- return True
- return False
- return CheckAffected
-
-def isPathBuiltin(path):
- incl = {}
- pkgs = {}
- conf = open(".config", "r")
-
- while True:
- line = conf.readline()
- if line == '':
- break
- m = re.match("^(CONFIG_PACKAGE_.+?)=y", line)
- if m:
- incl[m.group(1)] = True
-
- conf.close()
-
- deps = open("tmp/.packagedeps", "r")
-
- while True:
- line = deps.readline()
- if line == '':
- break
- m = re.match("^package-\$\((CONFIG_PACKAGE_.+?)\) \+= (\S+)", line)
- if m and incl.get(m.group(1)) == True:
- pkgs["package/%s" % m.group(2)] = True
-
- deps.close()
-
- while path != '':
- if pkgs.get(path) == True:
+def IsCleanRequested(pattern):
+ def CheckCleanProperty(step):
+ val = step.getProperty("clean")
+ if val and re.match(pattern, val):
return True
- path = os.path.dirname(path)
+ else:
+ return False
- return False
-
-def isChangeBuiltin(change):
- return True
-# for request in change.build.requests:
-# for source in request.sources:
-# for change in source.changes:
-# for file in change.files:
-# if isPathBuiltin(file):
-# return True
-# return False
+ return CheckCleanProperty
c['builders'] = []
description = "Finding number of CPUs",
command = ["nproc"]))
+ # expire tree if needed
+ if tree_expire > 0:
+ factory.addStep(FileDownload(
+ mastersrc = "expire.sh",
+ slavedest = "../expire.sh",
+ mode = 0755))
+
+ factory.addStep(ShellCommand(
+ name = "expire",
+ description = "Checking for build tree expiry",
+ command = ["./expire.sh", str(tree_expire)],
+ workdir = ".",
+ haltOnFailure = True,
+ timeout = 2400))
+
+ # user-requested clean targets
+ for tuple in CleanTargetMap:
+ factory.addStep(ShellCommand(
+ name = tuple[1],
+ description = 'User-requested "make %s"' % tuple[1],
+ command = ["make", tuple[1], "V=s"],
+ doStepIf = IsCleanRequested(tuple[0])
+ ))
+
# check out the source
factory.addStep(Git(repourl=repo_url, mode='update'))
# description = "Copy the feeds.conf",
# command='''cp ~/feeds.conf ./feeds.conf''' ))
+ # feed
+ factory.addStep(ShellCommand(
+ name = "rmfeedlinks",
+ description = "Remove feed symlinks",
+ command=["rm", "-rf", "package/feeds/"]))
+
# feed
factory.addStep(ShellCommand(
name = "updatefeeds",
# CONFIG_PER_FEED_REPO_ADD_COMMENTED is not set
CONFIG_KERNEL_KALLSYMS=y
CONFIG_COLLECT_KERNEL_DEBUG=y
+CONFIG_TARGET_ALL_PROFILES=y
+CONFIG_TARGET_MULTI_PROFILE=y
+CONFIG_TARGET_PER_DEVICE_ROOTFS=y
EOT''' %(ts[0], ts[0], ts[1]) ))
factory.addStep(ShellCommand(
want_stdout = False
))
+ # prepare tar
+ factory.addStep(ShellCommand(
+ name = "dltar",
+ description = "Building GNU tar",
+ command = ["make", WithProperties("-j%(nproc:~4)s"), "tools/tar/install", "V=s"],
+ haltOnFailure = True
+ ))
+
# populate dl
factory.addStep(ShellCommand(
name = "dlrun",
command=["make", "package/base-files/clean", "V=s"]
))
- # optional clean steps
- for pattern, maketarget in MakeTargetMap.items():
- factory.addStep(ShellCommand(
- name = maketarget,
- description = maketarget,
- command=["make", maketarget, "V=s"], doStepIf=IsAffected(pattern)
- ))
-
# build
factory.addStep(ShellCommand(
name = "tools",
name = "pkginstall",
description = "Installing packages",
command=["make", WithProperties("-j%(nproc:~4)s"), "package/install", "V=s"],
- doStepIf = isChangeBuiltin,
haltOnFailure = True
))
factory.addStep(ShellCommand(
name = "images",
description = "Building images",
- command=["make", "-j1", "target/install", "V=s"],
- doStepIf = isChangeBuiltin,
+ command=["make", WithProperties("-j%(nproc:~4)s"), "target/install", "V=s"],
+ haltOnFailure = True
+ ))
+
+ factory.addStep(ShellCommand(
+ name = "checksums",
+ description = "Calculating checksums",
+ command=["make", "-j1", "checksum", "V=s"],
haltOnFailure = True
))
factory.addStep(ShellCommand(
name = "signpack",
description = "Packing files to sign",
- command = ["sh", "-c", WithProperties("find bin/targets/%s/%s%%(libc)s/ -mindepth 1 -maxdepth 2 -type f -name sha256sums -or -name Packages -print0 | xargs -0 tar -czf sign.tar.gz" %(ts[0], ts[1]))],
+ command = WithProperties("find bin/targets/%s/%s%%(libc)s/ -mindepth 1 -maxdepth 2 -type f -name sha256sums -print0 -or -name Packages -print0 | xargs -0 tar -czf sign.tar.gz" %(ts[0], ts[1])),
haltOnFailure = True
))
factory.addStep(ShellCommand(
name = "targetupload",
description = "Uploading target files",
- command=["rsync", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", WithProperties("bin/targets/%s/%s%%(libc)s/" %(ts[0], ts[1])), "%s/targets/%s/%s/" %(rsync_bin_url, ts[0], ts[1])],
+ command=["rsync", "--delete", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", WithProperties("bin/targets/%s/%s%%(libc)s/" %(ts[0], ts[1])), "%s/targets/%s/%s/" %(rsync_bin_url, ts[0], ts[1])],
env={'RSYNC_PASSWORD': rsync_bin_key},
haltOnFailure = True,
logEnviron = False
factory.addStep(ShellCommand(
name = "sourceupload",
description = "Uploading source archives",
- command=["rsync", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "dl/", "%s/" %(rsync_src_url)],
+ command=["rsync", "--checksum", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-avz", "dl/", "%s/" %(rsync_src_url)],
env={'RSYNC_PASSWORD': rsync_src_key},
haltOnFailure = True,
logEnviron = False