summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-12-16 19:25:36 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-12-16 19:25:36 +0100
commit99485b28aa396e68bd374d792c1686f396b7ee2e (patch)
tree01b60588e7224d88e60dcdeb9d21679f78ded183 /src
parent303a52a1af49db280d8d364aedc477e6f4316189 (diff)
probably fix for deletion of dm_mapper devices
Diffstat (limited to 'src')
-rw-r--r--src/core/libs/lib-ui-interactive.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 4b7e273..6bb5612 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -386,14 +386,15 @@ interactive_filesystem ()
# Cascading remove theoretical blockdevice(s), if relevant ( eg if we just changed from vg->ext3, dm_crypt -> fat, or if we changed the label of a FS, causing a name change in a dm_mapper device)
- if [[ $old_fs_type = lvm-* || $old_fs_type = dm_crypt ]] && [ "$NEW_FILESYSTEM" = no_fs -o "$old_fs_type" != "$fs_type" -o "$old_fs_label" != "$fs_label" ] #TODO: deletion doesn't work when you delete an lvm LV, maybe otherwise too
+ if [[ $old_fs_type = lvm-* || $old_fs_type = dm_crypt ]] && [ "$NEW_FILESYSTEM" = no_fs -o "$old_fs_type" != "$fs_type" -o "$old_fs_label" != "$fs_label" ]
then
target=
[ "$old_fs_type" = lvm-vg ] && target="/dev/mapper/$old_fs_label $old_fs_type $old_fs_label"
[ "$old_fs_type" = lvm-pv ] && target="$part+ $old_fs_type $old_fs_label"
[ "$old_fs_type" = lvm-lv ] && target="/dev/mapper/$part_label-$old_fs_label $old_fs_type $old_fs_label"
[ "$old_fs_type" = dm_crypt ] && target="/dev/mapper/$old_fs_label $old_fs_type $old_fs_label"
- sed -i "#$target#d" $TMP_BLOCKDEVICES #TODO: check affected items, delete those, etc etc.
+ declare target_escaped=${target//\//\\/} # note: apparently no need to escape the '+' sign
+ sed -i "#$target_escaped#d" $TMP_BLOCKDEVICES #TODO: check affected items, delete those, etc etc.
fi
return 0