ok, there's definitely something weird in the latest kernel --
2.4.20-2.2 -- that affects (although not in a fatal way) which
config file will be used as a default if there is no current
config file.  (i've verified that the same problem exists
in earlier kernel source trees.)

  in my brand new 2.4.20-2.2 source tree, as in many previous
kernel source trees, there is a directory of config files in
the configs/ directory, as most people are aware.  in addition,
there is what appears to be a much more generic config file
in arch/i386/defconfig.  so which one gets used?

  first, make sure everything is completely cleaned with
"make mrproper" -- there is now no .config file.

  then run "make xconfig", let it come up, and immediately
save and exit.  there is now a .config file.  where did it
come from?

  the top level Makefile calls the Makefile in the scripts/
directory, so it's worth seeing what scripts/Makefile does.
here's the salient excerpt:

----------------

KERNTYPE=`sed -n 's_^/\* Kernel type \(.*\) \*/_\1_p' /boot/kernel.h 2>/dev/null`; \
if [ -f configs/*-$KERNTYPE.config ]; then \
        conf=`echo configs/*-$KERNELTYPE.config`; \
        echo "set defaults \"${conf}\"" >> kconfig.tk; \
else \
        echo "set defaults \"arch/${ARCH}/defconfig\"" >> kconfig.tk; \
fi
echo "set ARCH \"${ARCH}\"" >> kconfig.tk

----------------

  obviously, this excerpt grabs the kernel type out of the file
/boot/kernel.h, which in my case is "i686".  but notice that,
a couple lines further down, the variable used is "KERNELTYPE",
not "KERNTYPE".  oversight?  typo?  certainly seems like it's not
going to work very well.  but it gets better.

  if you edit the file scripts/Makefile, that "if" construct
(using the default vi coloring scheme, at least on my host)
shows only the *first* letter of "KERNTYPE" in color, the rest
in black, as if, somehow, it's being parsed as ${K}ERNTYPE.
check it yourself.  what does this mean?

  and it's obvious that it's not processing that conditional
correctly the instant you look at the output of "make xconfig":

--------------------------

(snip)

KERNTYPE=`sed -n 's_^/\* Kernel type \(.*\) \*/_\1_p' /boot/kernel.h 2>/dev/null`; \
Eif [ -f configs/*-ERNTYPE.config ]; then \       <--- ??????????
        conf=`echo configs/*-ERNELTYPE.config`; \
        echo "set defaults \"\"" >> kconfig.tk; \
else \
        echo "set defaults \"arch/i386/defconfig\"" >> kconfig.tk; \
fi
echo "set ARCH \"i386\"" >> kconfig.tk

------------------------------

  note how the leading K has been dropped from the if construct
variable, which matches the fact that only that "K" showed up
in color in the vi editor -- is this some kind of variable 
processing within a bash test that's not obvious?  i've never
seen anything like it.

  in any case, if the test had worked *properly*, the initial
config file should have been configs/<whatever>-i686.config.
but because the test failed, you can see at the end of the output
that it's the "arch/i386/defconfig" file that's used as the
initial .config file.  so the "make xconfig" doesn't technically
fail -- it just uses a non-optimal choice for .config.

  am i making any sense?  why is this happening?  and why
has no one noticed this before?

rday



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to