#u=http://fai-project.org/download/basefiles/XENIAL64.tar.xz
#wget -nv -N $u
EOF
+
+faiserver-enable
# esac
# fi
#
-if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
- echo "STABLE"
+if [[ -e /a/bin/fai/fai-wrapper ]]; then
+ source /a/bin/distro-functions/src/identify-distros
+ if isdebian-stable; then
+ echo "STABLE"
+ fi
fi
# use a list of classes for our demo machine
save_vars did_fai_check last_boot
}
-# we don't set this to fai check so we can't get into
+# fai_check is so we can act like a pxe boot, but just for fai, and by
+# using /debian_bootstrap to do it. We toggle on and off the grub var
+# did_fai_check so we can do the check every other boot. Then
+# /debian_bootstrap checks for that var on boot and if we want to do a
+# fai check, it does it, then reboots. But it also sets did_fai_check to
+# a 3rd state os_true which means we did the fai check, and we don't
+# want to do it again. This is useful for systems without libreboot.
+
+# We don't set this to fai check so we can't get into
# an infinite reboot cycle. We depend on the os to
# create the initial grubenv file.
set default=/debianstable_bootstrap # could use 0 here.
envfile=$part/grubenv
if [ -s $envfile ]; then
load_env --file $envfile
- if [ x$did_fai_check != xtrue -a x$last_boot != x$default ]; then
+ if [ x$did_fai_check == xfalse -a x$last_boot != x$default ]; then
set default=fai-check
elif [ ! -z $last_boot ]; then
set default=$last_boot
# keep it short so we don't delay too much wnen we don't have networking.
NETWORK_TIMOUT_SECS=10
-fai_check=false
+did_fai_check=false
check-fai() {
# we could just as well check if last_boot != /debianstable_boostrap
# the intent with this one is just a little clearer.
if [[ $did_fai_check == true ]]; then
- fai_check=true
+ grub-editenv /mnt/grubenv set did_fai_check=os_true
# ref: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
deadline=$(( `date +%s` + NETWORK_TIMOUT_SECS ))
while ! systemctl status network-online.target && \
umount /mnt
done
-if $fai_check && [[ $last_boot != /debianstable_boostrap ]]; then
+# the check for last_boot is not needed afaik, just sanity check.
+if [[ $did_fai_check == true && $last_boot != /debianstable_boostrap ]]; then
# no need to reboot if we actually want to boot into this os.
reboot
fi
# for debian:
+
+apt-get update
+# all the dependencies except the dhcp server
+deps="$(apt-cache show fai-quickstart | grep ^Depends: |head -n 1|\
+ sed -r 's/^Depends:|,|\|[^,]+|isc-dhcp-server//g')"
+to_install=(tar)
+for pkg in $deps; do
+ dpkg -s $pkg &>/dev/null && continue ||:
+ to_install+=($pkg)
+ # just so we have a record.
+ echo `date` $pkg >>/var/log/fai-manually-installed-packages.log
+done
+if [[ $to_install ]]; then
+ apt-get -y install ${to_install[@]}
+fi
+
r=http://http.us.debian.org/debian
# like default, but scrap httpredir, and nonfree.
# All my systems should be able to get along without nonfree
EOF
fi
-apt-get update
-# all the dependencies except the dhcp server
-deps="$(apt-cache show fai-quickstart | grep ^Depends: |head -n 1|\
- sed -r 's/^Depends:|,|\|[^,]+|isc-dhcp-server//g')"
-to_install=(tar)
-for pkg in $deps; do
- dpkg -s $pkg &>/dev/null && continue ||:
- to_install+=($pkg)
- # just so we have a record.
- echo `date` $pkg >>/var/log/fai-manually-installed-packages.log
-done
-if [[ $to_install ]]; then
- apt-get -y install ${to_install[@]}
-fi
-
# tried out a stretch base, doesn't work yet.
$sed -f - /etc/fai/nfsroot.conf <<EOF
host=$(chost faiserver)
ssh root@$host bash -s "$@" <myfai-chboot-local
-if [[ $1 ]]; then
- ./faiserver-enable
-else
- ./faiserver-disable
-fi
Usage: ${0##*/} [OPTIONS] [HOST TYPE]
One line description
+Without HOST TYPE, disable pxe server and fai server.
TYPE is one of arch, plain, fai.
-HOST is a hostname known to the dhcp server, or default for all, or none to disable
+HOST is a hostname known to the dhcp server, or default for all
-r Don't redeploy fai config. For example, if there is a different host
that is mid-install.
192.168.1.2 treetowl $IMPERSONAL_DOMAIN
192.168.1.3 frodo
192.168.1.4 htpc
-192.168.1.5 x2
+192.168.1.5 x2 faiserver
192.168.1.6 demohost
-192.168.1.7 faiserver
+#192.168.1.7 faiserver
192.168.1.8 tp
72.14.176.105 li
45.33.1.160 lj