# dirinstall
host=kw
-distro=flidas
+distro=trisquel
t=/tmp/d
-# be root:
+myfai-chboot default
sudo sed -i 's/^LOGUSER=/#LOGUSER=/' /etc/fai/fai.conf
-# required after a failed run
-umount /var/lib/fai/config ||:
+# config umount required after a failed run, proc umount always required
+sudo umount /var/lib/fai/config ||: ; sudo umount -R $t/proc ||:
fai-redep faiserver $distro
-rm -rf $t ; mkdir $t; fai -N -u $host dirinstall $t
+sudo rm -rf $t ; mkdir $t; time sudo LANG= fai -N -u $host dirinstall $t
# cleanup:
sudo sed -i 's/^#LOGUSER=/LOGUSER=/' /etc/fai/fai.conf
-s umount -R $t/proc
+sudo umount -R $t/proc
# Turning a dirinstall into a basefile. taken from mk-basefile
-chroot $t apt-get clean
-rm -f $t/etc/hostname $t/etc/resolv.conf \
+sudo chroot $t apt-get clean
+sudo rm -f $t/etc/hostname $t/etc/resolv.conf \
$t/var/lib/apt/lists/*_* $t/usr/bin/qemu-*-static \
$t/etc/udev/rules.d/70-persistent-net.rules
-> $t/etc/machine-id
-tar --one-file-system -C $t -cf - . | gzip > /a/bin/fai-basefiles/basefiles/FLIDAS64X.tar.gz
+echo | sudo dd of=$t/etc/machine-id
+sudo tar --one-file-system -C $t -cf - . | gzip > /a/bin/fai-basefiles/basefiles/FLIDAS64X.tar.gz
License stuff:
The license for the project is GPLv2 or later, mostly because fai is and
esac
host=${1:-faiserver}
-
+distro=$2
# i use faiserver as a dns alias, but ssh key is associated with
# a canonical hostname and we will have ssh warning spam unless we
. /a/bin/distro-setup/pkgs
-pall+=($(/a/bin/buildscripts/emacs -p; /a/bin/distro-setup/distro-pkgs $2))
+pall+=($(/a/bin/buildscripts/emacs -p; /a/bin/distro-setup/distro-pkgs $distro))
{ echo PACKAGES install; echo "${pall[*]}"|sed 's/ /\n/g'; } | \
ssh root@$faiserver_host dd of=/srv/fai/config/package_config/DESKTOP 2>/dev/null ||: # broken pipe
#!/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
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
# 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
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
# add universe, pxe-kexec is there
sed -ri '/^\s*deb/{/universe/!s/$/ universe/}' /etc/apt/sources.list
fi
-if ! type -p pxe-kexec &>/dev/null; then
+if ! type -p pxe-kexec >/dev/null 2>&1; then
apt-get update
apt-get install -y debconf
debconf-set-selections <<EOF
x=$(readlink -f "$BASH_SOURCE"); cd ${x%/*}
usage() {
- cat <<EOF
-usage: ${0##*/} [-h|--help] [hostname|ip]
+ cat <<EOF
+usage: ${0##*/} [-h|--help] HOSTNAME|IP|default
Sets up tftp pxe config and nfs server on host "faiserver".
-h|--help Print help and exit.
EOF
- exit $1
+ exit $1
}
+if [[ ! $1 ]]; then
+ usage 1
+fi
case $1 in
- -h|--help) usage ;;
+ -h|--help) usage ;;
esac
mkdir -p /mnt/usb/tftpboot
v cedit /etc/dnsmasq.conf <<'EOF' || dnsmasq_restart=true
-############ updating dns servers ###################3
-
+# https://ret2got.wordpress.com/2018/01/19/how-your-ethereum-can-be-stolen-using-dns-rebinding/
+stop-dns-rebind
# this says the ip of default gateway and dns server,
# but I think they are unneded and default
dhcp-host=f4:6d:04:02:ed:66,set:treetowl,192.168.1.2,treetowl
dhcp-host=00:26:18:97:bb:16,set:frodo,192.168.1.3,frodo
dhcp-host=10:78:d2:da:29:22,set:htpc,192.168.1.4,htpc
-dhcp-host=00:1f:16:16:39:24,set:kw,192.168.1.5,x2
+dhcp-host=00:1f:16:16:39:24,set:x2,192.168.1.5,x2
+#wireless interface
+#dhcp-host=00:22:5f:88:28:27,set:x2,192.168.1.5,x2
#dhcp-host=00:1f:16:16:39:24,set:kw,192.168.1.10,kw
#dhcp-host=00:c0:ca:27:e9:b2,set:kww,192.168.1.11,kww
# this is so fai can have an explicit name to use for testing,