From aa87019efb598cb5a482acb0476343469d5580dc Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sun, 18 Sep 2011 16:45:19 +0200 Subject: [PATCH] I believe there is no need to reinvent make-kpkg --- kernel_inpbuilder.py | 70 +++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/kernel_inpbuilder.py b/kernel_inpbuilder.py index d9affd9..0d756a1 100644 --- a/kernel_inpbuilder.py +++ b/kernel_inpbuilder.py @@ -204,6 +204,7 @@ def build_kernel(version, revision, parallel_jobs='auto', distcc=False): cmd = [MAKE_KPKG, '-j', '%s' %(parallel_jobs), '--arch', '%s' %(BUILD_ARCH), '--rootcmd', 'fakeroot', + '--append-to-version', '-%s' %(version), '--initrd', '--arch-in-name', 'configure' ] @@ -261,40 +262,41 @@ def add_local_version_to_config(kernel_build_revision): logger.error('GIT_BRANCH_NAME is %s, flavour is none.' % GIT_BRANCH_NAME) 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 + 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): logger.info('Exit with %s', retcode) -- 2.39.5