From 28d5b6abea9f7a3022aaf6e7c82ef90ecdf652c4 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 30 May 2007 22:53:30 +0000 Subject: Small fix for dnbd2 if the interface is dowm for short period (dhclient related problem which is shared with the other network block devices too) and error message ... git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1118 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/etc/messages | 3 +++ initramfs/initrd-stuff/init | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'initramfs/initrd-stuff') diff --git a/initramfs/initrd-stuff/etc/messages b/initramfs/initrd-stuff/etc/messages index 32791bd6..7cf31c1a 100644 --- a/initramfs/initrd-stuff/etc/messages +++ b/initramfs/initrd-stuff/etc/messages @@ -46,6 +46,9 @@ the network block device client. Unable to mount root\n filesystem." init_nbddev=" For some reason the network block device /dev/${NBD}0 never \ appeared.\n You might want to check udev or your list of static device \ files." +init_dnbd2s=" After 100 retries, it was not possible to start the dnbd2 \ +service. Please\n check that at least one server is available. You might \ +use the\n /sys/block/vnbd0 interface for this." init_moddir=" The requested modules directory does not exist. That could \ mean:\n * The kernel was updated but mkdxsinitrd was not run afterwards.\n\ * The mounted filesystem does not contain the modules directory at all.\n\ diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index 9c87ce79..f8905d35 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -389,17 +389,25 @@ if [ -n "${nbdmod}" ] ; then # switch off unneeded block read ahead echo "0" > /sys/block/nbd0/queue/read_ahead_kb ;; - # dnbd2 by Vito di Leo + # dnbd2 by Vito Di Leo dnbd2) RDEV=/dev/vnbd0 waitfor "${RDEV}" 20000 || error "$init_nbddev" echo $nbdhost $nbdport > /sys/block/vnbd0/server0/sock echo 1 > /sys/block/vnbd0/config/vid echo 1 > /sys/block/vnbd0/config/rid - echo 1 > /sys/block/vnbd0/config/running echo noop > /sys/block/vnbd0/queue/scheduler - # switch off unneeded block read ahead - echo "0" > /sys/block/vnbd0/queue/read_ahead_kb + i=0 + while [ $(cat /sys/block/vnbd0/config/running) != 1 ] ; do + echo 1 > /sys/block/vnbd0/config/running + usleep 50 + i=$(expr $i + 1) + if [ $i -ge 100 ] ; then + error "$init_dnbd2s" + break + fi + done + # echo "0" > /sys/block/vnbd0/queue/read_ahead_kb ;; # dnbd by Thorsten Zitterell dnbd) -- cgit v1.2.3-55-g7522