diff -urN mkinitrd/init mkinitrd-dmraid/init
--- mkinitrd/init	2012-10-12 10:32:02.000000000 +0600
+++ mkinitrd-dmraid/init	2012-10-12 10:45:01.000000000 +0600
@@ -118,6 +118,9 @@
     rootfs=*)
       ROOTFS=$(echo $ARG | cut -f2 -d=)
     ;;
+    rootfstype=*)
+      ROOTFS=$(echo $ARG | cut -f2 -d=)
+    ;;
     waitforroot=*)
       WAIT=$(echo $ARG | cut -f2 -d=)
     ;;
@@ -170,6 +173,11 @@
     fdisk -l /dev/md* 1> /dev/null 2> /dev/null
   fi
 
+  # Initialize ATARAID:
+  if [ -x /sbin/dmraid ]; then
+    /sbin/dmraid -ay -Z
+  fi
+
   # Unlock any encrypted partitions necessary to access the
   # root filesystem, such as encrypted LVM Physical volumes, disk
   # partitions or mdadm arrays.
diff -urN mkinitrd/mkinitrd mkinitrd-dmraid/mkinitrd
--- mkinitrd/mkinitrd	2012-10-12 10:32:08.000000000 +0600
+++ mkinitrd-dmraid/mkinitrd	2012-10-12 12:43:35.000000000 +0600
@@ -44,8 +44,10 @@
 #   Yada yada yada.
 # Modified by Patrick Volkerding <volkerdi@slackware.com> 21 August 2012
 #   Add Btrfs multi-device filesystem support option (-B).
+# Modified by Alexey Rytchkov <lilo0@nm.ru> Oct 2012
+#   Added support for ATARAID partitions (static dmraid and dmsetup binary is required)
 
-MKINITRD_VERSION=1.4.7
+MKINITRD_VERSION=1.4.7a
 
 # Don't include these things from /lib/udev/ in the initrd image
 LIBUDEV_BLACKLIST="\
@@ -103,6 +105,7 @@
           part of a Btrfs multi-device filesystem.
   -M      Add the files in /etc/modprobe.d/ to the initrd
   -R      Add support for RAID partitions
+  -D      Add support for ATARAID partitions
   -V      Display version number
 
 A simple example:  Build an initrd for a reiserfs root partition:
@@ -375,6 +378,10 @@
       RAID=1
       shift
       ;;
+    -D)
+      DMRAID=1
+      shift
+      ;;
     *) # unknown, prevent infinite loop
       shift
       ;;
@@ -484,6 +491,22 @@
   fi
 fi
 
+# Include ATARAID support in initrd
+if [ ! -z "$DMRAID" ]; then
+  if [ -r /sbin/dmraid -a -r /sbin/dmsetup ]; then
+    mkdir -p $SOURCE_TREE/sbin
+    cp /sbin/dmraid $SOURCE_TREE/sbin/dmraid
+    cp /sbin/dmsetup $SOURCE_TREE/sbin/dmsetup
+    chmod 0755 $SOURCE_TREE/sbin/dmraid
+    chmod 0755 $SOURCE_TREE/sbin/dmsetup
+    mkdir -p $SOURCE_TREE/lib/udev/rules.d
+    echo 'KERNEL=="dm-[0-9]*", OPTIONS+="db_persist"' > \
+      $SOURCE_TREE/lib/udev/rules.d/95-dm-initrd.rules
+  else
+    echo "ERROR:  dmraid and/or dmsetup binary is missing, ATARAID support not installed"
+  fi
+fi
+
 # Include Btrfs support in initrd
 if [ ! -z "$BTRFS" ]; then
   if [ -r /sbin/btrfs ]; then
diff -urN mkinitrd/mkinitrd.8 mkinitrd-dmraid/mkinitrd.8
--- mkinitrd/mkinitrd.8	2012-10-12 10:32:11.000000000 +0600
+++ mkinitrd-dmraid/mkinitrd.8	2012-10-12 10:45:01.000000000 +0600
@@ -61,6 +61,9 @@
 .B \-R
 ]
 [
+.B \-D
+]
+[
 .B \-V
 ]
 .SH DESCRIPTION
@@ -187,6 +190,10 @@
 This option adds RAID support to the initrd, if a static mdadm binary is
 available on the system.
 .TP
+.B \-D
+This option adds ATARAID support to the initrd, if a static dmraid binary is
+available on the system.
+.TP
 .B \-V
 Display version information and exit.
 .SH EXAMPLES
diff -urN mkinitrd/mkinitrd.SlackBuild mkinitrd-dmraid/mkinitrd.SlackBuild
--- mkinitrd/mkinitrd.SlackBuild	2012-10-12 10:32:15.000000000 +0600
+++ mkinitrd-dmraid/mkinitrd.SlackBuild	2012-10-12 10:51:59.000000000 +0600
@@ -21,7 +21,7 @@
 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-VERSION=${VERSION:-1.4.7}
+VERSION=${VERSION:-1.4.7a}
 BB=1.20.1
 BUILD=${BUILD:-6}
 
diff -urN mkinitrd/mkinitrd.conf.5 mkinitrd-dmraid/mkinitrd.conf.5
--- mkinitrd/mkinitrd.conf.5	2012-10-12 10:32:18.000000000 +0600
+++ mkinitrd-dmraid/mkinitrd.conf.5	2012-10-12 10:45:01.000000000 +0600
@@ -157,6 +157,16 @@
 RAID="1"          # Add RAID support to initrd
 
 .TP 5
+.I DMRAID
+This option adds the dmraid binary to the initrd to support ATARAID.
+.br
+Examples:
+.br
+DMRAID="0"          # Do not add ATARAID support to initrd
+.br
+DMRAID="1"          # Add ATARAID support to initrd
+
+.TP 5
 .I LVM
 This option adds support for LVM partitions into the initrd.
 If you wish to add LVM support to the initrd, then set this to 1;
diff -urN mkinitrd/mkinitrd.conf.sample mkinitrd-dmraid/mkinitrd.conf.sample
--- mkinitrd/mkinitrd.conf.sample	2012-10-12 10:32:21.000000000 +0600
+++ mkinitrd-dmraid/mkinitrd.conf.sample	2012-10-12 10:45:01.000000000 +0600
@@ -13,6 +13,7 @@
 #ROOTFS="ext3"
 #RESUMEDEV="/dev/sda2"
 #RAID="0"
+#DMRAID="0"
 #LVM="0"
 #UDEV="1"
 #MODCONF="0"
