aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2023-01-18 15:33:30 -0700
committerDaniel Golle <daniel@makrotopia.org>2023-01-23 01:31:52 +0000
commitb1edbe349f9e70c72c4a48565a4fd37c94f20a0a (patch)
treec4bd437f16780fda0d1b67bdeeaf7d94a74b549b /utils
parent36a45c4ce709c025fb309ca52c256d0d3a55e00c (diff)
uvol: fix regression in handling fractional megabytes free
Also, fix off-by-one issue when computing free size. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/uvol/Makefile4
-rw-r--r--utils/uvol/files/autopart.defaults15
2 files changed, 5 insertions, 14 deletions
diff --git a/utils/uvol/Makefile b/utils/uvol/Makefile
index ab2f8ba61..591a6a645 100644
--- a/utils/uvol/Makefile
+++ b/utils/uvol/Makefile
@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uvol
-PKG_VERSION:=0.8
-PKG_RELEASE:=$(AUTORELEASE)
+PKG_VERSION:=0.9
+PKG_RELEASE:=1
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=GPL-2.0-or-later
diff --git a/utils/uvol/files/autopart.defaults b/utils/uvol/files/autopart.defaults
index 99ea09406..007dd3e2e 100644
--- a/utils/uvol/files/autopart.defaults
+++ b/utils/uvol/files/autopart.defaults
@@ -56,23 +56,14 @@ part_fixup() {
get_free_area() {
local found=
- sfdisk -q -F "$1" 2>/dev/null | while read -r start end sectors size; do
+ sfdisk --bytes -q -F "$1" 2>/dev/null | while read -r start end sectors size; do
case $start in
*"Unpartitioned"* | *"Units:"* | *"Sector"* | *"Start"* )
continue
;;
[0-9]*)
- case "$size" in
- *"k" | *"b")
- continue
- ;;
- *"M")
- [ "${size%%.*M}" -lt 100 ] && continue
- ;;
- *"G" | *"T")
- ;;
- esac
- [ "$found" ] || echo "start=$start, size=$((end - start))"
+ [ $size" -lt $((100 * 1024 * 1024)) ] && continue
+ [ "$found" ] || echo "start=$start, size=$sectors"
found=1
;;
esac