[Rear-users] SF.net SVN: rear:[751] trunk/usr/share/rear

jhoekx at users.sourceforge.net jhoekx at users.sourceforge.net
Wed Jan 18 09:44:51 CET 2012


Revision: 751
          http://rear.svn.sourceforge.net/rear/?rev=751&view=rev
Author:   jhoekx
Date:     2012-01-18 08:44:51 +0000 (Wed, 18 Jan 2012)
Log Message:
-----------
layout: no longer show ram* and loop* devices as options during target disk mapping.

The exact blacklist can be configured in default.conf.

Modified Paths:
--------------
    trunk/usr/share/rear/conf/default.conf
    trunk/usr/share/rear/layout/prepare/default/30_map_disks.sh

Modified: trunk/usr/share/rear/conf/default.conf
===================================================================
--- trunk/usr/share/rear/conf/default.conf	2012-01-17 16:14:44 UTC (rev 750)
+++ trunk/usr/share/rear/conf/default.conf	2012-01-18 08:44:51 UTC (rev 751)
@@ -552,6 +552,9 @@
 # Only used to exclude files from the restore.
 EXCLUDE_RESTORE=()
 
+# Exclude several device names from being viable mapping options during a restore
+EXCLUDE_DEVICE_MAPPING=( "loop*" "ram*" )
+
 ################ ---- various warnings
 #
 # Warnings can be also disabled by unsetting these variables

Modified: trunk/usr/share/rear/layout/prepare/default/30_map_disks.sh
===================================================================
--- trunk/usr/share/rear/layout/prepare/default/30_map_disks.sh	2012-01-17 16:14:44 UTC (rev 750)
+++ trunk/usr/share/rear/layout/prepare/default/30_map_disks.sh	2012-01-18 08:44:51 UTC (rev 751)
@@ -79,6 +79,19 @@
             continue
         fi
 
+        ### Skip if the name is in EXCLUDE_DEVICE_MAPPING
+        skip=
+        for name in "${EXCLUDE_DEVICE_MAPPING[@]}" ; do
+            case "${path##*/}" in
+                ($name)
+                    skip=y
+                    ;;
+            esac
+        done
+        if [[ "$skip" ]] ; then
+            continue
+        fi
+
         if ! reverse_mapping_exists "/dev/$(get_device_name $path)" && [ -d $path/queue ] ; then
             possible_targets=("${possible_targets[@]}" "$(get_device_name $path)")
         fi

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rear-users mailing list