#!/bin/sh
-#
# geninitrd mod: dmraid
+USE_DMRAID=${USE_DMRAID:-yes}
# if we should init dmraid at boot
have_dmraid=no
-if [ -x /sbin/dmraid-initrd ]; then
- USE_DMRAID=yes
-else
- USE_DMRAID=no
-fi
+# setup geninitrd module
+# @access public
+setup_mod_dmraid() {
+ dmraid=$(find_tool $initrd_dir/dmraid /sbin/dmraid-initrd)
+ if [ ! -x /sbin/dmraid ] || [ ! -x "$dmraid" ]; then
+ USE_DMRAID=no
+ fi
+
+ if [ "$kernel_version" -lt "002006" ]; then
+ USE_DMRAID=no
+ fi
+}
# return true if dmraid is set on $devpath
# @param string $devpath device node to be examined
# generate initrd fragment for dmraid
# @access public
initrd_gen_dmraid() {
- if [ ! -x /sbin/dmraid-initrd ]; then
- die "/sbin/dmraid-initrd is missing!"
+ if ! is_yes "$have_dmraid"; then
+ return
fi
inst_d /sbin
- inst_exec /sbin/dmraid-initrd /sbin/dmraid
+ inst_exec $dmraid /sbin/dmraid
mount_dev
mount_sys