path: root/
diff options
authorJohannes Berg <>2013-04-09 23:25:50 +0200
committerJohannes Berg <>2013-04-09 23:45:50 +0200
commit572e852fd02bc492e22bc6d14b9bc6d1ba492db4 (patch)
tree4640ce803131a8c4746e305f4c9af7eddb2badbd /
parentd5a0e005f00119af47d58eeb67cd93aca9294247 (diff)
git tracker: add special version string to build
In output trees created with the git tracker, we avoid changing the "versions" file all the time and just put "(see git)" into the versions. However, it's useful to still be able to identify it, and when using this the backport is (usually) built in the git tree. Use this fact and add the git tree commit into a new variable to put it into the MODULE_VERSION and also print it at runtime. Signed-off-by: Johannes Berg <>
Diffstat (limited to '')
1 files changed, 10 insertions, 4 deletions
diff --git a/ b/
index a223b476..adef899c 100755
--- a/
+++ b/
@@ -294,7 +294,7 @@ def _main():
def process(kerneldir, outdir, copy_list_file, git_revision=None,
clean=False, refresh=False, base_name="Linux", gitdebug=False,
verbose=False, extra_driver=[], logwrite=lambda x:None,
- kernel_version_name=None, backport_version_name=None):
+ git_tracked_version=False):
class Args(object):
def __init__(self, kerneldir, outdir, copy_list_file,
git_revision, clean, refresh, base_name,
@@ -437,13 +437,19 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
git_debug_snapshot(args, "convert select to depends on")
# write the versioning file
- backports_version = backport_version_name or git.describe(tree=source_dir)
- kernel_version = kernel_version_name or git.describe(rev=args.git_revision or 'HEAD',
- tree=args.kerneldir)
+ if git_tracked_version:
+ backports_version = "(see git)"
+ kernel_version = "(see git)"
+ else:
+ backports_version = git.describe(tree=source_dir)
+ kernel_version = git.describe(rev=args.git_revision or 'HEAD',
+ tree=args.kerneldir)
f = open(os.path.join(args.outdir, 'versions'), 'w')
f.write('BACKPORTS_VERSION="%s"\n' % backports_version)
f.write('BACKPORTED_KERNEL_VERSION="%s"\n' % kernel_version)
f.write('BACKPORTED_KERNEL_NAME="%s"\n' % args.base_name)
+ if git_tracked_version:
+ f.write('BACKPORTS_GIT_TRACKED="backport tracker ID: $(shell git rev-parse HEAD 2>/dev/null || echo \'not built in git tree\')"\n')
symbols = configtree.symbols()