diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-02-11 14:25:13 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-02-11 14:25:13 +0000 |
commit | e8d81c3d85b28c0df7afb44f6b26de422b4131d0 (patch) | |
tree | ac785616d342201c3ba769a05a05ba57a036c3a1 | |
parent | 3dddd920e035b909143861e6fd5ab7a522966b24 (diff) | |
download | drakx-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.tar drakx-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.tar.gz drakx-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.tar.bz2 drakx-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.tar.xz drakx-e8d81c3d85b28c0df7afb44f6b26de422b4131d0.zip |
set number and device_id only when required (setting number broke installation on too small disks)
-rwxr-xr-x | rescue/restore-image.sh | 20 |
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 |