unfinished diff to let pcidump print VPD info

2020-06-07 Thread David Gwynne
I was looking for something in a devices VPD info and got this far
before finding out it wasn't there. I'm a bit over it now though.

PCI VPD stuff is weird because the capability doesn't contain the data
itself, it's a register that lets you communicate with whatever is
storing the data on the device. Rather than let userland do the
necessary writes to the register for that communication, this adds
another PCI ioctl so the kernel can do it on userlands behalf. This also
prevents userland from updating or writing to the VPD info on the
device.

It looks a bit like this:

dlg@ix pcidump$ sudo ./obj/pcidump -v 0:3:0  
 0:3:0: Intel 82599
0x: Vendor ID: 8086, Product ID: 10fb
0x0004: Command: 0107, Status: 0010
0x0008: Class: 02 Network, Subclass: 00 Ethernet,
Interface: 00, Revision: 01
0x000c: BIST: 00, Header Type: 00, Latency Timer: 00,
Cache Line Size: 10
0x0010: BAR mem 64bit addr: 0xfea8/0x0008
0x0018: BAR io addr: 0xc0a0/0x0020
0x001c: BAR empty ()
0x0020: BAR mem 64bit addr: 0xfebd/0x4000
0x0028: Cardbus CIS: 
0x002c: Subsystem Vendor ID: 1028 Product ID: 1f72
0x0030: Expansion ROM Base Address: 
0x0038: 
0x003c: Interrupt Pin: 02 Line: 0a Min Gnt: 00 Max Lat: 00
0x0040: Capability 0x01: Power Management
State: D0
0x0050: Capability 0x05: Message Signalled Interrupts (MSI)
Enabled: yes
0x0070: Capability 0x11: Extended Message Signalled Interrupts (MSI-X)
Enabled: no; table size 64 (BAR 4:0)
0x00a0: Capability 0x10: PCI Express
0x0100: Enhanced Capability 0x01: Advanced Error Reporting
0x0140: Enhanced Capability 0x03: Device Serial Number
Serial Number: 02deffad
0x00e0: Capability 0x03: Vital Product Data (VPD)
Product Name: X520 10GbE Controller
PN: G61346
MN: 1028
V0: FFV14.5.8
V1: DSV1028VPDR.VER1.0
V3: DTINIC
V4: DCM10010081D521010081D5
V5: NPY2
V6: PMT12345678
V7: NMVIntel Corp
RV: \M-z

If anyone think there's value in doing more work on it, please feel
free.

dlg

Index: sys/dev/pci/pci.c
===
RCS file: /cvs/src/sys/dev/pci/pci.c,v
retrieving revision 1.115
diff -u -p -r1.115 pci.c
--- sys/dev/pci/pci.c   15 Jan 2020 14:01:19 -  1.115
+++ sys/dev/pci/pci.c   8 Jun 2020 03:13:05 -
@@ -1031,10 +1031,11 @@ pci_vpd_read(pci_chipset_tag_t pc, pcita
int ofs, i, j;
 
KASSERT(data != NULL);
-   KASSERT((offset + count) < 0x7fff);
+   if (offset + count) >= PCI_VPD_ADDRESS_MASK)
+   return (EINVAL);
 
if (pci_get_capability(pc, tag, PCI_CAP_VPD, , ) == 0)
-   return (1);
+   return (ENXIO);
 
for (i = 0; i < count; offset += sizeof(*data), i++) {
reg &= 0x;
@@ -1049,7 +1050,7 @@ pci_vpd_read(pci_chipset_tag_t pc, pcita
j = 0;
do {
if (j++ == 20)
-   return (1);
+   return (EIO);
delay(4);
reg = pci_conf_read(pc, tag, ofs);
} while ((reg & PCI_VPD_OPFLAG) == 0);
@@ -1203,6 +1204,7 @@ pciioctl(dev_t dev, u_long cmd, caddr_t 
break;
case PCIOCGETROMLEN:
case PCIOCGETROM:
+   case PCIOCGETVPD:
break;
case PCIOCGETVGA:
case PCIOCSETVGA:
@@ -1366,6 +1368,35 @@ pciioctl(dev_t dev, u_long cmd, caddr_t 
 
fail:
rom->pr_romlen = PCI_ROM_SIZE(mask);
+   break;
+   }
+
+   case PCIOCGETVPD: {
+   struct pci_vpd_req *pv = (struct pci_vpd_req *)data;
+   pcireg_t *data;
+   size_t len;
+   int s;
+
+   CTASSERT(sizeof(*data) == sizeof(*pv->pv_data));
+
+   data = mallocarray(pv->pv_count, sizeof(*data), M_TEMP,
+   M_WAITOK|M_CANFAIL);
+   if (data == NULL) {
+   error = ENOMEM;
+   break;
+   }
+
+   s = splhigh();
+   error = pci_vpd_read(pc, tag, pv->pv_offset, pv->pv_count,
+   data);
+   splx(s);
+
+   len = pv->pv_count * sizeof(*pv->pv_data);
+
+   if (error == 0)
+   error = copyout(data, pv->pv_data, len);
+
+   free(data, M_TEMP, len);
break;
}
 
Index: sys/sys/pciio.h

[PATCH] [xenocara] app/xenodm/config/Xsetup_0 - reduce the number of lines

2020-06-07 Thread Raf Czlonka
Hi all,

I've been running openbsd-backgrounds on all of my desktop machines and
thought this can be simplified a bit:

- fewer lines to uncomment
- easier to automate, i.e. via one liner, script, config management, etc.
- still under 80 columns wide

For your consideration.

Cheers,

Raf

Index: app/xenodm/config/Xsetup_0
===
RCS file: /cvs/xenocara/app/xenodm/config/Xsetup_0,v
retrieving revision 1.6
diff -u -p -r1.6 Xsetup_0
--- app/xenodm/config/Xsetup_0  29 Jun 2019 13:33:06 -  1.6
+++ app/xenodm/config/Xsetup_0  7 Jun 2020 18:29:16 -
@@ -6,9 +6,6 @@ xconsole -geometry 480x130-0-0 -daemon -
 #  install package openbsd-backgrounds
 #  then uncomment:
 #
-# if test -x /usr/local/bin/openbsd-wallpaper
-# then
-#  /usr/local/bin/openbsd-wallpaper
-# fi
+# test -x /usr/local/bin/openbsd-wallpaper && /usr/local/bin/openbsd-wallpaper
 
 # sxpm OpenBSD.xpm &



Re: BIOCINSTALLBOOT/sparc64 installboot: EFBIG on too big boot loaders

2020-06-07 Thread Klemens Nanni
On Sun, Jun 07, 2020 at 03:24:30PM +0200, Klemens Nanni wrote:
> On Sun, Jun 07, 2020 at 12:42:57AM +1000, Joel Sing wrote:
> > While this works, you would be better off making use of the error
> > reporting mechanism that exists. A compile tested only diff for
> > the kernel side is below. A diff to installboot would be needed to
> > graft some code similar to that in bioctl's bio_status() function.
> Thanks, I didn't even look how bioctl(8) does it; that seems better.
> 
> The complete diff for softraid(4),  and installboot(8)
> makes sparc64 look like this:
> 
>   # ./obj/installboot -v sd2 /usr/mdec/bootblk /ofwboot.big
>   Using / as root
>   installing bootstrap on /dev/rsd2c
>   using first-stage /usr/mdec/bootblk, second-stage /ofwboot.big
>   boot block is 6882 bytes (14 blocks @ 512 bytes = 7168 bytes)
>   sd2: softraid volume with 1 disk(s)
>   sd2: installing boot loader on softraid volume
>   installboot: boot loader too large (272452 > 163840)
>   # echo $?
>   1
> 
> I ommitted "is" from the kernel message to stay in line with other
> "too large" ones in softraid.c.
> 
> Contrary to bioctl's bio_status(), installboot's new sr_status() uses
> warnx(3) for simplicity and put warnings on stderr (where they belong).
> 
> Feedback? OK?
Updated diff after the biovar.h commit.


Index: sys/dev/softraid.c
===
RCS file: /cvs/src/sys/dev/softraid.c,v
retrieving revision 1.401
diff -u -p -r1.401 softraid.c
--- sys/dev/softraid.c  14 Apr 2020 07:38:21 -  1.401
+++ sys/dev/softraid.c  7 Jun 2020 11:20:05 -
@@ -3704,11 +3704,17 @@ sr_ioctl_installboot(struct sr_softc *sc
goto done;
}
 
-   if (bb->bb_bootblk_size > SR_BOOT_BLOCKS_SIZE * DEV_BSIZE)
+   if (bb->bb_bootblk_size > SR_BOOT_BLOCKS_SIZE * DEV_BSIZE) {
+   sr_error(sc, "boot block is too large (%d > %d)",
+   bb->bb_bootblk_size, SR_BOOT_BLOCKS_SIZE * DEV_BSIZE);
goto done;
+   }
 
-   if (bb->bb_bootldr_size > SR_BOOT_LOADER_SIZE * DEV_BSIZE)
+   if (bb->bb_bootldr_size > SR_BOOT_LOADER_SIZE * DEV_BSIZE) {
+   sr_error(sc, "boot loader is too large (%d > %d)",
+   bb->bb_bootldr_size, SR_BOOT_LOADER_SIZE * DEV_BSIZE);
goto done;
+   }
 
secsize = sd->sd_meta->ssdi.ssd_secsize;
 
Index: usr.sbin/installboot/i386_softraid.c
===
RCS file: /cvs/src/usr.sbin/installboot/i386_softraid.c,v
retrieving revision 1.15
diff -u -p -r1.15 i386_softraid.c
--- usr.sbin/installboot/i386_softraid.c9 Mar 2020 06:16:56 -   
1.15
+++ usr.sbin/installboot/i386_softraid.c7 Jun 2020 12:31:20 -
@@ -178,6 +178,7 @@ sr_install_bootldr(int devfd, char *dev)
"softraid volume\n", dev);
if (ioctl(devfd, BIOCINSTALLBOOT, ) == -1)
errx(1, "softraid installboot failed");
+   sr_status(_bio.bio_status);
}
 
/*
Index: usr.sbin/installboot/installboot.h
===
RCS file: /cvs/src/usr.sbin/installboot/installboot.h,v
retrieving revision 1.11
diff -u -p -r1.11 installboot.h
--- usr.sbin/installboot/installboot.h  1 Sep 2018 16:55:29 -   1.11
+++ usr.sbin/installboot/installboot.h  7 Jun 2020 11:46:52 -
@@ -15,6 +15,8 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include 
+
 #include 
 
 extern int nowrite;
@@ -41,4 +43,5 @@ void  md_installboot(int, char *);
 void   sr_installboot(int, char *);
 void   sr_install_bootblk(int, int, int);
 void   sr_install_bootldr(int, char *);
+void   sr_status(struct bio_status *);
 #endif
Index: usr.sbin/installboot/softraid.c
===
RCS file: /cvs/src/usr.sbin/installboot/softraid.c,v
retrieving revision 1.4
diff -u -p -r1.4 softraid.c
--- usr.sbin/installboot/softraid.c 3 Oct 2015 16:56:52 -   1.4
+++ usr.sbin/installboot/softraid.c 7 Jun 2020 13:04:24 -
@@ -92,3 +92,19 @@ sr_volume(int devfd, char *dev, int *vol
 
return 1;
 }
+
+void
+sr_status(struct bio_status *bs)
+{
+   int i;
+
+   for (i = 0; i < bs->bs_msg_count; i++)
+   warnx("%s", bs->bs_msgs[i].bm_msg);
+
+   if (bs->bs_status == BIO_STATUS_ERROR) {
+   if (bs->bs_msg_count == 0)
+   errx(1, "unknown error");
+   else
+   exit(1);
+   }
+}
Index: usr.sbin/installboot/sparc64_softraid.c
===
RCS file: /cvs/src/usr.sbin/installboot/sparc64_softraid.c,v
retrieving revision 1.4
diff -u -p -r1.4 sparc64_softraid.c
--- usr.sbin/installboot/sparc64_softraid.c 28 Jun 2019 13:32:48 -  
1.4
+++ 

Re: biovar.h: Add missing include guard

2020-06-07 Thread Klemens Nanni
On Sun, Jun 07, 2020 at 10:31:31AM -0600, Theo de Raadt wrote:
> No.
> 
> "So at minimum, the leading _"...
Does "_SYS_DEV_BIOVAR_H_" not contain a leading underscore?

What am I missing?



Re: biovar.h: Add missing include guard

2020-06-07 Thread Theo de Raadt
No.

"So at minimum, the leading _"...


Klemens Nanni  wrote:

> On Sun, Jun 07, 2020 at 09:58:44AM -0600, Theo de Raadt wrote:
> > Bad naming.  The correct protection is visible in others in the same
> > directory, most of them doing it better.
> > 
> > audio_if.h:#ifndef _SYS_DEV_AUDIO_IF_H_
> > ipmi.h:#ifndef _IPMI_H_
> > ipmivar.h:#ifndef _IPMIVAR_H_
> > midi_if.h:#ifndef _SYS_DEV_MIDI_IF_H_
> > midivar.h:#ifndef _SYS_DEV_MIDIVAR_H_
> > radio_if.h:#ifndef _SYS_DEV_RADIO_IF_H
> > radiovar.h:#ifndef _SYS_DEV_RADIOVAR_H
> > rndis.h:#ifndef _DEV_RNDIS_H_
> > softraidvar.h:#ifndef SOFTRAIDVAR_H
> > video_if.h:#ifndef _SYS_DEV_VIDEO_IF_H
> > vndioctl.h:#ifndef _SYS_VNDIOCTL_H_
> > vscsivar.h:#ifndef _SYS_DEV_VSCSIVAR_H
> Thanks, I picked softraidvar.h to adapt from...
> 
> > So at minimum, the leading _, but the directory name and _H_ at end
> > is also common.
> Sure.
> 
> Should we do SOFTRAIDVAR_H -> _SYS_DEV_SOFTRAIDVAR_H_ as well?
> 
> 
> Index: biovar.h
> ===
> RCS file: /cvs/src/sys/dev/biovar.h,v
> retrieving revision 1.45
> diff -u -p -r1.45 biovar.h
> --- biovar.h  14 Aug 2016 04:08:03 -  1.45
> +++ biovar.h  7 Jun 2020 16:28:16 -
> @@ -26,6 +26,9 @@
>   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> +#ifndef _SYS_DEV_BIOVAR_H_
> +#define _SYS_DEV_BIOVAR_H_
> +
>  /*
>   * Devices getting ioctls through this interface should use ioctl class 'B'
>   * and command numbers starting from 32, lower ones are reserved for generic
> @@ -305,3 +308,5 @@ void  bio_info(struct bio_status *, int, 
>  void bio_warn(struct bio_status *, int, const char *, ...);
>  void bio_error(struct bio_status *, int, const char *, ...);
>  #endif
> +
> +#endif /* _SYS_DEV_BIOVAR_H_ */
> 



Re: biovar.h: Add missing include guard

2020-06-07 Thread Klemens Nanni
On Sun, Jun 07, 2020 at 09:58:44AM -0600, Theo de Raadt wrote:
> Bad naming.  The correct protection is visible in others in the same
> directory, most of them doing it better.
> 
> audio_if.h:#ifndef _SYS_DEV_AUDIO_IF_H_
> ipmi.h:#ifndef _IPMI_H_
> ipmivar.h:#ifndef _IPMIVAR_H_
> midi_if.h:#ifndef _SYS_DEV_MIDI_IF_H_
> midivar.h:#ifndef _SYS_DEV_MIDIVAR_H_
> radio_if.h:#ifndef _SYS_DEV_RADIO_IF_H
> radiovar.h:#ifndef _SYS_DEV_RADIOVAR_H
> rndis.h:#ifndef _DEV_RNDIS_H_
> softraidvar.h:#ifndef SOFTRAIDVAR_H
> video_if.h:#ifndef _SYS_DEV_VIDEO_IF_H
> vndioctl.h:#ifndef _SYS_VNDIOCTL_H_
> vscsivar.h:#ifndef _SYS_DEV_VSCSIVAR_H
Thanks, I picked softraidvar.h to adapt from...

> So at minimum, the leading _, but the directory name and _H_ at end
> is also common.
Sure.

Should we do SOFTRAIDVAR_H -> _SYS_DEV_SOFTRAIDVAR_H_ as well?


Index: biovar.h
===
RCS file: /cvs/src/sys/dev/biovar.h,v
retrieving revision 1.45
diff -u -p -r1.45 biovar.h
--- biovar.h14 Aug 2016 04:08:03 -  1.45
+++ biovar.h7 Jun 2020 16:28:16 -
@@ -26,6 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef _SYS_DEV_BIOVAR_H_
+#define _SYS_DEV_BIOVAR_H_
+
 /*
  * Devices getting ioctls through this interface should use ioctl class 'B'
  * and command numbers starting from 32, lower ones are reserved for generic
@@ -305,3 +308,5 @@ voidbio_info(struct bio_status *, int, 
 void   bio_warn(struct bio_status *, int, const char *, ...);
 void   bio_error(struct bio_status *, int, const char *, ...);
 #endif
+
+#endif /* _SYS_DEV_BIOVAR_H_ */



Re: biovar.h: Add missing include guard

2020-06-07 Thread Theo de Raadt
Bad naming.  The correct protection is visible in others in the same
directory, most of them doing it better.

audio_if.h:#ifndef _SYS_DEV_AUDIO_IF_H_
ipmi.h:#ifndef _IPMI_H_
ipmivar.h:#ifndef _IPMIVAR_H_
midi_if.h:#ifndef _SYS_DEV_MIDI_IF_H_
midivar.h:#ifndef _SYS_DEV_MIDIVAR_H_
radio_if.h:#ifndef _SYS_DEV_RADIO_IF_H
radiovar.h:#ifndef _SYS_DEV_RADIOVAR_H
rndis.h:#ifndef _DEV_RNDIS_H_
softraidvar.h:#ifndef SOFTRAIDVAR_H
video_if.h:#ifndef _SYS_DEV_VIDEO_IF_H
vndioctl.h:#ifndef _SYS_VNDIOCTL_H_
vscsivar.h:#ifndef _SYS_DEV_VSCSIVAR_H

So at minimum, the leading _, but the directory name and _H_ at end
is also common.

Klemens Nanni  wrote:

> 
> 
> Building installboot(8) with multiple  includes fails
> without this.
> 
> OK?
> 
> 
> Index: dev/biovar.h
> ===
> RCS file: /cvs/src/sys/dev/biovar.h,v
> retrieving revision 1.45
> diff -u -p -r1.45 biovar.h
> --- dev/biovar.h  14 Aug 2016 04:08:03 -  1.45
> +++ dev/biovar.h  7 Jun 2020 11:55:15 -
> @@ -26,6 +26,9 @@
>   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> +#ifndef BIOVAR_H
> +#define BIOVAR_H
> +
>  /*
>   * Devices getting ioctls through this interface should use ioctl class 'B'
>   * and command numbers starting from 32, lower ones are reserved for generic
> @@ -305,3 +308,5 @@ void  bio_info(struct bio_status *, int, 
>  void bio_warn(struct bio_status *, int, const char *, ...);
>  void bio_error(struct bio_status *, int, const char *, ...);
>  #endif
> +
> +#endif /* BIOVAR_H */
> 



Re: BIOCINSTALLBOOT/sparc64 installboot: EFBIG on too big boot loaders

2020-06-07 Thread Klemens Nanni
On Sun, Jun 07, 2020 at 12:42:57AM +1000, Joel Sing wrote:
> While this works, you would be better off making use of the error
> reporting mechanism that exists. A compile tested only diff for
> the kernel side is below. A diff to installboot would be needed to
> graft some code similar to that in bioctl's bio_status() function.
Thanks, I didn't even look how bioctl(8) does it; that seems better.

The complete diff for softraid(4),  and installboot(8)
makes sparc64 look like this:

# ./obj/installboot -v sd2 /usr/mdec/bootblk /ofwboot.big
Using / as root
installing bootstrap on /dev/rsd2c
using first-stage /usr/mdec/bootblk, second-stage /ofwboot.big
boot block is 6882 bytes (14 blocks @ 512 bytes = 7168 bytes)
sd2: softraid volume with 1 disk(s)
sd2: installing boot loader on softraid volume
installboot: boot loader too large (272452 > 163840)
# echo $?
1

I ommitted "is" from the kernel message to stay in line with other
"too large" ones in softraid.c.

Contrary to bioctl's bio_status(), installboot's new sr_status() uses
warnx(3) for simplicity and put warnings on stderr (where they belong).

Feedback? OK?


Index: sys/dev/biovar.h
===
RCS file: /cvs/src/sys/dev/biovar.h,v
retrieving revision 1.45
diff -u -p -r1.45 biovar.h
--- sys/dev/biovar.h14 Aug 2016 04:08:03 -  1.45
+++ sys/dev/biovar.h7 Jun 2020 11:55:15 -
@@ -26,6 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef BIOVAR_H
+#define BIOVAR_H
+
 /*
  * Devices getting ioctls through this interface should use ioctl class 'B'
  * and command numbers starting from 32, lower ones are reserved for generic
@@ -305,3 +308,5 @@ voidbio_info(struct bio_status *, int, 
 void   bio_warn(struct bio_status *, int, const char *, ...);
 void   bio_error(struct bio_status *, int, const char *, ...);
 #endif
+
+#endif /* BIOVAR_H */
Index: sys/dev/softraid.c
===
RCS file: /cvs/src/sys/dev/softraid.c,v
retrieving revision 1.401
diff -u -p -r1.401 softraid.c
--- sys/dev/softraid.c  14 Apr 2020 07:38:21 -  1.401
+++ sys/dev/softraid.c  7 Jun 2020 11:20:05 -
@@ -3704,11 +3704,17 @@ sr_ioctl_installboot(struct sr_softc *sc
goto done;
}
 
-   if (bb->bb_bootblk_size > SR_BOOT_BLOCKS_SIZE * DEV_BSIZE)
+   if (bb->bb_bootblk_size > SR_BOOT_BLOCKS_SIZE * DEV_BSIZE) {
+   sr_error(sc, "boot block is too large (%d > %d)",
+   bb->bb_bootblk_size, SR_BOOT_BLOCKS_SIZE * DEV_BSIZE);
goto done;
+   }
 
-   if (bb->bb_bootldr_size > SR_BOOT_LOADER_SIZE * DEV_BSIZE)
+   if (bb->bb_bootldr_size > SR_BOOT_LOADER_SIZE * DEV_BSIZE) {
+   sr_error(sc, "boot loader is too large (%d > %d)",
+   bb->bb_bootldr_size, SR_BOOT_LOADER_SIZE * DEV_BSIZE);
goto done;
+   }
 
secsize = sd->sd_meta->ssdi.ssd_secsize;
 
Index: usr.sbin/installboot/i386_softraid.c
===
RCS file: /cvs/src/usr.sbin/installboot/i386_softraid.c,v
retrieving revision 1.15
diff -u -p -r1.15 i386_softraid.c
--- usr.sbin/installboot/i386_softraid.c9 Mar 2020 06:16:56 -   
1.15
+++ usr.sbin/installboot/i386_softraid.c7 Jun 2020 12:31:20 -
@@ -178,6 +178,7 @@ sr_install_bootldr(int devfd, char *dev)
"softraid volume\n", dev);
if (ioctl(devfd, BIOCINSTALLBOOT, ) == -1)
errx(1, "softraid installboot failed");
+   sr_status(_bio.bio_status);
}
 
/*
Index: usr.sbin/installboot/installboot.h
===
RCS file: /cvs/src/usr.sbin/installboot/installboot.h,v
retrieving revision 1.11
diff -u -p -r1.11 installboot.h
--- usr.sbin/installboot/installboot.h  1 Sep 2018 16:55:29 -   1.11
+++ usr.sbin/installboot/installboot.h  7 Jun 2020 11:46:52 -
@@ -15,6 +15,8 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include 
+
 #include 
 
 extern int nowrite;
@@ -41,4 +43,5 @@ void  md_installboot(int, char *);
 void   sr_installboot(int, char *);
 void   sr_install_bootblk(int, int, int);
 void   sr_install_bootldr(int, char *);
+void   sr_status(struct bio_status *);
 #endif
Index: usr.sbin/installboot/softraid.c
===
RCS file: /cvs/src/usr.sbin/installboot/softraid.c,v
retrieving revision 1.4
diff -u -p -r1.4 softraid.c
--- usr.sbin/installboot/softraid.c 3 Oct 2015 16:56:52 -   1.4
+++ usr.sbin/installboot/softraid.c 7 Jun 2020 13:04:24 -
@@ -92,3 +92,19 @@ sr_volume(int devfd, char *dev, int *vol
 
return 1;
 }
+
+void
+sr_status(struct 

biovar.h: Add missing include guard

2020-06-07 Thread Klemens Nanni


Building installboot(8) with multiple  includes fails
without this.

OK?


Index: dev/biovar.h
===
RCS file: /cvs/src/sys/dev/biovar.h,v
retrieving revision 1.45
diff -u -p -r1.45 biovar.h
--- dev/biovar.h14 Aug 2016 04:08:03 -  1.45
+++ dev/biovar.h7 Jun 2020 11:55:15 -
@@ -26,6 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef BIOVAR_H
+#define BIOVAR_H
+
 /*
  * Devices getting ioctls through this interface should use ioctl class 'B'
  * and command numbers starting from 32, lower ones are reserved for generic
@@ -305,3 +308,5 @@ voidbio_info(struct bio_status *, int, 
 void   bio_warn(struct bio_status *, int, const char *, ...);
 void   bio_error(struct bio_status *, int, const char *, ...);
 #endif
+
+#endif /* BIOVAR_H */