]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
I believe there is no need to reinvent make-kpkg
authorHolger Levsen <holger@layer-acht.org>
Sun, 18 Sep 2011 14:45:19 +0000 (16:45 +0200)
committerHolger Levsen <holger@layer-acht.org>
Sun, 18 Sep 2011 14:45:19 +0000 (16:45 +0200)
kernel_inpbuilder.py

index d9affd9da728fa18e95501f233c0cc19b1ad2cf4..0d756a1470c76c3b313f88c7cb9a5b9f7c19ff07 100644 (file)
@@ -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)