tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: i386: boot using tftp by default when using pxeboot




Am 13.09.2009 um 12:21 schrieb Marc Balmer:

pxeboot_ia32.bin tries to boot 'netbsd' by default, which fails in most
cases.  It does not make sense imo to try booting a local kernel when
booting the machine via PXE. I suggest that when we boot using PXE, we
default to loading 'tftp:netbsd' instead.


I discussed this off-list with Jared McNeill and we think a good strategy to decide where to boot from would be to look at what the DHCP server sends us:

- If we get an option root-path, we assume nfs, read boot.cfg from nfs and then boot the kernel from nfs.

- Otherwise we assume tftp, read boot.cfg using tftp and boot the kernel using tftp. We don't set a root filesystem path and assume the booted kernel has the root filesystem on a ramdisk (e.g. an installer).

Jared also suggested using option extensions-path to define where to get boot.cfg from.

Of course prefixing a kernel name with a load method ("tftp:", "nfs:") would still be possible, to override the sane default ;)

The goal is to have a pxebooter with sane defaults that work out of the box, but not break existing setups.

That said, there will be a better patch eventually.

Comments?  ok?

Index: sys/arch/i386/stand/pxeboot/main.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/pxeboot/main.c,v
retrieving revision 1.20
diff -u -p -r1.20 main.c
--- sys/arch/i386/stand/pxeboot/main.c  21 Mar 2009 15:01:56 -0000      1.20
+++ sys/arch/i386/stand/pxeboot/main.c  13 Sep 2009 10:14:54 -0000
@@ -146,7 +146,7 @@ main(void)
#endif

        printf("Press return to boot now, any other key for boot menu\n");
-       printf("booting netbsd - starting in ");
+       printf("booting tftp:netbsd - starting in ");

#ifdef SMALL
        c = awaitkey(boot_params.bp_timeout, 1);
@@ -164,7 +164,7 @@ main(void)
         * The file name provided here is just a default.  If the
         * DHCP server provides a file name, we'll use that instead.
         */
-       bootit("netbsd", 0);
+       bootit("tftp:netbsd", 0);

        /*
         * If that fails, let the BIOS try the next boot device.
--
Marc Balmer, Micro Systems, Wiesendamm 2a, Postfach, CH-4019 Basel, Switzerland http://www.msys.ch/ http://www.vnode.ch/ "In God we trust, in C we code."



Home | Main Index | Thread Index | Old Index