Bug#514916: live-initramfs: scripts/live doesn't deal properly with multiple NICs
Package: live-initramfs
Version: 1.154.8-1
Severity: important
I'm using line-initramfs as part of FAI to netboot machines with two
NICs, only one of which is actually set up to be DHCPd. We have
hundreds of machines like this at my work, it's not something we can
reasonably change at the per-machine level.
The following patch makes everything work in my environment, and I
believe will still work in single-NIC setups:
*** /srv/fai/nfsroot/live/filesystem.dir/usr/share/initramfs-tools/scripts/functions Wed Jan 7 06:14:37 2009
--- /srv/fai/broken/initramfs-tools_scripts_functions Wed Feb 11 12:56:23 2009
***************
*** 269,278 ****
--- 269,294 ----
;;
""|on|any)
# Bring up device
+ if [ -n "${DEVICE}" ]
+ then
ipconfig -t 180 ${DEVICE}
+ else
+ # In some cases, the first run doesn't work but the second does immediately.
+ ipconfig -t 60 all
+ ipconfig -t 60 all
+ ipconfig -t 60 all
+ fi
;;
dhcp|bootp|rarp|both)
+ if [ -n "${DEVICE}" ]
+ then
ipconfig -t 180 -c ${IPOPTS} -d ${DEVICE}
+ else
+ # In some cases, the first run doesn't work but the second does immediately.
+ ipconfig -t 60 -c ${IPOPTS} -d all
+ ipconfig -t 60 -c ${IPOPTS} -d all
+ ipconfig -t 60 -c ${IPOPTS} -d all
+ fi
;;
*)
ipconfig -t 180 -d $IPOPTS
*** /srv/fai/nfsroot/live/filesystem.dir/usr/share/initramfs-tools/scripts/live Sun Feb 8 06:09:09 2009
--- /srv/fai/broken/initramfs-tools_scripts_live Wed Feb 11 12:56:22 2009
***************
*** 699,709 ****
udevsettle
fi
! ipconfig ${DEVICE} | tee /netboot.config
- # source relevant ipconfig output
- OLDHOSTNAME=${HOSTNAME}
- . /tmp/net-${DEVICE}.conf
[ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
export HOSTNAME
--- 699,711 ----
udevsettle
fi
! # We don't necessarily know which NIC we should be using
! DEVICE=''
!
! # make /scripts/live use configure_networking just like /scripts/nfs
! # does; this sources /tmp/net-*.conf as well
! configure_networking
[ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
export HOSTNAME
-- Package-specific info:
-- System Information:
Debian Release: 5.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.24.2-ls3 (SMP w/1 CPU core)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages live-initramfs depends on:
ii busybox 1:1.10.2-2 Tiny utilities for small and embed
ii file 4.26-1 Determines file type using "magic"
ii initramfs-tools 0.92o tools for generating an initramfs
ii sudo 1.6.9p17-1 Provide limited super user privile
ii udev 0.125-7 /dev/ and hotplug management daemo
ii user-setup 1.23 Set up initial user and password
Versions of packages live-initramfs recommends:
ii eject 2.1.5+deb1-4 ejects CDs and operates CD-Changer
ii uuid-runtime 1.41.3-1 universally unique id library
ii wget 1.11.4-2 retrieves files from the web
Versions of packages live-initramfs suggests:
pn curlftpfs <none> (no description available)
pn genext2fs <none> (no description available)
pn httpfs2 <none> (no description available)
ii loop-aes-utils 2.13.1-4 Tools for mounting and manipulatin
pn mtd-tools <none> (no description available)
pn squashfs-tools <none> (no description available)
-- no debconf information
Reply to: