From 99485b28aa396e68bd374d792c1686f396b7ee2e Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 16 Dec 2008 19:25:36 +0100 Subject: probably fix for deletion of dm_mapper devices --- src/core/libs/lib-ui-interactive.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3-54-g00ecf