summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile14
-rwxr-xr-xinitrd/initrd-stuff/bin/servconfig19
-rwxr-xr-xinitrd/initrd-stuff/init4
3 files changed, 22 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 404e6d84..b5d2801a 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
# to the various destination directories
#
# Author(s): Lars Mueller <lm@opendiskless.org>, 11-08-2006
-# Dirk von Suchodoletz <dirk@goe.net>, 15-08-2006
+# Dirk von Suchodoletz <dirk@goe.net>, 20-08-2006
#
# Copyright: (c) 2006 - opendiskless.org project
#
@@ -28,14 +28,14 @@ install:
@cp installer/default_files/machine-setup.default \
/usr/share/opendiskless/templates
@echo -e "#!/bin/sh\n#\n# This script allows the local admin to \
-extend the\n# capabilities at the beginning of the initramfs. The toolset \
-is rather\n# restricted and you have to keep in mind that stage4 rootfs \
-has the\n# prefix '/mnt'." \
+extend the\n# capabilities at the beginning of the initramfs (stage3). \
+The toolset is rather\n# restricted and you have to keep in mind that \
+stage4 rootfs has the\n# prefix '/mnt'." \
> /var/lib/opendiskless/config/default/initramfs/preinit.local
@echo -e "#!/bin/sh\n#\n# This script allows the local admin to \
-extend the\n# capabilities at the end of the initramfs. The toolset \
-is rather\n# restricted and you have to keep in mind that stage4 rootfs \
-has the\n# prefix '/mnt'." \
+extend the\n# capabilities at the end of the initramfs (stage3). The \
+toolset is rather\n# restricted and you have to keep in mind that stage4 \
+rootfs has the\n# prefix '/mnt'." \
> /var/lib/opendiskless/config/default/initramfs/postinit.local
@chmod u+x /var/lib/opendiskless/config/default/initramfs/*init.local
diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig
index c645cef6..d3bbf8a4 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>, 18-08-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 20-08-2006
# Michael Janczyk <mj0>, 31-05-2006
# Lars Mueller <lm@opendiskless.org>, 23-06-2006
# Oliver Tappe <ot@opendiskless.org>, 23-06-2006
@@ -202,11 +202,13 @@ if [ -n "${automnt_src}" ] ; then
automnt_dir=${automnt_dir%/}
test -d /${automnt_dir} || error "$scfg_erradir" nonfatal
strinstr "/" ${automnt_dir} && error "$scfg_erratpld" nonfatal
+ amserv=$(uri_token $automnt_src server)
+ ampath=$(uri_token $automnt_src path)
echo -e "/${automnt_dir}\t/etc/auto.${automnt_dir}\n" \
>> /mnt/etc/auto.master
echo -e "# /etc/auto.${automnt_dir} created by $0:\n" \
> /mnt/etc/auto.${automnt_dir}
- echo -e "*\t-rsize=32768,wsize=32768,rw\t${automnt_src}/&" \
+ echo -e "*\t-rsize=32768,wsize=32768,rw\t${amserv}:/${ampath}/&" \
>> /mnt/etc/auto.${automnt_dir}
# no tempfs needed if automounter operates on /home
[ "${automnt_dir}" = "home" ] && umount -t tmpfs /mnt/home 2>/dev/null
@@ -334,24 +336,27 @@ fi
# wait for completion of detection, setup process
waitfor /tmp/tmpready 10000
# create some directories and correct permissions
-tmpisdisk=`sed -n '/\/tmp/p' /tmp/tmpready`
+tmpisdisk=`sed -n '/\/tmp/p' /tmp/fstab 2>/dev/null`
# if there is no local disk partition for /tmp then try to mount a rw
# 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
+ # exports have to be per client!!
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 && {
+ tmpserv=$(uri_token $scratch server)
+ tmppath=$(uri_token $scratch path)
+ mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid \
+ ${tmpserv}:/${tmppath} /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; }
+ ${tmpserv}:/${tmppath}/${clientip} /mnt/tmp >/dev/null 2>&1; }
;;
esac
fi
diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init
index a2560b3f..d9de24f1 100755
--- a/initrd/initrd-stuff/init
+++ b/initrd/initrd-stuff/init
@@ -476,7 +476,9 @@ cp /etc/machine-setup /mnt/etc
postinit
[ -s /initramfs/postinit.local ] && \
cp /initramfs/postinit.local /bin/postinit.local
-[ -x /bin/postinit.local ] && /bin/postinit.local
+[ -x /bin/postinit.local ] && {
+ echo "Running postinit.local - if boot stops here, check the script!"
+ /bin/postinit.local; }
# start a debug shell in higher debug levels
[ $DEBUGLEVEL -gt 2 ] && /bin/sh