-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathmain.sh
More file actions
40 lines (35 loc) · 1.16 KB
/
main.sh
File metadata and controls
40 lines (35 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# snippets used in individual variants to avoid repetition
base() {
PKGS+=("base-system")
if [ "$SETUP_TYPE" = "iso" ]; then
PKGS+=("dialog" "cryptsetup" "lvm2" "mdadm" "void-docs-browse" "xtools-minimal" "grub-i386-efi" "grub-x86_64-efi" "xmirror")
SERVICES+=("sshd")
elif [ "$SETUP_TYPE" = "system" ]; then
if [ -n "$EFI_SYSTEM" ]; then
if [ "$EFI_FW_BITS" -eq 32 ]; then
PKGS+=("grub-i386-efi")
else
PKGS+=("grub-x86_64-efi")
fi
else
PKGS+=("grub")
fi
fi
}
xorg_base() {
base
PKGS+=("xorg-minimal" "xorg-input-drivers" "xorg-video-drivers" "setxkbmap" "xauth" "font-misc-misc" "terminus-font" "dejavu-fonts-ttf" "alsa-plugins-pulseaudio")
}
deduplicate() {
printf "%s\n" $@ | sort -u | tr '\n' ' '
}
# set PKGS, SERVICES and other variables based on which variant we want to set up for
setup_variant() {
variant="$1" # xfce, base, gnome, etc.
local PKGS=()
local SERVICES=()
. "setupscripts/variants/$variant.sh"
PKGSSTR=$(deduplicate "${PKGS[@]}")
SERVICESSTR=$(deduplicate "${SERVICES[@]}")
}