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

Bug#575766: marked as done (initramfs-tools: configure_networking function fails if no DEVICE is specified)



Your message dated Sat, 29 May 2010 04:17:07 +0000
with message-id <E1OIDTv-0002KL-Vu@ries.debian.org>
and subject line Bug#575766: fixed in initramfs-tools 0.95
has caused the Debian Bug report #575766,
regarding initramfs-tools: configure_networking function fails if no DEVICE is specified
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
575766: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=575766
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: initramfs-tools
Severity: normal
Tags: patch

the configure_networking function relies on DEVICE being set, and
conf/initramfs.conf hard-codes this to eth0. though some scripts may call this
from /scripts/local-top, and DEVICE may not be set. even when it is set, it
hard-coding it to eth0 may be the wrong network interface.

the following patch should partially address this by checking for DEVICE when
not defined, and using the first interface with an active link.

diff --git a/conf/initramfs.conf b/conf/initramfs.conf
index 23dd249..471dfea 100644
--- a/conf/initramfs.conf
+++ b/conf/initramfs.conf
@@ -55,7 +55,7 @@ BOOT=local
 # Specify the network interface, like eth0
 #
 
-DEVICE=eth0
+#DEVICE=eth0
 
 #
 # NFSROOT: [ auto | HOST:MOUNT ]
diff --git a/scripts/functions b/scripts/functions
index 0ecb1d6..5444c11 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -294,6 +294,24 @@ configure_networking()
 		done
 	fi
 
+	if [ -z "${DEVICE}" ]; then
+		# attempt to detect the first device with an established link.
+		for net_device_path in /sys/class/net/* ; do
+			net_device=${net_device_path##*/}
+			case $net_device in
+				lo) ;;
+				*)
+					if read carrier < "$net_device_path/carrier" ; then
+						if [ "$carrier" = "1" ]; then
+							DEVICE="$net_device"
+							break
+						fi
+					fi
+					;;
+			esac
+		done
+	fi
+
 	# networking already configured thus bail out
 	[ -n "${DEVICE}" ] && [ -e /tmp/net-"${DEVICE}".conf ] && return 0
 

live well,
  vagrant



--- End Message ---
--- Begin Message ---
Source: initramfs-tools
Source-Version: 0.95

We believe that the bug you reported is fixed in the latest version of
initramfs-tools, which is due to be installed in the Debian FTP archive:

initramfs-tools_0.95.dsc
  to main/i/initramfs-tools/initramfs-tools_0.95.dsc
initramfs-tools_0.95.tar.gz
  to main/i/initramfs-tools/initramfs-tools_0.95.tar.gz
initramfs-tools_0.95_all.deb
  to main/i/initramfs-tools/initramfs-tools_0.95_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 575766@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
maximilian attems <maks@debian.org> (supplier of updated initramfs-tools package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 28 May 2010 17:22:56 -0700
Source: initramfs-tools
Binary: initramfs-tools
Architecture: source all
Version: 0.95
Distribution: unstable
Urgency: low
Maintainer: Debian kernel team <debian-kernel@lists.debian.org>
Changed-By: maximilian attems <maks@debian.org>
Description: 
 initramfs-tools - tools for generating an initramfs
Closes: 545728 566295 575766 577253 577981 579702
Changes: 
 initramfs-tools (0.95) unstable; urgency=low
 .
   [ maximilian attems ]
   * update TODO list.
   * hook-functions: refactor copy_exec.
   * mkinitramfs: check only once for existing ldd.
   * mkinitramfs: Use eventual TMPDIR definition.
   * mkinitramfs: guard against empty EXTRA_CONF.
   * update-initramfs: Use nounset.
   * mkinitramfs: Fix several unbound variables.
   * mkinitramfs: On verbose indicate what we rm.
   * bug script: include sizes of generated initramfs.
   * debian/script: add generated resume param to bug.
   * hook-functions: manual_add_modules simplify.
   * hook-functions: copy_modules_dir() small simplifications.
   * mkinitramfs.8: Fix wrong sourcing in boot script. (Closes: #545728)
   * initramfs-tools.8: Mention /scritps/functions.
   * initramfs-tools.8: cryptopts param gone.
   * initramfs-tools.8: document BOOTIF variable.
   * configure_networking(): work with empty DEVICE string.
     (Closes: #566295, #575766)
   * hook-functions: add hid-apple. (Closes: #577253)
   * Revert "mkinitramfs: only copy modprobe conf files". (Closes: #577981)
   * initramfs-tools: change license to GPL.
   * hook-functions: re-add hid-microsoft. (Closes: #577253)
   * initramfs-tools: drop outdated breaks.
   * debian/copyright: add boilerplate to keep lintian happy.
   * hook-functions: Fix copy_modules_dir().
 .
   [ Axel Beckert ]
   * mkinitramfs.8: Add information about $TMPDIR environment variable.
 .
   [ bert schulze ]
   * mkinitramfs: add LZO support.
   * mkinitramfs: use -9 for lzop.
 .
   [ Vagrant Cascadian ]
   * configure_networking: pxelinux BOOTIF fixes.
   * init: add BOOTIF bootarg.
 .
   [ Michael Prokop ]
   * Support booting from USB 3 xHCI-based controllers.
 .
   [ Claus Herwig ]
   * mkinitramfs: fix MODULES=dep on mylex raid devices (DAC960).
     (Closes: #579702)
Checksums-Sha1: 
 9216f73b02d3b5eb006e3260b75655a6da7c45de 922 initramfs-tools_0.95.dsc
 a690ae41f9d01ff63d9997a2dba0c94d19dcd0ac 73275 initramfs-tools_0.95.tar.gz
 e7baa9731d1f5f5e0ac6314d9e2e4d6f2fd74640 79950 initramfs-tools_0.95_all.deb
Checksums-Sha256: 
 7b8954fd0a8e075a38c5c33970b475bd6e9d1c2e4b6f2f81814461d37986ec56 922 initramfs-tools_0.95.dsc
 ceafb109d8cf6240e8c5ea22cd14122c268bee30236867cc43b06b8821d37514 73275 initramfs-tools_0.95.tar.gz
 a8cab85628b927a365d9194f29a2825c1943c21c7e49a1083b5105ce1f655976 79950 initramfs-tools_0.95_all.deb
Files: 
 6b6072a0e133472eba9a27d0b257a96b 922 utils optional initramfs-tools_0.95.dsc
 c43c28e9ff65b26563ccf43079fc3d03 73275 utils optional initramfs-tools_0.95.tar.gz
 1c7793dab0a318b0a2773188f3f41fae 79950 utils optional initramfs-tools_0.95_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkwAX84ACgkQeW7Lc5tEHqiDYwCgz4kG/6PcZ8KZAzpUNAKPgmKb
iy4An2v7U7LwlGo0tSJKhdjCy0xS+bwQ
=v+rR
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: