Skip to content

Commit 1cede1a

Browse files
David WoodhouseDavid Woodhouse
authored andcommitted
Fix modules_install on RO nfs-exported trees.
Fixes http://bugzilla.kernel.org/show_bug.cgi?id=11355 by avoiding a needless rebuild of the firmware/ihex2fw tool. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent bef69ea commit 1cede1a

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎firmware/Makefile‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,27 @@ $(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/%
146146
$(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %)
147147
$(call cmd,ihex)
148148

149+
# Don't depend on ihex2fw if we're installing and it already exists.
150+
# Putting it after | in the dependencies doesn't seem sufficient when
151+
# we're installing after a cross-compile, because ihex2fw has dependencies
152+
# on stuff like /usr/lib/gcc/ppc64-redhat-linux/4.3.0/include/stddef.h and
153+
# thus wants to be rebuilt. Which it can't be, if the prebuilt kernel tree
154+
# is exported read-only for someone to run 'make install'.
155+
ifeq ($(INSTALL):$(wildcard $(obj)/ihex2fw),install:$(obj)/ihex2fw)
156+
ihex2fw_dep :=
157+
else
158+
ihex2fw_dep := $(obj)/ihex2fw
159+
endif
160+
149161
# .HEX is also Intel HEX, but where the offset and length in each record
150162
# is actually meaningful, because the firmware has to be loaded in a certain
151163
# order rather than as a single binary blob. Thus, we convert them into our
152164
# more compact binary representation of ihex records (<linux/ihex.h>)
153-
$(obj)/%.fw: $(obj)/%.HEX $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %)
165+
$(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
154166
$(call cmd,ihex2fw)
155167

156168
# .H16 is our own modified form of Intel HEX, with 16-bit length for records.
157-
$(obj)/%.fw: $(obj)/%.H16 $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %)
169+
$(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
158170
$(call cmd,h16tofw)
159171

160172
$(firmware-dirs):

0 commit comments

Comments
 (0)