From: Luis R. Rodriguez Date: Thu, 17 May 2012 02:29:24 +0000 (-0700) Subject: compat: add COMPAT_BASE tag X-Git-Tag: compat-2012-07-02~1^2~11 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=cbc64a7f0986aadf310ffd153e002c6e6dc46e7f;p=~emulex%2Ffor-vlad%2Fold%2Fcompat.git compat: add COMPAT_BASE tag I'm going to start adding tags to compat.git. This tag will also be printed upon loading of the compat module. This is useful to annotating what release of compat.git was used exactly. Moving forward the goal will be to try to add a tag only once a full version of linux-next.git with a respective date tag from that release has been addressed for backporting. Right now the only consumer of compat.git that I am aware of is compat-wireless (soon to be renamed to compat-drivers) so what this means in practice is I will only add a tag to compat.git once ckmake is used to verify compilation against all supported kernels. This means there are two tasks when backporting: * compat.git work * compat-wireless.git work The compat.git work will likely be finished first than the compat-wireless.git work. Older compat.git versions should work with newer versions of tags from compat-wireless.git, however, I may still add tags to compat.git to annotate that that release (even if no changes were made) has also been used and tested. Every single release of compat.git and compat-wireless.git that has a tag means that that tag has been tested with ckmake to cross compile against all supported kernels. Signed-off-by: Luis R. Rodriguez --- diff --git a/Makefile b/Makefile index 8775294..05a7d72 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,10 @@ export COMPAT_BASE_TREE := "linux-next.git" export COMPAT_BASE_TREE_VERSION := "next-20100517" export COMPAT_VERSION := $(shell git describe) +# This is used to annotate what version of +# compat.git was used. +export COMPAT_BASE := $(shell git describe) + # to check config and compat autoconf export COMPAT_CONFIG=$(PWD)/.config export COMPAT_AUTOCONF=$(PWD)/include/linux/compat_autoconf.h @@ -33,6 +37,7 @@ else NOSTDINC_FLAGS := -I$(M)/include/ \ -include $(M)/include/linux/compat-2.6.h \ $(CFLAGS) \ + -DCOMPAT_BASE="\"$(COMPAT_BASE)\"" \ -DCOMPAT_BASE_TREE="\"$(COMPAT_BASE_TREE)\"" \ -DCOMPAT_BASE_TREE_VERSION="\"$(COMPAT_BASE_TREE_VERSION)\"" \ -DCOMPAT_PROJECT="\"Generic kernel\"" \ diff --git a/compat/main.c b/compat/main.c index e04cc88..9141858 100644 --- a/compat/main.c +++ b/compat/main.c @@ -4,6 +4,10 @@ MODULE_AUTHOR("Luis R. Rodriguez"); MODULE_DESCRIPTION("Kernel compatibility module"); MODULE_LICENSE("GPL"); +#ifndef COMPAT_BASE +#error "You need a COMPAT_BASE" +#endif + #ifndef COMPAT_BASE_TREE #error "You need a COMPAT_BASE_TREE" #endif @@ -16,10 +20,15 @@ MODULE_LICENSE("GPL"); #error "You need a COMPAT_VERSION" #endif +static char *compat_base = COMPAT_BASE; static char *compat_base_tree = COMPAT_BASE_TREE; static char *compat_base_tree_version = COMPAT_BASE_TREE_VERSION; static char *compat_version = COMPAT_VERSION; +module_param(compat_base, charp, 0400); +MODULE_PARM_DESC(compat_base_tree, + "The upstream verion of compat.git used"); + module_param(compat_base_tree, charp, 0400); MODULE_PARM_DESC(compat_base_tree, "The upstream tree used as base for this backport"); @@ -52,6 +61,8 @@ static int __init compat_init(void) printk(KERN_INFO "Backport based on " COMPAT_BASE_TREE " " COMPAT_BASE_TREE_VERSION "\n"); + printk(KERN_INFO "compat.git: " + COMPAT_BASE_TREE "\n"); return 0; }