summaryrefslogtreecommitdiffstats
path: root/rescue
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-02-11 14:25:13 +0000
committerOlivier Blin <oblin@mandriva.com>2009-02-11 14:25:13 +0000
commite8d81c3d85b28c0df7afb44f6b26de422b4131d0 (patch)
treeac785616d342201c3ba769a05a05ba57a036c3a1 /rescue
parent3dddd920e035b909143861e6fd5ab7a522966b24 (diff)
downloaddrakx-backup-do-not-use-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.tar
drakx-backup-do-not-use-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.tar.gz
drakx-backup-do-not-use-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.tar.bz2
drakx-backup-do-not-use-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.tar.xz
drakx-backup-do-not-use-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.zip
set number and device_id only when required (setting number broke installation on too small disks)
Diffstat (limited to 'rescue')
-rwxr-xr-xrescue/restore-image.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh
index 358dbffed..046ba10e0 100755
--- a/rescue/restore-image.sh
+++ b/rescue/restore-image.sh
@@ -135,16 +135,6 @@ function resize_win32()
device_type=$(vol_id --type ${device})
modprobe ${device_type}
- # get the next partition integer
- number=$(echo ${device} | sed 's@/dev/...@@g')
- let number++
-
- case ${device_type} in
- vfat) device_id=b ;;
- ntfs) device_id=7 ;;
- hpfs) device_id=87 ;;
- esac
-
# df for that partition
mount ${device} /mnt
size=$(df ${device} | tail -1)
@@ -156,6 +146,16 @@ function resize_win32()
avail=$((${left}/2))
if [ ! ${avail} -lt ${MIN_DISKSIZE} ]; then
+ # get the next partition integer
+ number=$(echo ${device} | sed 's@/dev/...@@g')
+ let number++
+
+ case ${device_type} in
+ vfat) device_id=b ;;
+ ntfs) device_id=7 ;;
+ hpfs) device_id=87 ;;
+ esac
+
# wrapper around libdrakx by blino (it takes half of 'left')
diskdrake-resize ${device} ${device_type} $(($((${used}+${avail}))*2)) &>/dev/null