Skip to contentSkip to conversation

2.5.38: modular IDE broken

DISCUSSION Bob_Tracy 3 participants 7 messages Sep 23, 2002 – Sep 27, 2002 Kbuild

lore
Share & tools
lore

Bob_Tracy

author
#0 lore raw

This may well have been broken in earlier versions... The last one I tried to compile before 2.5.38 was 2.5.34. Quick problem summary:

ide-proc.o doesn't get built if CONFIG_BLK_DEV_IDE isn't "y", so depmod complains about unresolved symbols.

If I edit linux/drivers/ide/Makefile to force the build, I still end up with various depmod errors, some of which would doubtless go away if I turned off module versioning. Anyone got a quick fix that I'm too tired to see? Here's the depmod output with ide-proc.o forced:

if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.5.38; fi

depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide-disk.o
depmod:         proc_ide_read_geometry_R50fed6f7
depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide-floppy.o
depmod:         proc_ide_read_geometry_R50fed6f7
depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide-probe.o
depmod:         do_ide_request
depmod:         ide_add_generic_settings
depmod:         create_proc_ide_interfaces_Rab2c600e
depmod:         ide_bus_type
depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide.o
depmod:         proc_ide_create_Ra8e0f104
depmod:         ide_remove_proc_entries_R5a5a621b
depmod:         ide_add_proc_entries_Rce569c25
depmod:         destroy_proc_ide_drives_Ra54f63e5
depmod:         proc_ide_destroy_R35e1351c
depmod:         bus_unregister
depmod:         proc_ide_read_capacity_R46b2a30d
depmod:         create_proc_ide_interfaces_Rab2c600e
depmod:         ide_scan_pcibus
make: *** [_modinst_post] Error 1
Signature · 4 lines
-----------------------------------------------------------------------
Bob Tracy                   WTO + WIPO = DMCA? http://www.anti-dmca.org
[email protected]
-----------------------------------------------------------------------
#1 lore raw
Quoted 5 lines · Bob_Tracy

This may well have been broken in earlier versions... The last one I tried to compile before 2.5.38 was 2.5.34. Quick problem summary:

ide-proc.o doesn't get built if CONFIG_BLK_DEV_IDE isn't "y", so depmod complains about unresolved symbols.

Yup, drivers/ide/Makefile should have

===== Makefile 1.5 vs edited =====

Makefile renamed from drivers/ide/Makefile +1 -1
@@ -24,7 +24,7 @@
 obj-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
 obj-$(CONFIG_BLK_DEV_ISAPNP)		+= ide-pnp.o
 
-ifeq ($(CONFIG_BLK_DEV_IDE),y)
+ifdef CONFIG_BLK_DEV_IDE
 obj-$(CONFIG_PROC_FS)			+= ide-proc.o
 endif
 
Quoted 18 lines

If I edit linux/drivers/ide/Makefile to force the build, I still end up with various depmod errors, some of which would doubtless go away if I turned off module versioning. Anyone got a quick fix that I'm too tired to see? Here's the depmod output with ide-proc.o forced:

if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.5.38; fi

depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide-disk.o
depmod:         proc_ide_read_geometry_R50fed6f7
depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide-floppy.o
depmod:         proc_ide_read_geometry_R50fed6f7
depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide-probe.o
depmod:         do_ide_request
depmod:         ide_add_generic_settings
depmod:         create_proc_ide_interfaces_Rab2c600e
depmod:         ide_bus_type
depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide.o
depmod:         proc_ide_create_Ra8e0f104
depmod:         ide_remove_proc_entries_R5a5a621b
Quoted 8 lines
depmod:         ide_add_proc_entries_Rce569c25
depmod:         destroy_proc_ide_drives_Ra54f63e5
depmod:         proc_ide_destroy_R35e1351c
depmod:         bus_unregister
depmod:         proc_ide_read_capacity_R46b2a30d
depmod:         create_proc_ide_interfaces_Rab2c600e
depmod:         ide_scan_pcibus
make: *** [_modinst_post] Error 1

Basically, for all symbols which don't end in _R*, an EXPORT_SYMBOL() statement is missing. Add as necessary ;)

--Kai

author
#2 lore raw

Makefile line 29

Quoted 11 lines · Kai Germaschewski

===== Makefile 1.5 vs edited =====

Makefile renamed from drivers/ide/Makefile +1 -1
@@ -24,7 +24,7 @@
 obj-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
 obj-$(CONFIG_BLK_DEV_ISAPNP)		+= ide-pnp.o
 
-ifeq ($(CONFIG_BLK_DEV_IDE),y)
+ifdef CONFIG_BLK_DEV_IDE
 obj-$(CONFIG_PROC_FS)			+= ide-proc.o
 endif

I neglected to mention that the above patch (exactly the same, as it turns out :-)) is how I forced the ide-proc.o build. The brokenness extends deeper.

Specific example: proc_ide_read_geometry has the requisite EXPORT_SYMBOL() wrapper in ide-proc.c, yet, I still end up with proc_ide_read_geometry_R* unresolved at depmod time. In case anyone is wondering, I *did* do a "make clean", manually cleaned out linux/include/modules to make *sure* there wasn't any old cruft lying about, then ran "make dep && make bzImage && make modules && make modules_install". The depmod output quoted below is the result of all that.

Quoted 21 lines

if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.5.38; fi

depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide-disk.o
depmod:         proc_ide_read_geometry_R50fed6f7
depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide-floppy.o
depmod:         proc_ide_read_geometry_R50fed6f7
depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide-probe.o
depmod:         do_ide_request
depmod:         ide_add_generic_settings
depmod:         create_proc_ide_interfaces_Rab2c600e
depmod:         ide_bus_type
depmod: *** Unresolved symbols in /lib/modules/2.5.38/kernel/drivers/ide/ide.o
depmod:         proc_ide_create_Ra8e0f104
depmod:         ide_remove_proc_entries_R5a5a621b
depmod:         ide_add_proc_entries_Rce569c25
depmod:         destroy_proc_ide_drives_Ra54f63e5
depmod:         proc_ide_destroy_R35e1351c
depmod:         bus_unregister
depmod:         proc_ide_read_capacity_R46b2a30d
depmod:         create_proc_ide_interfaces_Rab2c600e
depmod:         ide_scan_pcibus
make: *** [_modinst_post] Error 1
Signature · 4 lines
-----------------------------------------------------------------------
Bob Tracy                   WTO + WIPO = DMCA? http://www.anti-dmca.org
[email protected]
-----------------------------------------------------------------------
#3 lore raw
Quoted 17 lines · Bob_Tracy

Makefile line 29

Quoted 11 lines · Kai Germaschewski

===== Makefile 1.5 vs edited =====

Makefile renamed from drivers/ide/Makefile +1 -1
@@ -24,7 +24,7 @@
 obj-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
 obj-$(CONFIG_BLK_DEV_ISAPNP)		+= ide-pnp.o
 
-ifeq ($(CONFIG_BLK_DEV_IDE),y)
+ifdef CONFIG_BLK_DEV_IDE
 obj-$(CONFIG_PROC_FS)			+= ide-proc.o
 endif

I neglected to mention that the above patch (exactly the same, as it turns out :-)) is how I forced the ide-proc.o build. The brokenness extends deeper.

Quoted 7 lines

Specific example: proc_ide_read_geometry has the requisite EXPORT_SYMBOL() wrapper in ide-proc.c, yet, I still end up with proc_ide_read_geometry_R* unresolved at depmod time. In case anyone is wondering, I *did* do a "make clean", manually cleaned out linux/include/modules to make *sure* there wasn't any old cruft lying about, then ran "make dep && make bzImage && make modules && make modules_install". The depmod output quoted below is the result of all that.

Well, fortunately enough, it turns out not to be a general problem in the build nor modversions related at all, but rather a messed up drivers/ide/Makefile.

The specific problem here is that you have CONFIG_IDE = CONFIG_BLK_DEV_IDE = m, but end up with ide-proc.o in $(obj-y). So that asks for ide-proc.o being linked into vmlinux. However, since the whole drivers/ide subdir is marked as "m" (CONFIG_IDE), it does not end up in vmlinux. Anyway, that's not really what you wanted in the first place, so never mind.

There are more problems than this, but the appended patch at least gets rid of this issue, it needs a

mv drivers/ide/ide.c drivers/ide/ide-main.c,

to work. There's still other unresolved symbols which need exporting.

Any of the IDE people interested in figuring this out properly?

--Kai

===== drivers/ide/Makefile 1.5 vs edited =====

drivers/ide/Makefile +10 -6
@@ -7,14 +7,22 @@
 # Note : at this point, these files are compiled on all systems.
 # In the future, some of these should be built conditionally.
 #
-export-objs := ide-iops.o ide-taskfile.o ide-proc.o ide.o ide-probe.o ide-dma.o ide-lib.o setup-pci.o
+export-objs := ide-iops.o ide-taskfile.o ide-proc.o ide-main.o \
+	       ide-probe.o ide-dma.o ide-lib.o setup-pci.o
 
 # First come modules that register themselves with the core
 obj-$(CONFIG_BLK_DEV_IDEPCI)		+= pci/
 
 # Core IDE code - must come before legacy
 
-obj-$(CONFIG_BLK_DEV_IDE)		+= ide-probe.o ide-geometry.o ide-iops.o ide-taskfile.o ide.o ide-lib.o
+ide-y					+= ide-geometry.o \
+					   ide-iops.o ide-taskfile.o  \
+					   ide-main.o ide-lib.o
+ide-$(CONFIG_PROC_FS)			+= ide-proc.o
+ide-objs				:= $(ide-y)
+
+obj-$(CONFIG_BLK_DEV_IDE)		+= ide-probe.o ide.o
+
 obj-$(CONFIG_BLK_DEV_IDEDISK)		+= ide-disk.o
 obj-$(CONFIG_BLK_DEV_IDECD)		+= ide-cd.o
 obj-$(CONFIG_BLK_DEV_IDETAPE)		+= ide-tape.o
@@ -23,10 +31,6 @@
 obj-$(CONFIG_BLK_DEV_IDEPCI)		+= setup-pci.o
 obj-$(CONFIG_BLK_DEV_IDEDMA_PCI)	+= ide-dma.o
 obj-$(CONFIG_BLK_DEV_ISAPNP)		+= ide-pnp.o
-
-ifeq ($(CONFIG_BLK_DEV_IDE),y)
-obj-$(CONFIG_PROC_FS)			+= ide-proc.o
-endif
 
 obj-$(CONFIG_BLK_DEV_IDE)		+= legacy/ ppc/ arm/
 

===== drivers/ide/ide-main.c 1.22 vs edited =====

drivers/ide/ide-main.c +2 -0
@@ -3553,7 +3553,9 @@
 	return 0;
 }
 
+#ifndef MODULE
 module_init(ide_init);
+#endif
 
 #ifdef MODULE
 char *options = NULL;
#4 lore raw
In reply to Bob_Tracy
Quoted 4 lines

Specific example: proc_ide_read_geometry has the requisite EXPORT_SYMBOL() wrapper in ide-proc.c, yet, I still end up with proc_ide_read_geometry_R* unresolved at depmod time. In case anyone is wondering, I *did* do a "make clean", manually cleaned out linux/include/modules to make *sure*

Let me give a simple clear explanation here. I don't give a flying ***k about modular IDE until the IDE works. Cleaning up the modular IDE after it all works is relatively easy and gets easier the more IDE is cleaned up. Until then its not even on the radar unless someone else wants to do all the work for 2.4/2.5 and verify/test them

author
#5 lore raw
Quoted 2 lines · Alan Cox

Let me give a simple clear explanation here. I don't give a flying ***k about modular IDE until the IDE works.

Understood. My position is simply that I noted something broken, and I reported it during the development cycle. Would you prefer that I had waited until after 2.5.X became 2.6? I didn't think so... I was not (and am not) presuming to dictate what any developer's priorities should be.

Signature · 4 lines
-----------------------------------------------------------------------
Bob Tracy                   WTO + WIPO = DMCA? http://www.anti-dmca.org
[email protected]
-----------------------------------------------------------------------
#6 lore raw
Quoted 5 lines · Bob_Tracy

Understood. My position is simply that I noted something broken, and I reported it during the development cycle. Would you prefer that I had waited until after 2.5.X became 2.6? I didn't think so... I was not (and am not) presuming to dictate what any developer's priorities should be.

Nod.. its just I've had lots of equally helpful reports 8)