-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·36 lines (27 loc) · 1 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·36 lines (27 loc) · 1 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
#!/usr/bin/env bash
set -euo pipefail
if (( EUID != 0 )); then
printf 'Run this installer as root: sudo ./install.sh\n' >&2
exit 1
fi
source_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
if ! grep -q 'vendor_id[[:space:]]*: GenuineIntel' /proc/cpuinfo; then
printf 'This utility supports Intel CPUs only.\n' >&2
exit 1
fi
command -v cc > /dev/null || {
printf 'A C compiler is required (for example, the base-devel package).\n' >&2
exit 1
}
modprobe msr
make -C "$source_dir"
install -Dm0755 "$source_dir/build/bd-prochot-fix" /usr/local/sbin/bd-prochot-fix
install -Dm0644 "$source_dir/systemd/bd-prochot-fix.service" \
/etc/systemd/system/bd-prochot-fix.service
install -Dm0755 "$source_dir/systemd/bd-prochot-fix-sleep" \
/usr/lib/systemd/system-sleep/bd-prochot-fix
systemctl daemon-reload
systemctl enable --now bd-prochot-fix.service
printf '\nInstalled successfully. Current status:\n'
/usr/local/sbin/bd-prochot-fix status
systemctl --no-pager --full status bd-prochot-fix.service