summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-02-11 15:07:31 +0000
committerOlivier Blin <oblin@mandriva.com>2009-02-11 15:07:31 +0000
commitd1d6c38ffec93c60598d063a7f89366ed7b75243 (patch)
tree688195e849a4a7a9b3155da54bbf145e2ec66796
parentb69de005c0af4ba87dc5e503d780522d72c8b8c1 (diff)
downloaddrakx-backup-do-not-use-d1d6c38ffec93c60598d063a7f89366ed7b75243.tar
drakx-backup-do-not-use-d1d6c38ffec93c60598d063a7f89366ed7b75243.tar.gz
drakx-backup-do-not-use-d1d6c38ffec93c60598d063a7f89366ed7b75243.tar.bz2
drakx-backup-do-not-use-d1d6c38ffec93c60598d063a7f89366ed7b75243.tar.xz
drakx-backup-do-not-use-d1d6c38ffec93c60598d063a7f89366ed7b75243.zip
run detect_and_resize_win32 first (to move more logic inside)
-rwxr-xr-xrescue/restore-image.sh15
1 files changed, 6 insertions, 9 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh
index f03831881..08741c9e7 100755
--- a/rescue/restore-image.sh
+++ b/rescue/restore-image.sh
@@ -103,7 +103,11 @@ function detect_root()
first_win32_part_dev=$(grep -e "FAT\|NTFS\|HPFS" /tmp/fdisk.log | tail -1 | sed 's/ .*$//')
set +f
- if [ -z "${first_win32_part_dev}" ]; then
+ if [ -n "${first_win32_part_dev}" ]; then
+ root=$(detect_and_resize_win32 $first_disk $first_win32_part_dev)
+ fi
+
+ if [ -z "${root}" ]; then
rm -rf /tmp/fdisk.log
if [ "$devs_found" -gt "2" ]; then
if [ ! -z ${dev} ]; then
@@ -120,8 +124,6 @@ function detect_root()
else
root=$first_disk
fi
- else
- root=$(detect_and_resize_win32 $first_disk $first_win32_part_dev)
fi
echo "${root}"
@@ -155,14 +157,9 @@ function detect_and_resize_win32()
# our install takes half of 'left'
win32_part_new_size=$(($((${used}+${avail}))*2))
resize_win32 ${win32_part_dev} ${win32_part_type} ${win32_part_new_size}
- else
- rm -f /tmp/fdisk.log
+ echo "${disk}${number}"
fi
- else
- rm -f /tmp/fdisk.log
fi
-
- echo "${disk}${number}"
}
function resize_win32()