add xenial support with basic debian parity
[automated-distro-installer] / fai / config / scripts / LAST / 50-misc
index 62c31db7b3a3ceafe726aa5ad180a387fcce75a8..232b0c807d2feb1f3edeb84b49c5cd58655d1fdf 100755 (executable)
@@ -4,20 +4,25 @@
 
 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
 
-# check if mdadm has been forgotten
-if grep -q active /proc/mdstat 2>/dev/null; then
+if [ "$FAI_ACTION" = "dirinstall" ] ; then
+  :
+else
+  # check if mdadm has been forgotten
+  if grep -q active /proc/mdstat 2>/dev/null; then
     if [ ! -d $target/etc/mdadm ]; then
        echo ERROR: Found Software RAID, but the mdadm package was not installed
        error=1
     fi
-fi
-
-usedm=$(dmsetup ls | egrep -v '^live-rw|^live-base|^No devices found' | wc -l)
-if [ $usedm -ne 0 ]; then
-    if [ ! -d $target/etc/lvm ]; then
-       echo ERROR: Found lvm devices, but the lvm2 package was not installed
-       error=1
-    fi
+  fi
+
+  # # commented because it does false possitive
+  # usedm=$(dmsetup ls | egrep -v '^live-rw|^live-base|^No devices found' | wc -l)
+  # if [ $usedm -ne 0 ]; then
+  #   if [ ! -d $target/etc/lvm ]; then
+  #       echo ERROR: Found lvm devices, but the lvm2 package was not installed
+  #       error=1
+  #   fi
+  # fi
 fi
 
 # remove backup files from cfengine, but only if cfengine is installed
@@ -41,7 +46,7 @@ if [ $do_init_tasks -eq 1 ] ; then
 fi
 
 # Make sure everything is configured properly
-if ifclass DEBIAN ; then
+if ifclass DEBIAN || ifclass UBUNTU; then
         echo "Running \"apt-get -f install\" for the last time."
         $ROOTCMD apt-get -f install
 fi