Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/makefs Add "efi" as a supported boot image type and...



details:   https://anonhg.NetBSD.org/src/rev/d609ad35a9c3
branches:  trunk
changeset: 957044:d609ad35a9c3
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Nov 15 00:18:48 2020 +0000

description:
Add "efi" as a supported boot image type and derive the platform ID for
the validation entry from the default boot image instead of hard-coding
X86.

diffstat:

 usr.sbin/makefs/cd9660/cd9660_eltorito.c |  18 ++++++++++++++----
 usr.sbin/makefs/makefs.8                 |   5 +++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diffs (83 lines):

diff -r f2a462b80401 -r d609ad35a9c3 usr.sbin/makefs/cd9660/cd9660_eltorito.c
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c  Sat Nov 14 23:03:08 2020 +0000
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c  Sun Nov 15 00:18:48 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_eltorito.c,v 1.23 2018/03/28 06:48:55 nonaka Exp $      */
+/*     $NetBSD: cd9660_eltorito.c,v 1.24 2020/11/15 00:18:48 jmcneill Exp $    */
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660_eltorito.c,v 1.23 2018/03/28 06:48:55 nonaka Exp $");
+__RCSID("$NetBSD: cd9660_eltorito.c,v 1.24 2020/11/15 00:18:48 jmcneill Exp $");
 #endif  /* !__lint */
 
 #ifdef DEBUG
@@ -109,9 +109,11 @@
        else if (strcmp(sysname, "macppc") == 0 ||
                 strcmp(sysname, "mac68k") == 0)
                new_image->system = ET_SYS_MAC;
+       else if (strcmp(sysname, "efi") == 0)
+               new_image->system = ET_SYS_EFI;
        else {
                warnx("boot disk system must be "
-                     "i386, powerpc, macppc, or mac68k");
+                     "i386, powerpc, macppc, mac68k, or efi");
                free(temp);
                free(new_image);
                return 0;
@@ -363,6 +365,7 @@
        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;
+       u_char system;
 
        headp = NULL;
        x86_head = mac_head = ppc_head = efi_head = NULL;
@@ -377,9 +380,16 @@
        cd9660_bothendian_dword(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;
 
diff -r f2a462b80401 -r d609ad35a9c3 usr.sbin/makefs/makefs.8
--- a/usr.sbin/makefs/makefs.8  Sat Nov 14 23:03:08 2020 +0000
+++ b/usr.sbin/makefs/makefs.8  Sun Nov 15 00:18:48 2020 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: makefs.8,v 1.65 2020/04/04 13:44:57 reinoud Exp $
+.\"    $NetBSD: makefs.8,v 1.66 2020/11/15 00:18:48 jmcneill Exp $
 .\"
 .\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -33,7 +33,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 6, 2019
+.Dd November 14, 2020
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -358,6 +358,7 @@
 where
 .Dq sysid
 is one of
+.Ql efi ,
 .Ql i386 ,
 .Ql mac68k ,
 .Ql macppc ,



Home | Main Index | Thread Index | Old Index