diff options
author | Sebastian Schmelzer | 2012-05-08 00:45:00 +0200 |
---|---|---|
committer | Sebastian Schmelzer | 2012-05-08 00:45:00 +0200 |
commit | 478478f7d70c07667c1e50f535e90fdcec91a66a (patch) | |
tree | de2d6b21a04bc8d0ef0810a966a05704438cde0a | |
parent | first working dnbd3 boot :) (diff) | |
download | core-478478f7d70c07667c1e50f535e90fdcec91a66a.tar.gz core-478478f7d70c07667c1e50f535e90fdcec91a66a.tar.xz core-478478f7d70c07667c1e50f535e90fdcec91a66a.zip |
get vid, rid from rootfs uri
-rwxr-xr-x | src/initramfs/scripts/init | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/initramfs/scripts/init b/src/initramfs/scripts/init index ea815986..0d65b70e 100755 --- a/src/initramfs/scripts/init +++ b/src/initramfs/scripts/init @@ -272,8 +272,7 @@ line in $0\nnfsserver=\"${nfsserver}\"\nnfspath=\"${nfspath}\"" \ path=$(uri_token $rootfs path) bldrfst=${path##*/} bldopt=${path%/*} - echo "bldrfst $bldrfst\n" - echo "bldopt $bldopt\n" + bldopt=${bldopt#/*} ;; aoe) echo "Not implemented yet" @@ -556,16 +555,22 @@ if [ -n "${bldmod}" ] ; then RDEV=/dev/dnbd0 waitfor "${RDEV}" 20000 || error "$init_nbddev" i=0 - vid=1 #${${blkopt#/*}%%/*} - rid=0 #${${${blkopt#/*}#*/}%%/*} - ls -lah /sys/block/dnbd0/net/cur_server_ip + + vid=${bldopt%/*} + rid=${bldopt#*/} + echo "blkopt: $bldopt" + echo "vid: $vid" + echo "rid: $rid" [ "x" == "x$bldport" ] || bldporrt="-p $bldport" tryagain=1 while [ "x$tryagain" == "x1" ] ; do dnbd3-client -h $bldhost $bldport -d ${RDEV} -v $vid -r $rid usleep 10000 - [ "$(cat /sys/block/dnbd0/net/cur_server_ip)x" != "x" ] && tryagain=0 - echo -n "retry: " + if [ "$(cat /sys/block/dnbd0/net/cur_server_ip)x" != "x" ]; then + tryagain=0 + else + echo -n "retry: " + fi done sleep 1 ;; |