summaryrefslogtreecommitdiff
path: root/packages/initrdscripts/files
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2008-02-06 13:23:58 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2008-02-06 13:23:58 +0000
commiteb62ab748a332a39c68f0928d8e798e0fbd19b46 (patch)
treeb9debf6dd8977f2b2699ec747f3899d22cfe8073 /packages/initrdscripts/files
parenteb3c1f6abe11f88d3666023814a75574fecd083b (diff)
initramfs-module-check-modules: An initramfs module to check modules consistency.
* Checks that version of the boot kernel matches that of modules installed in rootfs. * A step towards providing manageable upgrade path for kernels outside rootfs.
Diffstat (limited to 'packages/initrdscripts/files')
-rw-r--r--packages/initrdscripts/files/90-check-modules.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/initrdscripts/files/90-check-modules.sh b/packages/initrdscripts/files/90-check-modules.sh
new file mode 100644
index 0000000000..2423d7f8c5
--- /dev/null
+++ b/packages/initrdscripts/files/90-check-modules.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Check that modules for the current kernel exist, error out otherwise
+
+uname=`cat /proc/version`
+ver=`expr "x$uname" : 'xLinux version \([^ ]\+\) '`
+
+if [ -n "$BOOT_ROOT" -a ! -d "$BOOT_ROOT/lib/modules/$ver" ]; then
+ echo -e "\033[1m===================="
+ echo "ERROR!"
+ echo "There are no modules for this kernel"
+ echo "version ($ver) in the root file "
+ echo "system, which will lead to boot failure or"
+ echo "broken functionally. If you performed"
+ echo "a kernel upgrade, make sure that version"
+ echo "installed in root filesystem matches"
+ echo "version used in bootloader."
+ echo -e "====================\033[0m"
+ echo
+
+ echo "System halted"
+ while true; do
+ sleep 10000
+ done
+fi