[PATCH] efi_runtime: fix the broken kernel vermagic when upgrading the kernel pacakge (LP: #1223801)

Keng-Yu Lin kengyu at canonical.com
Thu Sep 12 08:30:33 UTC 2013


Using `uname -r` in the Makefile, the compiled .ko has the vermagic of the
current running kernel, rather than the upgrading one.

The correct way is to use the $kernelver variable provided by DKMS.

Signed-off-by: Keng-Yu Lin <kengyu at canonical.com>
---
 debian/fwts-efi-runtime-dkms.dkms | 2 +-
 efi_runtime/Makefile              | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/debian/fwts-efi-runtime-dkms.dkms b/debian/fwts-efi-runtime-dkms.dkms
index 685b189..94b3415 100644
--- a/debian/fwts-efi-runtime-dkms.dkms
+++ b/debian/fwts-efi-runtime-dkms.dkms
@@ -1,6 +1,6 @@
 PACKAGE_NAME="fwts-efi-runtime-dkms"
 PACKAGE_VERSION="#MODULE_VERSION#"
-MAKE[0]="make"
+MAKE[0]="KVER=$kernelver make"
 BUILT_MODULE_NAME[0]="efi_runtime"
 DEST_MODULE_LOCATION[0]="/updates"
 AUTOINSTALL="yes"
diff --git a/efi_runtime/Makefile b/efi_runtime/Makefile
index ea0cac2..a9c0ea7 100644
--- a/efi_runtime/Makefile
+++ b/efi_runtime/Makefile
@@ -1,9 +1,9 @@
 obj-m += efi_runtime.o
 all:
-	make -C /lib/modules/`uname -r`/build M=`pwd` modules
+	make -C /lib/modules/$(KVER)/build M=`pwd` modules
 
 install:
-	make -C /lib/modules/`uname -r`/build M=`pwd` modules_install
+	make -C /lib/modules/$(KVER)/build M=`pwd` modules_install
 
 clean:
-	make -C /lib/modules/`uname -r`/build M=`pwd` clean
+	make -C /lib/modules/$(KVER)/build M=`pwd` clean
-- 
1.8.1.2




More information about the fwts-devel mailing list