]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: hydractl: provision: fix byte unit from megabyte to mebibyte
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Jan 2022 21:38:47 +0000 (18:38 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Jan 2022 21:38:47 +0000 (18:38 -0300)
share/hydractl/provision

index 35137ee5961a9240158b8025ad04aa50b5080d03..c219a0f4c91c5353c042b58de64e09fa32a1a8de 100755 (executable)
@@ -231,7 +231,7 @@ else
   # See https://rainbow.chard.org/2013/01/30/how-to-align-partitions-for-best-performance-using-parted/
   #     https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-block
   #     https://people.redhat.com/msnitzer/docs/io-limits.txt
-  megabyte="$((1024*1024))"
+  mebibyte="$((1024*1024))"
   block="`echo $device | sed -e 's|^/dev/||'`"
   optimal_size="`cat /sys/block/$block/queue/optimal_io_size`"
 
@@ -240,7 +240,7 @@ else
   #     https://blog.hqcodeshop.fi/archives/273-GNU-Parted-Solving-the-dreaded-The-resulting-partition-is-not-properly-aligned-for-best-performance.html
   #     http://opensource.hqcodeshop.com/Parted%20calculator/parted_mkpart_calc.sh
   if [ "$optimal_size" == "0" ]; then
-    optimal_size="$megabyte"
+    optimal_size="$mebibyte"
   fi
 
   alignment_offset="`cat /sys/block/$block/alignment_offset`"
@@ -249,7 +249,7 @@ else
   optimal_sector_size="$(($optimal_size / $block_size))"
 
   # Sector size for a 1MB partition
-  bios_grub_size="$(($megabyte/$block_size))"
+  bios_grub_size="$(($mebibyte/$block_size))"
   bios_grub_end="$(($start + $bios_grub_size - 1))"
 
   # Regular disk partitioning.
@@ -289,7 +289,7 @@ else
     #boot_start="$(($bios_grub_end + 1))"
     boot_size="1024"
     boot_start="`partition_sector_start $start $bios_grub_end $optimal_sector_size`"
-    boot_size="$(($boot_size * $megabyte / $block_size))"
+    boot_size="$(($boot_size * $mebibyte / $block_size))"
     boot_end="$(($boot_start + $boot_size -1))"
     #lvm_start="$($boot_end + 1))"
     lvm_start="`partition_sector_start $start $boot_end $optimal_sector_size`"