summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2007-12-11 17:53:16 +0000
committerderaadt <deraadt@openbsd.org>2007-12-11 17:53:16 +0000
commit0afea549102d35aa4084d5549c318d0d6f5780b5 (patch)
tree20f03effbb7a6b5dc977e18553c98055d8abb96a
parentmention starttls(8) (diff)
downloadwireguard-openbsd-0afea549102d35aa4084d5549c318d0d6f5780b5.tar.xz
wireguard-openbsd-0afea549102d35aa4084d5549c318d0d6f5780b5.zip
if we pxebooted, and can find the interface, put it in a "pxeboot" group
so that later applications can try to do the right thing for reyk
-rw-r--r--sys/arch/amd64/amd64/autoconf.c17
-rw-r--r--sys/arch/amd64/amd64/machdep.c6
-rw-r--r--sys/arch/i386/i386/autoconf.c17
-rw-r--r--sys/arch/i386/i386/bios.c6
4 files changed, 18 insertions, 28 deletions
diff --git a/sys/arch/amd64/amd64/autoconf.c b/sys/arch/amd64/amd64/autoconf.c
index 52782ec6943..e842191d834 100644
--- a/sys/arch/amd64/amd64/autoconf.c
+++ b/sys/arch/amd64/amd64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.22 2007/06/01 19:25:09 deraadt Exp $ */
+/* $OpenBSD: autoconf.c,v 1.23 2007/12/11 17:53:18 deraadt Exp $ */
/* $NetBSD: autoconf.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -143,9 +143,7 @@ diskconf(void)
struct device *bootdv = NULL;
dev_t tmpdev;
char buf[128];
-#if defined(NFSCLIENT)
extern bios_bootmac_t *bios_bootmac;
-#endif
dkcsumattach();
@@ -158,12 +156,9 @@ diskconf(void)
bootdv = parsedisk(buf, strlen(buf), part, &tmpdev);
}
-#if defined(NFSCLIENT)
if (bios_bootmac) {
struct ifnet *ifp;
- printf("PXE boot MAC address %s, ",
- ether_sprintf(bios_bootmac->mac));
for (ifp = TAILQ_FIRST(&ifnet); ifp != NULL;
ifp = TAILQ_NEXT(ifp, if_list)) {
if ((ifp->if_type == IFT_ETHER ||
@@ -174,15 +169,19 @@ diskconf(void)
break;
}
if (ifp) {
- printf("interface %s\n", ifp->if_xname);
+ if_addgroup(ifp, "pxeboot");
+#if defined(NFSCLIENT)
+ printf("PXE boot MAC address %s, interface %s",
+ ether_sprintf(bios_bootmac->mac), ifp->if_xname);
mountroot = nfs_mountroot; /* potentially */
bootdv = parsedisk(ifp->if_xname, strlen(ifp->if_xname),
0, &tmpdev);
part = 0;
+#endif
} else
- printf("unknown interface\n");
+ printf("PXE boot MAC address %s, interface %s\n",
+ ether_sprintf(bios_bootmac->mac), "unknown");
}
-#endif
setroot(bootdv, part, RB_USERREQ);
dumpconf();
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 2acbc3a9671..d4d6d581be4 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.66 2007/11/25 09:11:12 jsg Exp $ */
+/* $OpenBSD: machdep.c,v 1.67 2007/12/11 17:53:18 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -221,9 +221,7 @@ typedef struct _boot_args32 {
#define BOOTARGC_MAX NBPG /* one page */
-#ifdef NFSCLIENT
bios_bootmac_t *bios_bootmac;
-#endif
/* locore copies the arguments from /boot to here for us */
char bootinfo[BOOTARGC_MAX];
@@ -1828,11 +1826,9 @@ getbootinfo(char *bootinfo, int bootinfo_size)
cnset(cdp->consdev);
}
break;
-#ifdef NFSCLIENT
case BOOTARG_BOOTMAC:
bios_bootmac = (bios_bootmac_t *)q->ba_arg;
break;
-#endif
default:
#ifdef BOOTINFO_DEBUG
diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c
index 109a719a94c..26ad97903c5 100644
--- a/sys/arch/i386/i386/autoconf.c
+++ b/sys/arch/i386/i386/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.76 2007/11/28 17:05:09 tedu Exp $ */
+/* $OpenBSD: autoconf.c,v 1.77 2007/12/11 17:53:16 deraadt Exp $ */
/* $NetBSD: autoconf.c,v 1.20 1996/05/03 19:41:56 christos Exp $ */
/*-
@@ -178,9 +178,7 @@ diskconf(void)
struct device *bootdv = NULL;
dev_t tmpdev;
char buf[128];
-#if defined(NFSCLIENT)
extern bios_bootmac_t *bios_bootmac;
-#endif
dkcsumattach();
@@ -193,12 +191,9 @@ diskconf(void)
bootdv = parsedisk(buf, strlen(buf), part, &tmpdev);
}
-#if defined(NFSCLIENT)
if (bios_bootmac) {
struct ifnet *ifp;
- printf("PXE boot MAC address %s, ",
- ether_sprintf(bios_bootmac->mac));
for (ifp = TAILQ_FIRST(&ifnet); ifp != NULL;
ifp = TAILQ_NEXT(ifp, if_list)) {
if ((ifp->if_type == IFT_ETHER ||
@@ -209,15 +204,19 @@ diskconf(void)
break;
}
if (ifp) {
- printf("interface %s\n", ifp->if_xname);
+ if_addgroup(ifp, "pxeboot");
+#if defined(NFSCLIENT)
+ printf("PXE boot MAC address %s, interface %s",
+ ether_sprintf(bios_bootmac->mac), ifp->if_xname);
mountroot = nfs_mountroot; /* potentially */
bootdv = parsedisk(ifp->if_xname, strlen(ifp->if_xname),
0, &tmpdev);
part = 0;
+#endif
} else
- printf("unknown interface\n");
+ printf("PXE boot MAC address %s, interface %s\n",
+ ether_sprintf(bios_bootmac->mac), "unknown");
}
-#endif
setroot(bootdv, part, RB_USERREQ);
dumpconf();
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index 74fc30f9ed2..4820a6dc2fd 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.75 2007/12/05 19:17:13 deraadt Exp $ */
+/* $OpenBSD: bios.c,v 1.76 2007/12/11 17:53:16 deraadt Exp $ */
/*
* Copyright (c) 1997-2001 Michael Shalayeff
@@ -100,9 +100,7 @@ struct smbios_entry smbios_entry;
#ifdef MULTIPROCESSOR
void *bios_smpinfo;
#endif
-#ifdef NFSCLIENT
bios_bootmac_t *bios_bootmac;
-#endif
void smbios_info(char*);
@@ -498,11 +496,9 @@ bios_getopt()
break;
#endif
-#ifdef NFSCLIENT
case BOOTARG_BOOTMAC:
bios_bootmac = (bios_bootmac_t *)q->ba_arg;
break;
-#endif
default:
#ifdef BIOS_DEBUG