Matt Fioravante
2011-May-15 04:14 UTC
[syslinux] Chainloading pxe boot loaders and dhcp root-path option
Is there anyway to set dynamically set dhcp options when chain loading another pxe boot loader? I'm setting up a pxelinux network install server and one operating system I want to support is freebsd. Freebsd has its own pxe loader called pxeboot that you can use. You just have to boot it from tftp and set the root-path dhcp option (option 17) to the location of your nfs server with the kernel and network filesystem. I want to support multiple versions of freebsd (i386 and amd64) along with Linux distros and others. The are hackish ways to accomplish this using memdisk, but thats not a great idea if you want to have a 280MB live cd image. The most elegant way I can see to do this is to chain load freebsd's pxeboot loader from pxelinux. The problem is when you do this, the dhcp root-path option is not set and defaults to /. I need to be able to dynamically change this dhcp option before chain loading into the next pxe boot loader. Essentiallly, I'd like to be able to do something like this: LABEL fbsd32 pxe pxeboot.0 dhcp-root-path=/nfsserv/freebsd/i386/root LABEL fbsd64 pxe pxeboot.0 dhcp-root-path=/nfsserv/freebsd/amd64/root Is this at all possible with pxelinux? Thanks!
H. Peter Anvin
2011-May-15 06:39 UTC
[syslinux] Chainloading pxe boot loaders and dhcp root-path option
On 05/14/2011 09:14 PM, Matt Fioravante wrote:> Is there anyway to set dynamically set dhcp options when chain loading > another pxe boot loader? > > I'm setting up a pxelinux network install server and one operating system I > want to support is freebsd. > > Freebsd has its own pxe loader called pxeboot that you can use. You just > have to boot it from tftp and set the root-path dhcp option (option 17) to > the location of your nfs server with the kernel and network filesystem. > > I want to support multiple versions of freebsd (i386 and amd64) along with > Linux distros and others. The are hackish ways to accomplish this using > memdisk, but thats not a great idea if you want to have a 280MB live cd > image. The most elegant way I can see to do this is to chain load freebsd's > pxeboot loader from pxelinux. The problem is when you do this, the dhcp > root-path option is not set and defaults to /. > > I need to be able to dynamically change this dhcp option before chain > loading into the next pxe boot loader. Essentiallly, I'd like to be able to > do something like this: > > LABEL fbsd32 > pxe pxeboot.0 dhcp-root-path=/nfsserv/freebsd/i386/root > > LABEL fbsd64 > pxe pxeboot.0 dhcp-root-path=/nfsserv/freebsd/amd64/root > > Is this at all possible with pxelinux? >This is what pxechain.com does. This assumes that pxeboot.0 gets the DHCP options from memory and not by doing its own DHCP request. -hpa
Geert Stappers
2011-May-15 06:54 UTC
[syslinux] Chainloading pxe boot loaders and dhcp root-path option
On Sun, May 15, 2011 at 12:14:29AM -0400, Matt Fioravante wrote:> Is there anyway to set dynamically set dhcp options when chain loading > another pxe boot loader? > > I'm setting up a pxelinux network install server and one operating system I > want to support is freebsd. > > Freebsd has its own pxe loader called pxeboot that you can use. You just > have to boot it from tftp and set the root-path dhcp option (option 17) to > the location of your nfs server with the kernel and network filesystem. > > I want to support multiple versions of freebsd (i386 and amd64) along with > Linux distros and others. The are hackish ways to accomplish this using > memdisk, but thats not a great idea if you want to have a 280MB live cd > image. The most elegant way I can see to do this is to chain load freebsd's > pxeboot loader from pxelinux. The problem is when you do this, the dhcp > root-path option is not set and defaults to /. > > I need to be able to dynamically change this dhcp option before chain > loading into the next pxe boot loader. Essentiallly, I'd like to be able to > do something like this: > > LABEL fbsd32 > pxe pxeboot.0 dhcp-root-path=/nfsserv/freebsd/i386/root > > LABEL fbsd64 > pxe pxeboot.0 dhcp-root-path=/nfsserv/freebsd/amd64/root > > Is this at all possible with pxelinux?AIUI is the scripting of iPXE wanted, http://ipxe.org/scripting Setting root-path is not enumrated at http://ipxe.org/cmd/set However root-path is seen in the screenshot at http://ipxe.org/cmd/config Groeten Stappers --> And is there a policy on top-posting vs. bottom-posting?Yes.
Andrzej Tobola
2011-May-16 17:14 UTC
[syslinux] Chainloading pxe boot loaders and dhcp root-path option
On Sun, May 15, 2011 at 12:14:29AM -0400, Matt Fioravante wrote:> Is there anyway to set dynamically set dhcp options when chain loading > another pxe boot loader? > > I'm setting up a pxelinux network install server and one operating system I > want to support is freebsd. > > Freebsd has its own pxe loader called pxeboot that you can use. You just > have to boot it from tftp and set the root-path dhcp option (option 17) to > the location of your nfs server with the kernel and network filesystem. > > I want to support multiple versions of freebsd (i386 and amd64) along with > Linux distros and others. The are hackish ways to accomplish this using > memdisk, but thats not a great idea if you want to have a 280MB live cd > image. The most elegant way I can see to do this is to chain load freebsd's > pxeboot loader from pxelinux. The problem is when you do this, the dhcp > root-path option is not set and defaults to /. > > I need to be able to dynamically change this dhcp option before chain > loading into the next pxe boot loader. Essentiallly, I'd like to be able to > do something like this: > > LABEL fbsd32 > pxe pxeboot.0 dhcp-root-path=/nfsserv/freebsd/i386/root > > LABEL fbsd64 > pxe pxeboot.0 dhcp-root-path=/nfsserv/freebsd/amd64/root > > Is this at all possible with pxelinux? > > Thanks!If you just want do auto-select 32/64 bit /ROOT version you can do it in dhcpd.conf # FreeBSD sys/nfs/bootp_subr.c bootpc_init() option space FreeBSD; option FreeBSD.root-opts code 130 = string; # root mount options "rsize=8192,wsize=8192,intr,soft,noconn,tcp" option FreeBSD.cookie code 134 = string; # sysctl kern.bootp_cookie # root-path and swap-path are expanded using: %H -> hostname %I -> IP address # Kernel request: # Vendor-Class Option 60 # "FreeBSD:amd64:8.0-CURRENT" # "FreeBSD:i386:5.2-CURRENT" # 012345678901234567890 # ostype:MACHINE:osrelease class "FreeBSD" { match if substring (option vendor-class-identifier,0,7) = "FreeBSD"; log(info,concat("FreeBSD kernel: ",option vendor-class-identifier)); # fatal/error/info/debug site-option-space "FreeBSD"; option FreeBSD.root-opts "nolockd"; # RO root. R?wnowa?ne boot.nfsroot.options="nolockd" ? if substring (option vendor-class-identifier,8,4) = "i386" { # 32bit option root-path "194.29.146.3:/R"; # volt:/nfs/freebsd/i386/8.x } elsif substring (option vendor-class-identifier,8,5) = "amd64" { # 64bit option root-path "194.29.146.3:/"; # volt - OK } else { log (info, "unknown arch?"); option root-path "194.29.146.3:/JAKA-ARCH?"; } } and select proper kernel (32/64) in loader.conf (I am booting FreeBSD 32/64 without pxelinux) -a