# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# 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.
# 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.
-if grep -xFq 'VERSION="9 (stretch)"' /etc/os-release; then
- # if we use stretch, no need for fai-project repo.
- # this will need to be updated when there is a codename
- # for stretch+1
- rm -f /etc/apt/sources.list.d/fai.list
-elif armhf; then
if apt-cache policy | grep o=Debian,a=testing,n=stretch &>/dev/null; then
cat >/etc/apt/sources.list.d/testing.list <<'EOF'
deb http://http.us.debian.org/debian testing main contrib non-free
if apt-cache policy | grep o=Debian,a=testing,n=stretch &>/dev/null; then
cat >/etc/apt/sources.list.d/testing.list <<'EOF'
deb http://http.us.debian.org/debian testing main contrib non-free
-else
- wget -O - http://fai-project.org/download/074BCDE4.asc | apt-key add -
- cat >/etc/apt/sources.list.d/fai.list <<'EOF'
+elif grep -xFq 'VERSION="8 (jessie)"' /etc/os-release; then
+ gpg -a --recv-keys 2BF8D9FE074BCDE4; gpg -a --export 2BF8D9FE074BCDE4 | apt-key add -
+ cat >/etc/apt/sources.list.d/fai.list <<'EOF'
+ 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
# fix tar https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819978
deb http://ftp.debian.org/debian jessie-backports main
EOF
# fix tar https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819978
deb http://ftp.debian.org/debian jessie-backports main
EOF
# note, fai doesn\'t look at /etc/fai/apt/preferences.d
cat >/etc/fai/apt/preferences <<'EOF'
Package: tar
# note, fai doesn\'t look at /etc/fai/apt/preferences.d
cat >/etc/fai/apt/preferences <<'EOF'
Package: tar
# tried out a stretch base, doesn't work yet.
#
$sed -f - /etc/fai/nfsroot.conf <<EOF
# tried out a stretch base, doesn't work yet.
#
$sed -f - /etc/fai/nfsroot.conf <<EOF
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.
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.
# 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
# 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
- # tftp environment
- local pxebin
-
- # wheezy path
- if [ -f $NFSROOT/usr/lib/PXELINUX/pxelinux.0 ]; then
- pxebin=$NFSROOT/usr/lib/PXELINUX/pxelinux.0
- else
- # jessie/stretch path
- pxebin=$NFSROOT/usr/lib/syslinux/pxelinux.0
- fi
-
- rm -f $NFSROOT/boot/*.bak
- mkdir -p $TFTPROOT/pxelinux.cfg
- chmod a+r $NFSROOT/boot/initrd.img-* || die 9 "No initrd was created. Check the package name of the linux-image package in /etc/fai/NFSROOT."
- cp -p $v $NFSROOT/boot/vmlinu?-* $NFSROOT/boot/initrd.img-* $TFTPROOT
- cp -u $pxebin $TFTPROOT
- if [ -f $NFSROOT/usr/lib/syslinux/modules/bios/ldlinux.c32 ]; then
- cp -u $NFSROOT/usr/lib/syslinux/modules/bios/ldlinux.c32 $TFTPROOT
- fi
- if [ X$verbose = X1 ]; then
- echo "TFTP environment prepared. Enable DHCP and start the TFTP daemon on root $TFTPROOT."
- fi
+ # tftp environment
+ local pxebin
+
+ # wheezy path
+ if [ -f $NFSROOT/usr/lib/PXELINUX/pxelinux.0 ]; then
+ pxebin=$NFSROOT/usr/lib/PXELINUX/pxelinux.0
+ else
+ # jessie/stretch path
+ pxebin=$NFSROOT/usr/lib/syslinux/pxelinux.0
+ fi
+
+ rm -f $NFSROOT/boot/*.bak
+ mkdir -p $TFTPROOT/pxelinux.cfg
+ chmod a+r $NFSROOT/boot/initrd.img-* || die 9 "No initrd was created. Check the package name of the linux-image package in /etc/fai/NFSROOT."
+ cp -p $v $NFSROOT/boot/vmlinu?-* $NFSROOT/boot/initrd.img-* $TFTPROOT
+ cp -u $pxebin $TFTPROOT
+ if [ -f $NFSROOT/usr/lib/syslinux/modules/bios/ldlinux.c32 ]; then
+ cp -u $NFSROOT/usr/lib/syslinux/modules/bios/ldlinux.c32 $TFTPROOT
+ fi
+ if [ X$verbose = X1 ]; then
+ echo "TFTP environment prepared. Enable DHCP and start the TFTP daemon on root $TFTPROOT."
+ fi
-else
- e fai-setup -e -vf
- # make the faiserver also the apt proxy server
- apt-get -y install apt-cacher-ng
+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