kbuild: forbid kernel directory to contain spaces and colons
authorRobert Jarzmik <robert.jarzmik@free.fr>
Sat, 2 Apr 2016 19:38:53 +0000 (21:38 +0200)
committerMichal Marek <mmarek@suse.com>
Tue, 10 May 2016 14:55:59 +0000 (16:55 +0200)
When the kernel path contains a space or a colon somewhere in the path
name, the modules_install target doesn't work anymore, as the path names
are not enclosed in double quotes. It is also supposed that and O= build
will suffer from the same weakness as modules_install.

Instead of checking and improving kbuild to resist to directories
including these characters, error out early to prevent any build if the
kernel's main directory contains a space.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Makefile

index 5806729cef64e37b4676c1f78e3425661d1590a7..26500ffc5eabeb08a219a3ed52495a0ae8776efd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -128,6 +128,10 @@ _all:
 # Cancel implicit rules on top Makefile
 $(CURDIR)/Makefile Makefile: ;
 
+ifneq ($(words $(subst :, ,$(CURDIR))), 1)
+  $(error main directory cannot contain spaces nor colons)
+endif
+
 ifneq ($(KBUILD_OUTPUT),)
 # Invoke a second make in the output directory, passing relevant variables
 # check that the output directory actually exists
This page took 0.026145 seconds and 5 git commands to generate.