summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand/libsa
diff options
context:
space:
mode:
authorTom Cosgrove <tom@cvs.openbsd.org>2007-07-27 17:46:58 +0000
committerTom Cosgrove <tom@cvs.openbsd.org>2007-07-27 17:46:58 +0000
commit30515f6f19fa739a4b0f706aa4baa76c87996f5d (patch)
tree80f9bd98286467e6c112b1579f3fbe005cdb1cac /sys/arch/i386/stand/libsa
parent618f49663432f1402262847be95ee45f6db23714 (diff)
We don't want to pass the PXE MAC address to the kernel when booting
from a local disk, since the MAC address causes the kernel to look for root on NFS. Do this by remembering (not adding to boot arguments) the MAC address when opening the PXE device, and clearing this if we happen to load a file off a non-network disk. "works as advertised for me" todd@; "stop sitting on this/no objections" deraadt@
Diffstat (limited to 'sys/arch/i386/stand/libsa')
-rw-r--r--sys/arch/i386/stand/libsa/exec_i386.c7
-rw-r--r--sys/arch/i386/stand/libsa/pxe.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/sys/arch/i386/stand/libsa/exec_i386.c b/sys/arch/i386/stand/libsa/exec_i386.c
index 54fae4f6789..cfcefbcbb80 100644
--- a/sys/arch/i386/stand/libsa/exec_i386.c
+++ b/sys/arch/i386/stand/libsa/exec_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_i386.c,v 1.31 2006/03/27 20:34:21 mickey Exp $ */
+/* $OpenBSD: exec_i386.c,v 1.32 2007/07/27 17:46:56 tom Exp $ */
/*
* Copyright (c) 1997-1998 Michael Shalayeff
@@ -40,6 +40,8 @@
typedef void (*startfuncp)(int, int, int, int, int, int, int, int)
__attribute__ ((noreturn));
+char *bootmac = NULL;
+
void
run_loadfile(u_long *marks, int howto)
{
@@ -58,6 +60,9 @@ run_loadfile(u_long *marks, int howto)
cd.conspeed = com_speed;
addbootarg(BOOTARG_CONSDEV, sizeof(cd), &cd);
+ if (bootmac != NULL)
+ addbootarg(BOOTARG_BOOTMAC, sizeof(bios_bootmac_t), bootmac);
+
/* Pass memory map to the kernel */
mem_pass();
diff --git a/sys/arch/i386/stand/libsa/pxe.c b/sys/arch/i386/stand/libsa/pxe.c
index 554a82b3fcb..5c5fc8fe977 100644
--- a/sys/arch/i386/stand/libsa/pxe.c
+++ b/sys/arch/i386/stand/libsa/pxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxe.c,v 1.4 2006/05/20 22:37:40 deraadt Exp $ */
+/* $OpenBSD: pxe.c,v 1.5 2007/07/27 17:46:56 tom Exp $ */
/* $NetBSD: pxe.c,v 1.5 2003/03/11 18:29:00 drochner Exp $ */
/*
@@ -115,6 +115,8 @@ BOOTPLAYER bootplayer;
struct in_addr servip; /* for tftp */ /* XXX init this */
+extern char *bootmac; /* To pass to kernel */
+
/* static struct btinfo_netif bi_netif; */
/*****************************************************************************
@@ -230,7 +232,7 @@ pxe_netif_open()
}
bcopy(bootplayer.CAddr, desc.myea, ETHER_ADDR_LEN);
- addbootarg(BOOTARG_BOOTMAC, sizeof(bios_bootmac_t), bootplayer.CAddr);
+ bootmac = bootplayer.CAddr;
/*
* Since the PXE BIOS has already done DHCP, make sure we