aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2023-03-30 14:31:45 +0000
committerEd Maste <emaste@FreeBSD.org>2023-04-10 23:07:14 +0000
commit22db5e5d03278471c46799016c177abf95f273cb (patch)
tree417b0e6fbba0b6de836c23df5aeecd772669d2fa
parent1d1ffa2efd2a54c435b7977dc1cfd21dce248671 (diff)
makefs: set the validation entry system type
Obtained from: NetBSD c3cb4dcc9c43 Sponsored by: The FreeBSD Foundation
-rw-r--r--usr.sbin/makefs/cd9660/cd9660_eltorito.c10
1 files changed, 9 insertions, 1 deletions
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;