summaryrefslogtreecommitdiffstats
path: root/client/engine/Image.lib
diff options
context:
space:
mode:
authoradv <adv@uma.es>2011-05-08 19:52:57 +0000
committeradv <adv@uma.es>2011-05-08 19:52:57 +0000
commitbe3b96a1e4567a1c6697c46e465ca50eee446095 (patch)
tree9db721b814b2252144d60f47b3365e3191e0a462 /client/engine/Image.lib
parent7e4db2f6872974f0b54e2391fee5d04eacdebb5e (diff)
version 1.0.1 #389 controlando tamaƱo de particion y sistema de archivos en procesos de restauracion de imagenes
git-svn-id: https://opengnsys.es/svn/branches/version1.0@1945 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/engine/Image.lib')
-rwxr-xr-xclient/engine/Image.lib6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/engine/Image.lib b/client/engine/Image.lib
index c85354a1..d21bc258 100755
--- a/client/engine/Image.lib
+++ b/client/engine/Image.lib
@@ -489,7 +489,9 @@ IMGFILE=$(ogGetPath "$1" "$2.$IMGTYPE")
[ -r "$IMGFILE" ] || ogRaiseError OG_ERR_NOTFOUND "$IMGFILE" || return $?
# Error si la imagen no cabe en la particion.
IMGSIZE=$(ogGetImageSize "$1" "$2")
-PARTSIZE=$(ogGetPartitionSize $3 $4)
+#TODO:
+#PARTSIZE=$(ogGetPartitionSize $3 $4)
+PARTSIZE=$(parted `ogDiskToDev $3 $4` unit kB print | awk '{y=x; x=$4};END{print y}' | tr -d kB)
if [ $IMGSIZE -gt $PARTSIZE ]; then
ogRaiseError $OG_ERR_IMGSIZEPARTITION "$IMGSIZE > $PARTSIZE"
return $?
@@ -678,7 +680,7 @@ then
then
TOOLS=PARTCLONE
FS=$(echo $PARTCLONEINFO | awk '{gsub(/\: /,"\n"); print toupper($8);}')
- echo $PARTCLONEINFO | grep GB > /dev/null && SIZEFACTOR=1048576 || SIZEFACTOR=1024
+ echo $PARTCLONEINFO | grep GB > /dev/null && SIZEFACTOR=1000000 || SIZEFACTOR=1024
SIZE=$(echo $PARTCLONEINFO | awk -v FACTOR=$SIZEFACTOR '{gsub(/\: /,"\n"); printf "%d\n", $11*FACTOR;}')
IMGDETECT="TRUE"
fi