tg3 network cards [SOLVED]
Ryan Steele
ryans at aweber.com
Thu Dec 11 21:47:29 CET 2008
Ryan Steele wrote:
> Ralf Utermann wrote:
>> Ryan Steele wrote:
>> [...]
>>
>>> 638: # make /scripts/live use configure_networking just like
>>> /scripts/nfs does
>>> 639: #ipconfig ${DEVICE} | tee /netboot.config
>>> 640: configure_networking
>>>
>>>
>>>
>>> And this change to /scripts/functions, at the bottom of the
>>> configure_networking function:
>>>
>>>
>>>
>>> 356: # If we don't know the device ahead of time, we need to check
>>> net-*.conf
>>> 357: # source ipconfig output
>>> 358: #if [ -n "${DEVICE}" ]; then
>>> 359: # # source specific bootdevice
>>> 360: # . /tmp/net-${DEVICE}.conf
>>> 361: #else
>>> 362: # source any interface as not exactly specified
>>> 363: . /tmp/net-*.conf
>>> 364: #fi
>>>
>>>
>>>
>> these changes did not work for me on a lenny system :( Still
>> hangs trying eth0 and I don't see it trying any other
>> interface. So I go back to my udev rule for renaming ...
>>
>
> Ah, I (think I) forgot to tell you that I had to put 'ip=all' in the
> pxelinux.cfg, otherwise you either hang or get kernel panics.
>
>>> Basically, when we PXE boot with the pxelinux.cfg file set up by
>>> fai-chboot using ip=dhcp, we end up using the /scripts/live shell
>>> script, which uses the 'ipconfig' binary. But, we need to tell
>>> ipconfig
>>> to time out for an interface for which it can't find a DHCP server,
>>> which is what configure_networking does using 'ipconfig -t'. I'm not
>>>
>> the configure_networking, which my lenny/fai3.2.14 puts into the
>> generated initrd has no -t in any ipconfig call.
>>
>
> Well, what's stopping you from adding it? :)
>
>>
>>> sure why /scripts/live doesn't use the configure_networking script by
>>> default, or if this is even the right thing to do, but it works for me,
>>> no matter which interface I have cables in or which interfaces can
>>> contact a DHCP server via ipconfig. If anybody has any comments,
>>> please
>>> feel free to voice them.
>>>
>>
>> Ryan, can you send me your scripts/functions file?
>
> Sure, I'll post it for all to see, hopefully the list formatting won't
> butcher the config - I use a 30" monitor, so I don't restrict my
> config files to 80 chars in width. That being said, the only function
> I hacked in there was configure_networking, so here it is:
>
> configure_networking()
> {
> # RYANS 2008-12-05 - add debugging output
> echo -e "\n\nInside configure_networking\n\n" > /dev/console 2>&1
> # networking already configured thus bail out
> [ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0
>
> # RYANS 2008-12-05 - set timeout to 30
> # support ip options see linux sources Documentation/nfsroot.txt
> case ${IPOPTS} in
> none|off)
> # Do nothing
> ;;
> ""|on|any)
> # Bring up device
> ipconfig -t 30 ${DEVICE}
> ;;
> dhcp|bootp|rarp|both)
> ipconfig -t 30 -c ${IPOPTS} -d ${DEVICE}
> ;;
> *)
> ipconfig -t 30 -d $IPOPTS
>
> # grab device entry from ip option
> NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}
> if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then
> NEW_DEVICE=${NEW_DEVICE%:*}
> else
> # wrong parse, possibly only a partial string
> NEW_DEVICE=
> fi
> if [ -n "${NEW_DEVICE}" ]; then
> DEVICE="${NEW_DEVICE}"
> fi
> ;;
> esac
>
> # RYANS 2008-12-05 - just source net-*.conf and be done with it
> # source ipconfig output
> #if [ -n "${DEVICE}" ]; then
> # # source specific bootdevice
> # . /tmp/net-${DEVICE}.conf
> #else
> # source any interface as not exaclty specified
> . /tmp/net-*.conf
> #fi
> }
>
>
>
>
And I forgot to mention also, that I have to use a custom script to
rewrite the IP in the boot.log, otherwise at the end of the
installation, fai-chboot fails to connect to the server and change the
pxelinux.cfg file to foo.disable. Here is that script:
#! /bin/bash
error=0 ; trap "error=$((error|1))" ERR
set -x
REALIP=$(echo `host $(cat $target/etc/hostname) | awk '{print $4}'`)
perl -i -pe "s/^IPADDR=all(.*)/IPADDR='"$REALIP"'$3/" $LOGDIR/boot.log
exit $error
HTH,
Ryan
More information about the linux-fai
mailing list