minor fixes
[automated-distro-installer] / faiserver-setup
index f1ede11628990d3b920787981bb6f2f6756a0a2d..bbc4f50c27fd2e83d2778f3a67579d53ec274f90 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright (C) 2016 Ian Kelling
+# Copyright (C) 2018 Ian Kelling
 
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -85,14 +85,14 @@ elif grep -xFq 'VERSION="8 (jessie)"' /etc/os-release; then
   cat >/etc/apt/sources.list.d/fai.list <<'EOF'
 deb http://fai-project.org/download jessie koeln
 EOF
-elif grep -xFq 'VERSION="9 (stretch)"' /etc/os-release; then
+elif grep -xFq 'VERSION="9 (stretch)"' /etc/os-release || grep -iE 'flidas|xenail' /etc/os-release ; then
+  # fai on ubuntu only has official support using the universe repo, but newer
+  # tends to have less bugs.
   gpg -a --recv-keys 2BF8D9FE074BCDE4; gpg -a --export 2BF8D9FE074BCDE4 | apt-key add -
 
   cat >/etc/apt/sources.list.d/fai.list <<'EOF'
 deb http://fai-project.org/download stretch koeln
 EOF
-elif grep -iE 'flidas|xenail' /etc/os-release; then
-    add-apt-repository -y ppa:fai/ppa
 else
   rm -f /etc/apt/sources.list.d/fai.list
 fi
@@ -103,7 +103,8 @@ apt-get update
 # I especially do not wait isc-dhcp-server or an inetd. Also excludes
 # nfs-kernel-server. On an android chroot, we don\'t have nfs in the
 # kernel, or the ability to install it.
-pkgs=(fai-doc tftpd-hpa tar reprepro squashfs-tools binutils)
+# xorriso is for running fai-cd -a, not strictly need for fai-server
+pkgs=(fai-doc tftpd-hpa tar reprepro squashfs-tools binutils xorriso)
 if modprobe nfsd &>/dev/null; then
   pkgs+=(nfs-kernel-server)
 else
@@ -164,6 +165,9 @@ s,^( *FAI_DEBOOTSTRAP=).*,\1"$base $r",
 EOF
 
 $sed 's/#LOGUSER/LOGUSER/' /etc/fai/fai.conf
+$sed -i '/^FAI_FLAGS=/d' /etc/fai/fai.conf
+echo "FAI_FLAGS=verbose" >>/etc/fai/fai.conf
+
 # from man fai-make-nfsroot,
 # figured out after partitioning ignored my crypt partition