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
8 # set these early so they are lowest priority.
9 echo FAIBASE STANDARD DEBIAN
12 # For multi-boot system.
13 # We check that we aren't in a pxe boot environment.
14 # There is probably a better way to do this.
15 # We check the reverse condition in 51-multi-boot,
16 # and set what os we are installing, but don't check it
17 # into git since it changes regularly.
21 # Each host defines following:
23 # UBUNTU or nothing. DEBIAN is always defined as a base.
25 # The base disto version, only use so far is the basefile name if it exists.
26 # Debian stable basefile gets built by faisetup and gets used otherwise.
27 # With X suffix, means it has gone through the dirinstall process and has eXtra
28 # things installed, to speed up installation.
30 # STRETCH64, BUSTER64, BULLSEYE64, BOOKWORM64
31 # FLIDAS64, FLIDAS64BIG, ETIONA64, NABIA64, ARAMO64
32 # XENIAL64, BIONIC64, FOCAL64,
34 # The distro subvol name, we can add as many of these as we want:
35 # VOL_TESTING, VOL_STRETCH, VOL_BUSTER, VOL_BULLSEYE, VOL_BOOKWORM
36 # VOL_FLIDAS, VOL_ETIONA, VOL_NABIA, VOL_ARAMO
37 # VOL_XENIAL, VOL_BIONIC VOL_FOCAL
38 # VOL_BUSTER_BOOTSTRAP.
39 # Using VOL_BUSTER_BOOTSTRAP sets up the install to act like a pxe rom if
40 # grub sets a specific var.
42 # The apt sources files we want,
43 # STRETCH_FREE, STRETCH_NONFREE, STRETCH_LINODE
44 # BUSTER_FREE, BUSTER_NONFREE,
45 # BULLSEYE_FREE, BULLSEYE_NONFREE
46 # BOOKWORM_FREE, BOOKWORM_NONFREE
47 # TESTING_FREE, TESTING_NONFREE,
48 # XENIAL_FREE, BIONIC, FOCAL, FLIDAS, ETIONA, NABIA, ARAMO.
50 # It's all a little redundant in some cases, but it keeps things
54 # Other notable classes:
56 # INSTALL: for autodiscover iso, this is needed. We could also add it to
57 # the autodiscover grub, but then we have to burn a new iso if we want a
58 # non-install one. It sets the class for the corresponding INSTALL.var,
59 # which sets FAI_ACTION=INSTALL. I'm not sure if this variable overrides
60 # FAI_ACTION outside of autodiscover, todo: test it out, if it doesn't,
61 # make install be default in 51-multi-boot, and disable it if needed.
63 # DESKTOP: install a bunch of extra packages. For creating X suffix
64 # basefiles. See README.
66 # LINODE: For running a vm on linode, especially one created with fai-cd.
68 # IANK / FSF: general setup of my machine vs FSF machines
69 # NABIA_EXTRA: extra repos for NABIA from other distros
70 # ARAMO_EXTRA: extra repos for ARAMO from other distros
72 # UBUNTU_UP: for trisquel, we want to inherit ubuntu things, except for
73 # some ubuntu things which go in this class. UP = upstream.
75 # D16: for kgpe-d16 specific settings.
77 # For filesystem/partitioning related classes, see comments at the top of
78 # fai/config/hooks/partition.DEFAULT
80 if [[ -e /a
/bin
/fai
/fai-wrapper
]]; then
81 source /a
/bin
/distro-functions
/src
/identify-distros
83 codename
=$
(debian-codename
)
89 # nonfree repo is not going away any time soon due to
90 # gcc-doc being in nonfree
91 echo ${codename^^}_NONFREE
94 # easier to stay with fai example config if we just call it ubuntu
100 li|lj
) echo "LINODE" ;;
101 bk|je
) echo "NOCRYPT" ;;
106 #echo "PARTITION_PROMPT"
110 if grep ^
52:54:00: /sys
/class
/net
/eth
0/address
&>/dev
/null
; then
111 # if our eth0 mac is in the kvm range, we are a vm.
116 ### Below here is a comment of code, exit above is so it does not get executed ###
118 ###### begin Template for 51-multi-boot ######
120 # It has reasonable combinations of above classes.
121 # We must first replace _ with host name(s).
128 if [[ ! -e /a
/bin
/fai
/fai-wrapper ||
$FAI_ACTION == dirinstall
]]; then
130 # bullseye based minimal recovery / bootstraping os:
131 _
) echo BULLSEYE64 VOL_BULLSEYE_BOOTSTRAP BULLSEYE_FREE
;;
133 _
) echo UBUNTU FLIDAS64 VOL_FLIDAS FLIDAS
;;
135 _
) echo UBUNTU ETIONA64 VOL_ETIONA ETIONA
;;
137 _
) echo UBUNTU NABIA64 VOL_NABIA NABIA NABIA_EXTRA
;;
139 _
) echo UBUNTU ARAMO64 VOL_ARAMO ARAMO ARAMO_EXTRA
;;
141 _
) echo STRETCH64 VOL_STRETCH STRETCH_NONFREE
;;
143 _
) echo BUSTER64 VOL_BUSTER BUSTER_NONFREE
;;
145 _
) echo BULLSEYE64 VOL_BULLSEYE BULLSEYE_NONFREE
;;
147 _
) echo BOOKWORM64 VOL_BOOKWORM BOOKWORM_NONFREE
;;
149 _
) echo BOOKWORM64 VOL_TESTING TESTING_NONFREE
;;
151 _
) echo UBUNTU XENIAL64 VOL_XENIAL XENIAL_FREE
;;
153 _
) echo UBUNTU BIONIC64 VOL_BIONIC BIONIC
;;
155 _
) echo UBUNTU FOCAL64 VOL_FOCAL FOCAL
;;
157 _
) echo UBUNTU JAMMY64 VOL_JAMMY JAMMY
;;
160 ###### end Template for 51-multi-boot ######