summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initramfs/initrd-stuff/etc/messages3
-rwxr-xr-xinitramfs/initrd-stuff/init16
2 files changed, 15 insertions, 4 deletions
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)