From 88c2acd706d5a1cac28dbbbf91e24defa0e3e5a1 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Tue, 4 Mar 2008 19:11:17 +0000 Subject: Fixes for DNDB2 in SLX init, update of mkcdboot.uclib with ipcalc applet. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1598 95ad53e4-c205-0410-b2fa-d234c58c8868 --- AUTHORS | 14 +++++++------- Makefile | 2 +- initramfs/cdboot/init | 26 +++----------------------- initramfs/cdboot/mkcdboot.uclib | 2 +- initramfs/initrd-stuff/init | 20 ++++++++++++-------- 5 files changed, 24 insertions(+), 40 deletions(-) diff --git a/AUTHORS b/AUTHORS index b0f0e051..5fdb65b1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,13 +1,13 @@ Authors are named in the row of entry dates into the OpenSLX project. -Dirk von Suchodoletz, , 2002 - 2007 -Michael Janczyk, <>, 2003 - 2007 +Dirk von Suchodoletz, , 2002 - 2008 +Michael Janczyk, <>, 2003 - 2008 Nico Dietrich, <>, 2005 - 2006 Felix Endres, <>, 2005 - 2007 Tobias Maier, <>, 2005 - 2006 -Bastian Wissler, <>, 2006 - 2007 -Lars Mueller, , 2006 - 2007 -Oliver Tappe, , 2006 - 2007 -Volker Uhrig, <>, 2007 -Sebastian Schmelzer, <>, 2007 +Bastian Wissler, <>, 2006 - 2008 +Lars Mueller, , 2006 - 2008 +Oliver Tappe, , 2006 - 2008 +Volker Uhrig, <>, 2007 - 2008 +Sebastian Schmelzer, <>, 2007 - 2008 diff --git a/Makefile b/Makefile index 6dc40578..f8582162 100644 --- a/Makefile +++ b/Makefile @@ -196,7 +196,7 @@ supported."; \ tar -xp -C $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share; \ cd theming; tar --exclude=.svn -cp * | \ tar -xp -C $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/themes; cd ..; \ - cp -pP tools/busybox{,.links,.x86_64,.i586} \ + cp -pP tools/busybox{,.links,.x86_64,.i586,.uclib.i586} \ $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/busybox/; \ cp -pP tools/{ddcprobe,915resolution}{,.x86_64,.i586} \ $(SLX_BUILD_PATH)$(SLX_BASE_PATH)/share/ramfstools; \ diff --git a/initramfs/cdboot/init b/initramfs/cdboot/init index dd0af295..499768f9 100755 --- a/initramfs/cdboot/init +++ b/initramfs/cdboot/init @@ -12,27 +12,7 @@ # Main script for cd-boot demo initial ramfs - preloading environment for # for running OpenSLX linux stateless clients version 4 for testing -############################################################################# -# helper function: compute prefix bit number from netmask -# fixme: replace with ipcalc -p $ip $netmask -nm2pref () { -set $(IFS="."; echo $1) -local n=0 -local i - for i in $1 $2 $3 $4 ; do - case $i in - 0) break ;; - 128) n=$(($n + 1)) ; break ;; - 192) n=$(($n + 2)) ; break ;; - 224) n=$(($n + 3)) ; break ;; - 240) n=$(($n + 4)) ; break ;; - 252) n=$(($n + 6)) ; break ;; - 254) n=$(($n + 7)) ; break ;; - 255) n=$(($n + 8)) ; continue ;; - esac - done -echo $n -} + ############################################################################# # device files get their own filesystem (to be move mounted later) @@ -150,7 +130,7 @@ BOOT_IMAGE\nset >/tmp/ipstuff" >/usr/share/udhcpc/default.script chmod u+x /usr/share/udhcpc/default.script modprobe -q af_packet [ -n $vci ] && vci="-V $vci" -udhcpc -n -q $vci -s /usr/share/udhcpc/default.script -i $nwif 2>/dev/null +udhcpc -t 5 -q $vci -s /usr/share/udhcpc/default.script -i $nwif 2>/dev/null if grep "ip=" /tmp/ipstuff >/dev/null 2>&1 ; then . /tmp/ipstuff for i in $dns ; do @@ -159,7 +139,7 @@ if grep "ip=" /tmp/ipstuff >/dev/null 2>&1 ; then else echo "Did not get any proper IP configuration"; /bin/ash fi -ip addr add $ip/$(nm2pref $subnet) dev $nwif +ip addr add $ip/$(ipcalc -s -p $ip $subnet|sed s/.*=//) dev $nwif ip route add default via $router # at this point a little selection script could be downloaded, which lets the diff --git a/initramfs/cdboot/mkcdboot.uclib b/initramfs/cdboot/mkcdboot.uclib index 6f33bb19..2ae16809 100755 --- a/initramfs/cdboot/mkcdboot.uclib +++ b/initramfs/cdboot/mkcdboot.uclib @@ -26,7 +26,7 @@ cp ${SLX_SHARE_PATH}/cdboot/init ${BUILDDIR}/init cp ${SLX_SHARE_PATH}/busybox/busybox.uclib.i586 ${BUILDDIR}/bin/busybox for bbins in [ ar arping ash bunzip2 cat chmod chown chroot cp cpio cut \ date dd df dmesg du echo env expr fdisk free grep gunzip hwclock \ - insmod id ip kill killall ln ls lsmod mdev mkdir \ + insmod id ip ipcalc kill killall ln ls lsmod mdev mkdir \ mknod mkswap modprobe mount mv nice ping printf ps rdate \ rm rmmod sed sleep sort swapoff swapon switch_root tar test tftp \ time touch tr udhcpc umount uptime usleep vconfig vi wget zcat zcip; do diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index d7ed6037..480c293c 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -448,13 +448,19 @@ if [ -n "${bldmod}" ] ; then dnbd2) RDEV=/dev/vnbd0 waitfor "${RDEV}" 20000 || error "$init_nbddev" + # quickhack, should be read in from URI + echo 1 > /sys/block/vnbd0/config/vid + echo 1 > /sys/block/vnbd0/config/rid # check for others in machine-setup and then kernel cmdline rootfs="$(sed -n "/rootfs=/p" /etc/initramfs-setup| \ sed "s,rootfs=,,;s,\",,g") " - [ -z "$rootfs" ] && \ + [ "$rootfs" = " " ] && \ rootfs="$(cat /proc/cmdline|sed "s,.*rootfs=\",,;s,\".*,,") " + usleep 5000 i=0 - while [ "x$bldhost" != "x" ]; do + # assume no more than 16 different dnbd2 servers (default 4) + while [ "x$bldhost" != "x" -a $i -lt 16 ]; do + #echo "I: $i R: $rootfs P:$bldport H:$bldhost" echo $bldhost $bldport > /sys/block/vnbd0/server${i}/sock i=$(($i + 1)) rootfs=${rootfs#* } @@ -462,12 +468,10 @@ if [ -n "${bldmod}" ] ; then bldhost=$(uri_token $bldsp server) bldport=$(uri_token $bldsp port) done - # quickhack, should be read in from URI - echo 1 > /sys/block/vnbd0/config/vid - echo 1 > /sys/block/vnbd0/config/rid - echo deadline > /sys/block/vnbd0/queue/scheduler + # the deadline, cfq scheduler seem not a good idea here + echo noop > /sys/block/vnbd0/queue/scheduler + # needed for some reason to settle initialization i=0 - sleep 1 while [ $(cat /sys/block/vnbd0/config/running) != 1 ] ; do echo 1 > /sys/block/vnbd0/config/running usleep 5000 @@ -476,7 +480,7 @@ if [ -n "${bldmod}" ] ; then error "$init_dnbd2s"; break fi done - echo "32" > /sys/block/vnbd0/queue/read_ahead_kb + echo "64" > /sys/block/vnbd0/queue/read_ahead_kb ;; # dnbd by Thorsten Zitterell dnbd) -- cgit v1.2.3-55-g7522