From 7dea6269b01f294f60df982df71de6080eb6f283 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Tue, 5 Jun 2007 20:49:47 +0000 Subject: Removed obsolete udev stuff from debian specific. Added support for multisource dnbd2. Integrated functionality to read machine-setup and kernel commandline the same way for init variable initialization. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1148 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/init | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'initramfs/initrd-stuff/init') 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 -- cgit v1.2.3-55-g7522