Andrew Benton wrote:
> On 18/02/10 20:57, Bruce Dubbs wrote:
>> I've noticed an irritating message when klogd starts up.  It says:
>>
>>    Cannot find map file.
>>
>> I traced the cause of this message.  System.map is a dump of the kernel
>> symbols using nm.  klogd finds the System.map, but rejects it because
>> there is no symbol with the name "Version_xxxxxx" where xxxxxx is a
>> decimal conversion of the kernel's major/minor/patch (e.g. 2.6.32).
>>
>> Researching some more, it looks like the kernel removed this symbol by
>> default somewhere around 2.6.27.  sysklogd has not been updated since 2007.
>>
>> I checked some other distros.  The ones I found still have the Version_
>> symbol (grep Version_ System.map).  They are generally using older
>> kernels with back ported patches.
>>
>> 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.
>>
>> To stop klogd from trying to read System.map, it requires passing -x in
>> the command line.  We can do that easily in the boot scripts.
>>
>> What this also implies is that we don't need to copy System.map to /boot
>> at all.  My analysis may have not gone deep enough, but I want to get
>> this out for other opinions.
> 
> What I do is modify the boot script to start klogd with the -k 
> /path/to/System.map option.
> It removes that annoying "Cannot find map file" message.
> 
> 
>               boot_mesg "Starting the kernel log daemon..."
>               loadproc klogd -k /boot/System.map
>               ;;

Andy,  Perhaps I wasn't clear enough.  I have:

Feb 18 00:42:04 core2 kernel: Inspecting /boot/System.map-2.6.30.2-lfs65
Feb 18 00:42:04 core2 kernel: Cannot find map file.

It finds /boot/System.map-2.6.30.2-lfs65 just fine, but doesn't like it 
because it doesn't contain 'Version_'.

I ran klogd with modifications to print out debugging info and it is 
reading the file fine.

The point is that if KALLSYMS is set in the kernel config, then klogd 
shouldn't be reading the System.map file at all.  The symbols are not 
used in this case because the kernel itself does the translating.

Looking at the source,  -k filename still reads the file, but doesn't 
put out the error message if 'Version_ is not found.

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to