aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Marcet <javier@marcet.info>2020-04-04 17:52:29 +0200
committerChristian Lamparter <chunkeey@gmail.com>2021-12-29 21:38:58 +0100
commite81dd8a10a141936650da707447bdf3f976aab4b (patch)
tree0cf5c43f81b2bfa305117289df559357c6ade548
parent8166bbf6803053224a6b5807ed6d1f8391d2021c (diff)
downloadupstream-e81dd8a10a141936650da707447bdf3f976aab4b.tar.gz
upstream-e81dd8a10a141936650da707447bdf3f976aab4b.tar.bz2
upstream-e81dd8a10a141936650da707447bdf3f976aab4b.zip
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 <javier@marcet.info> [moved the dot] Signed-off-by: Christian Lamparter <chunkeey@gmail.com> (cherry picked from commit 018ada5403f02921be22ee0cf49b88b2700ee105)
-rw-r--r--package/base-files/files/lib/upgrade/common.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index 968893e226..13dbb7ab25 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -267,7 +267,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