Skip to contentSkip to conversation

v3.16-rc4 messes up make kernelrelease with additional output

PATCH New Russell King - ARM Linux 2 participants 5 messages Jul 9, 2014 – Jul 11, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

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)
Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
#1 lore raw
Quoted 6 lines · Russell King - ARM Linux

3.16-rc3 and all previous versions:

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

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

#2 lore raw
Quoted 14 lines · Michal Marek
Quoted 6 lines · Russell King - ARM Linux

3.16-rc3 and all previous versions:

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

3.16-rc4:

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

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?

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
#3 lore raw
Quoted 3 lines · Russell King - ARM Linux

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

#4 lore raw

PATCH 1/1 kbuild: make -s should be used with kernelrelease/kernelversion/image_name

In reply to Russell King - ARM Linux

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.

---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -3
index 97b2861..284071c 100644
@@ -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  ''
Signature · 1 line
1.8.4.5