diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-02-26 14:13:32 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-02-26 14:13:32 +0000 |
commit | 72f86d8886a064108e614940a5e72a7e8af0beab (patch) | |
tree | e2e5237d7c6e1016d115d9ae2eb9f79b41741d05 /rescue/restore-image.sh | |
parent | a4064f5cfa14ebc74472b431dd4766a84dcca705 (diff) | |
download | drakx-72f86d8886a064108e614940a5e72a7e8af0beab.tar drakx-72f86d8886a064108e614940a5e72a7e8af0beab.tar.gz drakx-72f86d8886a064108e614940a5e72a7e8af0beab.tar.bz2 drakx-72f86d8886a064108e614940a5e72a7e8af0beab.tar.xz drakx-72f86d8886a064108e614940a5e72a7e8af0beab.zip |
fix detecting multiple partitions to avoid win32 detection
Diffstat (limited to 'rescue/restore-image.sh')
-rwxr-xr-x | rescue/restore-image.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh index ebbfd6932..61cda588a 100755 --- a/rescue/restore-image.sh +++ b/rescue/restore-image.sh @@ -102,11 +102,7 @@ function detect_root() devs_found=$(($(echo $devices | wc -w)/2)) - root_data= - # win32 detection won't handle complex layouts - if [ "${devs_found}" = 1 ]; then - root_data=$(detect_win32 ${inst_source_dev}) - fi + root_data=$(detect_win32 ${inst_source_dev}) if [ -z "${root_data}" ]; then if [ "$devs_found" -gt "1" ]; then @@ -134,6 +130,11 @@ function detect_win32() # from detect_root() skip_dev=${1} + # win32 detection won't handle complex layouts + if [ $(fdisk -l | grep "^/dev/" | grep -v ${skip_dev} | wc -l) -gt 1 ]; then + exit + fi + # get the last created windows partition information set -f device=$(fdisk -l | grep "^/dev/" | grep -v ${skip_dev} | grep -e "FAT\|NTFS\|HPFS" | tail -1 | sed 's/ .*$//') |