From 688b2149dcf93a2460e89c275c494a71d917c847 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 15 Apr 2006 07:52:59 +0000 Subject: [PATCH] Fix depmod on non-running kernel version. Original patch from Peter Breitenlohner. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3283 7894878c-1315-0410-8ee3-d5d059ff63e0 --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index caabd490..42b25a9a 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,8 @@ CC := gcc # This is the main modules directory into which the modules will be installed. # The magic invocation will return something like this: # /lib/modules/2.4.29 -MODPREF := /lib/modules/$(shell $(CC) -I$(LINUX_HEADERS) -E etc/config.c | grep uts_release |cut -f 2 -d'"') +KERNELVERSION := $(shell $(CC) -I$(LINUX_HEADERS) -E etc/config.c | grep uts_release | cut -f 2 -d'"') +MODPREF := /lib/modules/$(KERNELVERSION) # When building userspace for use with 2.4.x series kernels, we turn off # sysfs support by default. You can override this (e.g. if you want @@ -319,7 +320,9 @@ user_install:: all :: user install :: all user_install ifeq ($(DESTDIR),) - -/sbin/depmod -a + -if [ -r $(MODPREF)/build/System.map -a -x /sbin/depmod ] ; then \ + /sbin/depmod -a -F $(MODPREF)/build/System.map $(KERNELVERSION) ; \ + fi else @echo "*** This is a \`staged' install using \"$(DESTDIR)\" as prefix." @echo "***"