summaryrefslogtreecommitdiffstats
path: root/source/a/mkinitrd/mkinitrd_kernelcheck.diff
blob: e1302f54eb5f4ec53f69d20f193e14afaff3d3db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- mkinitrd.orig	2008-11-30 15:35:58.000000000 +0100
+++ mkinitrd	2008-12-11 11:16:37.000000000 +0100
@@ -277,6 +277,12 @@
   esac
 done
 
+# If kernel modules are needed but the kernel version is absent, exit now:
+if [ ! -d /lib/modules/$KERNEL_VERSION ]; then
+  echo "No modules tree found for kernel \"$KERNEL_VERSION\""
+  exit 1
+fi
+
 # If clearing source tree was requested, do that first
 if [ "$CLEAR_TREE" = "1" ]; then
   clear_source_tree