git: 36095c942031 - main - release: Comply with Azure Marketplace requirements for aarch64

From: Li-Wen Hsu <lwhsu_at_FreeBSD.org>
Date: Fri, 07 Nov 2025 05:12:00 UTC
The branch main has been updated by lwhsu:

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

commit 36095c942031f7f1613eec554f1c7615cbd891fd
Author:     Li-Wen Hsu <lwhsu@FreeBSD.org>
AuthorDate: 2025-11-07 05:10:44 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2025-11-07 05:10:44 +0000

    release: Comply with Azure Marketplace requirements for aarch64
    
    Azure requires the first 1 MB (2,048 sectors) of the OS disk to remain
    empty for VM images:
    
      https://learn.microsoft.com/partner-center/marketplace-offers/azure-vm-certification-faq#vm-images-must-have-1-mb-of-free-space
    
    Also append the BOOTPARTSOFFSET suffix for aarch64 images, which only
    has an ESP partition for booting.
    
    Co-authored-by: Brad Davis <brd@FreeBSD.org>
    Approved by:    cperciva
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D53628
---
 release/tools/vmimage.subr | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr
index 8531e9b8f2d6..92f00f9cf7c3 100644
--- a/release/tools/vmimage.subr
+++ b/release/tools/vmimage.subr
@@ -449,7 +449,11 @@ vm_create_disk() {
 		# Create an ESP
 		espfilename=$(mktemp /tmp/efiboot.XXXXXX)
 		make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi
-		BOOTPARTS="${BOOTPARTS} -p efi/efiboot0:=${espfilename}"
+		espsuffix=""
+		if [ -z "${BOOTPARTS}" ]; then
+			espsuffix="${BOOTPARTSOFFSET}"
+		fi
+		BOOTPARTS="${BOOTPARTS} -p efi/efiboot0:=${espfilename}${espsuffix}"
 
 		# Add this to fstab
 		mkdir -p ${DESTDIR}/boot/efi