[Fai-commit] r5922 - trunk/bin
Thomas Lange
lange at alioth.debian.org
Sat Jul 31 15:33:20 UTC 2010
Author: lange
Date: 2010-07-31 15:33:16 +0000 (Sat, 31 Jul 2010)
New Revision: 5922
Modified:
trunk/bin/make-fai-nfsroot
Log:
code cleanup
Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot 2010-07-30 21:39:16 UTC (rev 5921)
+++ trunk/bin/make-fai-nfsroot 2010-07-31 15:33:16 UTC (rev 5922)
@@ -255,9 +255,15 @@
fi
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-add_all_host_entries() {
+add_etc_hosts_entries() {
- local ips=$(ip addr show up| grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1)
+ # some default entries
+ ainsl -as $NFSROOT/etc/hosts "127.0.0.1 localhost"
+ ainsl $NFSROOT/etc/hosts "# Following entries are specific to your environment"
+ ainsl $NFSROOT/etc/hosts "$NFSROOT_ETC_HOSTS"
+
+ # add entries for all network devices
+local ips=$(ip addr show up| grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1)
for eth in $ips; do
getent hosts $eth >> etc/hosts || true
done
@@ -310,16 +316,12 @@
die 1 "Can't mount $FAI_DEBMIRROR to $NFSROOT/$MNTPOINT."
fi
- # hoaks some packages
# liloconfig, dump needs these files
echo "# UNCONFIGURED FSTAB FOR BASE SYSTEM" > etc/fstab
- echo 'NTPSERVERS=""' > etc/default/ntp-servers
cp -La $cfdir/apt $NFSROOT/etc
- ainsl -as $NFSROOT/etc/hosts "127.0.0.1 localhost"
- ainsl $NFSROOT/etc/hosts "$NFSROOT_ETC_HOSTS"
- add_all_host_entries
+ add_etc_hosts_entries
# we need these option before installing the first package. So we
# can't put this into fai-nfsroot /etc/apt/apt.conf.d/90fai
@@ -455,11 +457,13 @@
trap 'echo "Aborting";umount_dirs' EXIT
trap "bad_exit" ERR
-{
# repeat message, so it will appear in the log file
-[ "$verbose" ] && echo "Using configuration files from $cfdir"
+[ "$verbose" ] && echo "Using configuration files from $cfdir" > /var/log/fai/make-fai-nfsroot.log
+{
+
+
# remove all kernels from nfsroot
[ -n "$kremove" ] && {
echo "Removing all kernels from NFSROOT."
@@ -522,7 +526,7 @@
umount_dirs
echo "make-fai-nfsroot finished $merror."
exit 0
-} 2>&1 | tee /var/log/fai/make-fai-nfsroot.log
+} 2>&1 | tee -a /var/log/fai/make-fai-nfsroot.log
umount_dirs
trap "true" EXIT
echo "Log file written to /var/log/fai/make-fai-nfsroot.log"
More information about the Fai-commit
mailing list