diff mbox

firmware: Create directories for external firmware

Message ID 1404823639-6496-1-git-send-email-mmarek@suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Marek July 8, 2014, 12:47 p.m. UTC
Commit 5180d5f4 ("firmware: Simplify directory creation") broke
including firmware specified in CONFIG_EXTRA_FIRMWARE:

  MK_FW   firmware/amd-ucode/microcode_amd.bin.gen.S
/bin/sh: firmware/amd-ucode/microcode_amd.bin.gen.S: No such file or directory
...
firmware/Makefile:185: recipe for target
'firmware/amd-ucode/microcode_amd.bin.gen.S' failed

It works with O= builds, because the directory is created by
Makefile.build. Create the directory in firmware/Makefile in non-O
builds.

Reported-by: Ronald <ronald645@gmail.com>
Reported-by: Torsten Kaiser <just.for.lkml@googlemail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---

Can you try this patch?

Ronald, can you tell me your full name for the Reported-by: line?

Thanks.
---

 firmware/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ronald July 8, 2014, 3:19 p.m. UTC | #1
2014-07-08 17:18 GMT+02:00 Ronald <ronald645@gmail.com>:
> My full name is 'Ronald Uitermark'.
>
> I will try this patch tonight.
>
>
> 2014-07-08 14:47 GMT+02:00 Michal Marek <mmarek@suse.cz>:
>
>> Commit 5180d5f4 ("firmware: Simplify directory creation") broke
>> including firmware specified in CONFIG_EXTRA_FIRMWARE:
>>
>>   MK_FW   firmware/amd-ucode/microcode_amd.bin.gen.S
>> /bin/sh: firmware/amd-ucode/microcode_amd.bin.gen.S: No such file or
>> directory
>> ...
>> firmware/Makefile:185: recipe for target
>> 'firmware/amd-ucode/microcode_amd.bin.gen.S' failed
>>
>> It works with O= builds, because the directory is created by
>> Makefile.build. Create the directory in firmware/Makefile in non-O
>> builds.
>>
>> Reported-by: Ronald <ronald645@gmail.com>
>> Reported-by: Torsten Kaiser <just.for.lkml@googlemail.com>
>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>> ---
>>
>> Can you try this patch?
>>
>> Ronald, can you tell me your full name for the Reported-by: line?
>>
>> Thanks.
>> ---
>>
>>  firmware/Makefile | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/firmware/Makefile b/firmware/Makefile
>> index 5747417..0862d34 100644
>> --- a/firmware/Makefile
>> +++ b/firmware/Makefile
>> @@ -219,6 +219,12 @@ $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep)
>>  obj-y                           += $(patsubst %,%.gen.o,
>> $(fw-external-y))
>>  obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o,
>> $(fw-shipped-y))
>>
>> +ifeq ($(KBUILD_SRC),)
>> +# Makefile.build only creates subdirectories for O= builds, but external
>> +# firmware might live outside the kernel source tree
>> +_dummy := $(foreach d,$(addprefix $(obj)/,$(dir $(fw-external-y))),
>> $(shell [ -d $(d) ] || mkdir -p $(d)))
>> +endif
>> +
>>  # Remove .S files and binaries created from ihex
>>  # (during 'make clean' .config isn't included so they're all in
>> $(fw-shipped-))
>>  targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
>> --
>> 1.8.4.5
>>
>

(resend for flat text mode, sorry for the dupe which included top posting)

My full name is 'Ronald Uitermark'.

I will try this patch tonight.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ronald July 8, 2014, 4:29 p.m. UTC | #2
>> 2014-07-08 14:47 GMT+02:00 Michal Marek <mmarek@suse.cz>:
>>
>>> Commit 5180d5f4 ("firmware: Simplify directory creation") broke
>>> including firmware specified in CONFIG_EXTRA_FIRMWARE:
>>>
>>>   MK_FW   firmware/amd-ucode/microcode_amd.bin.gen.S
>>> /bin/sh: firmware/amd-ucode/microcode_amd.bin.gen.S: No such file or
>>> directory
>>> ...
>>> firmware/Makefile:185: recipe for target
>>> 'firmware/amd-ucode/microcode_amd.bin.gen.S' failed
>>>
>>> It works with O= builds, because the directory is created by
>>> Makefile.build. Create the directory in firmware/Makefile in non-O
>>> builds.
>>>
>>> Reported-by: Ronald <ronald645@gmail.com>
>>> Reported-by: Torsten Kaiser <just.for.lkml@googlemail.com>
>>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>>> ---
>>>
>>> Can you try this patch?
>>>
>>> Ronald, can you tell me your full name for the Reported-by: line?
>>>
>>> Thanks.
>>> ---
>>>
>>>  firmware/Makefile | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/firmware/Makefile b/firmware/Makefile
>>> index 5747417..0862d34 100644
>>> --- a/firmware/Makefile
>>> +++ b/firmware/Makefile
>>> @@ -219,6 +219,12 @@ $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep)
>>>  obj-y                           += $(patsubst %,%.gen.o,
>>> $(fw-external-y))
>>>  obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o,
>>> $(fw-shipped-y))
>>>
>>> +ifeq ($(KBUILD_SRC),)
>>> +# Makefile.build only creates subdirectories for O= builds, but external
>>> +# firmware might live outside the kernel source tree
>>> +_dummy := $(foreach d,$(addprefix $(obj)/,$(dir $(fw-external-y))),
>>> $(shell [ -d $(d) ] || mkdir -p $(d)))
>>> +endif
>>> +
>>>  # Remove .S files and binaries created from ihex
>>>  # (during 'make clean' .config isn't included so they're all in
>>> $(fw-shipped-))
>>>  targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
>>> --
>>> 1.8.4.5

I can confirm that this patch on top of current HEAD fixes the issue.
Thanks a ton!
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Torsten Kaiser July 8, 2014, 6:03 p.m. UTC | #3
On Tue, Jul 8, 2014 at 2:47 PM, Michal Marek <mmarek@suse.cz> wrote:
> Commit 5180d5f4 ("firmware: Simplify directory creation") broke
> including firmware specified in CONFIG_EXTRA_FIRMWARE:
>
>   MK_FW   firmware/amd-ucode/microcode_amd.bin.gen.S
> /bin/sh: firmware/amd-ucode/microcode_amd.bin.gen.S: No such file or directory
> ...
> firmware/Makefile:185: recipe for target
> 'firmware/amd-ucode/microcode_amd.bin.gen.S' failed
>
> It works with O= builds, because the directory is created by
> Makefile.build. Create the directory in firmware/Makefile in non-O
> builds.
>
> Reported-by: Ronald <ronald645@gmail.com>
> Reported-by: Torsten Kaiser <just.for.lkml@googlemail.com>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
>
> Can you try this patch?

Works fine for me.

Thanks for the quick patch!

Torsten

> Ronald, can you tell me your full name for the Reported-by: line?
>
> Thanks.
> ---
>
>  firmware/Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/firmware/Makefile b/firmware/Makefile
> index 5747417..0862d34 100644
> --- a/firmware/Makefile
> +++ b/firmware/Makefile
> @@ -219,6 +219,12 @@ $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep)
>  obj-y                           += $(patsubst %,%.gen.o, $(fw-external-y))
>  obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y))
>
> +ifeq ($(KBUILD_SRC),)
> +# Makefile.build only creates subdirectories for O= builds, but external
> +# firmware might live outside the kernel source tree
> +_dummy := $(foreach d,$(addprefix $(obj)/,$(dir $(fw-external-y))), $(shell [ -d $(d) ] || mkdir -p $(d)))
> +endif
> +
>  # Remove .S files and binaries created from ihex
>  # (during 'make clean' .config isn't included so they're all in $(fw-shipped-))
>  targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
> --
> 1.8.4.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/firmware/Makefile b/firmware/Makefile
index 5747417..0862d34 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -219,6 +219,12 @@  $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep)
 obj-y				 += $(patsubst %,%.gen.o, $(fw-external-y))
 obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y))
 
+ifeq ($(KBUILD_SRC),)
+# Makefile.build only creates subdirectories for O= builds, but external
+# firmware might live outside the kernel source tree
+_dummy := $(foreach d,$(addprefix $(obj)/,$(dir $(fw-external-y))), $(shell [ -d $(d) ] || mkdir -p $(d)))
+endif
+
 # Remove .S files and binaries created from ihex
 # (during 'make clean' .config isn't included so they're all in $(fw-shipped-))
 targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \