Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Mar 2021 14:21:29 GMT
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f3054d18bfbd - releng/13.0 - mkimg: We always want the last block of the last inserted partition
Message-ID:  <202103021421.122ELTtd068641@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/13.0 has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=f3054d18bfbd4629cb695922f3cd1fab36b1dc5b

commit f3054d18bfbd4629cb695922f3cd1fab36b1dc5b
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2021-02-25 15:34:28 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2021-03-02 14:20:53 +0000

    mkimg: We always want the last block of the last inserted partition
    
    Even with an absolute offset we want to know the last block the partition
    otherwise we endup with an image the size of the metadata.
    This allow to create image with the ESP placed at a specific position which
    is useful on arm/arm64 where u-boot have always a hard time to read the ESP
    if it's not aligned on 512k.
    mkimg -v -o sdcard -s gpt -p efi::54M:1M -p freebsd-ufs::1G
    now works.
    
    MFC after:      3 days
    Approved by:    re (gjb)
    (cherry picked from commit 3b6268bb9e4aea939c4ce7f37353174aa90e6751)
    (cherry picked from commit 9c5f4f8e4ee8261a669ab99257bffd439bad6635)
---
 usr.bin/mkimg/mkimg.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c
index d870f3a8f0c3..c4f0acbe3927 100644
--- a/usr.bin/mkimg/mkimg.c
+++ b/usr.bin/mkimg/mkimg.c
@@ -528,10 +528,8 @@ mkimg(void)
 				    (long long)blkoffset);
 			}
 		}
-		if (!abs_offset) {
-			block = scheme_metadata(SCHEME_META_PART_AFTER,
-			    part->block + part->size);
-		}
+		block = scheme_metadata(SCHEME_META_PART_AFTER,
+		    part->block + part->size);
 	}
 
 	mkimg_validate();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103021421.122ELTtd068641>