-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprovision.sh
executable file
·67 lines (50 loc) · 1.62 KB
/
provision.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/bash
set -euo pipefail
echo "removing cd-rom from apt sources"
sudo cp ~/install/sources.list /etc/apt/
echo "upgrading operating system"
sudo apt update
sudo apt upgrade
echo "installing required packages"
sudo apt-get -y install \
bridge-utils \
clevis-tpm2 \
clevis-luks \
clevis-dracut
# sudo apt-get -y --no-install-recommends install firejail/bullseye-backports
echo "installing optional packages - you will need to enter your user password to switch to zsh"
sudo apt-get -y install zsh git ripgrep && chsh -s $(which zsh) || true
echo "removing open-iscsi"
sudo apt-get -y remove open-iscsi
echo "deploying user config for $USER"
cd ~
tar xzvf ~/install/$USER.tgz
echo "grabbing powerlevel10k"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo "bringing down networking"
sudo systemctl stop networking
cd /
echo "deploying system configuration"
sudo tar xzvf ~/install/configuration.tgz
echo "enabling journal monitor"
sudo systemctl daemon-reload
sudo systemctl enable monitor-systemd-journal.service
echo "deploying sev firmware"
sudo tar xzvf ~/install/firmware.tgz
echo "deploying existing MOK"
sudo tar xzvf ~/install/mok.tgz
echo "bringing up networking"
sudo systemctl start networking
echo "installing sme kernel"
cd ~
cp ~/install/kernel.tgz .
~/install/scripts/install-sme-kernel.sh
echo "copying secrets"
cp ~/install/secrets.tgz .
echo "enabling clevis on demand"
sudo systemctl enable clevis-luks-askpass.path
echo "creating src dir"
mkdir -p ~/src
echo "cleaning up"
sudo apt-get -y autoremove
echo "to complete provisioning phase 1, reboot and enable secureboot now."