import kernel_persistence
import urllib
-JOB_URL = 'http://rwittler:MiMaMopel@jenkins:80/job/%(flavour)s-source/buildWithParameters?'
-JOB_DELAY = '0sec'
-
CWD = os.environ.get('WORKSPACE')
BUILD_NUMBER = os.environ.get('BUILD_NUMBER')
BUILD_ID = os.environ.get('BUILD_ID')
def build_kernel_with_pbuilder(revision, pbuilder_script, dist='stable'):
pbuilder_script = os.path.abspath(pbuilder_script)
- if os.environ.get('SOURCE_BUILD'):
- SOURCE_BUILD='--source-only=True'
- else:
- SOURCE_BUILD=''
-
cmd = [
SUDO,
PBUILDER,
'--revision', '%s' %(revision),
'--dist', '%s' %(dist),
'--overlay-dir', '%s' % os.path.join(CWD,'kernel-package-overlay'),
- SOURCE_BUILD
]
os.environ.update({'DIST': '%s' %(dist)})
dist='stable'):
exit_error()
- # trigger source build
- logger.info('Triggering source build now')
- flavour=GIT_REPO_NAME[6:-4]
- urlencode_expansion_dict = {
- 'flavour': 'linux-%s' % flavour
- }
- url = HudsonUrl()
- data = urllib.urlencode(
- (
- ('GIT_REPO_PATH', GIT_REPO_PATH),
- ('DISTRIBUTION', pb_suite),
- ('delay', JOB_DELAY)
- )
- )
- ret = url.open(JOB_URL %(urlencode_expansion_dict) + '%s' %(data))
-
- if ret.code == 200:
- logger.info('jenkins url called successfully.')
- else:
- logger.info('URL was %s' % JOB_URL %(urlencode_expansion_dict) + '%s' %(data))
- logger.info('jenkins sends the following: %s' %(ret.read()) )
- exit_error()
-
exit_ok()
help='Set the overlay-dir for make-kpkg Default: %default'
)
- parser.add_option(
- '--source-only',
- dest='source_only',
- default=False,
- metavar='SOURCE_ONLY',
- help='If set, only build source packages. Default: %default'
- )
-
return parser.parse_args()
def git_clone_remote_repository(url, destination):
logger.info('Running %s' % cmd)
os.system(cmd)
- if options.source_only:
- # only build source
- logger.info('Lets build only sources')
- if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR, [ 'kernel_source' ]):
- exit(ERROR)
- else:
- # build binaries and modules
- if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR, [ 'kernel_debug', 'kernel_image' ]):
+ if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR, [ 'kernel_image', 'kernel_source', 'kernel_debug' ]):
+ exit(ERROR)
+ if has_extra_modules():
+ if not install_extra_modules():
+ logger.error('Error during installation of extra kernel modules')
exit(ERROR)
- if has_extra_modules():
- if not install_extra_modules():
- logger.error('Error during installation of extra kernel modules')
- exit(ERROR)
if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR, [ 'modules' ]):
exit(ERROR)