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

Bug#721088: initramfs-tools: nfsroot with pxelinux fails on systems with multiple NICs



Package: initramfs-tools
Version: 0.109.1
Severity: normal

When I try to use Debian initramfs to mount root over NFS on a machine with
multiple NICs, it never succeeds, because the initramfs configures all NICs
with the same IP address.

In more detail, the following happens:

  o  I have configured pxelinux to boot Linux kernel and set "ipappend 3",
     so that pxelinux appends "ip=" and "BOOTIF=" to kernel options. The
     former contains the IP address and netmask (but no information on the
     interface, which is logical, because it has no idea how will the kernel
     name the interface). The latter contains the MAC address of the boot
     interface.

  o  configure_networking() in scripts/functions inside the initramfs
     correctly detects that BOOTIF was passed and sets the DEVICE variable
     to the name of the right network device.

  o  Later, configure_networking() detects that the "ip" parameter contains
     something complex (different from trivial things like "any", "off",
     "dhcp", ...) and runs ipconfig on all interfaces.

  o  Therefore, the DEVICE variable calculated from BOOTIF is not used at all.

A simple work-around exists: let pxelinux pass only the BOOTIF parameter
("ipappend 2") and add "ip=dhcp" manually, in which case configure_networking()
behaves correctly and runs ipconfig only on the matching interface. However,
(1) this is unnecessarily slow (DHCP is run twice, once in PXE and then in
the initramfs), (2) one should not need such tricks to get a working nfsroot.

I propose the following fix: In the "complex ip parameter" case (around line
393 in my version of the scripts/functions file), the DEVICE variable should
be checked and if it already set, ipconfig should be run only on the selected
device.

Also, the NEW_DEVICE logic below that call to ipconfig is likely wrong for the
same reason. I think it should be moved to the same place where the BOOTIF
check resides.

If you wish, I can provide a patch.


-- Package-specific info:
-- initramfs sizes
-- /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.9.2-kam root=UUID=9a1f02a6-70f0-4958-821a-b603696c6d2d ro

-- /proc/filesystems
	ext3
	ext2
	ext4
	vfat
	msdos
	iso9660
	romfs
	udf

-- lsmod
Module                  Size  Used by
usblp                   9474  0 
tun                    15607  2 
deflate                 1775  0 
zlib_deflate           17451  1 deflate
ctr                     3415  0 
twofish_generic         6017  0 
twofish_x86_64_3way    18587  0 
twofish_x86_64          5221  1 twofish_x86_64_3way
twofish_common         12753  3 twofish_generic,twofish_x86_64_3way,twofish_x86_64
camellia_generic       18041  0 
camellia_x86_64        43873  0 
serpent_sse2_x86_64    44621  0 
serpent_generic        18028  1 serpent_sse2_x86_64
xts                     2687  3 camellia_x86_64,serpent_sse2_x86_64,twofish_x86_64_3way
lrw                     3069  3 camellia_x86_64,serpent_sse2_x86_64,twofish_x86_64_3way
gf128mul                5138  2 lrw,xts
glue_helper             3105  3 camellia_x86_64,serpent_sse2_x86_64,twofish_x86_64_3way
blowfish_generic        3032  0 
blowfish_x86_64        13244  0 
blowfish_common         6159  2 blowfish_generic,blowfish_x86_64
cast5_generic          10293  0 
cast_common             4849  1 cast5_generic
ablk_helper             1556  1 serpent_sse2_x86_64
cryptd                  6479  1 ablk_helper
xcbc                    2269  0 
rmd160                  7160  0 
sha512_generic          4553  0 
sha256_generic          9509  0 
sha1_generic            1822  0 
crypto_null             2468  0 
af_key                 22195  0 
xfrm_algo               4208  1 af_key
ip6t_REJECT             2428  3 
xt_nat                  1777  6 
ipt_REJECT              2009  2 
xt_LOG                  9702  5 
xt_limit                1678  7 
xt_state                1151  3 
xt_multiport            1566  2 
xt_DSCP                 2003  2 
xt_owner                1107  3 
xt_mark                 1133  8 
xt_connmark             1653  2 
ip6table_filter         1284  1 
ip6_tables             13824  1 ip6table_filter
iptable_mangle          1424  1 
iptable_nat             2382  1 
nf_conntrack_ipv4       6526  6 
nf_defrag_ipv4          1259  1 nf_conntrack_ipv4
nf_nat_ipv4             2992  1 iptable_nat
nf_nat                 11007  3 nf_nat_ipv4,xt_nat,iptable_nat
nf_conntrack           50975  6 nf_nat,xt_state,nf_nat_ipv4,xt_connmark,iptable_nat,nf_conntrack_ipv4
iptable_filter          1312  1 
ip_tables              13378  3 iptable_filter,iptable_mangle,iptable_nat
x_tables               13511  16 ip6table_filter,xt_DSCP,xt_mark,ip_tables,xt_limit,xt_owner,xt_state,xt_LOG,xt_nat,xt_multiport,iptable_filter,xt_connmark,ipt_REJECT,iptable_mangle,ip6_tables,ip6t_REJECT
acpi_cpufreq            6294  1 
mperf                   1107  1 acpi_cpufreq
snd_hda_codec_hdmi     24489  1 
kvm_amd                43896  0 
snd_hda_codec_realtek    26712  1 
kvm                   315861  1 kvm_amd
radeon                631819  2 
snd_hda_intel          26851  1 
snd_hda_codec         102967  3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
snd_pcm                62018  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
snd_page_alloc          6002  2 snd_pcm,snd_hda_intel
fbcon                  32349  72 
bitblit                 4081  1 fbcon
fbcon_rotate            1796  1 bitblit
fbcon_ccw               4462  1 fbcon_rotate
fbcon_ud                4509  1 fbcon_rotate
fbcon_cw                4406  1 fbcon_rotate
softcursor              1141  4 fbcon_cw,fbcon_ud,fbcon_ccw,bitblit
font                    7292  1 fbcon
tileblit                1965  1 fbcon
drm_kms_helper         22796  1 radeon
ttm                    51242  1 radeon
drm                   195966  4 ttm,drm_kms_helper,radeon
cfbfillrect             2994  1 radeon
cfbimgblt               1943  1 radeon
cfbcopyarea             2982  1 radeon
i2c_algo_bit            4463  1 radeon
fb                     44774  9 fbcon,fbcon_cw,fbcon_ud,drm_kms_helper,radeon,softcursor,fbcon_ccw,tileblit,bitblit
processor              32110  1 acpi_cpufreq
fbdev                    798  2 fb,fbcon
snd_timer              14965  1 snd_pcm
snd                    46104  8 snd_hda_codec_realtek,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec,snd_hda_intel
parport_pc             23562  0 
i2c_piix4               7463  0 
k10temp                 2698  0 
asus_atk0110            8418  0 
wmi                     6955  0 
button                  4525  0 
ehci_pci                3312  0 
parport                25915  1 parport_pc
hid_generic             1105  0 
usbhid                 22258  0 
hid                    73002  2 hid_generic,usbhid
microcode               9233  0 
r8169                  46016  0 
ohci_hcd               17344  0 
ehci_hcd               31352  1 ehci_pci
firewire_ohci          26301  0 
firewire_core          42677  1 firewire_ohci
usbcore               127518  6 usblp,ohci_hcd,ehci_hcd,ehci_pci,usbhid
usb_common               874  1 usbcore

-- /etc/initramfs-tools/modules

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=y
KEYMAP=n
COMPRESS=gzip
DEVICE=
NFSROOT=auto

-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no

-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:

/usr/share/initramfs-tools/hooks:
amd64_microcode
busybox
dmsetup
fuse
keymap
klibc
kmod
ntfs_3g
thermal
udev


-- System Information:
Debian Release: 7.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.9.2-kam (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages initramfs-tools depends on:
ii  cpio               2.11+dfsg-0.1
ii  klibc-utils        2.0.1-3.1
ii  kmod               9-3
ii  module-init-tools  9-3
ii  udev               175-7.2

Versions of packages initramfs-tools recommends:
pn  busybox | busybox-initramfs | busybox-static  <none>

Versions of packages initramfs-tools suggests:
pn  bash-completion  <none>

-- no debconf information


Reply to: