diff options
Diffstat (limited to 'lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py')
-rw-r--r-- | lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py | 195 |
1 files changed, 0 insertions, 195 deletions
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py b/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py deleted file mode 100644 index 23527c97..00000000 --- a/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py +++ /dev/null @@ -1,195 +0,0 @@ -''' -Created on Jan 6, 2013 - -__author__ = "Elizabeth 'pidge' Flanagan" -__copyright__ = "Copyright 2012-2013, Intel Corp." -__credits__ = ["Elizabeth Flanagan"] -__license__ = "GPL" -__version__ = "2.0" -__maintainer__ = "Elizabeth Flanagan" -__email__ = "pidge@toganlabs.com" -''' - - -from buildbot.steps.shell import ShellCommand -from buildbot.process.buildstep import LogLineObserver -from distutils.version import StrictVersion -from buildbot.status.results import SUCCESS, SKIPPED -import os, datetime - -from lib.buildsteps import BitbakeShellCommand - -class BuildImages(BitbakeShellCommand): - haltOnFailure = False - flunkOnFailure = True - name = "BuildImages" - def __init__(self, factory, argdict=None, **kwargs): - self.layerversion_yoctobsp=0 - self.machine="" - self.images="" - self.oeinit = "oe-init-build-env" - self.overrideenv = [] - self._pendingLogObservers = [] - self.factory = factory - for k, v in argdict.iteritems(): - setattr(self, k, v) - # Timeout needs to be passed to LoggingBuildStep as a kwarg - self.timeout = 100000 - kwargs['timeout']=self.timeout - super(BuildImages, self).__init__(factory, argdict=None, - **kwargs) - - def start(self): - self.localconf = self.getProperty("LOCALCONF") - self.layerversion_yoctobsp = \ - int(self.getProperty("layerversion_yoctobsp", "0")) - self.layerversion_core = \ - int(self.getProperty("layerversion_core", "0")) - self.machine = self.getProperty("MACHINE", "") - self.minnowExists = self.getProperty("minnowExists") - try: - self.deploycheck = self.getProperty('custom_deploy_artifacts') - except: - self.deploycheck = "True" - - builddir = os.path.join(self.getProperty('builddir'), 'build') - if self.overrideenv: - for i, e in enumerate(self.overrideenv): - self.overrideenv[i] = e.replace('#YPDIR', builddir) - - # the eventlog capability exists only in bitbake 1.25 and newer - self.create_eventlog = "False" - if self.getProperty('bitbakeversion') \ - and StrictVersion(self.getProperty('bitbakeversion')) >= StrictVersion("1.25"): - try: - self.create_eventlog = self.getProperty("custom_create_eventlog") - if self.create_eventlog == "True": - timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S") - self.eventlog_name = "tmp/log/bitbake_eventlog-%s.json" % timestamp - except: - pass - - env = '' - if self.overrideenv: - env = ' '.join(self.overrideenv) + ' ' - - # Refkit builds should only happen for non-releases on master, - # master-next or ross/mut* branches - branch = self.getProperty('branch') - masterish = False - if self.getProperty('is_release') != 'True' \ - and (branch in ['master', 'master-next'] \ - or branch.startswith('ross/mut')): - masterish = True - - if self.images == "#SCRAPEDTARGETS": - self.images = self.getProperty("scraped_targets") - - if self.images == "#TOASTER": - bitbakeflags = "-k " - if self.create_eventlog == "True": - bitbakeflags += "-w '" + self.eventlog_name + "' " - self.images=self.getProperty("custom_images") - self.command = env + ". ./" + self.oeinit + "; bitbake " + bitbakeflags + self.images - self.description = ["Building " + str(self.images)] - elif self.images == "package-index" and str(self.deploycheck) == "False": - self.skipStep('Skipping build as the required artifacts are not there') - elif not masterish and 'refkit' in self.images: - # Refkit tracks OE-Core master, skip it for named branches - self.skipStep('Skipping refkit build, not supported for releases.') - # core-image-basic rename - # See: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b7f1cca517bbd4191828c6bae32e0c5041f1ff19 - # I hate making people change their configs, so support both. - else: - if self.layerversion_core < 4: - self.images=self.images.replace("core-image-full-cmdline", "core-image-basic") - else: - self.images=self.images.replace("core-image-basic", "core-image-full-cmdline") - - if self.layerversion_core < 8: - self.images=self.images.replace("core-image-sato-sdk-ptest", "") - - if self.layerversion_core > 6: - self.images=self.images.replace("LSB-QT-IMAGES", "") - else: - self.images=self.images.replace("LSB-QT-IMAGES", "core-image-lsb-qt3") - - # Releases older than Rocko didn't build - # core-image-sato-sdk with musl. - if self.layerversion_core < 11 \ - and "musl" in self.localconf: - self.images = self.images.replace("core-image-sato-sdk", "core-image-sato") - - # Releases older than Pyro need to build an image before - # invoking oe-selfest - if self.layerversion_core < 10: - self.images = self.images.replace("SELFTEST-PRE", "core-image-minimal") - else: - self.images = self.images.replace("SELFTEST-PRE", "") - - # The switch to recipe-specific-sysroots during the Pyro release forced us - # to change how we build the native dependencies for wic and introduce - # wic-tools. As we've traditionally made efforts in the AB to not break - # existing buildset we should handle both wic-tools and the full list - # of native dependencies correctly. - wicNativeDeps = ("syslinux syslinux-native parted-native " - "gptfdisk-native dosfstools-native mtools-native") - if self.layerversion_core > 9: - self.images = self.images.replace(wicNativeDeps, "wic-tools") - else: - self.images = self.images.replace("wic-tools", wicNativeDeps) - - if "minnow" in self.machine: - - if self.minnowExists is "False": - self.skipStep("Minnowboard layer does not build for 1.8") - - ''' - Various images/builds/features do not work in earlier versions of - oe-core/other layers. This excludes certain builds from building. - - While we could do something like: - - if <some condition is met>: - self.finished(SUCCESS) - self.description = ["Skipping Build"] - self.build.allStepsDone() - - we really don't want to do this as other bits later in the build - set may in fact be needed. - ''' - if self.layerversion_core > 7 \ - and "adt-installer" in self.images: - self.skipStep('Skipping adt-installer.') - elif self.layerversion_core < 8 \ - and 'DISTRO_FEATURES_remove="x11"' in self.localconf.replace(" ", ""): - self.skipStep('Skipping no-x11 Build.') - elif self.layerversion_core != 8 \ - and 'uclibc' in self.localconf: - self.skipStep('Skipping uclib Build.') - elif self.layerversion_core < 8 \ - and 'musl' in self.localconf: - self.skipStep('Skipping musl Build.') - elif self.layerversion_core < 7 \ - and "populate_sdk_ext" in self.images: - self.skipStep('Skipping eSDK Build.') - elif self.layerversion_yoctobsp < 2 \ - and self.machine == "genericx86-64": - self.skipStep("Skipping genericx86-64 Build") - elif self.images == "": - self.skipStep("Skipping Build. No Images to be built") - else: - bitbakeflags = "-k " - if self.create_eventlog == "True": - bitbakeflags += "-w '" + self.eventlog_name + "' " - if self.minnowExists is None or self.minnowExists == "True": - self.command = env + ". ./" + self.oeinit + "; bitbake " + bitbakeflags + self.images - self.description = ["Building " + str(self.images)] - - self.setProperty("BuildImages", self.images, "BuildImages") - - ShellCommand.start(self) - - def describe(self, done=False): - description = ShellCommand.describe(self, done) - return description |