diff options
Diffstat (limited to 'initrd/initrd-stuff/bin')
| -rwxr-xr-x | initrd/initrd-stuff/bin/hwautocfg | 8 | ||||
| -rwxr-xr-x | initrd/initrd-stuff/bin/servconfig | 35 |
2 files changed, 31 insertions, 12 deletions
diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg index 827611c5..866ea0d5 100755 --- a/initrd/initrd-stuff/bin/hwautocfg +++ b/initrd/initrd-stuff/bin/hwautocfg @@ -4,7 +4,7 @@ # script for linux diskless clients, using hwconfig from # knoppix as base tool # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 10-07-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 15-07-2006 # Felix Endres # # Copyright: (c) 2003 - 2006 - RZ Universitaet Freiburg @@ -428,9 +428,9 @@ for hd in $(cat /tmp/hwsetup.info|sed -n -e '/HD$/,/device:/p'| \ # we use special non assigned partition type for harddisk scratch space for hdpartnr in $(cat /tmp/hd_part | \ sed -n -e "/ 44 /p"|sed -e "s/[[:space:]].*//") ; do - # ugly message from ext2 mount :-( - ( mkfs.ext2 -q $hdpartnr; mount -n $hdpartnr /mnt/tmp; \ - echo "$hdpartnr" > /tmp/tmpready ) & + # ext2fs_check_if_mount message supressed + ( mkfs.ext2 -Fq $hdpartnr 2>/dev/null; mount -n -o nocheck,noexec \ + $hdpartnr /mnt/tmp 2>/dev/null; echo "$hdpartnr" > /tmp/tmpready ) & echo -e "$hdpartnr\t/tmp\t\text2\t\tdefaults\t 0 0" >> /tmp/fstab part44=yes break diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index b6d5aedb..0239e401 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -4,7 +4,7 @@ # for linux diskless clients (executed within initial # ramdisk) # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 09-07-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 23-07-2006 # Michael Janczyk, 31-05-2006 # Lars Mueller, 23-06-2006 # Oliver Tappe, 23-06-2006 @@ -83,9 +83,19 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then if [ -d /mnt/usr/share/vmware ] ; then ln -sf /usr/share/vmware /mnt/var/lib/vmware elif [ -n "${imgsrv}" ] ; then - # # more general mount script should be used here!? + # get type, server, path of VMware image export + vmimgsprot=$(uri_token $imgsrv prot) + vmimgsserv=$(uri_token $imgsrv server) + vmimgspath="/$(uri_token $imgsrv path)" + case "$vmimgsprot" in + *nbd) + ;; + *) + # # more general mount script should be used here!? nfsmnt ${imgsrv} /mnt/var/lib/vmware || { error "$scfg_nfs" nonfatal; noimg=yes; } + ;; + esac fi fi @@ -324,15 +334,24 @@ waitfor /tmp/tmpready 10000 # create some directories and correct permissions tmpisdisk=`sed -n '/\/tmp/p' /mnt/etc/fstab` # if there is no local disk partition for /tmp then try to mount a rw -# NFS scratch space (if defined in $scratch) and prepared on server +# scratch space (if defined in $scratch) and prepared on server if [ -n "$scratch" -a -z "$tmpisdisk" ] ; then + scrproto=$(uri_token $FILESRC prot) + scrpath=$(uri_token $FILESRC path) mkdir -p /tmp/scratch >/dev/null 2>&1 - mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid ${scratch} \ + case "$scrproto" in + nbd) + # exports have to be per client!! + ;; + *) + mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid ${scratch} \ /tmp/scratch >/dev/null 2>&1 && { - mkdir -p /tmp/scratch/${clientip} >/dev/null 2>&1 - umount /tmp/scratch - mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid \ - ${scratch}/${clientip} /mnt/tmp >/dev/null 2>&1; } + mkdir -p /tmp/scratch/${clientip} >/dev/null 2>&1 + umount /tmp/scratch + mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid \ + ${scratch}/${clientip} /mnt/tmp >/dev/null 2>&1; } + ;; + esac fi chmod 1777 /mnt/tmp |
