summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand/pxeboot/devopen.c
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/pxeboot/devopen.c
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/pxeboot/devopen.c')
-rw-r--r--sys/arch/i386/stand/pxeboot/devopen.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/arch/i386/stand/pxeboot/devopen.c b/sys/arch/i386/stand/pxeboot/devopen.c
index cf1deffdd75..836329474f1 100644
--- a/sys/arch/i386/stand/pxeboot/devopen.c
+++ b/sys/arch/i386/stand/pxeboot/devopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: devopen.c,v 1.3 2007/06/27 20:29:38 mk Exp $ */
+/* $OpenBSD: devopen.c,v 1.4 2007/07/27 17:46:57 tom Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -38,6 +38,8 @@ extern char *fs_name[];
extern int nfsname;
extern struct devsw netsw[];
+extern char *bootmac; /* Gets passed to kernel for network boot */
+
/* XXX use slot for 'rd' for 'hd' pseudo-device */
const char bdevs[][4] = {
"wd", "", "fd", "", "sd", "st", "cd", "mcd",
@@ -96,6 +98,16 @@ devopen(struct open_file *f, const char *fname, char **file)
}
}
+ /*
+ * Assume that any network filesystems would be caught by the
+ * code above, so that the next phase of devopen() is only for
+ * local devices.
+ *
+ * Clear bootmac, to signal that we loaded this file from a
+ * non-network device.
+ */
+ bootmac = NULL;
+
for (i = 0; i < ndevs && rc != 0; dp++, i++) {
#ifdef DEBUG
if (debug)