Changeset 4738

Show
Ignore:
Timestamp:
09/01/07 10:09:49 (7 years ago)
Author:
khali
Message:

Fix kernel version detection (#2187).

Location:
lm-sensors/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4734 r4738  
    66           Speed up sensors_get_ignored() a bit 
    77           Fix thmc50 support for Linux 2.6 
     8  Makefile: Fix kernel version detection (#2187) 
    89  Module fscher: Add missing read of control register (2.6 backport) 
    910  Module i2c-piix4: Add ATI SB700 support (2.6 backport) 
  • lm-sensors/trunk/Makefile

    r4522 r4738  
    8484# The magic invocation will return something like this: 
    8585#   /lib/modules/2.4.29 
    86 KERNELVERSION := $(shell $(CC) -I$(LINUX_HEADERS) -E etc/config.c | grep uts_release | cut -f 2 -d'"') 
    87 MODPREF := /lib/modules/$(KERNELVERSION) 
     86ifneq (,$(findstring /2.4., /$(KERNELVERSION))) 
     87        UTSRELEASE := $(shell $(CC) -I$(LINUX_HEADERS) -E etc/config.c | grep uts_release | cut -f 2 -d'"') 
     88        MODPREF := /lib/modules/$(UTSRELEASE) 
     89endif 
    8890 
    8991# When building userspace for use with 2.4.x series kernels, we turn off 
     
    9395# if you do this: you will need to install the libsysfs libraries on your 
    9496# kernel 2.4.x systems also. 
    95 ifeq (,$(findstring /2.4., $(MODPREF))) 
     97ifeq (,$(findstring /2.4., /$(KERNELVERSION))) 
    9698        SYSFS_SUPPORT := 1 
    9799else 
     
    101103 
    102104# Prevent 2.6+ users from using improper targets, as this won't work. 
    103 ifeq (,$(findstring /2.4., $(MODPREF))) 
     105ifeq (,$(findstring /2.4., /$(KERNELVERSION))) 
    104106    ifeq (, $(MAKECMDGOALS)) 
    105107        $(error For 2.6 kernels and later, use "make user") 
     
    321323ifeq ($(DESTDIR),) 
    322324        -if [ -r $(MODPREF)/build/System.map -a -x /sbin/depmod ] ; then \ 
    323           /sbin/depmod -a -F $(MODPREF)/build/System.map $(KERNELVERSION) ; \ 
     325          /sbin/depmod -a -F $(MODPREF)/build/System.map $(UTSRELEASE) ; \ 
    324326        fi 
    325327else 
  • lm-sensors/trunk/etc/config.c

    r1739 r4738  
    44 * A simple grep doesn't work for Mandrake and Red Hat distributions 
    55 * that contain multiple UTS_RELEASE definitions in version.h. 
     6 * 
     7 * Note: since kernel 2.6.17, the definition of UTS_RELEASE has 
     8 * moved to <linux/utsrelease.h> so this no longer works. 
    69 */ 
    710#include <linux/version.h>