various fixes and improvements
[automated-distro-installer] / faiserver-setup
index 3e805df9ca2fb5766c210f201fdcf286bfca07fc..491cfda4107b274ef69f378b1c6fbe390df8dacd 100755 (executable)
@@ -43,8 +43,6 @@ esac
 
 e() { echo "$@"; "$@"; }
 
-# When stretch becomes stable, change this to stretch.
-# I\'ve tested this with stretch, it works, but notably,
 # the automatic basefile getting will be for stretch
 # instead of jessie, so if you install jessie, you need
 # to setup the basefile and it\'s corresponding class.
@@ -157,8 +155,10 @@ fi
 # tried out a stretch base, doesn't work yet.
 #
 $sed -f - /etc/fai/nfsroot.conf <<EOF
-$ a FAI_ROOTPW="$(</q/root/shadow/standard)"
+$ a FAI_ROOTPW='$(</q/root/shadow/standard)'
 /^\s*FAI_ROOTPW/d
+$ a SSH_IDENTITY=/root/.ssh/home.pub
+/^\s*SSH_IDENTITY/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.
@@ -179,7 +179,7 @@ fi
 if armhf; then
   cd /srv/fai
   rm -rf nfsroot
-  tar Jxf /a/bin/fai-basefiles/base.tar.xz
+  tar Jxf /a/bin/fai-basefiles/basefiles/STRETCH64.tar.xz
   # background: Can't build the nfsroot on my arm system now.  First,
   # fai-make-nfsroot won't work out of the box. One idea to make it work
   # is by installing qemu-user-static, then copying qemu-x86_64-static
@@ -229,8 +229,10 @@ EOF
   # seem contradictory, but it works.
   fai-setup -evag
 
-else
-    e fai-setup -e -vf
+else # not armhf
+    # note, this copies the -B arg to
+    # /srv/fai/nfsroot/var/tmp/base.tar.xz
+    e fai-setup -evf -B /a/bin/fai-basefiles/basefiles/STRETCH64.tar.xz
     # make the faiserver also the apt proxy server
     apt-get -y install apt-cacher-ng
 fi