X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=faiserver-setup;h=168dcda6d0518e09652ebfbb0c59fbbfcc4bd56d;hb=HEAD;hp=42ecb3b30c29602ef10f42a33b5b2112f1fbcc7f;hpb=591c84435e22df12f2b5121c08578bff7c6bb047;p=automated-distro-installer diff --git a/faiserver-setup b/faiserver-setup index 42ecb3b..b2d8bc7 100755 --- a/faiserver-setup +++ b/faiserver-setup @@ -15,15 +15,14 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace" +set -e; . /usr/local/lib/bash-bear; set +e [[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@" -LC_USEBASHRC=t; . ~/.bashrc usage() { - cat < limittime )); then + if (( cachetime > limittime )); then update=true fi fi @@ -131,7 +135,8 @@ fi # kernel, or the ability to install it. # xorriso is for running fai-cd -a, not strictly need for fai-server # perl-tk is for fai-monitor-gui -pkgs=(fai-doc tftpd-hpa tar reprepro squashfs-tools binutils xorriso perl-tk) +# mtools is for fai-cd +pkgs=(fai-doc tftpd-hpa tar reprepro squashfs-tools binutils xorriso perl-tk mtools) if modprobe nfsd &>/dev/null; then pkgs+=(nfs-kernel-server) else @@ -189,9 +194,14 @@ EOF # fi -$sed -f - /etc/fai/nfsroot.conf <>/srv/fai/nfsroot/root/.ssh/known_hosts done +# make it the root because pxe-kexec only looks there. +# It wouldn't be too hard to change if we needed. +# We could also just dump things in /srv/tftp, but fai +# has some defaults, which I don't even use, which expect +# the other directory, so it's kind of a tossup, whatever. +# This means fai's example isc-dhcp-server filename directory should remove the fai/ prefix. +sed -ri 's,^ *(TFTP_DIRECTORY=).*,\1"/srv/tftp/fai",' /etc/default/tftpd-hpa +systemctl restart tftpd-hpa + # serial console # mainly from @@ -344,6 +362,6 @@ echo "c0:2345:respawn:/sbin/agetty 115200 ttyS0 linux" >>/srv/fai/nfsroot/etc/in # the logsave prompted because the hostname faiserver was uknown. # Here it was faiserver.lan when running from a faiserver vm. # When running from a normal host with faiserver alias, it was the normal hosts name. -$sed 's/(^[^,]+,)\S+/\1faiserver/' /srv/fai/nfsroot/root/.ssh/known_hosts +$sed 's/(^[^,]+,)\S+/\1faiserver.b8.nz/' /srv/fai/nfsroot/root/.ssh/known_hosts # ditch the logo banner up top which screws with less. touch /srv/fai/nfsroot/.nocolorlogo