<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/scripts/setlocalversion, branch v4.9.272</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.272</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.272'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-11-10T09:23:50Z</updated>
<entry>
<title>scripts/setlocalversion: make git describe output more reliable</title>
<updated>2020-11-10T09:23:50Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2020-09-17T06:56:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=861c5ce033f3baea5512fa2aa0b787a30ffbbace'/>
<id>urn:sha1:861c5ce033f3baea5512fa2aa0b787a30ffbbace</id>
<content type='text'>
commit 548b8b5168c90c42e88f70fcf041b4ce0b8e7aa8 upstream.

When building for an embedded target using Yocto, we're sometimes
observing that the version string that gets built into vmlinux (and
thus what uname -a reports) differs from the path under /lib/modules/
where modules get installed in the rootfs, but only in the length of
the -gabc123def suffix. Hence modprobe always fails.

The problem is that Yocto has the concept of "sstate" (shared state),
which allows different developers/buildbots/etc. to share build
artifacts, based on a hash of all the metadata that went into building
that artifact - and that metadata includes all dependencies (e.g. the
compiler used etc.). That normally works quite well; usually a clean
build (without using any sstate cache) done by one developer ends up
being binary identical to a build done on another host. However, one
thing that can cause two developers to end up with different builds
[and thus make one's vmlinux package incompatible with the other's
kernel-dev package], which is not captured by the metadata hashing, is
this `git describe`: The output of that can be affected by

(1) git version: before 2.11 git defaulted to a minimum of 7, since
2.11 (git.git commit e6c587) the default is dynamic based on the
number of objects in the repo
(2) hence even if both run the same git version, the output can differ
based on how many remotes are being tracked (or just lots of local
development branches or plain old garbage)
(3) and of course somebody could have a core.abbrev config setting in
~/.gitconfig

So in order to avoid `uname -a` output relying on such random details
of the build environment which are rather hard to ensure are
consistent between developers and buildbots, make sure the abbreviated
sha1 always consists of exactly 12 hex characters. That is consistent
with the current rule for -stable patches, and is almost always enough
to identify the head commit unambigously - in the few cases where it
does not, the v5.4.3-00021- prefix would certainly nail it down.

[Adapt to `` vs $() differences between 5.4 and upstream.]
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks</title>
<updated>2019-11-06T11:18:03Z</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2018-11-15T02:11:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=514e04a933382b6ce5b14abf49b973427bdb99bd'/>
<id>urn:sha1:514e04a933382b6ce5b14abf49b973427bdb99bd</id>
<content type='text'>
[ Upstream commit ff64dd4857303dd5550faed9fd598ac90f0f2238 ]

git-diff-index does not refresh the index for you, so using it for a
"-dirty" check can give misleading results. Commit 6147b1cf19651
("scripts/setlocalversion: git: Make -dirty check more robust") tried to
fix this by switching to git-status, but it overlooked the fact that
git-status also writes to the .git directory of the source tree, which
is definitely not kosher for an out-of-tree (O=) build. That is getting
reverted.

Fortunately, git-status now supports avoiding writing to the index via
the --no-optional-locks flag, as of git 2.14. It still calculates an
up-to-date index, but it avoids writing it out to the .git directory.

So, let's retry the solution from commit 6147b1cf19651 using this new
flag first, and if it fails, we assume this is an older version of git
and just use the old git-diff-index method.

It's hairy to get the 'grep -vq' (inverted matching) correct by stashing
the output of git-status (you have to be careful about the difference
betwen "empty stdin" and "blank line on stdin"), so just pipe the output
directly to grep and use a regex that's good enough for both the
git-status and git-diff-index version.

Cc: Christian Kujau &lt;lists@nerdbynature.de&gt;
Cc: Guenter Roeck &lt;linux@roeck-us.net&gt;
Suggested-by: Alexander Kapshuk &lt;alexander.kapshuk@gmail.com&gt;
Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Tested-by: Genki Sky &lt;sky@genki.is&gt;
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>kbuild: setlocalversion: print error to STDERR</title>
<updated>2016-06-20T15:37:45Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-06-06T19:00:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=78283edf2c01c38eb840a3de5ffd18fe2992ab64'/>
<id>urn:sha1:78283edf2c01c38eb840a3de5ffd18fe2992ab64</id>
<content type='text'>
I tried to use 'make O=...' from an unclean source tree. This triggered
the error path of setlocalversion. But by printing to STDOUT, it created
a broken localversion which then caused another (unrelated) error:

"4.7.0-rc2Error: kernelrelease not valid - run make prepare to update it" exceeds 64 characters

After printing to STDERR, the true build error gets displayed later:

  /home/wsa/Kernel/linux is not clean, please run 'make mrproper'
  in the '/home/wsa/Kernel/linux' directory.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
</entry>
<entry>
<title>Fix detectition of kernel git repository in setlocalversion script [take #2]</title>
<updated>2014-01-03T13:48:42Z</updated>
<author>
<name>Franck Bui-Huu</name>
<email>fbuihuu@gmail.com</email>
</author>
<published>2013-12-02T15:34:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7593e0902bc41392315316f1b5f4ba15feead842'/>
<id>urn:sha1:7593e0902bc41392315316f1b5f4ba15feead842</id>
<content type='text'>
setlocalversion script was testing the presence of .git directory in
order to find out if git is used as SCM to track the current kernel
project. However in some cases, .git is not a directory but can be a
file: when the kernel is a git submodule part of a git super project for
example.

This patch just fixes this by using 'git rev-parse --show-cdup' to check
that the current directory is the kernel git topdir. This has the
advantage to not test and rely on git internal infrastructure directly.

Signed-off-by: Franck Bui-Huu &lt;fbuihuu@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>scripts/setlocalversion on write-protected source tree</title>
<updated>2013-06-23T22:08:01Z</updated>
<author>
<name>Christian Kujau</name>
<email>lists@nerdbynature.de</email>
</author>
<published>2013-06-15T01:04:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cdf2bc632ebc9ef512345fe8e6015edfd367e256'/>
<id>urn:sha1:cdf2bc632ebc9ef512345fe8e6015edfd367e256</id>
<content type='text'>
I just stumbled across another[0] issue when scripts/setlocalversion
operates on a write-protected source tree. Back then[0] the source tree
was on an read-only NFS share, so "test -w" was introduced before "git
update-index" was run.

This time, the source tree is on read/write NFS share, but the permissions
are world-readable and only a specific user (or root) can write.
Thus, "test -w ." returns "0" and then runs "git update-index",
producing the following message (on a dirty tree):

  fatal: Unable to create '/usr/local/src/linux-git/.git/index.lock': Permission denied

While it says "fatal", compilation continues just fine.

However, I don't think a kernel compilation should alter the source
tree (or the .git directory) in any way and I don't see how removing
"git update-index" could do any harm. The Mercurial and SVN routines in
scripts/setlocalversion don't have any tree-modifying commands, AFAICS.
So, maybe the patch below would be acceptable.

[0] https://patchwork.kernel.org/patch/29718/

Signed-off-by: Christian Kujau &lt;lists@nerdbynature.de&gt;
Cc: Nico Schottelius &lt;nico-linuxsetlocalversion@schottelius.org&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>kbuild: Unset language specific variables in setlocalversion script</title>
<updated>2013-02-22T13:18:30Z</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@c-s.fr</email>
</author>
<published>2013-02-22T08:59:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f893bfb61531548eeaff432e8d10758e86e788a7'/>
<id>urn:sha1:f893bfb61531548eeaff432e8d10758e86e788a7</id>
<content type='text'>
This patch allows the use of setlocalversion script regardless of the language
parameters. Otherwise, the `svn info 2&gt;/dev/null | grep '^Last Changed Rev'`
returns nothing because for instance, in French the text 'Last Changed Rev'
is replaced by 'Révision de la dernière modification'

Signed-off-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>setlocalversion: Use "grep -q" instead of piping output to "read dummy"</title>
<updated>2012-03-26T20:54:00Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-03-23T16:42:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7f3bd6c9cb8e9fa2b57bfa860cd3e734a28f48ed'/>
<id>urn:sha1:7f3bd6c9cb8e9fa2b57bfa860cd3e734a28f48ed</id>
<content type='text'>
In some circumstances (eg when running a build in an emacs shell
buffer), I get a spew of messages like

    grep: writing output: Broken pipe

from setlocalversion, because the "read" subshell apparently exits as
soon as it reads one line and gives EPIPE to grep.  It's not clear to
me why this way of writing the check was used instead of just using
grep -q to suppress output, but unless there is some deep reason I
don't know, this way looks cleaner to me anyway, and gets rid of the
ugly message spew.

(I double checked at http://pubs.opengroup.org/onlinepubs/009604499/utilities/grep.html
and "grep -q" is specified in POSIX / SuS, so hopefully even people
cross-compiling the kernel on some bizarre host OS can't complain
about this change)

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>setlocalversion: update mercurial tag parsing</title>
<updated>2011-01-14T23:40:44Z</updated>
<author>
<name>Mike Crowe</name>
<email>mcrowe@zipitwireless.com</email>
</author>
<published>2011-01-12T05:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=38b3439d84f4a310bd29e3dbc21dffe9119ef157'/>
<id>urn:sha1:38b3439d84f4a310bd29e3dbc21dffe9119ef157</id>
<content type='text'>
The tag output of hg doesn't quite match what setlocalversion currently
expects, so update it to handle the latest format.

Signed-off-by: Mike Crowe &lt;mcrowe@zipitwireless.com&gt;
Signed-off-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6</title>
<updated>2010-10-28T22:13:55Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-10-28T22:13:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c9e2a72ff1acfdffdecb338b3d997f90c507e665'/>
<id>urn:sha1:c9e2a72ff1acfdffdecb338b3d997f90c507e665</id>
<content type='text'>
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  initramfs: Fix build break on symbol-prefixed archs
  initramfs: fix initramfs size calculation
  initramfs: generalize initramfs_data.xxx.S variants
  scripts/kallsyms: Enable error messages while hush up unnecessary warnings
  scripts/setlocalversion: update comment
  kbuild: Use a single clean rule for kernel and external modules
  kbuild: Do not run make clean in $(srctree)
  scripts/mod/modpost.c: fix commentary accordingly to last changes
  kbuild: Really don't clean bounds.h and asm-offsets.h
</content>
</entry>
<entry>
<title>scripts/setlocalversion: update comment</title>
<updated>2010-09-06T11:26:30Z</updated>
<author>
<name>Michael Prokop</name>
<email>mika@grml.org</email>
</author>
<published>2010-09-06T09:57:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c3e2f196f9862cd75cb7f495a3cd1f1bbb82bb40'/>
<id>urn:sha1:c3e2f196f9862cd75cb7f495a3cd1f1bbb82bb40</id>
<content type='text'>
A tagged repository state isn't enough, git describe only
looks at signed or annotated tags (git tag -a/-s). This
documentation update makes sure the comment matches the
current behaviour.

Signed-off-by: Michael Prokop &lt;mika@grml.org&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
</feed>
