[PATCH] scripts/setlocalversion on readonly source

From: Christian Kujau
Date: Tue Jun 09 2009 - 16:30:57 EST


Hi,

I'm building kernels with O=/some/dir and at some point
scripts/setlocalversion is being called, doing:

+ git update-index --refresh --unmerged
fatal: Unable to create '.git/index.lock': Read-only file system

Not only does it throw this error but it takes quite a long time to run,
only to fail anyway because the kernel source dir is located on a
read-only NFS mount.

The following patch makes the error go away:

--- linux-2.6-git/scripts/setlocalversion 2009-05-29 07:14:34.746191990 +0200
+++ /home/dummy/tmp/scripts/setlocalversion.edited 2009-06-09 22:20:29.000000000 +0200
@@ -39,8 +39,8 @@
printf -- '-svn%s' "`git svn find-rev $head`"
fi

- # Are there uncommitted changes?
- git update-index --refresh --unmerged > /dev/null
+ # Are there uncommitted changes? (and can we update the repo?)
+ touch . 2>/dev/null && git update-index --refresh --unmerged > /dev/null
if git diff-index --name-only HEAD | grep -v "^scripts/package" \
| read dummy; then
printf '%s' -dirty


Thanks,
Christian.
--
BOFH excuse #426:

internet is needed to catch the etherbunny
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/