Remove modules dependency
authorDaniel Drake <dsd@laptop.org>
Thu, 2 Jul 2009 09:06:15 +0000 (10:06 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 2 Jul 2009 15:18:09 +0000 (17:18 +0200)
This makes it possible to build a dracut initramfs without modules,
where all needed kernel drivers are built into the kernel image.

dracut
modules.d/99base/check

diff --git a/dracut b/dracut
index 1d440efec1c06a4482c741ba778fbda1cfaee3de..ee8f6eb1354c25f4084f468389ad3f5a82734b1e 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -140,9 +140,11 @@ echo $mods_to_load
 ## final stuff that has to happen
 
 # generate module dependencies for the initrd
-if ! depmod -a -b "$initdir" $kernel; then
-    echo "\"depmod -a $kernel\" failed."
-    exit 1
+if [ -d "$initdir/lib/modules/$kernel" ]; then
+    if ! depmod -a -b "$initdir" $kernel; then
+        echo "\"depmod -a $kernel\" failed."
+        exit 1
+    fi
 fi
 
 # make sure that library links are correct and up to date
index 5c3bc510fc5f39d3378efa28ae9220bca98ba1f1..de9a2818e2028cf4a15b4b065c27b94c725fc069 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/bash
-[[ $1 = -d ]] && echo udev-rules kernel-modules
-exit 0
\ No newline at end of file
+[[ $1 = -d ]] && echo udev-rules 
+exit 0