mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ryan Anderson <ryan@michonline.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Helge Hafting <helge.hafting@aitel.hist.no>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Dave Airlie <airlied@gmail.com>,
	akpm@osdl.org
Subject: Re: rc6 keeps hanging and blanking displays where rc4-mm1 works fine.
Date: Mon, 15 Aug 2005 13:00:16 -0400	[thread overview]
Message-ID: <20050815170016.GH7001@mythryan2.michonline.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0508150843380.3553@g5.osdl.org>

On Mon, Aug 15, 2005 at 08:50:12AM -0700, Linus Torvalds wrote:
> > Is there any way to make git tell exactly where between rc4 and rc5
> > each kernel is, so I can name the bzimages accordingly?
> 
> You'd have to use the raw commit names, since these things don't have any 
> symbolic names. You can get that by just doing
> 
> 	cat .git/HEAD
> 
> which will give you a 40-character hex string (representing the 160-bit 
> SHA1 of the top commit). Not very readable, but it's unique, and if you 
> report that hex string to other git users, they can trivially recreate the 
> tree you have.

The following patch (which Sam has in the kbuild tree for 2.6.14, IIRC)
will make that automatic, or you can just do:

	ln -s .git/HEAD localversion-git

(My patch will notice when you are at a tag and not append anything
special in thaat case.)

Index: linux-git/Makefile
===================================================================
--- linux-git.orig/Makefile	2005-07-31 04:30:00.000000000 -0400
+++ linux-git/Makefile	2005-07-31 04:32:16.000000000 -0400
@@ -551,6 +551,26 @@ export KBUILD_IMAGE ?= vmlinux
 # images. Default is /boot, but you can set it to other values
 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 git TAG associated
+# with it.  The primary goal of this is to make it safe for a native
+# git/CVS/SVN 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.
+#
+# Currently, only git is supported.
+# Other SCMs can edit scripts/setlocalversion and add the appropriate
+# checks as needed.
+
+
+ifdef CONFIG_LOCALVERSION_AUTO
+	localversion-auto := $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree))
+	LOCALVERSION := $(LOCALVERSION)$(localversion-auto)
+endif
+
 #
 # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
 # relocations required by build roots.  This is not defined in the
Index: linux-git/init/Kconfig
===================================================================
--- linux-git.orig/init/Kconfig	2005-07-31 04:30:00.000000000 -0400
+++ linux-git/init/Kconfig	2005-07-31 04:32:16.000000000 -0400
@@ -77,6 +77,22 @@ config LOCALVERSION
 	  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 git tags that
+	  belong to the current top of tree revision.
+
+	  A string of the format -gxxxxxxxx will be added to the localversion
+	  if a git based tree is found.  The string generated by this will be
+	  appended after any matching localversion* files, and after the value
+	  set in CONFIG_LOCALVERSION
+
+	  Note: This requires Perl, and a git repository, but not necessarily
+	  the git or cogito tools to be installed.
+
 config SWAP
 	bool "Support for paging of anonymous memory (swap)"
 	depends on MMU
Index: linux-git/scripts/setlocalversion
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-git/scripts/setlocalversion	2005-07-31 04:32:16.000000000 -0400
@@ -0,0 +1,56 @@
+#!/usr/bin/perl
+# Copyright 2004 - Ryan Anderson <ryan@michonline.com>  GPL v2
+
+use strict;
+use warnings;
+use Digest::MD5;
+require 5.006;
+
+if (@ARGV != 1) {
+	print <<EOT;
+Usage: setlocalversion <srctree>
+EOT
+	exit(1);
+}
+
+my ($srctree) = @ARGV;
+chdir($srctree);
+
+my @LOCALVERSIONS = ();
+
+# We are going to use the following commands to try and determine if this
+# repository is at a Version boundary (i.e, 2.6.10 vs 2.6.10 + some patches) We
+# currently assume that all meaningful version boundaries are marked by a tag.
+# We don't care what the tag is, just that something exists.
+
+# Git/Cogito store the top-of-tree "commit" in .git/HEAD
+# A list of known tags sits in .git/refs/tags/
+#
+# The simple trick here is to just compare the two of these, and if we get a
+# match, return nothing, otherwise, return a subset of the SHA-1 hash in
+# .git/HEAD
+
+sub do_git_checks {
+	open(H,"<.git/HEAD") or return;
+	my $head = <H>;
+	chomp $head;
+	close(H);
+
+	opendir(D,".git/refs/tags") or return;
+	foreach my $tagfile (grep !/^\.{1,2}$/, readdir(D)) {
+		open(F,"<.git/refs/tags/" . $tagfile) or return;
+		my $tag = <F>;
+		chomp $tag;
+		close(F);
+		return if ($tag eq $head);
+	}
+	closedir(D);
+
+	push @LOCALVERSIONS, "g" . substr($head,0,8);
+}
+
+if ( -d ".git") {
+	do_git_checks();
+}
+
+printf "-%s\n", join("-",@LOCALVERSIONS) if (scalar @LOCALVERSIONS > 0);




-- 

Ryan Anderson
  sometimes Pug Majere

  reply	other threads:[~2005-08-15 17:00 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-02  5:07 Linux 2.6.13-rc5 Linus Torvalds
2005-08-02  6:17 ` Jan De Luyck
2005-08-02  6:43 ` Linux 2.6.13-rc5 - possible acpi regression? Jan De Luyck
2005-08-02 10:50   ` Rafael J. Wysocki
2005-08-03 10:59     ` Jan De Luyck
2005-08-02  7:56 ` Linux 2.6.13-rc5 Olaf Hering
2005-08-05 10:40 ` rc5 seemed to kill a disk that rc4-mm1 likes. Also some X trouble Helge Hafting
2005-08-05 22:05   ` Andrew Morton
2005-08-07  9:41     ` Helge Hafting
2005-08-07 17:06     ` Danny ter Haar
2005-08-08 11:27       ` Helge Hafting
2005-08-08 12:14         ` Danny ter Haar
2005-08-08 14:59           ` Danny ter Haar
     [not found]   ` <21d7e99705080503515e3045d5@mail.gmail.com>
2005-08-09 12:20     ` Helge Hafting
2005-08-12 10:01       ` rc6 keeps hanging and blanking displays where rc4-mm1 works fine Helge Hafting
2005-08-12 10:32         ` Alan Cox
2005-08-15 12:53           ` Bartlomiej Zolnierkiewicz
2005-08-15 13:00             ` Bartlomiej Zolnierkiewicz
2005-08-12 16:51         ` Linus Torvalds
2005-08-15 12:37           ` Helge Hafting
2005-08-15 15:50             ` Linus Torvalds
2005-08-15 17:00               ` Ryan Anderson [this message]
2005-08-15 17:45               ` Helge Hafting
2005-08-15 21:48                 ` Sanjoy Mahajan
2005-08-15 22:11               ` rc6 keeps hanging and blanking displays - bisection complete Helge Hafting
2005-08-15 22:59                 ` Linus Torvalds
2005-08-16  8:46                   ` Helge Hafting
2005-08-16 19:29                   ` Helge Hafting
2005-08-15 23:18                 ` Dave Airlie
2005-08-15 23:24                   ` Dave Airlie
2005-08-16  7:34                     ` Helge Hafting
2005-08-16 16:52                     ` rc6 keeps hanging and blanking displays Helge Hafting
2005-08-16 17:00                       ` Linus Torvalds
2005-08-16 21:14                         ` Helge Hafting
2005-08-16 23:50                           ` Dave Airlie
2005-08-17 11:05                             ` Helge Hafting
2005-08-17 11:05                               ` Dave Airlie
2005-08-17 15:19                                 ` Linus Torvalds
2005-08-22 21:44                                   ` Helge Hafting
2005-08-22 23:07                                     ` Dave Airlie
2005-08-22 23:40                                       ` Linus Torvalds
2005-08-23 15:33                                         ` Alan Cox
2005-08-24  6:04                                         ` Linus Torvalds
2005-08-24  8:37                                           ` Helge Hafting
2005-09-08 23:47               ` rc6 keeps hanging and blanking displays where rc4-mm1 works fine Andrew Morton
2005-09-09  0:16                 ` Linus Torvalds
2005-08-17 11:26       ` rc5 seemed to kill a disk that rc4-mm1 likes. Also some X trouble Rolf Eike Beer
2005-08-22  8:01         ` Rolf Eike Beer
2005-08-22 17:44           ` Linus Torvalds
2005-08-22 17:45             ` Linus Torvalds
2005-08-22 21:01             ` Benjamin Herrenschmidt
2005-08-23  6:48             ` Rolf Eike Beer
2005-08-30  8:07             ` Rolf Eike Beer
2005-09-05  7:49               ` Rolf Eike Beer
2005-09-05  8:45                 ` Linus Torvalds
2005-09-05 19:58                   ` Sonny Rao
2005-09-06  7:44                     ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050815170016.GH7001@mythryan2.michonline.com \
    --to=ryan@michonline.com \
    --cc=airlied@gmail.com \
    --cc=akpm@osdl.org \
    --cc=helge.hafting@aitel.hist.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®