Heinrich Rebehn wrote: > Reyk Floeter wrote: >> hi! >> >> On Mon, Jun 25, 2007 at 11:50:03AM +0200, Heinrich Rebehn wrote: >>> I have successfully set up a client for diskless(8) booting. >>> However, this works only when booting from the first (onboard) nic. >>> When i use another nic, the kernel still tries to do revarp from the >>> first nic, which fails. >>> >>> sys/nfs/nfs_boot.c offers a possibility to override the default search: >>> >>> /* >>> * Find a network interface. >>> */ >>> if (nfsbootdevname) >>> ifp = ifunit(nfsbootdevname); >>> else <search loop> >>> ... >>> >>> but where/how can i set nfsbootdevname? >>> >>> The boot.conf(8) manpage talks about passing options to the kernel >>> via "set howto". Could i use that? >>> >> >> you cannot set the nfsbootdevname as a kernel option. it is filled in >> by autoconf. for example, pxeboot passes the mac address of its boot >> interface and autoconf looks up the matching network interface in >> >> sys/arch/i386/i386/autoconf.c >> >> ---snip--- >> #if defined(NFSCLIENT) >> if (bios_bootmac) { >> extern char *nfsbootdevname; >> struct ifnet *ifp; >> mountroot = nfs_mountroot; >> >> printf("PXE boot MAC address %s, ", >> ether_sprintf(bios_bootmac->mac)); >> >> for (ifp = TAILQ_FIRST(&ifnet); ifp != NULL; >> ifp = TAILQ_NEXT(ifp, if_list)) { >> if ((ifp->if_type == IFT_ETHER || >> ifp->if_type == IFT_FDDI) && >> bcmp(bios_bootmac->mac, >> ((struct arpcom *)ifp)->ac_enaddr, >> ETHER_ADDR_LEN) == 0) >> break; >> } >> if (ifp) { >> nfsbootdevname = ifp->if_xname; >> printf("interface %s\n", nfsbootdevname); >> } else >> printf("no interface selected\n"); >> return; >> } >> #endif >> ---snap--- >> >> reyk >> > Hmm, at least in my case this does not seem to work. > I have not much C experience, but should nfsbootdevname not be declared > "extern" in sys/nfs/nfs_boot.c as well? > I also do not see any output from the printf's above. Maybe bios_bootmac is not true? NFSCLIENT *is* defined. Config is GENERIC with "root on nfs swap on nfs".
I am attaching a dmesg from a successfull boot from the onboard nic. --Heinrich OpenBSD 4.1-stable (DISKLESS) #0: Fri Jun 22 10:41:43 CEST 2007 [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/DISKLESS cpu0: AMD Athlon(tm) 64 Processor 3000+ ("AuthenticAMD" 686-class, 512KB L2 cache) 1.81 GHz cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3 cpu0: AMD erratum 89 present, BIOS upgrade may be required real mem = 536113152 (523548K) avail mem = 481468416 (470184K) using 4278 buffers containing 26931200 bytes (26300K) of memory mainbus0 (root) bios0 at mainbus0: AT/286+ BIOS, date 11/03/05, BIOS32 rev. 0 @ 0xf0010, SMBIOS rev. 2.3 @ 0xf0530 (67 entries) bios0: ASUSTeK Computer Inc. A8V apm0 at bios0: Power Management spec V1.2 apm0: AC on, battery charge unknown apm0: flags 30102 dobusy 0 doidle 1 pcibios0 at bios0: rev 2.1 @ 0xf0000/0x10000 pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf5980/192 (10 entries) pcibios0: PCI Interrupt Router at 000:17:0 ("VIA VT8237 ISA" rev 0x00) pcibios0: PCI bus #1 is the last bus bios0: ROM list: 0xc0000/0xb000 0xcb000/0x800 0xcb800/0x800 0xcc000/0x1000 acpi at mainbus0 not configured cpu0 at mainbus0 pci0 at mainbus0 bus 0: configuration mode 1 (no bios) pchb0 at pci0 dev 0 function 0 "VIA K8HTB Host" rev 0x00 pchb1 at pci0 dev 0 function 1 "VIA K8HTB Host" rev 0x00 pchb2 at pci0 dev 0 function 2 "VIA K8HTB Host" rev 0x00 pchb3 at pci0 dev 0 function 3 "VIA K8HTB Host" rev 0x00 pchb4 at pci0 dev 0 function 4 "VIA K8HTB Host" rev 0x00 pchb5 at pci0 dev 0 function 7 "VIA K8HTB Host" rev 0x00 ppb0 at pci0 dev 1 function 0 "VIA K8HTB AGP" rev 0x00 pci1 at ppb0 bus 1 vga1 at pci1 dev 0 function 0 "ATI Rage 128 Pro TF" rev 0x00 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) skc0 at pci0 dev 10 function 0 "Marvell Yukon 88E8001/8003/8010" rev 0x13, Yukon Lite (0x9): irq 10 sk0 at skc0 port A, address 00:13:d4:de:cf:88 eephy0 at sk0 phy 0: Marvell 88E1011 Gigabit PHY, rev. 5 xl0 at pci0 dev 12 function 0 "3Com 3c905C 100Base-TX" rev 0x78: irq 10, address 00:0a:5e:61:7a:2d exphy0 at xl0 phy 24: 3Com internal media interface xl1 at pci0 dev 14 function 0 "3Com 3c905C 100Base-TX" rev 0x78: irq 3, address 00:0a:5e:61:7a:04 exphy1 at xl1 phy 24: 3Com internal media interface pciide0 at pci0 dev 15 function 0 "VIA VT6420 SATA" rev 0x80: DMA pciide0: using irq 10 for native-PCI interrupt wd0 at pciide0 channel 1 drive 0: <Maxtor 6V080E0> wd0: 16-sector PIO, LBA48, 76293MB, 156250000 sectors wd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 5 pciide1 at pci0 dev 15 function 1 "VIA VT82C571 IDE" rev 0x06: ATA133, channel 0 configured to compatibility, channel 1 configured to compatibility pciide1: channel 0 disabled (no drives) pciide1: channel 1 disabled (no drives) uhci0 at pci0 dev 16 function 0 "VIA VT83C572 USB" rev 0x81: irq 11 usb0 at uhci0: USB revision 1.0 uhub0 at usb0 uhub0: VIA UHCI root hub, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhci1 at pci0 dev 16 function 1 "VIA VT83C572 USB" rev 0x81: irq 11 usb1 at uhci1: USB revision 1.0 uhub1 at usb1 uhub1: VIA UHCI root hub, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered uhci2 at pci0 dev 16 function 2 "VIA VT83C572 USB" rev 0x81: irq 10 usb2 at uhci2: USB revision 1.0 uhub2 at usb2 uhub2: VIA UHCI root hub, rev 1.00/1.00, addr 1 uhub2: 2 ports with 2 removable, self powered uhci3 at pci0 dev 16 function 3 "VIA VT83C572 USB" rev 0x81: irq 10 usb3 at uhci3: USB revision 1.0 uhub3 at usb3 uhub3: VIA UHCI root hub, rev 1.00/1.00, addr 1 uhub3: 2 ports with 2 removable, self powered ehci0 at pci0 dev 16 function 4 "VIA VT6202 USB" rev 0x86: irq 5 usb4 at ehci0: USB revision 2.0 uhub4 at usb4 uhub4: VIA EHCI root hub, rev 2.00/1.00, addr 1 uhub4: 8 ports with 8 removable, self powered viapm0 at pci0 dev 17 function 0 "VIA VT8237 ISA" rev 0x00 iic0 at viapm0 auvia0 at pci0 dev 17 function 5 "VIA VT8233 AC97" rev 0x60: irq 5 ac97: codec id 0x414c4790 (Avance Logic ALC850 rev 0) audio0 at auvia0 pchb6 at pci0 dev 24 function 0 "AMD AMD64 HyperTransport" rev 0x00 pchb7 at pci0 dev 24 function 1 "AMD AMD64 Address Map" rev 0x00 pchb8 at pci0 dev 24 function 2 "AMD AMD64 DRAM Cfg" rev 0x00 pchb9 at pci0 dev 24 function 3 "AMD AMD64 Misc Cfg" rev 0x00 isa0 at mainbus0 isadma0 at isa0 pckbc0 at isa0 port 0x60/5 pckbd0 at pckbc0 (kbd slot) pckbc0: using irq 1 for kbd slot wskbd0 at pckbd0: console keyboard, using wsdisplay0 pcppi0 at isa0 port 0x61 midi0 at pcppi0: <PC speaker> spkr0 at pcppi0 lpt0 at isa0 port 0x378/4 irq 7 lm0 at isa0 port 0x290/8: W83627THF npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16 pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo fdc0 at isa0 port 0x3f0/6 irq 6 drq 2 fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec biomask ff65 netmask ff6d ttymask ffef pctr: user-level cycle counter enabled uhidev0 at uhub0 port 1 configuration 1 interface 0 uhidev0: Logitech USB Receiver, rev 1.10/17.21, addr 2, iclass 3/1 ukbd0 at uhidev0: 8 modifier keys, 6 key codes wskbd1 at ukbd0 mux 1 wskbd1: connecting to wsdisplay0 uhidev1 at uhub0 port 1 configuration 1 interface 1 uhidev1: Logitech USB Receiver, rev 1.10/17.21, addr 2, iclass 3/1 uhidev1: 4 report ids ums0 at uhidev1 reportid 1: 16 buttons and Z dir. wsmouse0 at ums0 mux 0 uhid0 at uhidev1 reportid 2: input=2, output=0, feature=0 uhid1 at uhidev1 reportid 3: input=1, output=0, feature=0 uhid2 at uhidev1 reportid 4: input=3, output=0, feature=0 nfs_boot: using interface sk0, with revarp & bootparams nfs_boot: client_addr=192.168.34.100 nfs_boot: server_addr=192.168.34.1 hostname=frw1 root on 192.168.34.1:/data/root/frw1 nfs_boot: mountd swap, error=13 WARNING: no swap swapmount: no device