diff options
author | kn <kn@cvs.openbsd.org> | 2020-06-08 19:17:13 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2020-06-08 19:17:13 +0000 |
commit | 179d5f98f5f96156e3ba843002b62771bc53ce84 (patch) | |
tree | 6f3517d7606c1dd31796eea1f29cc1374f89116c /usr.sbin/installboot/i386_softraid.c | |
parent | 4d87865a98319d86a2bc0e344c7f71e8349381e4 (diff) |
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.c | 3 |
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); } /* |