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

Bug#385252: initramfs-tools: support etherboot passing short ip= string



Package: initramfs-tools
Version: 0.77
Severity: wishlist
Tags: patch

when etherboot is configured to pass the ip= option(so you only get one
call to dhcp), it unfortunately doesn't pass the whole string, but only
the first 4 or 5 segments.  this causes the DEVICE value to get set to
the whole ip= string.

attached is a patch that should detect this case and fallback to the
default DEVICE (usually eth0).

sure is hard to implement this stuff without "cut" or "awk" :)

live well,
  vagrant

p.s. also available in bzr (revno 210):
http://llama.freegeek.org/~vagrant/bzr-archives/initramfs-tools/vagrant-initramfs-tools
=== modified file 'scripts/nfs'
--- scripts/nfs	
+++ scripts/nfs	
@@ -22,7 +22,13 @@
 
 			# grab device entry from full line
 			NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}
-			NEW_DEVICE=${NEW_DEVICE%:*}
+			if [ "${NEW_DEVICE}" = "${IPOPTS}" ]; then
+				# unable to parse, possibly only a partial ip string.
+				# use default device.
+				NEW_DEVICE=
+			else
+				NEW_DEVICE=${NEW_DEVICE%:*}
+			fi
 			if [ -n "${NEW_DEVICE}" ]; then
 				DEVICE="${NEW_DEVICE}"
 			fi


Reply to: