summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/losetup.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/functions/losetup.sh b/functions/losetup.sh
index 233e637..3c470f9 100755
--- a/functions/losetup.sh
+++ b/functions/losetup.sh
@@ -35,3 +35,20 @@ Losetup ()
${LH_ROOT_COMMAND} ${LH_LOSETUP} -o "${OFFSET}" "${DEVICE}" "${FILE}"
fi
}
+
+Calculate_partition_size ()
+{
+ ORIGINAL_SIZE="${1}"
+ FILESYSTEM="${2}"
+
+ case "${FILESYSTEM}" in
+ ext2|ext3)
+ PERCENT="5"
+ ;;
+ *)
+ PERCENT="2"
+ ;;
+ esac
+
+ echo $(expr ${ORIGINAL_SIZE} + ${ORIGINAL_SIZE} \* ${PERCENT} / 100)
+}