Updated FAI 3.3.5 packages for Ubuntu Lucid

Stephan Hermann sh at sourcecode.de
Thu Aug 12 14:50:47 CEST 2010


Hi,

oh wow...again this shitty problem.....I had this with lenny.


What can be the cause?

1. PXE boot uses the first available NIC from the machine (mostly NIC1 in the 
bios settings)
2. Boot Kernel but gets the second NIC for DHCP request udevs numbering of 
NICs does not depend on the bios, but on the PCI-IDs I think, and higher PCI 
IDs are collected first somehow (I don't know it for real, but this is what I 
can see during PXE + NFS boots on my maschine which are HP HW).

3. I fixed it with a patch in the initramfs-live package, so that the ipconfig 
client can use all available NICs found by UDEV and the Kernel.

This works mostly out of the box, if you really only have one NIC connected to 
a real network, where DHCP works.

I didn't find the time to propose some patches towards mikap for the initramfs-
live package...my fault.

I'll attach the patched "live" script:

Go and check the "do_netmount()" function in this shell script:

There is this section:

      if [ -n "${BOOTIF}" ]; then
                # pxelinux sets BOOTIF to a value based on the mac address of 
the
                # network card used to PXE boot, so use this value for DEVICE 
rather
                # than a hard-coded device name from initramfs.conf. this 
facilitates
                # network booting when machines may have multiple network 
cards.
                # pxelinux sets BOOTIF to 01-$mac_address

                # strip off the leading "01-", which isn't part of the mac
                # address
                temp_mac=${BOOTIF#*-}

                # convert to typical mac address format by replacing "-" with 
":"
                bootif_mac=""
                IFS='-'
                for x in $temp_mac ; do
                        if [ -z "$bootif_mac" ]; then
                                bootif_mac="$x"
                        else
                                bootif_mac="$bootif_mac:$x"
                        fi
                done
                unset IFS

                # look for devices with matching mac address, and set DEVICE 
to
                # appropriate value if match is found.
                for device in /sys/class/net/* ; do
                        if [ -f "$device/address" ]; then
                                current_mac=$(cat "$device/address")
                                if [ "$bootif_mac" = "$current_mac" ]; then
                                        DEVICE=${device##*/}
                                        break
                                fi
                        fi
                done
        fi


this section works together with pxelinux and the IPAPPEND=2 setting in the 
pxelinux.cfg/<mac/ip/whatever you name it>-file

with IPAPPEND pxelinux adds the used interface with mac address of the PXE 
Boot device...this helps do_netmount() to realize the correct working 
interface.

No problems with it since ages.

Just adjust your pxelinux.cfg/* files to provide IPAPPEND=2 (sane setting) 
during tftp request after PXE DHCP request.

Regards,
\ſh

On Thursday, August 12, 2010 01:24:29 pm Juergen Kahnert wrote:
> Hello,
> 
> On Thursday, August 12, 2010 03:11:21 am Paul Santos wrote:
> > The PXE boot starts off OK, but the server crashes shortly before
> > mounting the NFS root device.
> 
> the same problem we had.  It's a problem of the initrd.  This "ipconfig"
> binary crashes.  We're using the one out of hardy, which works.  But it's
> still crap, because sometimes it don't recognize the DHCP reply.
> 
> So we increase the amounts of tries in scripts/live, too.  Also some
> speedup changes to avoid this long sleep if the answer comes directly.
> 
> The initrd of Ubuntu isn't really a great one and this of lucid is
> unusable for FAI without patches.
> 
> Regards
> 
>     Jürgen Kahnert



More information about the linux-fai mailing list