2014-07-09 13:00:04

by Russell King - ARM Linux

[permalink] [raw]
Subject: v3.16-rc4 messes up make kernelrelease with additional output

3.16-rc3 and all previous versions:

$ make ARCH=arm CROSS_COMPILE=arm-linux- O=/tmp/build/ kernelrelease
3.16.0-rc3+
$

3.16-rc4:

$ make ARCH=arm CROSS_COMPILE=arm-linux- O=/tmp/build/ kernelrelease
make[1]: Entering directory `/tmp/build'
3.16.0-rc4+
$

There are tools which expect kernelrelease to only produce a single
line. I believe c2e28dc975e (kbuild: Print the name of the build
directory) is probably responsible as this line appears on stdout.

This screws up scripts which do:

open FH, "$build_cmd kernelrelease $O |" or die $!;
my $kernelrelease = <FH>;
close FH;
chomp($kernelrelease);

or

version=$(make O=$o kernelrelease)

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.


2014-07-09 13:15:35

by Michal Marek

[permalink] [raw]
Subject: Re: v3.16-rc4 messes up make kernelrelease with additional output

On 2014-07-09 14:59, Russell King - ARM Linux wrote:
> 3.16-rc3 and all previous versions:
>
> $ make ARCH=arm CROSS_COMPILE=arm-linux- O=/tmp/build/ kernelrelease
> 3.16.0-rc3+
> $
>
> 3.16-rc4:
>
> $ make ARCH=arm CROSS_COMPILE=arm-linux- O=/tmp/build/ kernelrelease
> make[1]: Entering directory `/tmp/build'
> 3.16.0-rc4+
> $

This is fixed by commit 066b7ed9 in linux-next, which I'll send to Linus
shortly. But you should use make -s ... kernelrelease, otherwise the
output will be polluted not only by the "Entering directory" message,
but possibly also by a silentoldconfig run.

Michal

2014-07-09 13:20:53

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: v3.16-rc4 messes up make kernelrelease with additional output

On Wed, Jul 09, 2014 at 03:15:32PM +0200, Michal Marek wrote:
> On 2014-07-09 14:59, Russell King - ARM Linux wrote:
> > 3.16-rc3 and all previous versions:
> >
> > $ make ARCH=arm CROSS_COMPILE=arm-linux- O=/tmp/build/ kernelrelease
> > 3.16.0-rc3+
> > $
> >
> > 3.16-rc4:
> >
> > $ make ARCH=arm CROSS_COMPILE=arm-linux- O=/tmp/build/ kernelrelease
> > make[1]: Entering directory `/tmp/build'
> > 3.16.0-rc4+
> > $
>
> This is fixed by commit 066b7ed9 in linux-next, which I'll send to Linus
> shortly. But you should use make -s ... kernelrelease, otherwise the
> output will be polluted not only by the "Entering directory" message,
> but possibly also by a silentoldconfig run.

Since my scripts run a full build before doing that, it's very unlikely
that there would be a silentoldconfig run. The -s requirement isn't
documented in the help - should it be?

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

2014-07-09 13:36:50

by Michal Marek

[permalink] [raw]
Subject: Re: v3.16-rc4 messes up make kernelrelease with additional output

On 2014-07-09 15:20, Russell King - ARM Linux wrote:
> Since my scripts run a full build before doing that, it's very unlikely
> that there would be a silentoldconfig run. The -s requirement isn't
> documented in the help - should it be?

It should probably be.

Michal

2014-07-11 14:13:51

by Michal Marek

[permalink] [raw]
Subject: [PATCH] kbuild: make -s should be used with kernelrelease/kernelversion/image_name

If .config has been edited, there will be a silentoldconfig run:

$ make defconfig
...
$ make kernelrelease
scripts/kconfig/conf --silentoldconfig Kconfig
3.16.0-rc1+

Recently, kbuild started to print the name of the build directory when
using O=

$ make O=build kernelrelease
make[1]: Entering directory `/dev/shm/mmarek/linux-2.6/build'
3.16.0-rc1+

Since these targets are often used in scripts, add a hint to use make -s
to the help text.

Suggested-by: Russell King <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 97b2861..284071c 100644
--- a/Makefile
+++ b/Makefile
@@ -1214,9 +1214,9 @@ help:
@echo ' tags/TAGS - Generate tags file for editors'
@echo ' cscope - Generate cscope index'
@echo ' gtags - Generate GNU GLOBAL index'
- @echo ' kernelrelease - Output the release version string'
- @echo ' kernelversion - Output the version stored in Makefile'
- @echo ' image_name - Output the image name'
+ @echo ' kernelrelease - Output the release version string (use with make -s)'
+ @echo ' kernelversion - Output the version stored in Makefile (use with make -s)'
+ @echo ' image_name - Output the image name (use with make -s)'
@echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
echo ' (default: $(INSTALL_HDR_PATH))'; \
echo ''
--
1.8.4.5