[Fai-commit] r6124 - trunk/bin

Michael Prokop mika at alioth.debian.org
Thu Oct 14 14:48:01 UTC 2010


Author: mika
Date: 2010-10-14 14:47:59 +0000 (Thu, 14 Oct 2010)
New Revision: 6124

Modified:
   trunk/bin/fai
Log:
fai: re-add support for hostname=... bootoption when using live-config

live-config provides hostname handling through a separate script
and $HOSTNAME of bootoption hostname=... isn't available in the
environment any longer.

The argument of the bootoption HOSTNAME=... (uppercase) would be
available in the environment but as we want to be backwards
compatible and continue supporting the hostname=... bootoption
we've to use live-config accordingly if it's available.

Thanks for the bugreport and the initial patch to Karl Wallner.

Thanks: Karl Wallner <fai at karlwallner.de>
Signed-off-by: Michael Prokop <mika at debian.org>



Modified: trunk/bin/fai
===================================================================
--- trunk/bin/fai	2010-10-12 22:30:55 UTC (rev 6123)
+++ trunk/bin/fai	2010-10-14 14:47:59 UTC (rev 6124)
@@ -259,6 +259,16 @@
 [ "$0" = "/etc/init.d/rcS" ] || [ X$UPSTART_JOB = Xfai ] && do_init_tasks=1
 if [ $do_init_tasks -eq 1 ]; then
     hostname $HOSTNAME
+
+    # live-config provides hostname handling through a separate script,
+    # $HOSTNAME isn't available in environment any longer
+    if [ -x /lib/live/config.sh ] ; then
+      LIVE_CONFIGS=hostname /lib/live/config.sh
+      HOSTNAME=$(hostname)
+    fi
+
+    export HOSTNAME
+
     renewclass=1 # always renew class list when installing
     mkdir -p /var/lib/discover /var/discover /etc/sysconfig
 fi




More information about the Fai-commit mailing list