Well, kernel updates on our Linux servers running IBM’s RDAC driver (developed by LSI) is a real pest .. especially if you have to reboot the box two times in order to install the drivers/initrd correctly.
So I sat down and looked at the Makefile. Turns out, it just needs four tweaks in order to be working with a different kernel version (which you have to pass using environment variables to make).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| --- linuxrdac-09.03.0C05.0030.orig/Makefile
+++ linuxrdac-09.03.0C05.0030/Makefile
@@ -25,7 +25,10 @@
#
#######################################################################
-OS_VER := $(shell uname -r)
+ifeq ("$(OS_VER)","")
+ OS_VER := $(shell uname -r)
+endif
+
HOST_TYPE := $(shell uname -m)
IS_SMP := $(shell (uname -v | grep -c "SMP"))
# Kernel Distribution (either REDHAT or SUSE)
@@ -170,7 +173,7 @@ copyrpmfiles :
moduledep :
@echo "Generating module dependencies..."
- @/sbin/depmod $(uname -r)
+ @/sbin/depmod $(OS_VER)
setupfiles :
@install -o root -g root -m 0500 -D Makefile $(DEST_DIR)/opt/mpp/makefile.saved
@@ -190,7 +193,7 @@ setupfiles :
rm devicemapping; fi
setupdriver:
- @/opt/mpp/setupDriver.$(DIST)
+ @/opt/mpp/setupDriver.$(DIST) $(OS_VER)
@if [ -f /etc/SuSE-release ]; then
/sbin/insserv /etc/init.d/mpp;
else
@@ -266,7 +269,7 @@ uninstall_doer:
@echo "The mpp RAMdisk image mpp-$(OS_VER).img has been removed. You may want to remove it from your boot loader config file."
@if test ! -s /var/mpp/devicemapping ; then rm -rf /var/mpp/; fi
@echo "Generating module dependencies..."
- @/sbin/depmod $(uname -r)
+ @/sbin/depmod $(OS_VER)
LINUX_RDAC_DIR := $(shell pwd)
|
After that, a simple make KERNEL_OBJ=/lib/modules/2.6.16.60-0.37_f594963d-smp/build OS_VER=2.6.16.60-0.37_f594963d-smp install correctly installs the modules in /lib/modules, rebuilds the correct modules dependencies and builds the correct initrd image.