diff options
Diffstat (limited to 'initramfs/initrd-stuff/init')
-rwxr-xr-x | initramfs/initrd-stuff/init | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index b91326c1..bb05dbb8 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -108,7 +108,8 @@ echo "nofile" > /tmp/file-done # read kernel commandline read KCMDLINE < /proc/cmdline export KCMDLINE -for opts in ${KCMDLINE} ; do +# read the system wide machine-setup and then the kernel commandline +for opts in $(sed "s/#.*//" /etc/machine-setup) ${KCMDLINE} ; do case ${opts} in # localization country=*) @@ -193,6 +194,7 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup # if strinstr " " "$rootfs" ... rootfs=*) rootfs=${opts#rootfs=} + rootfs=${rootfs#\"} srvproto=$(uri_token $rootfs prot) case $srvproto in nfs) @@ -404,7 +406,23 @@ if [ -n "${nbdmod}" ] ; then dnbd2) RDEV=/dev/vnbd0 waitfor "${RDEV}" 20000 || error "$init_nbddev" + # first dnbd2 server echo $nbdhost $nbdport > /sys/block/vnbd0/server0/sock + # check for others in machine-setup and then kernel cmdline + rootfs="$(sed -n "/rootfs=/p" /etc/machine-setup|sed "s,rootfs=,,;s,\",,g") " + [ -z "$rootfs" ] && \ + rootfs="$(cat /proc/cmdline|sed "s,.*rootfs=\",,;s,\".*,,") " + i=0 + while [ "x$nbdhost" != "x" ]; do + i=$(expr $i + 1) + rootfs=${rootfs#* } + nbdsp=$(echo ${rootfs}|sed "s, .*,,") + [ -z "$nbdsp" ] && break + nbdhost=$(uri_token $nbdsp server) + nbdport=$(uri_token $nbdsp port) + echo $nbdhost $nbdport > /sys/block/vnbd0/server${i}/sock + done + cat /sys/block/vnbd0/server*/sock echo 1 > /sys/block/vnbd0/config/vid echo 1 > /sys/block/vnbd0/config/rid echo noop > /sys/block/vnbd0/queue/scheduler |