Source-Changes-HG archive

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

[src/netbsd-8]: src/usr.sbin/makefs/cd9660 Pull up following revision(s) (req...



details:   https://anonhg.NetBSD.org/src/rev/2748088ddea0
branches:  netbsd-8
changeset: 851520:2748088ddea0
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Mar 30 11:07:12 2018 +0000

description:
Pull up following revision(s) (requested by nonaka in ticket #660):
        usr.sbin/makefs/cd9660/cd9660_eltorito.c: revision 1.22
        usr.sbin/makefs/cd9660/cd9660_eltorito.c: revision 1.23

Initialize boot_catalog_entry's entry_type properly.

This had been missing but the type was used in cd9660_setup_boot().
>From OpenBSD usr.sbin/makefs/cd9660/cd9660_eltorito.c r1.10.

Correctly mark the last El Torito section header.
Pointed out by Benno Rice via DM.

diffstat:

 usr.sbin/makefs/cd9660/cd9660_eltorito.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (63 lines):

diff -r d485a3a30c64 -r 2748088ddea0 usr.sbin/makefs/cd9660/cd9660_eltorito.c
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c  Mon Mar 26 11:20:48 2018 +0000
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c  Fri Mar 30 11:07:12 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_eltorito.c,v 1.21 2017/01/24 11:22:43 nonaka Exp $      */
+/*     $NetBSD: cd9660_eltorito.c,v 1.21.4.1 2018/03/30 11:07:12 martin 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.21 2017/01/24 11:22:43 nonaka Exp $");
+__RCSID("$NetBSD: cd9660_eltorito.c,v 1.21.4.1 2018/03/30 11:07:12 martin Exp $");
 #endif  /* !__lint */
 
 #ifdef DEBUG
@@ -247,6 +247,7 @@
        size_t i;
        entry = cd9660_init_boot_catalog_entry();
 
+       entry->entry_type = ET_ENTRY_VE;
        ve = &entry->entry_data.VE;
 
        ve->header_id[0] = 1;
@@ -281,6 +282,7 @@
        if (default_entry == NULL)
                return NULL;
 
+       default_entry->entry_type = ET_ENTRY_IE;
        ie = &default_entry->entry_data.IE;
 
        ie->boot_indicator[0] = disk->bootable;
@@ -308,6 +310,7 @@
        if (entry == NULL)
                return NULL;
 
+       entry->entry_type = ET_ENTRY_SH;
        sh = &entry->entry_data.SH;
        /* More by default. The last one will manually be set to 0x91 */
        sh->header_indicator[0] = ET_SECTION_HEADER_MORE;
@@ -324,6 +327,7 @@
        if ((entry = cd9660_init_boot_catalog_entry()) == NULL)
                return NULL;
 
+       entry->entry_type = ET_ENTRY_SE;
        se = &entry->entry_data.SE;
 
        se->boot_indicator[0] = ET_BOOTABLE;
@@ -493,6 +497,12 @@
                LIST_INSERT_AFTER(head, temp, ll_struct);
        }
 
+       /* Find the last Section Header entry and mark it as the last. */
+       head = NULL;
+       LIST_FOREACH(next, &diskStructure->boot_entries, ll_struct) {
+               if (next->entry_type == ET_ENTRY_SH)
+                       head = next;
+       }
        if (head != NULL)
                head->entry_data.SH.header_indicator[0] = ET_SECTION_HEADER_LAST;
 



Home | Main Index | Thread Index | Old Index