iPXE discussion forum

Full Version: boot script for install NetBSD
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, people!

I use multiboot OS with TFTP server using the script menu of different configurations according to the manual (PXE chainloading)
Code:
if exists user-class and option user-class = "iPXE" {
    filename "menu.ipxe";
} else {
    filename "undionly.kpxe";
}

Please, help me to create a configuration of possible variants of the script (menu.ipxe) to install NetBSD by Protocol TFTP!

With according to the man page for this OS
Quote:Bootfile name is set to ``boot.cfg'' during the first request, and then to the filename argument on the boot command line typed in by the user (can be empty), using ``netbsd'' in the non-interactive case.

DHCP Vendor class identifier tag is set to ``NetBSD:i386:libsa''.

The DHCP server can use these fields (i.e. the DHCP vendor class identifier tag and the requested file name, possibly supplied by the user's command line input to the pxeboot program) to distinguish between the various originators of requests (PXE BIOS, first and second pxeboot stage, NetBSD kernel), and to alter its behaviour.
, configuration of the DHCP server does not provide for the use of different menu items:
Code:
if substring (option vendor-class-identifier, 0, 20)
  = "PXEClient:Arch:00000" {
    filename "pxeboot_ia32.bin";
} elsif substring (option vendor-class-identifier, 0, 17)
  = "NetBSD:i386:libsa" {
    if filename = "boot.cfg" {
        filename "tftp:boot.cfg";
    } else if filename = "netbsd" {
        filename "tftp:netbsd-INSTALL.gz";
    }
}
In this way, the loading takes place in several stages (PXE BIOS, first and second pxeboot stage, NetBSD kernel), so, the order of the query filenames is different by DHCP tags..

How to this can be redone to worked menu.ipxe (with a undionly.kpxe)?
I don't really understand your question fully, however you might want to take a look at https://gist.github.com/robinsmidsrod/4008017 for good ways of that config for iPXE
NiKiZe, thanks for the examples, but i don't quite understand how to pass filenames through the script IPXE, because in this case, in the configuration DHCP they are not.
In fact, according to the man NetBSD, the decision to transfer the filenames to the client for download is made at the stage of exchange of DHCP packets based on the substring "NetBSD:i386:libsa" and vendor class ID.
Is it possible to pass them through a script?
p.s. Sorry by very bed english Confused
iPXE supports creating "virtual" DHCP packets, which is cached in the UNDI stack. (one example is at http://forum.ipxe.org/showthread.php?tid...0#pid10350 which just sets the relevant dhcp options, and then loads next stage PXE binary, but you will have to test this yourself)
However if the NetBSD stuff forces a real DHCP request than it is your DHCP server that needs to do this, and then there is no way of iPXE to send specific strings.

After a quick read, your best bet if you want to have iPXE change settings or similar, is to try and not use the NetBSD pxeboot at all, and instead implement that in iPXE
Sorry that I can't help you more here.
(2019-10-28 07:00)NiKiZe Wrote: [ -> ]is to try and not use the NetBSD pxeboot at all, and instead implement that in iPXE
This is exactly what I want to achieve, so that only the iPXE core loader (undionly.kpxe, menu.ipxe) will participate in the loading stages of the filenames (boot.cfg, netbsd-INSTALL.gz).., being from pxeboot_ia32.bin..

Thanks for the help, I will continue experiments..
Reference URL's