linux fan wrote:
> On 2/18/10, Bruce Dubbs <bruce.du...@gmail.com> wrote:
>> My understanding is that klogd reads the symbols to translate kernel
>> oops to symbols.   I think I saw that the kernel is now doing that
>> internally.  In that case, there is no need for klogd to read System.map
>> at all.
> 
> That is what Linus said  in reply to an email:
> 
> On Sat, 7 Nov 2009, linux fan wrote:
>> "[PATCH] init/version.c: Define version_string only if"
>> causes sysklogd to report "Cannot find map"
> 
> But isn't that what we _want_.
> 
> If we have CONFIG_KALLSYMS, then we do _not_ want sysklogd to try to
> interpret kernel addresses, because the kernel will do that itself.
> 
> So the sysklogd "Cannot find map" warning is a feature, not a bug.
> 
> I think.
> 
>                Linus

I saw that when I was researching last night.  I don't think it is a 
feature.  It implies something is wrong.  When something is right in 
Linux/Unix, the application should stay silent.

One thing I was thinking about was modifying /etc/rc.d/init.d/sysklog to 
check for "Version_" in the System.map and change the parameters passed 
to klogd accordingly.  Something like below.

   -- Bruce

kversion=$(uname -r)
major=$(echo $kversion | cut -d. -f1)
minor=$(echo $kversion | cut -d. -f2)
patch=$(echo $kversion | cut -d. -f3)
kversiond=$(( $major * 65536 + $minor * 256 + $patch ))

for map in /boot/System.map-$kversion /boot/System.map
do
   version=$(grep Version_ $map | cut -d_ -f2)

   if [ x$version == x$kversiond ] ; then
     MAP=$map
     break
   fi

done

if [ x$MAP == x ] ; then
   KLOGD_OPTION=-x
else
   KLOGD_OPTION="-k $MAP"
fi

boot_mesg "Starting kernel log daemon..."
loadproc klogd $KLOGD_OPTION
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to