[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#566295: initramfs-tools: Deviation from Documentation/filesystems/nfs/nfsroot.txt WRT multiple net devs



Package: initramfs-tools
Version: 0.93.4
Severity: normal
Tags: patch

/usr/share/initramfs-tools/scripts/functions attempts to follow the
semantics described in Documentation/filesystems/nfs/nfsroot.txt with
respect to IP autoconfiguration, however a significant departure from
the behaviour is that nfsroot.txt says:

<device>      Name of network device to use.

     Default: If the host only has one device, it is used.
     Otherwise the device is determined using
     autoconfiguration. This is done by sending
     autoconfiguration requests out of all devices,
     and using the device that received the first reply.


initramfs-tools currently requires a device to be hard-coded, but this
is not much use if the network device is not known ahead of time.  If
the device specified in either /etc/initramfs-tools/initramfs.conf or
on the ip=xxx kernel command line.

Moreover a combination of the kernel commandline and the contents of
/etc/initramfs-tools/initramfs.conf is currently used which can be
misleading.

With the attached patch, it is possible to specify either:

DEVICE="all" or DEVICE="" in the /etc/initramfs-tools/initramfs.conf

The patch is against lenny, I've not had a chance to test it on sid but
it looks like it should apply (modulo the change of the relevant env
variable).

Many Thanks,

Tim.

-- Package-specific info:
-- /proc/cmdline
root=/dev/md0 ro console=tty0 

-- /proc/filesystems
	ext3
	vfat
	fuseblk

-- lsmod
Module                  Size  Used by
ftdi_sio               57736  0 
pl2303                 21508  0 
ark3116                16004  0 
usbserial              36592  3 ftdi_sio,pl2303,ark3116
dm_hp_sw                7168  0 
dm_multipath           21392  1 dm_hp_sw
dm_mirror              20608  0 
dm_log                 13956  1 dm_mirror
battery                16904  0 
usbhid                 45920  0 
hid                    41792  1 usbhid
ff_memless              9224  1 usbhid
fuse                   54176  1 
enclosure              13632  0 
ipt_REDIRECT            6272  1 
nls_utf8                6272  0 
nls_cp437              11136  0 
vfat                   14976  0 
fat                    51128  1 vfat
nls_base               12932  4 nls_utf8,nls_cp437,vfat,fat
radeon                133920  2 
drm                    91360  3 radeon
vzethdev               14720  0 
vznetdev               24456  1 
simfs                   8944  1 
vzrst                 122920  0 
vzcpt                 106424  0 
tun                    15492  2 vzrst,vzcpt
vzdquota               42740  1 [permanent]
vzmon                  31376  5 vzethdev,vznetdev,vzrst,vzcpt
vzdev                   7568  4 vzethdev,vznetdev,vzdquota,vzmon
xt_length               6400  0 
ipt_ttl                 6144  0 
xt_tcpmss               6656  0 
xt_dscp                 7168  0 
iTCO_wdt               15696  1 
authenc                 9984  2 
esp4                   10880  2 
aead                   11904  2 authenc,esp4
xfrm4_mode_tunnel       6912  4 
deflate                 7424  0 
zlib_deflate           24088  1 deflate
zlib_inflate           18944  1 deflate
ctr                     8832  0 
twofish                11136  0 
twofish_common         18560  1 twofish
camellia               25216  0 
serpent                23296  0 
blowfish               13056  0 
des_generic            21376  0 
cbc                     7936  2 
aes_x86_64             12416  2 
aes_generic            32552  1 aes_x86_64
xcbc                    8968  0 
sha256_generic         13696  0 
sha1_generic            6912  0 
crypto_null             7680  2 
af_key                 32280  0 
xt_tcpudp               7680  88 
xt_DSCP                 7808  34 
ipt_MASQUERADE          6528  2 
iptable_nat            11652  1 
nf_nat_ftp              7296  0 
nf_nat                 22548  4 ipt_REDIRECT,ipt_MASQUERADE,iptable_nat,nf_nat_ftp
xt_TCPMSS               8576  3 
ipt_LOG                10372  46 
ipt_REJECT              7552  0 
iptable_mangle          8704  1 
iptable_filter          8320  1 
xt_multiport            7424  0 
xt_state                6656  13 
xt_limit                7172  50 
xt_conntrack            8704  0 
nf_conntrack_ftp       12728  1 nf_nat_ftp
nf_conntrack_ipv4      24352  16 iptable_nat,nf_nat
nf_conntrack           82688  7 iptable_nat,nf_nat_ftp,nf_nat,xt_state,xt_conntrack,nf_conntrack_ftp,nf_conntrack_ipv4
ip_tables              21776  3 iptable_nat,iptable_mangle,iptable_filter
x_tables               25736  17 ipt_REDIRECT,xt_length,ipt_ttl,xt_tcpmss,xt_dscp,xt_tcpudp,xt_DSCP,ipt_MASQUERADE,iptable_nat,xt_TCPMSS,ipt_LOG,ipt_REJECT,xt_multiport,xt_state,xt_limit,xt_conntrack,ip_tables
nfs                   252336  1 
lockd                  70448  1 nfs
nfs_acl                 7552  1 nfs
sunrpc                202216  11 nfs,lockd,nfs_acl
ipv6                  296256  79 vzrst,vzcpt,vzmon
bridge                 54952  0 
loop                   64148  0 
dm_crypt               17032  0 
crypto_blkcipher       21636  7 authenc,ctr,cbc,crypto_null,dm_crypt
snd_hda_intel         436440  4 
snd_pcm_oss            41760  0 
snd_mixer_oss          18816  1 snd_pcm_oss
snd_pcm                81800  3 snd_hda_intel,snd_pcm_oss
snd_seq_dummy           7428  0 
snd_seq_oss            33280  0 
button                 11680  0 
snd_seq_midi           11072  0 
snd_rawmidi            26784  1 snd_seq_midi
snd_seq_midi_event     11904  2 snd_seq_oss,snd_seq_midi
snd_seq                54304  6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_timer              25744  3 snd_pcm,snd_seq
snd_seq_device         11668  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
snd                    63688  15 snd_hda_intel,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
pcspkr                  7040  0 
i2c_i801               13596  0 
i2c_core               27936  1 i2c_i801
joydev                 14848  0 
soundcore              12064  1 snd
snd_page_alloc         13072  2 snd_hda_intel,snd_pcm
evdev                  14208  5 
ext3                  124688  3 
jbd                    51240  1 ext3
mbcache                12804  1 ext3
dm_mod                 58864  16 dm_multipath,dm_mirror,dm_log,dm_crypt
raid1                  23936  3 
md_mod                 79908  4 raid1
ide_disk               16512  9 
ata_generic            10116  0 
ide_pci_generic         9220  0 [permanent]
uhci_hcd               25760  0 
ata_piix               22660  0 
libata                165600  2 ata_generic,ata_piix
scsi_mod              160888  2 dm_hp_sw,libata
dock                   14112  1 libata
tulip                  54048  0 
it821x                 11140  0 [permanent]
ide_core              128156  3 ide_disk,ide_pci_generic,it821x
r8169                  31492  0 
ehci_hcd               35980  0 
intel_agp              31856  0 
thermal                22816  1 
processor              42304  1 thermal
fan                     9352  1 
thermal_sys            17728  3 thermal,processor,fan

-- /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no
postinst_hook = update-grub
postrm_hook   = update-grub

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=y
KEYMAP=n
BOOT=local
DEVICE=eth0
NFSROOT=auto

-- /etc/crypttab
# <target name>	<source device>		<key file>	<options>
cryptvz1	/dev/ermintrude/lukstest /keysource/keymaterial luks,noauto
#cryptswap	/dev/md1		/dev/urandom	swap,cipher=aes-cbc-essiv:sha256,size=256,hash=sha256


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-openvz-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages initramfs-tools depends on:
ii  cpio                          2.10-1     GNU cpio -- a program to manage ar
ii  findutils                     4.4.2-1    utilities for finding files--find,
ii  klibc-utils                   1.5.15-1   small utilities built with klibc f
ii  module-init-tools             3.11-1     tools for managing Linux kernel mo
ii  udev                          149-2      /dev/ and hotplug management daemo

Versions of packages initramfs-tools recommends:
ii  busybox                       1:1.14.2-2 Tiny utilities for small and embed

initramfs-tools suggests no packages.

-- no debconf information
--- initramfs-tools-0.93.4/conf/initramfs.conf.old	2010-01-22 17:52:02.000000000 +0000
+++ initramfs-tools-0.93.4/conf/initramfs.conf	2010-01-22 17:54:55.000000000 +0000
@@ -52,10 +52,14 @@
 #
 # DEVICE: ...
 #
-# Specify the network interface, like eth0
+# Hard code a device for autoconfiguration.  If the empty
+# string, or the word "all" then autoconfiguration will occur
+# on all devices, and the first reply will be used.  May be
+# overridden using the "ip=..." argument as per the Linux kernel
+# Documentation/filesystems/nfs/nfsroot.txt
 #
 
-DEVICE=eth0
+DEVICE=all
 
 #
 # NFSROOT: [ auto | HOST:MOUNT ]
--- lenny/initramfs-tools/scripts/functions.orig	2009-01-07 14:14:37.000000000 +0000
+++ lenny/initramfs-tools/scripts/functions	2010-01-22 16:37:26.000000000 +0000
@@ -269,10 +269,10 @@
 		;;
 	""|on|any)
 		# Bring up device
-		ipconfig -t 180 ${DEVICE}
+		ipconfig -t 180 "${DEVICE}"
 		;;
 	dhcp|bootp|rarp|both)
-		ipconfig -t 180 -c ${IPOPTS} -d ${DEVICE}
+		ipconfig -t 180 -c ${IPOPTS} -d "${DEVICE}"
 		;;
 	*)
 		ipconfig -t 180 -d $IPOPTS
@@ -292,11 +292,12 @@
 	esac
 
 	# source ipconfig output
-	if [ -n "${DEVICE}" ]; then
+	if [ -n "${DEVICE}" ] && [ "${DEVICE}" != "all" ]; then
 		# source specific bootdevice
 		. /tmp/net-${DEVICE}.conf
 	else
-		# source any interface as not exaclty specified
+		# source any interface...
+		# ipconfig should have quit after first response
 		. /tmp/net-*.conf
 	fi
 }
--- initramfs-tools-0.93.4/initramfs.conf.5.orig	2010-01-22 17:45:51.000000000 +0000
+++ initramfs-tools-0.93.4/initramfs.conf.5	2010-01-22 18:11:43.000000000 +0000
@@ -57,7 +57,20 @@
 
 .TP
 \fB DEVICE
-Specifies the network interface, like eth0.
+Specifies the network interface which should be used during IP configuration.
+This can be overridden by arguments supplied on the kernel command line using
+the 'ip=...' argument as described in
+\fIDocumentation/filesystems/nfs/nfsroot.txt\fP from the Linux kernel
+documentation.
+
+If this is set to the empty string, or the value "all" i.e.
+\fIDEVICE\fP=\fI"all"\fP then autoconfiguration will be carried out on all
+network interfaces, and only the first reply will be used.
+
+Note that the network devices will have been renamed as specified in
+\fI/etc/udev/rules.d/70-persistent-net.rules\fP prior to autoconfiguration,
+and that a copy of this file (as it was at the time that
+update-initramfs/mkinitramfs was executed) will be included in the initramfs.
 
 .TP
 \fB ROOT

Reply to: