Skip to content

Commit

Permalink
fix modules_install via NFS
Browse files Browse the repository at this point in the history
Rafael reported:

I get the following error from 'make modules_install' on my test boxes:

  HOSTCC  firmware/ihex2fw
/home/rafael/src/linux-2.6/firmware/ihex2fw.c:268: fatal error: opening dependency file firmware/.ihex2fw.d: Read-only file system
compilation terminated.
make[3]: *** [firmware/ihex2fw] Error 1
make[2]: *** [_modinst_post] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2

where the configuration is that the kernel is compiled on a build box
with 'make O=<destdir> -j5' and then <destdir> is mounted over NFS read-only by
each test box (full path to this directory is the same on the build box and on
the test boxes).  Then, I cd into <destdir>, run 'make modules_install' and get
the error above.

The issue turns out to be that we when we install firmware pick
up the list of firmware blobs from firmware/Makefile.
And this triggers the Makefile rules to update ihex2fw.

There were two solutions for this issue:
1) Move the list of firmware blobs to a separate file
2) Avoid ihex2fw rebuild by moving it to scripts

As I seriously beleive that the list of firmware blobs should be
done in a fundamental different way solution 2) was selected.

Reported-and-tested-by: "Rafael J. Wysocki" <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
Cc: David Woodhouse <[email protected]>
  • Loading branch information
sravnborg committed Jan 7, 2009
1 parent 8d1a0a1 commit 8b249b6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion firmware/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
*.bin
*.csp
*.dsp
ihex2fw
10 changes: 4 additions & 6 deletions firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ quiet_cmd_ihex = IHEX $@
cmd_ihex = $(OBJCOPY) -Iihex -Obinary $< $@

quiet_cmd_ihex2fw = IHEX2FW $@
cmd_ihex2fw = $(objtree)/$(obj)/ihex2fw $< $@
cmd_ihex2fw = $(objtree)/scripts/ihex2fw $< $@

quiet_cmd_h16tofw = H16TOFW $@
cmd_h16tofw = $(objtree)/$(obj)/ihex2fw -w $< $@
cmd_h16tofw = $(objtree)/scripts/ihex2fw -w $< $@

quiet_cmd_fwbin = MK_FW $@
cmd_fwbin = FWNAME="$(patsubst firmware/%.gen.S,%,$@)"; \
Expand Down Expand Up @@ -165,11 +165,11 @@ $(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %)
# is actually meaningful, because the firmware has to be loaded in a certain
# order rather than as a single binary blob. Thus, we convert them into our
# more compact binary representation of ihex records (<linux/ihex.h>)
$(obj)/%.fw: $(obj)/%.HEX $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %)
$(obj)/%.fw: $(obj)/%.HEX | $(objtree)/$(obj)/$$(dir %)
$(call cmd,ihex2fw)

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

$(firmware-dirs):
Expand All @@ -186,5 +186,3 @@ targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
# Without this, built-in.o won't be created when it's empty, and the
# final vmlinux link will fail.
obj-n := dummy

hostprogs-y := ihex2fw
1 change: 1 addition & 0 deletions scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#
# Generated files
#
ihex2fw
conmakehash
kallsyms
pnmtologo
Expand Down
3 changes: 2 additions & 1 deletion scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# scripts contains sources for various helper programs used throughout
# the kernel for the build process.
# ---------------------------------------------------------------------------
# ihex2fw: Parser/loader for IHEX formatted data
# kallsyms: Find all symbols in vmlinux
# pnmttologo: Convert pnm files to logo files
# conmakehash: Create chartable
# conmakehash: Create arrays for initializing the kernel console tables

hostprogs-y := ihex2fw
hostprogs-$(CONFIG_KALLSYMS) += kallsyms
hostprogs-$(CONFIG_LOGO) += pnmtologo
hostprogs-$(CONFIG_VT) += conmakehash
Expand Down
File renamed without changes.

0 comments on commit 8b249b6

Please sign in to comment.