summaryrefslogtreecommitdiffstats
path: root/usr.sbin/installboot/i386_softraid.c
diff options
context:
space:
mode:
authorkn <kn@openbsd.org>2020-06-08 19:17:12 +0000
committerkn <kn@openbsd.org>2020-06-08 19:17:12 +0000
commit9de342e3b04133ec23118695b2817c7cf6cad954 (patch)
treea6520a92f3352cc1f5561d55501eb175e23e493a /usr.sbin/installboot/i386_softraid.c
parentSet up 64-bit mmio windows and enable DMA bypass mode. (diff)
downloadwireguard-openbsd-9de342e3b04133ec23118695b2817c7cf6cad954.tar.xz
wireguard-openbsd-9de342e3b04133ec23118695b2817c7cf6cad954.zip
Provide clear errors when trying to install oversized boot loader
sparc64 installboot(8) on softraid(4) with too large files, e.g. unstripped builds, fails poorly with "installboot: softraid installboot failed". This is due to the BIOCINSTALLBOOT ioctl(2) returing the default EINVAL rather than using softraid's sr_error() interface properly; additionally, installboot does not check for such message from the bio(4) layer. Make the kernel generate "boot block too large" and "boot loader too large" messages for softraid devices and have installboot act upon them analogous to bioctl(8), by adapting its bio_status() into the new sr_status() helper. Input, reminder to look at bioctl, same kernel diff from, OK jsing
Diffstat (limited to 'usr.sbin/installboot/i386_softraid.c')
-rw-r--r--usr.sbin/installboot/i386_softraid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/installboot/i386_softraid.c b/usr.sbin/installboot/i386_softraid.c
index 5c4de777772..9971a23496d 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.15 2020/03/09 06:16:56 otto Exp $ */
+/* $OpenBSD: i386_softraid.c,v 1.16 2020/06/08 19:17:12 kn Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
* Copyright (c) 2010 Otto Moerbeek <otto@drijf.net>
@@ -178,6 +178,7 @@ sr_install_bootldr(int devfd, char *dev)
"softraid volume\n", dev);
if (ioctl(devfd, BIOCINSTALLBOOT, &bb) == -1)
errx(1, "softraid installboot failed");
+ sr_status(&bb.bb_bio.bio_status);
}
/*