summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-02-11 15:26:41 +0000
committerOlivier Blin <oblin@mandriva.com>2009-02-11 15:26:41 +0000
commitae0e97e233c57d01e5c1fcb05e6243535d5f061f (patch)
treec4dc727a3387f5140374c7ec26b092770e0128f2
parent1b0301c344612da9e005c3eb4a3a70557fb77f53 (diff)
downloaddrakx-ae0e97e233c57d01e5c1fcb05e6243535d5f061f.tar
drakx-ae0e97e233c57d01e5c1fcb05e6243535d5f061f.tar.gz
drakx-ae0e97e233c57d01e5c1fcb05e6243535d5f061f.tar.bz2
drakx-ae0e97e233c57d01e5c1fcb05e6243535d5f061f.tar.xz
drakx-ae0e97e233c57d01e5c1fcb05e6243535d5f061f.zip
move win32 code in detect_and_resize_win32
-rwxr-xr-xrescue/restore-image.sh26
1 files changed, 14 insertions, 12 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh
index c59113f9c..7ad4d17e8 100755
--- a/rescue/restore-image.sh
+++ b/rescue/restore-image.sh
@@ -94,19 +94,10 @@ function detect_root()
fi
devs_found=$(($(echo $devices | wc -w)/2))
- # we might use it later again
- fdisk -l | grep "^/dev/" | grep -v ${inst_source_dev} > /tmp/fdisk.log
- # get the last created windows partition information
- set -f
- first_win32_part_dev=$(grep -e "FAT\|NTFS\|HPFS" /tmp/fdisk.log | tail -1 | sed 's/ .*$//')
- set +f
-
- # won't handle complex layouts
+ # win32 detection won't handle complex layouts
if [ "${devs_found}" = 1 ]; then
- if [ -n "${first_win32_part_dev}" ]; then
- root=$(detect_and_resize_win32 $first_win32_part_dev)
- fi
+ root=$(detect_and_resize_win32 ${inst_source_dev})
fi
if [ -z "${root}" ]; then
@@ -134,7 +125,18 @@ function detect_root()
function detect_and_resize_win32()
{
# from detect_root()
- device=${1}
+ skip_dev=${1}
+
+ # we might use it later again
+ fdisk -l | grep "^/dev/" | grep -v ${inst_source_dev} > /tmp/fdisk.log
+ # get the last created windows partition information
+ set -f
+ 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
+ exit
+ fi
# it might be needed, for safety
device_type=$(vol_id --type ${device})