diff --git a/examples/mini/Makefile b/examples/mini/Makefile
index 4c1f61bb5273a51b205f003defa7882f3bda6959..41f93e530d297373ddbaab76e04bff188190a90d 100644
--- a/examples/mini/Makefile
+++ b/examples/mini/Makefile
@@ -53,10 +53,10 @@ else
 #  default section
 #----------------------------------------------------------------
 
-ifneq ($(wildcard ethercat.conf),)
-include ethercat.conf
+ifneq ($(wildcard kernel.conf),)
+include kernel.conf
 else
-KERNELDIR = /usr/src/linux
+KERNELDIR := /lib/modules/`uname -r`/build
 endif
 
 modules:
diff --git a/examples/mini/ethercat.conf.tmpl b/examples/mini/kernel.conf.tmpl
similarity index 73%
rename from examples/mini/ethercat.conf.tmpl
rename to examples/mini/kernel.conf.tmpl
index a95d6ed5105424e5955f56d1bee019a11aa8b390..597ab9215936d81f11ded200951f78740f619286 100644
--- a/examples/mini/ethercat.conf.tmpl
+++ b/examples/mini/kernel.conf.tmpl
@@ -1,13 +1,12 @@
 #------------------------------------------------------------------------------
 #
-#  EtherCAT Konfigurationsdatei Kernel 2.6
+#  Kernel configuration file for EtherCAT mini sample
 #
 #  $Id$
 #
-#  This file is a versioned template configuration. Copy it to "ethercat.conf"
+#  This file is a versioned template configuration. Copy it to "kernel.conf"
 #  (which is ignored by Subversion) and adjust it to your needs.
 #
 #------------------------------------------------------------------------------
 
-KERNELDIR = /usr/src/linux
-
+KERNELDIR = /lib/modules/`uname -r`/build
diff --git a/examples/rtai/Makefile b/examples/rtai/Makefile
index 30d903c8839dceaeb1ac90c5d456a7da72c77f6f..adb83ff757b60ff318ae4ad47e77c66381da9807 100644
--- a/examples/rtai/Makefile
+++ b/examples/rtai/Makefile
@@ -58,7 +58,7 @@ else
 ifneq ($(wildcard kernel.conf),)
 include kernel.conf
 else
-KERNELDIR = /usr/src/linux
+KERNELDIR := /lib/modules/`uname -r`/build
 endif
 
 modules:
diff --git a/examples/rtai/kernel.conf.tmpl b/examples/rtai/kernel.conf.tmpl
index 88a5cb9ea80c476efc395d70de5cf22e03755fb0..c03240beddb630c170285d6949b0e50ad4111843 100644
--- a/examples/rtai/kernel.conf.tmpl
+++ b/examples/rtai/kernel.conf.tmpl
@@ -9,5 +9,4 @@
 #
 #------------------------------------------------------------------------------
 
-KERNELDIR = /usr/src/linux
-
+KERNELDIR = /lib/modules/`uname -r`/build