summaryrefslogtreecommitdiffstats
path: root/usr.sbin/installboot/i386_softraid.c
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2015-10-25 21:21:15 +0000
committerstsp <stsp@openbsd.org>2015-10-25 21:21:15 +0000
commit7528d680d9d77e95509b6cafb0554c9117024149 (patch)
treeda8e8a0c860a06cbd518f5c7836d8000961e994d /usr.sbin/installboot/i386_softraid.c
parentFold "malloc" into "stdio" and -- recognizing that no program so far has (diff)
downloadwireguard-openbsd-7528d680d9d77e95509b6cafb0554c9117024149.tar.xz
wireguard-openbsd-7528d680d9d77e95509b6cafb0554c9117024149.zip
Fix installboot(8) on i386/amd64 when softraid is on top of GPT.
ok krw deraadt
Diffstat (limited to 'usr.sbin/installboot/i386_softraid.c')
-rw-r--r--usr.sbin/installboot/i386_softraid.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/installboot/i386_softraid.c b/usr.sbin/installboot/i386_softraid.c
index 9a943c99aee..ff3d10c41b6 100644
--- a/usr.sbin/installboot/i386_softraid.c
+++ b/usr.sbin/installboot/i386_softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i386_softraid.c,v 1.4 2015/10/03 16:56:52 krw Exp $ */
+/* $OpenBSD: i386_softraid.c,v 1.5 2015/10/25 21:21:15 stsp Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
*
@@ -87,6 +87,12 @@ sr_install_bootblk(int devfd, int vol, int disk)
if (dl.d_type == 0)
warnx("disklabel type unknown");
+ part = findgptefisys(diskfd, &dl);
+ if (part != -1) {
+ write_efisystem(&dl, (char)part);
+ return;
+ }
+
/* Determine poffset and set symbol value. */
pp = &dl.d_partitions[part - 'a'];
if (pp->p_offseth != 0)