Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2023 23:08:02 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 22db5e5d0327 - main - makefs: set the validation entry system type
Message-ID:  <202304102308.33AN82Mo001397@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by emaste:

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

commit 22db5e5d03278471c46799016c177abf95f273cb
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-03-30 14:31:45 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-04-10 23:07:14 +0000

    makefs: set the validation entry system type
    
    Obtained from:  NetBSD c3cb4dcc9c43
    Sponsored by:   The FreeBSD Foundation
---
 usr.sbin/makefs/cd9660/cd9660_eltorito.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
index 6d7a32378b64..f837c0b3c381 100644
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
@@ -374,6 +374,7 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int first_sector)
 	struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, *efi_head,
 		*valid_entry, *default_entry, *temp, *head, **headp, *next;
 	struct cd9660_boot_image *tmp_disk;
+	uint8_t system;
 
 	headp = NULL;
 	x86_head = mac_head = ppc_head = efi_head = NULL;
@@ -388,9 +389,16 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int first_sector)
 	cd9660_731(first_sector,
 	    diskStructure->boot_descriptor->boot_catalog_pointer);
 
+	/*
+	 * Use system type of default image for validation entry. Fallback to
+	 * X86 system type if not found.
+	 */
+	system = default_boot_image != NULL ? default_boot_image->system :
+	    ET_SYS_X86;
+
 	/* Step 1: Generate boot catalog */
 	/* Step 1a: Validation entry */
-	valid_entry = cd9660_boot_setup_validation_entry(ET_SYS_X86);
+	valid_entry = cd9660_boot_setup_validation_entry(system);
 	if (valid_entry == NULL)
 		return -1;
 



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