Package: nbd-client
Version: 1:2.9.16-2
Severity: normal

Hi,

Sorry to probably inspire another sigh, but the configure_networking
fix has problems so I think the nbd-client.initrd needs another 
tweak.

The nbd-client initrd script now always calls configure_networking

This means that if you have nbd-client installed your initramfs is 
now configuring your network card which (I think) nbd only really 
requires if nbdroot is set.   The most obvious side effect is that 
it can introduce a delay before it succeeds or worse fails.

If you if have a network device that auto-configures and is 
supported by the initramfs you won't have a big problem with this. 
If you don't and have to wait 265s to boot it's a real pain though.

I think the right answer is for nbd-client.initrd to exit early and 
silently if "nbdroot" is not set.  In the process of coming to the 
patch below I realised another couple of things which this addresses:

1)  IP as set here would not be seen by configure_networking.
    initramfs-tools init will export it though so it would have 
      probably worked as it was for anyone using it that way anyway. 
    I think if IP is set here BOOTIF should be also?   Another 
      alternative being to set neither here to leave it up to 
      whatever calls this script.

2)  the ordering of root and nbdroot on the command line mattered,
    if root=/dev/nbd* was after nbdroot it would overwrite the 3rd 
      value of the 3 argument form of nbdroot=*.  if it was before 
      it then nbdroot would ignore root (which I think is fine if 
      the 3 argument form is given).
    A result of this patch is that nbdroot is preferred.

I didn't unindent the case sections that were inside the old 
proc/cmdline loop to keep this patch reading nicely.   Likewise 
I just set x="$nbdroot" so you could tell I wasn't touching that!

Quite simply this parses the cmdline early, exits early, or carries 
on as before with only nbdroot to care about.

I'm shutting up now, I think I've yabbered more then enough.

Thanks and hope this helps,

Niall

*** nbd-client.initrd.2.9.16.nw.diff
--- debian/nbd-client.initrd-orig       2010-07-30 15:14:10.000000000 +0100
+++ debian/nbd-client.initrd    2010-08-01 16:27:48.000000000 +0100
@@ -7,13 +7,35 @@
        ;;
 esac
 
+for x in $(cat /proc/cmdline); do
+       case $x in
+               nbdroot*)
+                       nbdroot="${x}"
+                       ;;
+               ip=*)
+                       IP="${x#ip=}"
+                       ;;
+               root=/dev/nbd*)
+                       # be noisy if nbdroot is not also set
+                       [ -z "${nbdroot}" ] && nbdroot="root"
+                       # these values can be overwritten by nbdroot=*,*,*
+                       nbdrootdev="${x#root=}"
+                       nbdbasedev="${x#root=/dev/}"
+                       ;;
+       esac
+done
+
+# if nbd root is not requested exit early and silently
+if [ -z "${nbdroot}" ]; then
+       exit 0
+fi
+
 . /scripts/functions
 
 log_begin_msg "Setting up nbd-client"
 
 configure_networking
-
-for x in $(cat /proc/cmdline); do
+x="$nbdroot"
        # Support setting stuff using DHCP
        case $x in
                nbdroot=dhcp)
@@ -34,15 +56,7 @@
                        nbdsrv="${nbdroot%,*}"
                        nbdport="${nbdroot#*,}"
                        ;;
-               ip=*)
-                       IP="${x#ip=}"
-                       ;;
-               root=/dev/nbd*)
-                       nbdrootdev="${x#root=}"
-                       nbdbasedev="${x#root=/dev/}"
-                       ;;
        esac
-done
 
 nbdrootdev=${nbdrootdev%p*}
 nbdbasedev=${nbdbasedev%p*}




-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.34-0.slh.11-sidux-686 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages nbd-client depends on:
ii  debconf [debconf-2.0]         1.5.33     Debian configuration management sy
ii  libc6                         2.11.2-2   Embedded GNU C Library: Shared lib

nbd-client recommends no packages.

nbd-client suggests no packages.

-- debconf information excluded



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to