summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/init
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-06-05 22:49:47 +0200
committerDirk von Suchodoletz2007-06-05 22:49:47 +0200
commit7dea6269b01f294f60df982df71de6080eb6f283 (patch)
treef0d9cf09d5981db6d0b5e42dfd2055aa867c1e27 /initramfs/initrd-stuff/init
parentfixed missing changes (diff)
downloadcore-7dea6269b01f294f60df982df71de6080eb6f283.tar.gz
core-7dea6269b01f294f60df982df71de6080eb6f283.tar.xz
core-7dea6269b01f294f60df982df71de6080eb6f283.zip
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
Diffstat (limited to 'initramfs/initrd-stuff/init')
-rwxr-xr-xinitramfs/initrd-stuff/init20
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