From 426ccd2e0cf56394017d32b864cd66a570852706 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 14 Aug 2022 20:51:37 +0200 Subject: [PATCH] uvol: fix autopart handling double/float number Consider only integer part of free space in megabytes when deciding the boundaries of the to be created partition. Signed-off-by: Daniel Golle (cherry picked from commit f50a289e515fcdc49da5c19d58ed3af54c640cd4) --- utils/uvol/files/autopart.defaults | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/uvol/files/autopart.defaults b/utils/uvol/files/autopart.defaults index 870cd4415..99ea09406 100644 --- a/utils/uvol/files/autopart.defaults +++ b/utils/uvol/files/autopart.defaults @@ -63,14 +63,14 @@ get_free_area() { ;; [0-9]*) case "$size" in + *"k" | *"b") + continue + ;; *"M") - [ "${size%%M}" -lt 100 ] && continue + [ "${size%%.*M}" -lt 100 ] && continue ;; *"G" | *"T") ;; - *"k" | *"b") - continue - ;; esac [ "$found" ] || echo "start=$start, size=$((end - start))" found=1