From owner-dev-commits-src-main@freebsd.org Thu Feb 25 15:37:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99C50567003; Thu, 25 Feb 2021 15:37:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmcNp3cpVz4tcR; Thu, 25 Feb 2021 15:37:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F5C319CFC; Thu, 25 Feb 2021 15:37:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11PFbUAm055046; Thu, 25 Feb 2021 15:37:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PFbUed055045; Thu, 25 Feb 2021 15:37:30 GMT (envelope-from git) Date: Thu, 25 Feb 2021 15:37:30 GMT Message-Id: <202102251537.11PFbUed055045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 3b6268bb9e4a - main - mkimg: We always want the last block of the last inserted partition MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b6268bb9e4aea939c4ce7f37353174aa90e6751 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2021 15:37:30 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=3b6268bb9e4aea939c4ce7f37353174aa90e6751 commit 3b6268bb9e4aea939c4ce7f37353174aa90e6751 Author: Emmanuel Vadot AuthorDate: 2021-02-25 15:34:28 +0000 Commit: Emmanuel Vadot CommitDate: 2021-02-25 15:34:28 +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 --- 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();