summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-12-11 17:53:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-12-11 17:53:19 +0000
commita205b583b766276393a32258200f8ab6635b0c73 (patch)
tree61efbebcdfdf3031e836bef589a386524aca31af /sys/arch/amd64
parentea3a215b72ffece821e6b68e94ad26b7526d1261 (diff)
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
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/autoconf.c17
-rw-r--r--sys/arch/amd64/amd64/machdep.c6
2 files changed, 9 insertions, 14 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