summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initrd/initrd-stuff/etc/functions2
-rwxr-xr-xinitrd/initrd-stuff/init15
-rwxr-xr-xinstaller/ld4-inst29
3 files changed, 27 insertions, 19 deletions
diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions
index 8c8e1c8f..53056344 100644
--- a/initrd/initrd-stuff/etc/functions
+++ b/initrd/initrd-stuff/etc/functions
@@ -332,7 +332,7 @@ waitfor () {
local file=$1
local maxwait=$2
local count=0
-while [ ! -f $file ] ; do
+while [ ! -e $file ] ; do
echo "waiting ........." > /dev/null
count=`expr $count + 1`
[ $count -gt $maxwait ] && return 1
diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init
index b21ffc8d..a3af01d5 100755
--- a/initrd/initrd-stuff/init
+++ b/initrd/initrd-stuff/init
@@ -2,11 +2,11 @@
# Description: main script for new type of initial ramdisk for
# linux diskless clients version 4
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 03-04-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 06-04-2006
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
#
-# Version: 0.2.4b
+# Version: 0.2.4c
# functions common for all distros, messages contains all error and info
# output
@@ -230,10 +230,13 @@ if [ -n "${NBD}" ] ; then
case "${NBD}" in
# network block device present in standard kernel
nbd)
- waitfor /dev/nbd0 10000 || error "$init_nbddev"
- nbd-client $nbdhost $nbdport /dev/nbd0 || error "$init_nbdcl"
RDEV=/dev/nbd0
- ;;
+ waitfor "${RDEV}" 15000 || error "$init_nbddev"
+ echo "0" > /sys/block/nbd0/queue/read_ahead_kb
+ nbd-client $nbdhost $nbdport ${RDEV} || error "$init_nbdcl"
+ # switch off unneeded block read ahead
+ echo "0" > /sys/block/nbd0/queue/read_ahead_kb
+ ;;
# dnbd by Thorsten Zitterell
dnbd)
if [ -z $nodnbdcache ] ; then # variable not really used yet
@@ -247,7 +250,7 @@ if [ -n "${NBD}" ] ; then
while ! dnbd-client -b $nbdhost -d /dev/dnbd0 $clientopt ; do
usleep 10
done
- #echo $?
+ echo "0" > /sys/block/dnbd0/queue/read_ahead_kb
RDEV=/dev/dnbd0
;;
esac
diff --git a/installer/ld4-inst b/installer/ld4-inst
index 88d314df..94b2265d 100755
--- a/installer/ld4-inst
+++ b/installer/ld4-inst
@@ -8,7 +8,7 @@
#
# Copyright: (c) 2003, 2006 - RZ Universitaet Freiburg
#
-# Version: 0.2.0b
+# Version: 0.2.0d
header() {
echo
@@ -242,8 +242,10 @@ create_nbd() {
if [ "$nbdyes" = "yes" -o "$nbdyes" = "y" -o "$nbdyes" = "Y" ] ; then
# TODO: mksquashfs (background process)
if [ "$nbdfs" = "squashfs" ] ; then
- echo -e "\nGenerating SquashFS imge ${rootdir}.squashfs (ca. 30 min.)"
- if `which mksquashfs` ; then
+ echo -e "\nGenerating SquashFS image ${rootdir}.squashfs (ca. 30 min.)"
+ if `which mksquashfs &>/dev/null` ; then
+ mv ${rootdir}.squashfs ${rootdir}.squashfs.old
+ echo "mksquashfs ${rootdir} ${rootdir}.squashfs"
mksquashfs ${rootdir} ${rootdir}.squashfs &
else
echo -e "Tool 'mksquashfs' not found, skipping"
@@ -338,7 +340,7 @@ setup_server () {
# nfs
echo -e "#/etc/exports - file generated by $0\n\
-# for backups of this file please check /etc/dxs directory\
+# for backups of this file please check /etc/dxs directory\n\
# NFS export entry for DXS\n\
${rootdir} ${netname}/${netmask}(ro,no_root_squash,async)" \
>> ${dxs_conf}/${dxs_exports_conf}-${timestamp}
@@ -365,19 +367,21 @@ ${rootdir} ${netname}/${netmask}(ro,no_root_squash,async)" \
default_string=""
fi
echo -e "LABEL ${client_distro}-${current_kernel}\n${default_string}\
- MENU LABEL $j. ${client_distro}-${client_distro_ver} ${current_kernel} Diskless\n \
- KERNEL ${server}::${tftpbootdir}/vmlinuz-${current_kernel}\n \
- APPEND nfsroot=${server}:${rootdir} initrd=${server}::${tftpbootdir}/initrd-dxs-${current_kernel} apic dhcp noldsc vci=DXS\n \
- ipappend 1\n\n" >> ${dxs_conf}/${dxs_pxedefault_conf}-${timestamp}
+ MENU LABEL $j. ${client_distro}-${client_distro_ver} ${current_kernel} Diskless\n\
+ KERNEL ${server}::${tftpbootdir}/vmlinuz-${current_kernel}\n\
+ APPEND nfsroot=${server}:${rootdir} initrd=${server}::${tftpbootdir}/initrd-dxs-${current_kernel} \
+ apic dhcp noldsc debug=$debuglevel vci=DXS\n\
+ ipappend 1\n" >> ${dxs_conf}/${dxs_pxedefault_conf}-${timestamp}
if [ -n "$nbdyes" ] ; then
j=$j+1
# create configs for nbd/squashfs kernels too
echo -e "LABEL ${client_distro}-${current_kernel}-nbd\n\
- MENU LABEL $j. ${client_distro}-${client_distro_ver} ${current_kernel} Diskless NBD\n \
- KERNEL ${server}::${tftpbootdir}/vmlinuz-${current_kernel}\n \
- APPEND nbdroot=${server}:5000,${nbdfs} initrd=${server}::${tftpbootdir}/initrd-dxs-${current_kernel} apic dhcp noldsc vci=DXS\n \
- ipappend 1\n\n" >> ${dxs_conf}/${dxs_pxedefault_conf}-${timestamp}
+ MENU LABEL $j. ${client_distro}-${client_distro_ver} ${current_kernel} Diskless NBD\n\
+ KERNEL ${server}::${tftpbootdir}/vmlinuz-${current_kernel}\n\
+ APPEND nbdroot=${server}:5000,${nbdfs} initrd=${server}::${tftpbootdir}/initrd-dxs-${current_kernel} \
+ apic dhcp noldsc debug=$debuglevel vci=DXS\n\
+ ipappend 1\n" >> ${dxs_conf}/${dxs_pxedefault_conf}-${timestamp}
fi
j=$j+1
@@ -453,6 +457,7 @@ header
precheck #(run as root, rsync etc.)
configure
copy_system
+create_nbd
create_initrd
setup_server
footer