/var/lib/fai/config/hooks/confdir.DEFAULT.source is in goto-fai 3.1-1.2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | #!/bin/sh
# Debug Shell
[ "$debug" ] && openvt -v -- sh
# Anyone logged in?
logged=$(w -hs | wc -l)
# Let us define the hostname if hook is defined
if [ -x $FAI/hooks/hostname ]; then
$FAI/hooks/hostname
export HOSTNAME=$(cat /tmp/hostname)
hostname $HOSTNAME
fi
if [ $logged -eq 0 ]; then
# Always open new VT, but don't switch to it
#
# Some explanation, since we can't comment in this "script"
# - first setup environment
# - echo -ne "\033%G" sets UTF-8
#
FAI_PROGRESS_VT=$(openvt -v 2>&1 -- sh -c "
export TERM=linux ;
export TERM_UTF8=yes ;
export FAI_LOG_PATH=$LOGDIR/fai.log ;
[ -f /etc/default/locale ] && eval $(echo -n "export "; grep ^LANG /etc/default/locale) ;
if [ -c /dev/fb0 ]; then
export DEBIAN_FRONTEND=gtk ;
else
export DEBIAN_FRONTEND=newt ;
fi ;
echo -ne '\033%G' ;
setterm -blank 0 -powersave off -powerdown 0 ;
touch -f $LOGDIR/fai.log ;
/usr/lib/cdebconf/debconf /usr/bin/fai-progress ;
reset")
export FAI_PROGRESS_VT=${FAI_PROGRESS_VT##* }
echo "${FAI_PROGRESS_VT##/dev/tty}" > $LOGDIR/fai-progress-vt
fi
# Redefine sendmon in order to get the progress bar and GOsa-SI
# informed
unset sendmon
sendmon() {
# Send message to gosa-si-client
echo $* >> /var/run/gosa-si/gosa-si-client.socket &
}
if [ "$action" != "softupdate" ]; then
if [ $logged -eq 0 -a ! -c /dev/fb0 ]; then
# newt cdebconf frontend needs a chvt
chvt ${FAI_PROGRESS_VT##/dev/tty}
fi
else
# Check the dhclient lease file for the server-name to set SERVER
LEASE=$(ps ax | grep "dhclient" | grep -v "grep" | sed -n 's/.*-lf \([^ ]*\).*/\1/p')
if [ -f $LEASE ]; then
SERVER=$(cat $LEASE | sed -n 's/.*server-name "\([^"]*\)";$/\1/p')
fi
fi
# Rebase FAI to load the LDAP stuff later on
FAI_REBASE=$(mktemp -d "/tmp/fai-ldap-XXXXXX")
export FAI_CONFIG_SRC="gosa://${FAI_REBASE}"
# Copy error hook to make it available in the target system
mkdir -p "$FAI_REBASE/hooks"
mkdir -p "$FAI_REBASE/scripts/DEFAULT"
cp "$FAI/hooks/error.DEFAULT" "$FAI_REBASE/hooks"
cp "$FAI/hooks/extrbase.DEFAULT" "$FAI_REBASE/hooks"
cp "$FAI/hooks/prepareapt.DEFAULT" "$FAI_REBASE/hooks"
cp "$FAI/scripts/DEFAULT/00-copy-templates" "$FAI_REBASE/scripts/DEFAULT"
# Make fai rebase
export FAI="$FAI_REBASE"
|