[PATCH] bug in scripts/Configure:dep_tristate

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Thu Jul 20 2000 - 14:26:47 EST


drivers/ide/Config.in triggers a problem with dep_tristate
as implemented by scripts/Configure.

The problem occurs when a dependency is a forward reference.
For instance, arch/i386/config.in does IDE before SCSI, so
the dependency from CONFIG_BLK_DEV_IDESCSI to CONFIG_SCSI
is a forward reference.

Consider a stable .config with CONFIG_BLK_DEV_IDESCSI and
CONFIG_SCSI as modules. Now `make config' but set CONFIG_MODULES=n.
When processing CONFIG_BLK_DEV_IDESCSI, dep_tristate will
see CONFIG_SCSI=m from the previous .config, and incorrectly
limit the result to m or n. Since CONFIG_MODULES=n, dep_tristate
will silently turn off CONFIG_BLK_DEV_IDESCSI (actually, it
drops its altogether). Seriously uncool.

This problem occurs because the script doesn't take into account
the fact that the CONFIG_SCSI=m dependency will be changed by the
script itself to CONFIG_SCSI=y later on (since modules are off).
Therefore, limiting the result to m or n is incorrect in this case.

The patch below (against 2.4.0-test4) fixes this problem. Please apply.

/Mikael

--- linux-2.4.0-test4/scripts/Configure.~1~ Sat Jul 1 00:14:11 2000
+++ linux-2.4.0-test4/scripts/Configure Thu Jul 20 19:47:23 2000
@@ -254,7 +254,13 @@
               return
               ;;
             m)
- need_module=1
+ # Note: "m" means "module" only when CONFIG_MODULES=y,
+ # otherwise it really means "y". This matters when
+ # a dep_tristate dependency is a forward reference
+ # which we haven't yet "corrected" from "m" to "y".
+ if [ "$CONFIG_MODULES" = "y" ]; then
+ need_module=1
+ fi
               ;;
           esac
           shift

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:14 EST