| if kinfo["type"] == "kernel24": |
if kinfo["type"] == "kernel24": |
| krn_build24(kinfo) |
krn_build24(kinfo) |
| elif kinfo["type"] == "kernel26": |
elif kinfo["type"] == "kernel26": |
| krn_build24(kinfo) #run kernel24 for now, change later |
krn_build26(kinfo) |
| |
|
| # Gerk comment: |
# Gerk comment: |
| # Do we need to change this with 24/26? we probably don't ... I'd rather see us define the list of make targets |
# Do we need to change this with 24/26? we probably don't ... I'd rather see us define the list of make targets |
| def krn_build26(kinfo): |
def krn_build26(kinfo): |
| """build a kernel, version 2.6""" |
"""build a kernel, version 2.6""" |
| |
|
| |
if krn_querymgr("checkout",kinfo): |
| |
try: |
| |
myversion=krn_localversion(kinfo) |
| |
|
| |
# fetch and cp the config file to work/.config |
| |
krn_config(kinfo) |
| |
|
| |
# **Note** : we set the preprocessing command to premake inline instead |
| |
# of globally as it is only needed in this target |
| |
if dont_build==0: |
| |
gkb_runmake("oldconfig",kinfo,premake+" /bin/cat %s/newlines | " % buildroot,makeopts) |
| |
|
| |
# give option to only repackage for testing purposes, comment out clean=1 at top of this file to use this feature |
| |
if (clean==1 and dont_build==0): |
| |
gkb_runmake("clean", kinfo, premake, makeopts) |
| |
|
| |
if dont_build==0: |
| |
gkb_runmake("", kinfo, premake, makeopts) |
| |
|
| |
# We should check to see if binary built ok, if not bail out |
| |
mybindir=bindir+"/linux-"+kinfo["name"]+"-"+myversion |
| |
verifydir(mybindir,kinfo) |
| |
verifydir(mybindir+"/boot",kinfo) |
| |
|
| |
kbinloc=kinfo["workdir"]+"/"+kinfo["binpath"]+"/"+kinfo["binname"] |
| |
if verifyfile(kbinloc,kinfo): |
| |
# the binary exists, so let's cp it to bin... |
| |
copy(kbinloc,mybindir+"/boot/"+kinfo["binname"]+"-"+myversion) |
| |
copy("%s/System.map" % kinfo["workdir"],mybindir+"/boot/System.map-"+myversion) |
| |
else: |
| |
# the binary is not there, inform user and bail out with error |
| |
raise BuildError("%s is not present, assuming build failure and exiting. See log for details." % kbinloc) |
| |
|
| |
if krn_modulesenabled(kinfo): |
| |
# now that we know he binary built, let's continue |
| |
if dont_build==0: |
| |
gkb_runmake("modules",kinfo, premake, makeopts) |
| |
|
| |
# **Note** : we prepend the INSTALL_MOD_PATH to the makeopts inline instead |
| |
# of globally as it is only needed in this target |
| |
gkb_runmake("modules_install", kinfo, premake, "INSTALL_MOD_PATH=%s %s" % (mybindir, makeopts)) |
| |
else: |
| |
log("skipping make modules (disabled in .config)",kinfo) |
| |
|
| |
# compress and upload source archive |
| |
chdir(kinfo["workdir"]+"/..",kinfo) |
| |
archive_name = "src-%s.tar.bz2" % kinfo["mastertree"], |
| |
|
| |
# compress and upload kernel binary |
| |
chdir(bindir,kinfo) |
| |
archive_name = "linux-%s-%s.tar.bz2" % (kinfo["name"], myversion) |
| |
|
| |
log("compressing binary archive "+archive_name,kinfo) |
| |
|
| |
if runcmd("tar cjf "+archive_name+" "+os.path.basename(mybindir), kinfo): |
| |
raise BuildError("failed to `tar cjf %s`" % archive_name) |
| |
|
| |
runcmd("rm -rf %s" % mybindir, kinfo) |
| |
|
| |
krn_upload(archive_name,"kernel",myversion,kinfo) |
| |
krn_querymgr("checkin",kinfo) |
| |
|
| |
# if os.fork() == 0: |
| |
# #in child |
| |
# try: |
| |
# # sync the source to make sure we are up to date ... |
| |
# log("re-fetching latest source",kinfo) |
| |
# gkb_getsource(kinfo) |
| |
# |
| |
# # go into the work directory |
| |
# chdir(workdir, kinfo) |
| |
# |
| |
# # archive the clean source for later uploading |
| |
# log("archiving source to " + kinfo["mastertree"] + ".tar.bz2", kinfo) |
| |
# runcmd("tar cjf " + kinfo["mastertree"] + ".tar.bz2 " + kinfo["mastertree"], kinfo) |
| |
# |
| |
# krn_upload(workdir + "/" + kinfo["mastertree"] + ".tar.bz2", "source", myversion, kinfo) |
| |
# finally: |
| |
# sys.exit(0) |
| |
|
| |
log("returning source directory to clean state",kinfo) |
| |
gkb_getsource(kinfo) |
| |
|
| |
except BuildError, e: |
| |
log(e.message, kinfo) |
| |
krn_querymgr("checkin",kinfo,"&failed=%s" % krn_localversion(kinfo)) |
| |
except: |
| |
krn_querymgr("checkin",kinfo,"&failed=%s" % krn_localversion(kinfo)) |
| |
raise |
| |
|
| # source get routines |
# source get routines |
| def gkb_getsource(kinfo): |
def gkb_getsource(kinfo): |
| """method to perform source sync on demand, currenty only supports rsync, but others can be added""" |
"""method to perform source sync on demand, currenty only supports rsync, but others can be added""" |
| form["version"] = version |
form["version"] = version |
| |
|
| #form.add_file(open(file), "application/x-bzip2", os.path.basename(file)) |
#form.add_file(open(file), "application/x-bzip2", os.path.basename(file)) |
| |
runcmd("ssh www.ppckernel.org 'mkdir -p %s/%s/'" % (uploaddir,kinfo["name"])) |
| runcmd("scp %s www.ppckernel.org:%s/%s/" % (os.path.basename(file),uploaddir,kinfo["name"])) |
runcmd("scp %s www.ppckernel.org:%s/%s/" % (os.path.basename(file),uploaddir,kinfo["name"])) |
| |
|
| # form.click() returns a urllib2.Request object |
# form.click() returns a urllib2.Request object |