If you just need to do PXE to install FreeBSD, then it's probably
best to just use TFTP/MFS and not bother with NFS at all.
Some time ago I figured out how to do this and made notes
on the way. 

They are brief: it was late, and I was tired because
this all happened during preparation of a technical conference
(and we all know, sleep suffers in these situations).

There still seem to be resource depletion problems with
FreeBSD after a few TFTP sessions. Still have to figure out why.

In any case, here's the notes and the patch. Enjoy.

Geert Jan

---


Late-night notes on the tftp-PXE hack

What?
Allow PC's to boot over PXE and TFTP. Normal FreeBSD PXE-boot is intended
for diskless operation, and hence expects an NFS root filesystem set up
per client; replacing the NFS root w/ MFS root, the data can be transferred
via TFTP and no server/client relation needs to be set up
(clients can be added w/o setting them up on the server).
This is ideal for network boot for system installs.

How?
1. FreeBSD's "pxeboot" can be recompiled to do TFTP rather than NFS.
   Unfortunately, the code will still try to get a root NFS handle. 
   The patch included fixes that problem (it breaks NFS diskless clients
   and needs to be #ifdef'ed; I didn't have time).
   You'll need to rebuild pxeboot after this fix.
2. Copy /boot from the FreeBSD 6.2 CD1 to /tftpboot/boot.
   replace boot/pxeboot with /boot/pxeboot.tftp built in step 1.
3. Add /boot/loader.conf:
        mfsroot_load="YES"
        mfsroot_type="mfs_root"
        mfsroot_name="/boot/mfsroot"
        loader_logo="beastie"
4. Use the following dhcpd.conf configuration.
   Note that 196.200.223.1 is the TFTP server and the address
   probably needs to be adjusted:
        subnet 196.200.223.0 netmask 255.255.255.0 {
                range 196.200.223.32 196.200.223.127;
                option routers 196.200.223.254;
                filename "/boot/pxeboot.tftp";
                next-server 196.200.223.1;
        }

That's all!

----
*** boot/i386/loader/Makefile.FCS       Thu Mar 29 19:55:44 2007
--- boot/i386/loader/Makefile   Sat Mar 31 22:29:23 2007
***************
*** 7,12 ****
--- 7,15 ----
  # architecture-specific loader code
  SRCS=         main.c conf.c vers.c
  
+ # grrrr
+ LOADER_TFTP_SUPPORT=  YES
+ 
  # Enable PXE TFTP or NFS support, not both.
  .if defined(LOADER_TFTP_SUPPORT)
  CFLAGS+=      -DLOADER_TFTP_SUPPORT
*** boot/i386/libi386/pxe.c.FCS Thu Mar 29 19:55:44 2007
--- boot/i386/libi386/pxe.c     Thu Mar 29 22:02:58 2007
***************
*** 336,342 ****
        return(0);
  
      /* get an NFS filehandle for our root filesystem */
!     pxe_setnfshandle(rootpath);
  
      if (pxe_sock >= 0) {
  
--- 336,342 ----
        return(0);
  
      /* get an NFS filehandle for our root filesystem */
! if (0)    pxe_setnfshandle(rootpath);
  
      if (pxe_sock >= 0) {
  
*** boot/Makefile.FCS   Thu Mar 29 19:55:45 2007
--- boot/Makefile       Sat Mar 31 22:21:38 2007
***************
*** 1,5 ****
--- 1,7 ----
  # $FreeBSD: src/sys/boot/Makefile,v 1.26 2004/12/21 12:32:13 ru Exp $
  
+ LOADER_TFTP_SUPPORT=YES
+ 
  .if !defined(NO_FORTH)
  # Build the add-in FORTH interpreter.
  SUBDIR+=              ficl

_______________________________________________
Soekris-tech mailing list
[email protected]
http://lists.soekris.com/mailman/listinfo/soekris-tech

Reply via email to