faiserver-revm # using pxe & preseed, create a vm which is a fai server
faiserver-uninstall # uninstall fai-server
faiserver-setup # install fai-server on the current machine
-myfai-chboot # setup fai tftp and nfs. useful with pxe-kexec
-pxe-server # disable/enable pxe dhcp, tfp, and nfs
+myfai-chboot # setup fai tftp and nfs. useful for doing pxe-kexec
+pxe-server # disable/enable pxe dhcp, tfp, and nfs. calls myfai-chboot
wrt-setup-remote # setup my router in general: dhcp, dns, etc.
# tried out a stretch base, doesn't work yet.
#
$sed -f - /etc/fai/nfsroot.conf <<EOF
+$ a FAI_ROOTPW="$(</q/root/shadow/standard)"
+/^\s*FAI_ROOTPW/d
s,^( *FAI_DEBOOTSTRAP=).*,\1"$base $r",
# add --arch amd64. this is needed on arm system which is
# used to install amd64 clients. On amd64 servers, it's redundant.
# disabled for now, since creating fai nfsroot on my arm machine
# is not working
#/--arch amd64/!s/^(\s*FAI_DEBOOTSTRAP_OPTS=")/\1--arch amd64 /
-/^\s*FAI_ROOTPW/d
-$ a FAI_ROOTPW="$(</q/root/shadow/standard)"
EOF
$sed 's/#LOGUSER/LOGUSER/' /etc/fai/fai.conf
#!/bin/bash
-x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace"
+# note, this script gets piped to bash, so cant cd to current dir
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+
fai_action_arg=I
fai_reboot_arg=,reboot
[[ $EUID == 0 ]] || exec sudo "${BASH_SOURCE}" "$@"
-e() { echo "$@"; "$@"; }
+e() {
+ echo "$*"
+ if ! "$@"; then
+ echo "$0: error: exit code $? from: $*"
+ exit 1
+ fi
+}
host=$1
my_ip=${network%/*}
if [[ $host == default ]]; then
ip=$network
+elif [[ $host == [0-9]*.[0-9]*.[0-9]*.[0-9]* ]]; then
+ ip=$host
else
ip=$(host $host | sed -rn 's/^\S+ has address //p;T;q')/32
fi
for os boot. Sometimes on debian, there is a 3rd one shortly
after the 2nd. I can't remember exactly why this caused a
problem, but I'm hoping the sleep will take care of it.
--S Pass -S to fai-chboot.
+-S sets FAI_ACTION=sysinfo, see myfai-chboot for more info.
-w Setup pxe, then wait like -a.
-h|--help Print help and exit