# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-set -x
# Note, sometimes shutting down the existing demohost vm
# fails. Just run again if that happens.
fi
sleep 30
-while ! timeout -s 9 10 ssh root@$name /bin/true; do sleep 5; done
+while ! timeout -s 9 10 ssh root@$name /bin/true; do
+ e sleep 5
+done
cleanup() { :; }
-pxe-server :
+e pxe-server :
if is_arch_revm; then
./arch-init-remote $name
fi
# Define your local mirros here
# For the first stage, set the CentOS/SLC mirror in /etc/rinse/rinse.conf
-MIRROR_DEBIAN=http://httpredir.debian.org/debian/
-MIRROR_DEBIAN=http://localmirror/debian/
+MIRROR_DEBIAN=http://http.us.debian.org/debian
+#MIRROR_DEBIAN=http://localmirror/debian/
MIRROR_UBUNTU=http://mirror.netcologne.de/ubuntu/
MIRROR_CENTOS=http://mirror.netcologne.de/
#MIRROR_CENTOS=http://localmirror
tarit
}
+stretch() {
+
+ local arch=$1
+
+ check
+ debootstrap --arch $arch --exclude=${EXCLUDE_JESSIE} --include=${INCLUDE_DEBIAN} stretch $xtmp ${MIRROR_DEBIAN}
+ cleanup-deb
+ tarit
+}
+
trusty() {
local arch=$1
WHEEZY64) wheezy amd64 ;;
JESSIE32) jessie i386 ;;
JESSIE64) jessie amd64 ;;
+ STRETCH64) stretch amd64 ;;
*) unknown ;;
esac
# do not use this if a menu will be presented
[ "$flag_menu" ] && exit 0
+
+# For multi-boot system.
+# Check that we aren't in a pxe boot environment.
+# There is probably a better way to do this.
+# We check the reverse condition in 51-multi-boot,
+# and set what os we are installing, but don't check it
+# into git since it changes regularly. Each host needs
+# to have a class of either STABLE or STRETCH64.
+#
+# It's shell looks like this:
+# if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
+# case $HOSTNAME in
+# tp) STABLE ;;
+# # add more multi-boot hostnames here
+# esac
+# fi
+#
+if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
+ echo "STABLE"
+fi
+
# use a list of classes for our demo machine
-echo "FAIBASE DEBIAN"
+echo "FAIBASE DEBIAN PARTITION_PROMPT"
case $HOSTNAME in
- demohost)
- echo "DESKTOP" ;;
- tp)
- echo "DESKTOP PARTITION_PROMPT"
- # For multi-boot system.
- # Check that we aren't in a pxe boot environment.
- # There is probably a better way to do this.
- # We check the reverse condition in 51-multi-boot,
- # and set what os we are installing, but don't check it
- # into git since it changes regularly.
- # It's shell looks like this:
- # if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
- # case $HOSTNAME in
- # tp) : ;;
- # # add more multi-boot hostnames here
- # esac
- # fi
- #
- if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
- echo "STABLE"
- fi
- ;;
x2|frodo|treetowl)
echo "NON_FREE"
if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
- echo "STABLE STABLE_NON_FREE"
+ echo "STABLE_NON_FREE"
fi
;;
- lj)
- echo "LINODESTABLE PARTITION_PROMPT" ;;
- li)
- echo "LINODESTABLE PARTITION_PROMPT" ;;
- do)
- echo "STABLE PARTITION_PROMPT" ;;
- # faiserver)
- # echo "DEMO FAISERVER" ;;
- # xfcehost)
- # echo "DEMO XORG XFCE LVM";;
- # gnomehost)
- # echo "DEMO XORG GNOME";;
- # centos)
- # echo "FAIBASE CENTOS" # you may want to add class XORG here
- # ifclass I386 && echo CENTOS6_32 # AFAIK there's no 32bit C7
- # ifclass AMD64 && echo CENTOS7_64
- # exit 0 ;; # CentOS does not use the GRUB class
- # slchost)
- # # Scientific Linux Cern, is very similar to CentOS. SLC should alsways use the class CENTOS
- # echo "FAIBASE CENTOS SLC" # you may want to add class XORG here
- # ifclass I386 && echo SLC7_32
- # ifclass AMD64 && echo SLC7_64
- # exit 0 ;; # CentOS/SLC does not use the GRUB class
- *)
- echo "DESKTOP" ;;
+ lj|lj)
+ echo "LINODESTABLE" ;;
esac
if grep ^52:54:00: /sys/class/net/eth0/address &>/dev/null; then
# modified from upstream fai example
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
-if ! ifclass VM && ! ifclass STABLE; then
- # get persistent interface name. Note, these class conditions
- # will need to get modified for new oses. testing vm doesn't use
- # it right now, but other vms do I'm sure.
- for field in ID_NET_NAME_FROM_DATABASE \
- ID_NET_NAME_ONBOARD \
- ID_NET_NAME_SLOT \
- ID_NET_NAME_PATH \
- ID_NET_NAME_MAC; do
- name=$(udevadm info /sys/class/net/$NIC1 | sed -rn "s/^E: $field=(.+)/\1/p")
- if [[ $name ]]; then
- NIC1=$name
- break
+if ! ifclass STABLE; then
+ if ifclass VM; then
+ # For a vm, we only get ID_NET_NAME_MAC from below,
+ # but when it reboots, it uses ID_NET_NAME_SLOT.
+ NIC1=ens3
+ else
+ # get persistent interface name. Note, these class conditions
+ # will need to get modified for new oses. testing vm doesn't use
+ # it right now, but other vms do I'm sure.
+ for field in ID_NET_NAME_FROM_DATABASE \
+ ID_NET_NAME_ONBOARD \
+ ID_NET_NAME_SLOT \
+ ID_NET_NAME_PATH \
+ ID_NET_NAME_MAC; do
+ name=$(udevadm info /sys/class/net/$NIC1 | sed -rn "s/^E: $field=(.+)/\1/p")
+ if [[ $name ]]; then
+ NIC1=$name
+ break
+ fi
+ done
+ if [[ ! $name ]]; then
+ echo "$0: error: could not find systemd predictable network name"
+ exit 1
fi
- done
- if [[ ! $name ]]; then
- echo "$0: error: could not find systemd predictable network name"
- exit 1
fi
fi
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Usage: faiserver-setup
+#
# Initial setup of a fai server on debian. works on localhost.
# Set's the current ip as the tftp server. I vaguely remember
-# that using a hostname does not work
-# Requires changing dns to point faiserver and running fai-redep
+# that using a hostname does not work.
+# Separate from running this, faiserver needs to be setup in dns
+# to point to whatever host this is run on.
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
e() { echo "$@"; "$@"; }
-base=${1:-jessie}
+# tried with stretch at one point, but jessie works for everything,
+# so no point in changing it. Leaving some code to deal with
+# stretch hanging around as it will eventually become stable.
+base=jessie
sed="sed -ri --follow-symlinks"
deb http://fai-project.org/download jessie koeln
EOF
else
+ # if we use stretch, no need for fai-project repo.
rm -f /etc/apt/sources.list.d/fai.list
fi
dd of=/etc/fai/apt/sources.list <<EOF
deb $r $base main contrib non-free
deb http://security.debian.org/debian-security $base/updates main contrib non-free
-
EOF
if [[ $base == jessie ]]; then