Skip to contentSkip to conversation

kernel versions on Linus bk tree

DISCUSSION Jon Smirl 5 participants 6 messages Jan 8, 2005 – Jan 11, 2005 Kbuild

lore
Share & tools
lore

Jon Smirl

author
#0 lore raw

I just came across a problem with the way the kernel is being versioned. The DRM driver needs an IFDEF for the four level page table change depending on kernel version built against. I used this:
#if LINUX_VERSION_CODE < 0x02060a

The problem is that 2.6.10 was released on kernel.org without the four level change. But Linus bk which also has version 2.6.10 has the change. Is there some way around this problem?

One solution would be to bump the version in Linus bk to 2.6.11-rc1 on the first check in after 2.6.10 is cut. The general case of this would be to always bump the Linus bk version number immediately after cutting the released version.

I've been bitten by this ambiguity before when kernels from Linus BK have more code in them than the one from kernel.org and have the same version number. Changing the timing of the version bump would lessen this problem since kernels complied from Linus bk tend to have a short life.

Signature · 2 lines
Jon Smirl
[email protected]
#1 lore raw
Quoted 4 lines · Jon Smirl

I just came across a problem with the way the kernel is being versioned. The DRM driver needs an IFDEF for the four level page table change depending on kernel version built against. I used this:
#if LINUX_VERSION_CODE < 0x02060a

you might probably use KERNEL_VERSION here which is more convenient:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)

Quoted 3 lines

The problem is that 2.6.10 was released on kernel.org without the four level change. But Linus bk which also has version 2.6.10 has the change. Is there some way around this problem?

include/linux/version.h is generated by the Makefile. This file do not come with the source.

Signature · 1 line
Vincent Hanquez
#2 lore raw
Quoted 6 lines · Vincent Hanquez
Quoted 3 lines

The problem is that 2.6.10 was released on kernel.org without the four level change. But Linus bk which also has version 2.6.10 has the change. Is there some way around this problem?

include/linux/version.h is generated by the Makefile. This file do not come with the source.

oops, I misread, just ignore the comment ;)
sorry for the noise.

Signature · 1 line
Vincent Hanquez
#3 lore raw
In reply to Jon Smirl
Quoted 4 lines · Jon Smirl

I just came across a problem with the way the kernel is being versioned. The DRM driver needs an IFDEF for the four level page table change depending on kernel version built against. I used this:
#if LINUX_VERSION_CODE < 0x02060a

Wait for 2.6.11 then. It is the price you pay for fooling around with kernels in between versions.

If you are experimenting, you know what you are working with, so what is the problem?

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
#4 lore raw
In reply to Jon Smirl

Hi!

Quoted 5 lines

I just came across a problem with the way the kernel is being versioned. The DRM driver needs an IFDEF for the four level page table change depending on kernel version built against. I used this:
#if LINUX_VERSION_CODE < 0x02060a

Quoted 8 lines

The problem is that 2.6.10 was released on kernel.org without the four level change. But Linus bk which also has version 2.6.10 has the change. Is there some way around this problem?

One solution would be to bump the version in Linus bk to 2.6.11-rc1 on the first check in after 2.6.10 is cut. The general case of this would be to always bump the Linus bk version number immediately after cutting the released version.

2.6.11-rc1 seems wrong, but marking it 2.6.10-bk0 should do the trick.

Pavel

Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#5 lore raw
In reply to Jon Smirl
Quoted 10 lines · Jon Smirl

One solution would be to bump the version in Linus bk to 2.6.11-rc1 on the first check in after 2.6.10 is cut. The general case of this would be to always bump the Linus bk version number immediately after cutting the released version.

I've been bitten by this ambiguity before when kernels from Linus BK have more code in them than the one from kernel.org and have the same version number. Changing the timing of the version bump would lessen this problem since kernels complied from Linus bk tend to have a short life.

I've got a patch in my local tree that tries to solve this through an attempt to auto-append -bkXXXXXXXX (where each X is hex-digit of the md5 hash of the top-of-tree BK commit).

It doesn't solve the particular problem that caused you to send this mail, but I think it solves the "modules from a -BK tree overwrite official releases" problem that prompted me to code up this patch.

(Sam, Kai, I added you in case you have the time to look at this and apply it or provide some feedback on my approach. I have both a shell script that depends on md5sum, and a Perl script in the patch.)

Makefile +18 -0
diff -Nru a/Makefile b/Makefile
@@ -513,6 +513,24 @@
 
 #export	INSTALL_PATH=/boot
 
+# If CONFIG_LOCALVERSION_AUTO is set, we automatically perform some tests
+# and try to determine if the current source tree is a release tree, of any sort,
+# or if is a pure development tree.
+# A 'release tree' is any tree with a BitKeeper TAG associated with it.
+# The primary goal of this is to make it safe for a native BitKeeper user to
+# build a release tree (i.e, 2.6.9) and also to continue developing against the
+# current Linus tree, without having the Linus tree overwrite the 2.6.9 tree 
+# when installed.
+#
+# (In the future, CVS and SVN support will be added as well.)
+
+ifeq ($(CONFIG_LOCALVERSION_AUTO),y)
+	ifeq ($(shell ls -d $(srctree)/BitKeeper 2>/dev/null),$(srctree)/BitKeeper)
+		localversion-bk := $(shell $(srctree)/scripts/setlocalversion.sh $(srctree) $(objtree))
+		LOCALVERSION := $(LOCALVERSION)$(localversion-bk)
+	endif
+endif
+
 #
 # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
 # relocations required by build roots.  This is not defined in the
init/Kconfig +12 -0
diff -Nru a/init/Kconfig b/init/Kconfig
@@ -69,6 +69,18 @@
 	  object and source tree, in that order.  Your total string can
 	  be a maximum of 64 characters.
 
+config LOCALVERSION_AUTO
+	bool "Automatically append version information to the version string"
+	default y
+	help
+	  This will try to automatically determine if the current tree is a
+	  release tree by looking for BitKeeper tags that belong to the
+	  current top of tree revision.
+	  A string of the format -BKxxxxxxxx will be added to the
+	  localversion.  The string generated by this will be appended 
+	  after any matching localversion* files, but before the 
+	  value set in CONFIG_LOCALVERSION
+
 config SWAP
 	bool "Support for paging of anonymous memory (swap)"
 	depends on MMU
scripts/setlocalversion new file +62 -0

62 lines not on this page · raw message

scripts/setlocalversion.sh new file +19 -0
diff -Nru a/scripts/setlocalversion.sh b/scripts/setlocalversion.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+BK=`which bk`
+
+srctree=$1
+objtree=$2
+
+if [ "$BK" == "" ];
+then
+	echo "scripts/setlocalversion.sh: Failed to find BK, not appending a -BK* version" >&2
+	exit 0
+fi
+
+cd $srctree
+changeset=`$BK changes -r+ -k`
+tag=`$BK prs -h -d':TAG:' -r'$changeset'`
+if [ "$tag" == "" ]; then
+	echo -n $changeset | md5sum | awk '{printf "-BK%s",substr($1,1,8)}'
+fi
Signature · 2 lines
Ryan Anderson
  sometimes Pug Majere