[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. 0.6-32-g21f7955
Andreas B. Mundt
andi at debian.org
Tue Aug 28 11:33:15 UTC 2012
The following commit has been merged in the master branch:
commit 0a91f5ce77c70c2f3c4ca48ca9b8f63486d52d8e
Author: Andreas B. Mundt <andi at debian.org>
Date: Tue Aug 28 12:40:39 2012 +0200
Improve installation procedure of the nfs/diskless chroot.
diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/etc/rc.local/FAISERVER
index f5bd06e..28b24c6 100755
--- a/fai/config/files/etc/rc.local/FAISERVER
+++ b/fai/config/files/etc/rc.local/FAISERVER
@@ -6,7 +6,7 @@ set -e
## Moved after successful execution.
############################
-TIMEOUT=60
+TIMEOUT=120
cat <<EOF
================================================================================
The nfsroot for FAI may be created by executing $0.
@@ -25,8 +25,6 @@ case $inp in
;;
esac
-echo "Creating the nfsroot for FAI."
-
. /etc/fai/fai.conf
. /etc/fai/nfsroot.conf
@@ -38,6 +36,7 @@ fi
URL="http.debian.net"
## Check if package repository is accessible:
if wget --quiet --output-document=/tmp/fai-setup $URL ; then
+ echo "Creating the nfsroot for FAI."
fai-setup -e -v -l
## Create pxelinux boot configuration for workstationXX.
## The seq range is sed from the corresponding variable
@@ -54,6 +53,8 @@ if wget --quiet --output-document=/tmp/fai-setup $URL ; then
## Use git to track modifications of the config space:
cd $FAI_CONFIGDIR
+ git config --global user.name "root"
+ git config --global user.email root@`hostname --fqdn`
git init
git add .
git commit -m "Initial commit"
@@ -64,7 +65,30 @@ if wget --quiet --output-document=/tmp/fai-setup $URL ; then
mv -v $0 $0_setup
mv -v /etc/rc.local.pre_fcopy $0
fi
- ## The following message is sed for diskless servers when fcopy'd:
- #DISKLESS_INFO
+ ## The following message is activated if diskless machines
+ ## are to be served. Do not change the following line:
+ exit 0 ##DISKLESS_SERVER##
+ cat <<EOF
+================================================================================
+To install the chroot for diskless clients execute:
+ export LC_ALL=C
+ fai -vNu diskless dirinstall /opt/live/filesystem.dir/
+This can be done right now or manually.
+If unanswered, this script will exit after $TIMEOUT seconds.
+EOF
+ read -e -t $TIMEOUT -n 1 -p "Install the chroot for diskless clients now? [y|N]: " inp
+ inp=${inp:-N}
+ case $inp in
+ y)
+ export LC_ALL=C
+ fai -vNu diskless dirinstall /opt/live/filesystem.dir/
+ ;;
+ *)
+ exit 0
+ ;;
+ esac
+else
+ echo "Error accessing '$URL', check network and internet access."
+ exit 0
fi
diff --git a/fai/config/scripts/FAISERVER/10-config b/fai/config/scripts/FAISERVER/10-config
index 7f40f80..a849fa4 100755
--- a/fai/config/scripts/FAISERVER/10-config
+++ b/fai/config/scripts/FAISERVER/10-config
@@ -10,15 +10,6 @@ if [ $FAI_ACTION == "install" ]; then
sed -i "s/WS_RANGE/${WS_RANGE}/g" $target/etc/rc.local
if ifclass DISKLESS_SERVER ; then
- sed -i "s/\#DISKLESS_INFO/\
-cat <<EOF\n\
-==============================================================\n\
-To install the chroot for diskless clients execute: \n\n\
- export LC_ALL=C \n\
- fai -vNu diskless dirinstall \/opt\/live\/filesystem.dir\/\n\n\
-You can do this right now or later. \n\
-==============================================================\n\
-EOF/" \
- $target/etc/rc.local
+ sed -i "s%\(^.*\#\#DISKLESS_SERVER\#\#\)%\#\1%" $target/etc/rc.local
fi
fi
--
Debian-LAN development and packaging
More information about the debian-lan-devel
mailing list