All of lore.kernel.org
 help / color / mirror / Atom feed
* kbuild: global makefile and spaces in path
@ 2015-12-21 20:49 Robert Jarzmik
  2016-01-06 14:48 ` Michal Marek
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Jarzmik @ 2015-12-21 20:49 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

Hi Michal,

I compiled my kernel in a directory /home/robert jarzmik/kernel, and that's the
first time I encountered a space in the path containing my kernel in years.

I was wondering if there is a known constraint that the linux kernel source
should be contained within a path without any space ?

If no such constraint is known, maybe you could consider the patch in [1].

Cheers.

-- 
Robert

---8>---
From a8af33224ad536cc3137297e4a7617ee1031efb7 Mon Sep 17 00:00:00 2001
From: Robert Jarzmik <robert.jarzmik@free.fr>
Date: Mon, 21 Dec 2015 21:42:42 +0100
Subject: [PATCH] kbuild: fix modules_install with spaces in kernel path

When the kernel path contains a space somewhere in the path name, the
modules_install target doesn't work anymore, as the path names are not
enclosed in double quotes.

This patch fixes the modules_install target.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 Makefile | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 7ce5c5a76c0b..45ec34644b4f 100644
--- a/Makefile
+++ b/Makefile
@@ -1119,16 +1119,16 @@ modules_install: _modinst_ _modinst_post
 
 PHONY += _modinst_
 _modinst_:
-	@rm -rf $(MODLIB)/kernel
-	@rm -f $(MODLIB)/source
-	@mkdir -p $(MODLIB)/kernel
-	@ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source
-	@if [ ! $(objtree) -ef  $(MODLIB)/build ]; then \
-		rm -f $(MODLIB)/build ; \
-		ln -s $(CURDIR) $(MODLIB)/build ; \
+	@rm -rf "$(MODLIB)"/kernel
+	@rm -f "$(MODLIB)"/source
+	@mkdir -p "$(MODLIB)"/kernel
+	@ln -s "`cd $(srctree) && /bin/pwd`" "$(MODLIB)"/source
+	@if [ ! "$(objtree)" -ef  "$(MODLIB)"/build ]; then \
+		rm -f "$(MODLIB)"/build ; \
+		ln -s "$(CURDIR)" "$(MODLIB)"/build ; \
 	fi
-	@cp -f $(objtree)/modules.order $(MODLIB)/
-	@cp -f $(objtree)/modules.builtin $(MODLIB)/
+	@cp -f $(objtree)/modules.order "$(MODLIB)"/
+	@cp -f $(objtree)/modules.builtin "$(MODLIB)"/
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
 
 # This depmod is only for convenience to give the initial
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: kbuild: global makefile and spaces in path
  2015-12-21 20:49 kbuild: global makefile and spaces in path Robert Jarzmik
@ 2016-01-06 14:48 ` Michal Marek
  2016-01-07 21:53   ` Robert Jarzmik
  0 siblings, 1 reply; 6+ messages in thread
From: Michal Marek @ 2016-01-06 14:48 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: linux-kbuild

On 2015-12-21 21:49, Robert Jarzmik wrote:
> Hi Michal,
> 
> I compiled my kernel in a directory /home/robert jarzmik/kernel, and that's the
> first time I encountered a space in the path containing my kernel in years.
> 
> I was wondering if there is a known constraint that the linux kernel source
> should be contained within a path without any space ?

Whitespace and colons are problematic.


> If no such constraint is known, maybe you could consider the patch in [1].

I expect it is going to break in lot more places, especially if you do
an O= build. I think it's better to just check for this and error out early.

Michal

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kbuild: global makefile and spaces in path
  2016-01-06 14:48 ` Michal Marek
@ 2016-01-07 21:53   ` Robert Jarzmik
  2016-02-05 21:30     ` Robert Jarzmik
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Jarzmik @ 2016-01-07 21:53 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

Michal Marek <mmarek@suse.com> writes:

> On 2015-12-21 21:49, Robert Jarzmik wrote:
>> Hi Michal,
>> 
>> I compiled my kernel in a directory /home/robert jarzmik/kernel, and that's the
>> first time I encountered a space in the path containing my kernel in years.
>> 
>> I was wondering if there is a known constraint that the linux kernel source
>> should be contained within a path without any space ?
> Whitespace and colons are problematic.
Ok.

>> If no such constraint is known, maybe you could consider the patch in [1].
> I expect it is going to break in lot more places, especially if you do
> an O= build. I think it's better to just check for this and error out early.
Ok, I'll try to do that. Let's see if the patch at the end of this mail is what
you're expecting.

Cheers.

-- 
Robert

---8<---
From 68bcedba135cc50254a234a949ed5cd3b4e92b7a Mon Sep 17 00:00:00 2001
From: Robert Jarzmik <robert.jarzmik@free.fr>
Date: Thu, 7 Jan 2016 22:39:51 +0100
Subject: [PATCH] kbuild: forbid kernel directory to contain spaces

When the kernel path contains a space 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 spaces, 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>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 45ec34644b4f..72e9b7371b0d 100644
--- a/Makefile
+++ b/Makefile
@@ -128,6 +128,10 @@ _all:
 # Cancel implicit rules on top Makefile
 $(CURDIR)/Makefile Makefile: ;
 
+ifneq ($(words $(CURDIR)),1)
+  $(error main directory cannot contain spaces)
+endif
+
 ifneq ($(KBUILD_OUTPUT),)
 # Invoke a second make in the output directory, passing relevant variables
 # check that the output directory actually exists
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: kbuild: global makefile and spaces in path
  2016-01-07 21:53   ` Robert Jarzmik
@ 2016-02-05 21:30     ` Robert Jarzmik
  2016-02-08 20:03       ` Michal Marek
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Jarzmik @ 2016-02-05 21:30 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

Robert Jarzmik <robert.jarzmik@free.fr> writes:

> Michal Marek <mmarek@suse.com> writes:
>
>> On 2015-12-21 21:49, Robert Jarzmik wrote:
>>> Hi Michal,
>>> 
>>> I compiled my kernel in a directory /home/robert jarzmik/kernel, and that's the
>>> first time I encountered a space in the path containing my kernel in years.
>>> 
>>> I was wondering if there is a known constraint that the linux kernel source
>>> should be contained within a path without any space ?
>> Whitespace and colons are problematic.
> Ok.
>
>>> If no such constraint is known, maybe you could consider the patch in [1].
>> I expect it is going to break in lot more places, especially if you do
>> an O= build. I think it's better to just check for this and error out early.
> Ok, I'll try to do that. Let's see if the patch at the end of this mail is what
> you're expecting.
>
> Cheers.
>
> -- 
> Robert
>
> ---8<---
> From 68bcedba135cc50254a234a949ed5cd3b4e92b7a Mon Sep 17 00:00:00 2001
> From: Robert Jarzmik <robert.jarzmik@free.fr>
> Date: Thu, 7 Jan 2016 22:39:51 +0100
> Subject: [PATCH] kbuild: forbid kernel directory to contain spaces
>
> When the kernel path contains a space 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 spaces, 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>
> ---
>  Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 45ec34644b4f..72e9b7371b0d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -128,6 +128,10 @@ _all:
>  # Cancel implicit rules on top Makefile
>  $(CURDIR)/Makefile Makefile: ;
>  
> +ifneq ($(words $(CURDIR)),1)
> +  $(error main directory cannot contain spaces)
> +endif
> +
>  ifneq ($(KBUILD_OUTPUT),)
>  # Invoke a second make in the output directory, passing relevant variables
>  # check that the output directory actually exists

Hi Michal,

Have you had the time to look at the patch above ?

Cheers.

-- 
Robert

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kbuild: global makefile and spaces in path
  2016-02-05 21:30     ` Robert Jarzmik
@ 2016-02-08 20:03       ` Michal Marek
  2016-02-08 20:10         ` Robert Jarzmik
  0 siblings, 1 reply; 6+ messages in thread
From: Michal Marek @ 2016-02-08 20:03 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: linux-kbuild

Dne 5.2.2016 v 22:30 Robert Jarzmik napsal(a):
> Robert Jarzmik <robert.jarzmik@free.fr> writes:
> 
>> Michal Marek <mmarek@suse.com> writes:
>>
>>> On 2015-12-21 21:49, Robert Jarzmik wrote:
>>>> Hi Michal,
>>>>
>>>> I compiled my kernel in a directory /home/robert jarzmik/kernel, and that's the
>>>> first time I encountered a space in the path containing my kernel in years.
>>>>
>>>> I was wondering if there is a known constraint that the linux kernel source
>>>> should be contained within a path without any space ?
>>> Whitespace and colons are problematic.
>> Ok.
>>
>>>> If no such constraint is known, maybe you could consider the patch in [1].
>>> I expect it is going to break in lot more places, especially if you do
>>> an O= build. I think it's better to just check for this and error out early.
>> Ok, I'll try to do that. Let's see if the patch at the end of this mail is what
>> you're expecting.
>>
>> Cheers.
>>
>> -- 
>> Robert
>>
>> ---8<---
>> From 68bcedba135cc50254a234a949ed5cd3b4e92b7a Mon Sep 17 00:00:00 2001
>> From: Robert Jarzmik <robert.jarzmik@free.fr>
>> Date: Thu, 7 Jan 2016 22:39:51 +0100
>> Subject: [PATCH] kbuild: forbid kernel directory to contain spaces
>>
>> When the kernel path contains a space 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 spaces, 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>
>> ---
>>  Makefile | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/Makefile b/Makefile
>> index 45ec34644b4f..72e9b7371b0d 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -128,6 +128,10 @@ _all:
>>  # Cancel implicit rules on top Makefile
>>  $(CURDIR)/Makefile Makefile: ;
>>  
>> +ifneq ($(words $(CURDIR)),1)
>> +  $(error main directory cannot contain spaces)
>> +endif
>> +
>>  ifneq ($(KBUILD_OUTPUT),)
>>  # Invoke a second make in the output directory, passing relevant variables
>>  # check that the output directory actually exists
> 
> Hi Michal,
> 
> Have you had the time to look at the patch above ?

Hi Robert,

sorry for the delay. We should also check for colons in path, because
they break the build in a similar way.

Michal


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kbuild: global makefile and spaces in path
  2016-02-08 20:03       ` Michal Marek
@ 2016-02-08 20:10         ` Robert Jarzmik
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Jarzmik @ 2016-02-08 20:10 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

Michal Marek <mmarek@suse.com> writes:

>
> Hi Robert,
>
> sorry for the delay. We should also check for colons in path, because
> they break the build in a similar way.
Okay, no problem, I'm on it.

Cheers.

-- 
Robert

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-08 20:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-21 20:49 kbuild: global makefile and spaces in path Robert Jarzmik
2016-01-06 14:48 ` Michal Marek
2016-01-07 21:53   ` Robert Jarzmik
2016-02-05 21:30     ` Robert Jarzmik
2016-02-08 20:03       ` Michal Marek
2016-02-08 20:10         ` Robert Jarzmik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.