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.
18 # Each host defines following:
22 # The base disto version, only use so far is the basefile name if it exists.
23 # Debian stable basefile gets built by faisetup and gets used otherwise.
24 # With X suffix, means it has gone through the dirinstall process and has eXtra
25 # things installed, to speed up installation.
26 # STRETCH64, BUSTER64, XENIAL64, FLIDAS64, FLIDAS64BIG, ETIONA64
28 # The distro subvol name, we can add as many of these as we want:
29 # VOL_TESTING, VOL_STRETCH, VOL_BUSTER, VOL_XENIAL, VOL_FLIDAS,
30 # VOL_ETIONA VOL_STRETCH_BOOTSTRAP. Using VOL_STRETCH_BOOTSTRAP sets up
31 # the install to act like a pxe rom if grub sets a specific var.
33 # The apt sources files we want, STRETCH_FREE, STRETCH_NONFREE,
34 # BUSTER_FREE, BUSTER_NONFREE, TESTING_FREE, TESTING_NONFREE,
35 # XENIAL_FREE, FLIDAS, ETIONA, STRETCH_LINODE, BUSTER_LINODE.
37 # It's all a little redundant in some cases, but it keeps things
41 # Other notable classes:
43 # INSTALL: for autodiscover iso, this is needed. We could also add it to
44 # the autodiscover grub, but then we have to burn a new iso if we want a
45 # non-install one. It sets the class for the corresponding INSTALL.var,
46 # which sets FAI_ACTION=INSTALL. I'm not sure if this variable overrides
47 # FAI_ACTION outside of autodiscover, todo: test it out, if it doesn't,
48 # make install be default in 51-multi-boot, and disable it if needed.
50 # DESKTOP: install a bunch of extra packages. For creating X suffix
51 # basefiles. See README.
53 # REPARTITION: we try to reuse partitions/filesystems to install a new
54 # os into a multi-os system, if we see some basic hueristics, like the
55 # right amount of them. This overrides that.
57 # PARTITION_PROMPT: If we don't see partitions to reuuse, prompt
58 # to make sure we really want to repartition and use a completely
59 # fresh install. I use this in case our repartition check has
60 # a bug in it, or I accidentally set REPARTITION.
62 # ROTATIONAL: in a system with ssd and hdd, install to the hdd
63 # instead of the default ssd.
65 # RAID0: Use raid 0 even if there are >= 4 disks with boot partititions.
69 ###### begin Template for 51-multi-boot ######
71 # It has reasonable combinations of above classes.
72 # It's a noop until we replace _ with host names.
75 if [[ ! -e /a
/bin
/fai
/fai-wrapper ||
$FAI_ACTION == dirinstall
]]; then
77 # stretch based minimal recovery / bootstraping os:
78 _
) echo DEBIAN STRETCH64 VOL_STRETCH_BOOTSTRAP STRETCH_FREE
;;
80 _
) echo UBUNTU FLIDAS64 VOL_FLIDAS FLIDAS
;;
82 _
) echo UBUNTU ETIONA64 VOL_ETIONA ETIONA
;;
84 _
) echo DEBIAN STRETCH64 VOL_STRETCH STRETCH_FREE
;;
86 _
) echo DEBIAN BUSTER64 VOL_BUSTER BUSTER_FREE
;;
88 _
) echo DEBIAN STRETCH64 VOL_TESTING TESTING_FREE
;;
90 _
) echo UBUNTU XENIAL64 VOL_XENIAL XENIAL_FREE
;;
93 ###### end Template for 51-multi-boot ######
95 if [[ -e /a
/bin
/fai
/fai-wrapper
]]; then
96 source /a
/bin
/distro-functions
/src
/identify-distros
100 if isdebian-stable
; then
103 li|lj
) echo "STRETCH_LINODE" ;;
105 # nonfree repo is not going away any time soon due to
106 # gcc-doc being in nonfree
107 echo "STRETCH_NONFREE"
113 echo FAIBASE STANDARD
115 #echo "PARTITION_PROMPT"
119 if grep ^
52:54:00: /sys
/class
/net
/eth
0/address
&>/dev
/null
; then
120 # if our eth0 mac is in the kvm range, we are a vm.