Skip to contentSkip to conversation

Build failure in current mainline - firmware related

Regression Rafael J. Wysocki 4 participants 14 messages Jan 3, 2009 – Jan 11, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi,

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.

2.6.28 didn't have this problem.

Thanks,
Rafael

#1 lore raw
Quoted 12 lines · Rafael J. Wysocki

Hi,

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

Quoted 7 lines

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.

2.6.28 didn't have this problem.

Strange...
1) The string "opening dependency file" does not occur in my freshly pulled kernel
2) Line 268 is last line of ihex2fw.c

Could you try to do a "make modules_install V=1" to see the exact arguments supplied ti ihex2fw.c

I gave up on all the firmware stuff long time ago and has never properly reviewed the implementation so I really have no clue what is actually happening.

Walking through the 179 lines Makefile has not yet benn on my "fun to do" list - and it most likely take a while before it hits it.

Sam

#2 lore raw
Quoted 26 lines · Sam Ravnborg
Quoted 12 lines · Rafael J. Wysocki

Hi,

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

Quoted 7 lines

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.

2.6.28 didn't have this problem.

Strange...
1) The string "opening dependency file" does not occur in my freshly pulled kernel
2) Line 268 is last line of ihex2fw.c

Quoted 8 lines

Could you try to do a "make modules_install V=1" to see the exact arguments supplied ti ihex2fw.c

I gave up on all the firmware stuff long time ago and has never properly reviewed the implementation so I really have no clue what is actually happening.

Walking through the 179 lines Makefile has not yet benn on my "fun to do" list - and it most likely take a while before it hits it.

Took a quick peek. The Makefile uses "order only" in three spots. This alone demand make version 3.80 IIRC and Documetnation/Changes says 3.79.1...

The "order only" is so rare that Paul Smith once said that coming up with a good example of usage was not easy.

For the headers_* stuff I recall when I reworked it I could kill the usage of "order only" there but now it crept back - sigh!

Sam

#3 lore raw
Quoted 40 lines · Sam Ravnborg
Quoted 26 lines · Sam Ravnborg
Quoted 12 lines · Rafael J. Wysocki

Hi,

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

Quoted 7 lines

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.

2.6.28 didn't have this problem.

Strange...
1) The string "opening dependency file" does not occur in my freshly pulled kernel
2) Line 268 is last line of ihex2fw.c

Quoted 8 lines

Could you try to do a "make modules_install V=1" to see the exact arguments supplied ti ihex2fw.c

I gave up on all the firmware stuff long time ago and has never properly reviewed the implementation so I really have no clue what is actually happening.

Walking through the 179 lines Makefile has not yet benn on my "fun to do" list - and it most likely take a while before it hits it.

Took a quick peek. The Makefile uses "order only" in three spots. This alone demand make version 3.80 IIRC and Documetnation/Changes says 3.79.1...

Quoted 6 lines

The "order only" is so rare that Paul Smith once said that coming up with a good example of usage was not easy.

For the headers_* stuff I recall when I reworked it I could kill the usage of "order only" there but now it crept back - sigh!

Well, in the meantime I ran 'make modules_install V=1' and this is the last thing printed (the previous ones are not really interesting):

make -f /home/rafael/src/linux-2.6/scripts/Makefile.fwinst obj=firmware __fw_modinst
gcc -Wp,-MD,firmware/.ihex2fw.d -Ifirmware -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o firmware/ihex2fw /home/rafael/src/linux-2.6/firmware/ihex2fw.c
/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

It fails because of the attempt to compile ihex2fw .

Thanks,
Rafael

#4 lore raw
Quoted 13 lines

Well, in the meantime I ran 'make modules_install V=1' and this is the last thing printed (the previous ones are not really interesting):

make -f /home/rafael/src/linux-2.6/scripts/Makefile.fwinst obj=firmware __fw_modinst
gcc -Wp,-MD,firmware/.ihex2fw.d -Ifirmware -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o firmware/ihex2fw /home/rafael/src/linux-2.6/firmware/ihex2fw.c
/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

Quoted 1 line

It fails because of the attempt to compile ihex2fw .

I recall we had this bug in previous kernel too.
But it seems noone cared to fix it.

Looking at all this firmware stuff makes me sad.

We have a nice distributed way to keep all our drivers and suddenly all the firmware are stored in a central place.
So adding a driver requiores changes to a central file, and moreso adding a file in a central place far far away from the driver itself.

I recall a long long thread about this that I never even looked at. [I commented on an early version of the implementation but never looked at it seriously despite being copied on stuff].

What we should have done:
1) all firmware files should be stored with their drivers so firmare are kept logically in the same place as the source.

2) we should add firmware information using config options rather than a long list in a centeal file.

config MY_DRIVER_FIRMWARE
string
depends on MY_DRIVER
default "drivers/my/driver.bin"

or something similar.

Then we could post process autoconf.h to have all relevant information I think.

This is far away from solving this regression - just my initial braindump seeing the implementation of the firmware stuff.

Sam

#5 lore raw
In reply to Rafael J. Wysocki
Quoted 60 lines · Rafael J. Wysocki
Quoted 40 lines · Sam Ravnborg
Quoted 26 lines · Sam Ravnborg
Quoted 12 lines · Rafael J. Wysocki

Hi,

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

Quoted 7 lines

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.

2.6.28 didn't have this problem.

Strange...
1) The string "opening dependency file" does not occur in my freshly pulled kernel
2) Line 268 is last line of ihex2fw.c

Quoted 8 lines

Could you try to do a "make modules_install V=1" to see the exact arguments supplied ti ihex2fw.c

I gave up on all the firmware stuff long time ago and has never properly reviewed the implementation so I really have no clue what is actually happening.

Walking through the 179 lines Makefile has not yet benn on my "fun to do" list - and it most likely take a while before it hits it.

Took a quick peek. The Makefile uses "order only" in three spots. This alone demand make version 3.80 IIRC and Documetnation/Changes says 3.79.1...

Quoted 6 lines

The "order only" is so rare that Paul Smith once said that coming up with a good example of usage was not easy.

For the headers_* stuff I recall when I reworked it I could kill the usage of "order only" there but now it crept back - sigh!

Well, in the meantime I ran 'make modules_install V=1' and this is the last thing printed (the previous ones are not really interesting):

make -f /home/rafael/src/linux-2.6/scripts/Makefile.fwinst obj=firmware __fw_modinst
gcc -Wp,-MD,firmware/.ihex2fw.d -Ifirmware -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o firmware/ihex2fw /home/rafael/src/linux-2.6/firmware/ihex2fw.c
/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

Quoted 1 line

It fails because of the attempt to compile ihex2fw .

There are at least two obvious ways to fix this.

We could try to rearrange things so we do not trigger the rebuild of ihex2fw in the modules_install case. This would likely involve creating a new file listing all the firmawre files and share it between firmware/Makefile and scripts/Makefile.fwinst

We could also move ihex2fw to scripts so it is build as part of the preparation for a kernel build.

Attched patch does the latter.
[I will update the changelog before I eventually commit it].

Sam

Patch is in old-style but the majority of the patch is the file move.

Quoted 1 line

From f023a3d57e2b70a2d3d9ac4a484f1d337f2a02e3 Mon Sep 17 00:00:00 2001

From: Sam Ravnborg <[email protected]>
Date: Sun, 4 Jan 2009 22:38:21 +0100
Subject: [PATCH] kbuild: move ihex2fw to scripts

This fix a situation where we try to rebuild ihex2fw when we do modules_install

---
 firmware/Makefile  |   10 +-
 firmware/ihex2fw.c |  268 ----------------------------------------------------
 scripts/Makefile   |    2 +
 scripts/ihex2fw.c  |  268 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 274 insertions(+), 274 deletions(-)
 delete mode 100644 firmware/ihex2fw.c
 create mode 100644 scripts/ihex2fw.c
firmware/Makefile +4 -6
index 6968388..0423c41 100644
@@ -88,10 +88,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,%,$@)";		     \
@@ -154,11 +154,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):
@@ -175,5 +175,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
firmware/ihex2fw.c deleted +0 -268

268 lines not on this page · raw message

scripts/Makefile +2 -0
index aafdf06..db5dd47 100644
@@ -2,11 +2,13 @@
 # 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
scripts/ihex2fw.c new file +268 -0

268 lines not on this page · raw message

Signature · 1 line
1.6.0.2.GIT
Quoted 3 lines

Thanks,
Rafael

#6 lore raw
Quoted 71 lines · Sam Ravnborg
Quoted 60 lines · Rafael J. Wysocki
Quoted 40 lines · Sam Ravnborg
Quoted 26 lines · Sam Ravnborg
Quoted 12 lines · Rafael J. Wysocki

Hi,

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

Quoted 7 lines

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.

2.6.28 didn't have this problem.

Strange...
1) The string "opening dependency file" does not occur in my freshly pulled kernel
2) Line 268 is last line of ihex2fw.c

Quoted 8 lines

Could you try to do a "make modules_install V=1" to see the exact arguments supplied ti ihex2fw.c

I gave up on all the firmware stuff long time ago and has never properly reviewed the implementation so I really have no clue what is actually happening.

Walking through the 179 lines Makefile has not yet benn on my "fun to do" list - and it most likely take a while before it hits it.

Took a quick peek. The Makefile uses "order only" in three spots. This alone demand make version 3.80 IIRC and Documetnation/Changes says 3.79.1...

Quoted 6 lines

The "order only" is so rare that Paul Smith once said that coming up with a good example of usage was not easy.

For the headers_* stuff I recall when I reworked it I could kill the usage of "order only" there but now it crept back - sigh!

Well, in the meantime I ran 'make modules_install V=1' and this is the last thing printed (the previous ones are not really interesting):

make -f /home/rafael/src/linux-2.6/scripts/Makefile.fwinst obj=firmware __fw_modinst
gcc -Wp,-MD,firmware/.ihex2fw.d -Ifirmware -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o firmware/ihex2fw /home/rafael/src/linux-2.6/firmware/ihex2fw.c
/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

Quoted 1 line

It fails because of the attempt to compile ihex2fw .

There are at least two obvious ways to fix this.

We could try to rearrange things so we do not trigger the rebuild of ihex2fw in the modules_install case. This would likely involve creating a new file listing all the firmawre files and share it between firmware/Makefile and scripts/Makefile.fwinst

Quoted 5 lines

We could also move ihex2fw to scripts so it is build as part of the preparation for a kernel build.

Attched patch does the latter.
[I will update the changelog before I eventually commit it].

The patch helps, thanks a lot.

Best,
Rafael

#7 lore raw
In reply to Sam Ravnborg
Quoted 6 lines · Sam Ravnborg

We could try to rearrange things so we do not trigger the rebuild of ihex2fw in the modules_install case. This would likely involve creating a new file listing all the firmawre files and share it between firmware/Makefile and scripts/Makefile.fwinst

Didn't we already have that, but it got broken for some reason, by unwanted changes in commit 4b29631db33292d416dc395c56122ea865e7635c

Your patch seems to have broken the Fedora kernel build for 'noarch', which runs 'make firmware_install' without building a kernel.

Rafael, if you revert Sam's fix and also revert 4b29631d, does it work again?

Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation
#8 lore raw
Quoted 2 lines · David Woodhouse

Rafael, if you revert Sam's fix and also revert 4b29631d, does it work again?

The firmware-2.6.git tree now contains what I suggest; please confirm that it's fixed (again).

Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation
#9 lore raw
In reply to David Woodhouse
Quoted 10 lines · On Sat, 10 Jan 2009 14:36:56 +0000 David Woodhouse <[email protected]> wrote:
Quoted 6 lines · Sam Ravnborg

We could try to rearrange things so we do not trigger the rebuild of ihex2fw in the modules_install case. This would likely involve creating a new file listing all the firmawre files and share it between firmware/Makefile and scripts/Makefile.fwinst

Didn't we already have that, but it got broken for some reason, by unwanted changes in commit 4b29631db33292d416dc395c56122ea865e7635c

Sorry for that. It seems that, I've committed Igor patch with a dirty tree. So, one patch for me to allow out-of-tree compiling were merged with the real patch from Igor.

Signature · 2 lines
Cheers,
Mauro
#10 lore raw
Quoted 1 line · Mauro Carvalho Chehab

So, one patch for me to allow out-of-tree compiling

Something we should be dealing with...?

Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation
#11 lore raw
In reply to David Woodhouse
Quoted 8 lines · David Woodhouse
Quoted 6 lines · Sam Ravnborg

We could try to rearrange things so we do not trigger the rebuild of ihex2fw in the modules_install case. This would likely involve creating a new file listing all the firmawre files and share it between firmware/Makefile and scripts/Makefile.fwinst

Quoted 8 lines

Didn't we already have that, but it got broken for some reason, by unwanted changes in commit 4b29631db33292d416dc395c56122ea865e7635c

Your patch seems to have broken the Fedora kernel build for 'noarch', which runs 'make firmware_install' without building a kernel.

Rafael, if you revert Sam's fix and also revert 4b29631d, does it work again?

Deosn't revert, sorry.

Can you send me a standalone fix patch to test, please?

Rafael

#12 lore raw
In reply to Rafael J. Wysocki
Quoted 12 lines · Rafael J. Wysocki

Hi,

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

Quoted 7 lines

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.

2.6.28 didn't have this problem.

Fix is in mainline now.

Sam

#13 lore raw
Quoted 19 lines · Sam Ravnborg
Quoted 18 lines · Rafael J. Wysocki

Hi,

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.

Quoted 3 lines
Quoted 1 line

2.6.28 didn't have this problem.

Fix is in mainline now.

I noticed, thanks a lot!

Rafael