summaryrefslogtreecommitdiffstats
path: root/core/rootfs/rootfs-stage31/data/init
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-25 14:15:47 +0200
committerSimon Rettberg2017-04-25 14:15:47 +0200
commit459a33ba2e4bd9b801889e4694b2c47c371f18b8 (patch)
tree97528d6c353005e36cc2e79088ab5c6d9a6f23f1 /core/rootfs/rootfs-stage31/data/init
parent[rfs-stage31] Autostart lecture handling (diff)
downloadmltk-459a33ba2e4bd9b801889e4694b2c47c371f18b8.tar.gz
mltk-459a33ba2e4bd9b801889e4694b2c47c371f18b8.tar.xz
mltk-459a33ba2e4bd9b801889e4694b2c47c371f18b8.zip
[rfs-stage31] Detect kernel<->initramfs mismatch
Diffstat (limited to 'core/rootfs/rootfs-stage31/data/init')
-rwxr-xr-xcore/rootfs/rootfs-stage31/data/init33
1 files changed, 33 insertions, 0 deletions
diff --git a/core/rootfs/rootfs-stage31/data/init b/core/rootfs/rootfs-stage31/data/init
index 01a3a5c1..98ee1a61 100755
--- a/core/rootfs/rootfs-stage31/data/init
+++ b/core/rootfs/rootfs-stage31/data/init
@@ -16,6 +16,39 @@
# set PATH correctly
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+# IMPORTANT - check if kernel modules in initrams match kernel version
+BASEDIR="/lib/modules/$(uname -r)/kernel/drivers"
+for dir in gpu hid misc; do
+ if ! [ -d "$BASEDIR/$dir" ]; then
+ cat <<WARNING
++
++
++
++
++ + + + + + + + + + + + + +
++ WARNING + + WARNING +
++ - - - - - - - - - - - - +
++
++ kernel/drivers/$dir missing!
++
++ Booted kernel version does not match
++ modules provided by initramfs.
++ Make sure kernel and initramfs-stage31
++ are up to date.
++
++ Kernel: $(uname -r)
++ initramfs: $(ls -1 /lib/modules | grep -m1 '\..*\..*-')
++
++ System halted.
++
++ + + + + + + + + + + + + +
+WARNING
+ while true; do
+ read some garbage
+ done
+ fi
+done
+
# import common functions
. "/inc/functions"