summaryrefslogtreecommitdiffstats
path: root/usr.sbin/makefs
diff options
context:
space:
mode:
authoryasuoka <yasuoka@openbsd.org>2017-10-31 13:36:22 +0000
committeryasuoka <yasuoka@openbsd.org>2017-10-31 13:36:22 +0000
commit783c932bf0963502981fc3ab00a4fb3c536052ed (patch)
tree822108a947df469fd7f0395f74e8c2538c3914a6 /usr.sbin/makefs
parentFix a bug which made the boot entries' order reverse, introduced at 1.8 on (diff)
downloadwireguard-openbsd-783c932bf0963502981fc3ab00a4fb3c536052ed.tar.xz
wireguard-openbsd-783c932bf0963502981fc3ab00a4fb3c536052ed.zip
Add platform-id for EFI.
seem fine deraadt
Diffstat (limited to 'usr.sbin/makefs')
-rw-r--r--usr.sbin/makefs/cd9660/cd9660_eltorito.c13
-rw-r--r--usr.sbin/makefs/cd9660/cd9660_eltorito.h3
-rw-r--r--usr.sbin/makefs/makefs.87
3 files changed, 15 insertions, 8 deletions
diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
index 7686ac4bd8a..15712d23f36 100644
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_eltorito.c,v 1.11 2017/10/31 13:32:40 yasuoka Exp $ */
+/* $OpenBSD: cd9660_eltorito.c,v 1.12 2017/10/31 13:36:23 yasuoka Exp $ */
/* $NetBSD: cd9660_eltorito.c,v 1.20 2013/01/28 21:03:28 christos Exp $ */
/*
@@ -104,9 +104,11 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, const char *boot_info)
new_image->system = ET_SYS_PPC;
else if (strcmp(sysname, "macppc") == 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, macppc, or powerpc");
+ "i386, macppc, powerpc or efi");
free(temp);
free(new_image);
return 0;
@@ -335,12 +337,12 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int first_sector)
int used_sectors;
int num_entries = 0;
int catalog_sectors;
- struct boot_catalog_entry *x86_head, *mac_head, *ppc_head,
+ 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;
headp = NULL;
- x86_head = mac_head = ppc_head = NULL;
+ x86_head = mac_head = ppc_head = efi_head = NULL;
/* If there are no boot disks, don't bother building boot information */
if (TAILQ_EMPTY(&diskStructure->boot_images))
@@ -413,6 +415,9 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int first_sector)
case ET_SYS_MAC:
headp = &mac_head;
break;
+ case ET_SYS_EFI:
+ headp = &efi_head;
+ break;
default:
warnx("%s: internal error: unknown system type",
__func__);
diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.h b/usr.sbin/makefs/cd9660/cd9660_eltorito.h
index 43483018ef3..f5774238c4e 100644
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.h
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_eltorito.h,v 1.3 2016/12/17 16:22:04 krw Exp $ */
+/* $OpenBSD: cd9660_eltorito.h,v 1.4 2017/10/31 13:36:23 yasuoka Exp $ */
/* $NetBSD: cd9660_eltorito.h,v 1.5 2009/07/04 14:31:38 ahoka Exp $ */
/*
@@ -41,6 +41,7 @@
#define ET_SYS_X86 0
#define ET_SYS_PPC 1
#define ET_SYS_MAC 2
+#define ET_SYS_EFI 0xef
#define ET_BOOT_ENTRY_SIZE 0x20
diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8
index 12cf499261f..d4f522e376f 100644
--- a/usr.sbin/makefs/makefs.8
+++ b/usr.sbin/makefs/makefs.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: makefs.8,v 1.18 2016/11/13 10:22:21 natano Exp $
+.\" $OpenBSD: makefs.8,v 1.19 2017/10/31 13:36:22 yasuoka Exp $
.\" $NetBSD: makefs.8,v 1.55 2015/11/25 16:32:00 wiz Exp $
.\"
.\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: November 13 2016 $
+.Dd $Mdocdate: October 31 2017 $
.Dt MAKEFS 8
.Os
.Sh NAME
@@ -215,8 +215,9 @@ where
is one of
.Ql i386 ,
.Ql macppc ,
+.Ql powerpc
or
-.Ql powerpc .
+.Ql efi .
.It Sy generic-bootimage
Load a generic boot image into the first 32K of the CD9660 image.
.It Sy hard-disk-boot