Browse Source

base-files: upgrade: fix efi partitions size calculation

We were missing (not using) the last sector of each partition,
compared with the output of gparted.

Signed-off-by: Javier Marcet <[email protected]>
[moved the dot]
Signed-off-by: Christian Lamparter <[email protected]>
Javier Marcet 5 years ago
parent
commit
018ada5403
1 changed files with 1 additions and 1 deletions
  1. 1 1
      package/base-files/files/lib/upgrade/common.sh

+ 1 - 1
package/base-files/files/lib/upgrade/common.sh

@@ -245,7 +245,7 @@ get_partitions() { # <device> <filename>
 				local type="$1"
 				local lba="$(( $(hex_le32_to_cpu $4) * 0x100000000 + $(hex_le32_to_cpu $3) ))"
 				local end="$(( $(hex_le32_to_cpu $6) * 0x100000000 + $(hex_le32_to_cpu $5) ))"
-				local num="$(( $end - $lba ))"
+				local num="$(( $end - $lba + 1 ))"
 
 				[ "$type" = "00000000000000000000000000000000" ] && continue