update ext filesystem support to latest distro standars
Jason D. Clinton [Wed, 22 Apr 2009 02:58:04 +0000 (21:58 -0500)]
etc/cloner/prep_disks.sh

index f6a684c..132072e 100755 (executable)
@@ -178,16 +178,36 @@ do
 
                case "${FS_TYPE}"
                in
+                       ext4)
+                                       CMD="/usr/bin/mke2fs -F -T ext4 ${FS_DEVICE}"
+                                       if [ "${FS_LABEL}" != "" ]
+                                       then
+                                               CMD="/usr/bin/mke2fs -F -T ext4 -L ${FS_LABEL} ${FS_DEVICE}"
+                                       fi
+
+                                       $CMD >> /tmp/stdout.log 2>> /tmp/stderr.log
+                                       if [ "$?" = "0" ]
+                                       then
+                                               # try to tune it out of fsck's but dont care if it fails
+                                               /usr/bin/tune2fs -c 0 ${FS_DEVICE}
+                                               ok_msg
+                                       else
+                                               fail_msg
+                                               fatal_error "Failed to make ext4 filesystem on ${FS_DEVICE}"
+                                       fi
+                               ;;
                        ext3)
-                                       CMD="/usr/bin/mke2fs -F -j ${FS_DEVICE}"
+                                       CMD="/usr/bin/mke2fs -F -T ext3 ${FS_DEVICE}"
                                        if [ "${FS_LABEL}" != "" ]
                                        then    
-                                               CMD="/usr/bin/mke2fs -F -L ${FS_LABEL} -j ${FS_DEVICE}"
+                                               CMD="/usr/bin/mke2fs -F -T ext3 -L ${FS_LABEL} ${FS_DEVICE}"
                                        fi
        
                                        $CMD >> /tmp/stdout.log 2>> /tmp/stderr.log
                                        if [ "$?" = "0" ]
                                        then
+                                               # try to tune it out of fsck's but dont care if it fails
+                                               /usr/bin/tune2fs -c 0 ${FS_DEVICE}
                                                ok_msg
                                        else
                                                fail_msg
@@ -195,10 +215,10 @@ do
                                        fi
                                ;;
                        ext2)
-                                       CMD="/usr/bin/mke2fs -F ${FS_DEVICE}"
+                                       CMD="/usr/bin/mke2fs -F -T ext2 ${FS_DEVICE}"
                                        if [ "${FS_LABEL}" != "" ]
                                        then    
-                                               CMD="/usr/bin/mke2fs -F -L ${FS_LABEL} ${FS_DEVICE}"
+                                               CMD="/usr/bin/mke2fs -F -T ext2 -L ${FS_LABEL} ${FS_DEVICE}"
                                        fi
        
                                        $CMD >> /tmp/stdout.log 2>> /tmp/stderr.log