fd8aad4d7f8807b51a7e824bb9bc0e089be9b509
3 # assign classes to hosts based on their hostname
5 # do not use this if a menu will be presented
6 [ "$flag_menu" ] && exit 0
9 # For multi-boot system.
10 # We check that we aren't in a pxe boot environment.
11 # There is probably a better way to do this.
12 # We check the reverse condition in 51-multi-boot,
13 # and set what os we are installing, but don't check it
14 # into git since it changes regularly.
15 # It's code looks like this:
16 # if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
18 # tp) DEBIAN STRETCH VOL_STRETCH STRETCH_FREE;;
19 # # add more multi-boot hostnames here
23 # Each host defines the base distro: UBUNTU or DEBIAN.
24 # the disto version, also the basefile name if we aren't installing debian stable:
25 # STRETCH64, XENIAL64, BELENOS64, FLIDAS64
26 # the distro subvol name, we can add as many of these as we want:
27 # VOL_TESTING, VOL_STRETCH, VOL_XENIAL, VOL_BELENOS, VOL_FLIDAS
28 # Using VOL_STRETCH_BOOTSTRAP sets up the install to act like a pxe rom if
29 # grub sets a specific var.
30 # and the class which defines the apt sources files we want,
31 # STRETCH_FREE, STRETCH_NONFREE, TESTING_FREE, TESTING_NONFREE,
32 # XENIAL_FREE (no XENIAL_NONFREE setup yet), BELENOS, FLIDAS, STRETCH_LINODE.
33 # This is a little redundant in some cases, but it keeps things
37 # Other notable classes:
39 # REPARTITION: we try to reuse partitions/filesystems to install a new
40 # os into a multi-os system, if we see some basic hueristics, like the
41 # right amount of them. This overrides that.
43 # PARTITION_PROMPT: If we don't see partitions to reuuse, prompt
44 # to make sure we really want to repartition and use a completely
45 # fresh install. I use this in case our repartition check has
46 # a bug in it, or I accidentally set REPARTITION.
48 # ROTATIONAL: in a system with ssd and hdd, install to the hdd
49 # instead of the default ssd.
51 # RAID0: Use raid 0 even if there are >= 4 disks with boot partititions.
54 if [[ -e /a
/bin
/fai
/fai-wrapper
]]; then
55 source /a
/bin
/distro-functions
/src
/identify-distros
59 if isdebian-stable
; then
62 li|lj
) echo "STRETCH_LINODE" ;;
64 # nonfree repo is not going away any time soon due to
65 # gcc-doc being in nonfree
66 echo "STRETCH_NONFREE"
69 elif isdebian-testing
; then
70 echo "TESTING_NONFREE"
76 echo "PARTITION_PROMPT"
80 if grep ^
52:54:00: /sys
/class
/net
/eth
0/address
&>/dev
/null
; then
81 # if our eth0 mac is in the kvm range, we are a vm.