'calling "%s" for compiling the kernel' %(' '.join(cmd))
)
- os.putenv('LOCALVERSION', '')
- os.environ['LOCALVERSION'] = ''
if distcc:
os.environ['MAKEFLAGS'] = 'CC=distcc'
os.putenv('MAKEFLAGS', 'CC=distcc')
return result
def add_local_version_to_config(kernel_build_revision):
- if not os.path.exists(KERNEL_CONFIG_PATH):
- raise Exception(
- 'No config file found at %s' %(KERNEL_CONFIG_PATH)
- )
- kernel_config = read_file(KERNEL_CONFIG_PATH)
# don't put the branch names into the packages names
if GIT_BRANCH_NAME.startswith('master-'):
flavour = GIT_BRANCH_NAME[7:]
flavour = 'none'
localversion = 'profitbricks-%s' % flavour
-# for lino, line in kernel_config.iteritems():
-# try:
-# key, value = CREG_KERNEL_CONFIG_DELIM.split(line)
-# except ValueError:
-# # found a comment line or something else
-# # we dont want.
-# continue
-# if key == 'CONFIG_LOCALVERSION':
-# value = localversion
-# kernel_config.update(((lino, '%s="%s"\n' %(key, value)),))
-# break
-# else:
-# # no CONFIG_LOCALVERSION in kernel config
-# lino += 1
-# kernel_config.setdefault(
-# lino,
-# 'CONFIG_LOCALVERSION="%s"\n' %(localversion)
-# )
-# logger.info('CONFIG_LOCALVERSION set to %s' % localversion)
-#
-# try:
-# fh = open(KERNEL_CONFIG_PATH, 'w', 1)
-# except:
-# raise
-# else:
-# for lino, line in sorted(
-# kernel_config.iteritems(),
-# key=lambda x: x[0]
-# ):
-# fh.write(line)
-# fh.close()
-# return localversion
-# return False
return localversion
def exit(retcode):
exit(ERROR)
new_version = REVISION
- try:
- kernel_version = add_local_version_to_config(new_version)
- except Exception, error:
- logger.exception(error)
- exit(ERROR)
- else:
- logger.info(
- 'updated CONFIG_LOCALVERSION in %s to %s'
- %(KERNEL_CONFIG_PATH, new_version)
- )
+ kernel_version = add_local_version_to_config(new_version)
+ logger.info('REVISION = %s, kernel_version = %s' %(REVISION,kernel_version))
logger.debug('changing dir to %s' %(GIT_TARGET_DIR))
os.chdir(GIT_TARGET_DIR)