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, XENIAL64, BELENOS64, FLIDAS64, FLIDAS64BIG
28 # The distro subvol name, we can add as many of these as we want:
29 # VOL_TESTING, VOL_STRETCH, VOL_XENIAL, VOL_BELENOS, VOL_FLIDAS, VOL_STRETCH_BOOTSTRAP
30 # Using VOL_STRETCH_BOOTSTRAP sets up the install to act like a pxe rom if
31 # grub sets a specific var.
33 # The apt sources files we want,
34 # STRETCH_FREE, STRETCH_NONFREE, TESTING_FREE, TESTING_NONFREE,
35 # XENIAL_FREE, FLIDAS, BELENOS, STRETCH_LINODE.
37 # It's all a little redundant in some cases, but it keeps things
38 # simpler. Belenos is broken right now, planning to remove it once
39 # flidas is released and rms has upgraded.
42 # Other notable classes:
44 # INSTALL: for autodiscover iso, this is needed. We could also add it to
45 # the autodiscover grub, but then we have to burn a new iso if we want a
46 # non-install one. It sets the class for the corresponding INSTALL.var,
47 # which sets FAI_ACTION=INSTALL. I'm not sure if this variable overrides
48 # FAI_ACTION outside of autodiscover, todo: test it out, if it doesn't,
49 # make install be default in 51-multi-boot, and disable it if needed.
51 # DESKTOP: install a bunch of extra packages. For creating X suffix
52 # basefiles. See README.
54 # REPARTITION: we try to reuse partitions/filesystems to install a new
55 # os into a multi-os system, if we see some basic hueristics, like the
56 # right amount of them. This overrides that.
58 # PARTITION_PROMPT: If we don't see partitions to reuuse, prompt
59 # to make sure we really want to repartition and use a completely
60 # fresh install. I use this in case our repartition check has
61 # a bug in it, or I accidentally set REPARTITION.
63 # ROTATIONAL: in a system with ssd and hdd, install to the hdd
64 # instead of the default ssd.
66 # RAID0: Use raid 0 even if there are >= 4 disks with boot partititions.
69 # Code in 51-multi-boot, with reasonable combinations of above
70 # uncommented for easier editing, and runs as a noop until
71 # we replace _ with host names.
72 if [[ ! -e /a
/bin
/fai
/fai-wrapper
]]; then
74 # stretch based minimal recovery / bootstraping os:
75 _
) echo DEBIAN STRETCH64 VOL_STRETCH_BOOTSTRAP STRETCH_NONFREE
;;
77 _
) echo UBUNTU FLIDAS64 VOL_FLIDAS FLIDAS
;;
79 _
) echo DEBIAN STRETCH64 VOL_STRETCH STRETCH_NONFREE
;;
81 _
) echo DEBIAN STRETCH64 VOL_TESTING TESTING_NONFREE
;;
83 _
) echo UBUNTU BELENOS64 VOL_BELENOS BELENOS
;;
85 _
) echo UBUNTU XENIAL64 VOL_XENIAL XENIAL_FREE
;;
89 if [[ -e /a
/bin
/fai
/fai-wrapper
]]; then
90 source /a
/bin
/distro-functions
/src
/identify-distros
94 if isdebian-stable
; then
97 li|lj
) echo "STRETCH_LINODE" ;;
99 # nonfree repo is not going away any time soon due to
100 # gcc-doc being in nonfree
101 echo "STRETCH_NONFREE"
104 elif isdebian-testing
; then
105 echo "TESTING_NONFREE"
111 #echo "PARTITION_PROMPT"
115 if grep ^
52:54:00: /sys
/class
/net
/eth
0/address
&>/dev
/null
; then
116 # if our eth0 mac is in the kvm range, we are a vm.