forked from ecdye/zram-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·30 lines (28 loc) · 1.32 KB
/
install.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
#!/bin/bash
systemctl -q is-active zram-config && { echo "ERROR: zram-config service is still running. Please run \"sudo service zram-config stop\" to stop it and uninstall"; exit 1; }
[ "$(id -u)" -eq 0 ] || { echo "You need to be ROOT (sudo can be used)"; exit 1; }
[ -d /usr/local/bin/zram-config ] && { echo "zram-config is already installed, uninstall first"; exit 1; }
apt-get -y install libattr1-dev
if grep -q "buster" /etc/os-release
then
git clone https://github.com/StuartIanNaylor/overlayfs-tools -b Arch
else
git clone https://github.com/StuartIanNaylor/overlayfs-tools
fi
cd overlayfs-tools
make
cd ..
# zram-config install
install -m 755 zram-config /usr/local/bin/
install -m 644 zram-config.service /etc/systemd/system/zram-config.service
install -m 644 ztab /etc/ztab
mkdir -p /usr/local/share/zram-config
mkdir -p /usr/local/share/zram-config/log
install -m 644 uninstall.sh /usr/local/share/zram-config/uninstall.sh
install -m 644 ro-root.sh /usr/local/share/zram-config/ro-root.sh
install -m 644 zram-config.logrotate /etc/logrotate.d/zram-config
mkdir -p /usr/local/lib/zram-config/
install -m 755 overlayfs-tools/overlay /usr/local/lib/zram-config/overlay
systemctl enable zram-config
echo "##### Reboot to activate zram-config #####"
echo "##### edit /etc/ztab to configure options #####"