-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_phase1.sh
More file actions
executable file
·30 lines (25 loc) · 1.06 KB
/
Copy pathsetup_phase1.sh
File metadata and controls
executable file
·30 lines (25 loc) · 1.06 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
#!/bin/bash
# LearnedCache setup — Part 1 of 2: install the cache-ext kernel, then reboot.
#
# Run this from the repo root on a fresh machine. It compiles/installs the
# custom cache-ext kernel, selects it for the next boot, and reboots. There is
# NO cron/automation: after the machine comes back up on the cache-ext kernel,
# finish setup by running ./setup_phase2.sh manually.
set -eu -o pipefail
BASE_DIR=$(cd "$(dirname "$0")" && pwd)
cd "$BASE_DIR"
if uname -r | grep -q "cache-ext"; then
echo "Already running the cache-ext kernel ($(uname -r))."
echo "Phase 1 (kernel install) is unnecessary — run ./setup_phase2.sh instead."
exit 0
fi
echo "==> Phase 1: installing cache-ext kernel..."
./install_kernel.sh
echo "==> Selecting cache-ext kernel for next boot..."
sudo grub-reboot "Advanced options for Ubuntu>Ubuntu, with Linux 6.6.8-cache-ext+"
echo ""
echo "Kernel installed. The machine will now reboot into the cache-ext kernel."
echo "After it comes back up, finish setup by running:"
echo " cd $BASE_DIR && ./setup_phase2.sh"
echo ""
sudo reboot now