Bug 39192

Summary: [PATCH]firmware_install fails with parallel make
Product: Other Reporter: Ambroz Bizjak (ambrop7)
Component: OtherAssignee: other_other
Status: CLOSED CODE_FIX    
Severity: normal CC: alan, djpohly+kernel, florian, gabrbedd, maciej.rutecki, mmarek, rdunlap, rjw, szg00000
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.3 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 36912    

Description Ambroz Bizjak 2011-07-12 09:35:45 UTC
make firmware_install (also modules_install) fails with parallel make when the firmware dir doesn't exist. Appears to be a regression from 3.0-rc6.

linux-3.0-rc7 # mkdir /tmp/install
linux-3.0-rc7 # make O=/var/tmp/paludis/sys-kernel-linux-3.0_rc7/work/build INSTALL_MOD_PATH=/tmp/install firmware_install -j9
  MKDIR   /tmp/install/lib/firmware/keyspan/
make[2]: *** No rule to make target `/tmp/install/lib/firmware/./', needed by `/tmp/install/lib/firmware/atmsar11.fw'.  Stop.
make[2]: *** Waiting for unfinished jobs....
  MKDIR   /tmp/install/lib/firmware/acenic/
  MKDIR   /tmp/install/lib/firmware/adaptec/
make[1]: *** [firmware_install] Error 2
make: *** [sub-make] Error 2
Comment 1 Florian Mickler 2012-01-25 19:47:12 UTC
Is this still a problem in 3.2 or 3.3-rc1?
Comment 2 Devin J. Pohly 2012-01-25 20:43:38 UTC
Yes, it still happens it with 3.3-rc1 (checked out from git) and make 3.82:

$ make -j8 INSTALL_MOD_PATH=../modtest firmware_install
make[1]: *** No rule to make target `../modtest/lib/firmware/./', needed by `../modtest/lib/firmware/atmsar11.fw'.  Stop.
make[1]: *** Waiting for unfinished jobs....
  MKDIR   ../modtest/lib/firmware/keyspan/
  MKDIR   ../modtest/lib/firmware/acenic/
  MKDIR   ../modtest/lib/firmware/adaptec/
make: *** [firmware_install] Error 2

Changing the following at scripts/Makefile.fwinst:30 seems to make it work:
-installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/.
+installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./

... though I have to wonder if this is a make bug, or something that could be dealt with more cleanly.
Comment 3 Gabriel M Beddingfield 2014-09-06 19:03:49 UTC
Looks like this was fixed by:

commit 5180d5f483486859c0a822c9020ec459f4504b59
Author: Michal Marek <mmarek@suse.cz>
Date:   Tue Apr 29 11:54:47 2014 +0200

    firmware: Simplify directory creation
    
    When building the firmware blobs, use a simple loop to create
    directories in $(objtree), like in Makefile.build. This simplifies the
    rules and also makes it possible to set $(objtree) to '.' later. Before
    this change, a dependency on $(objtree)/<dir> would be satisfied by
    <dir> in $(srctree).
    
    When installing the firmware blobs, call mkdir like in Makefile.modinst.
    
    Cc: David Woodhouse <dwmw2@infradead.org>
    Acked-by: Sam Ravnborg <sam@ravnborg.org>
    Signed-off-by: Michal Marek <mmarek@suse.cz>

Which first appears in 3.15 (>=3.15-rc2).
Comment 4 Michal Marek 2014-09-08 11:55:09 UTC
I think this had been fixed even earlier.
Comment 5 Michal Marek 2014-09-08 12:03:36 UTC
I can't close this :-(
Comment 6 Randy Dunlap 2018-03-10 20:27:24 UTC
Closed for Michal.