Install zram-config for zswap
This commit is contained in:
BIN
installer/linux-packages/zram-config-main.zip
Normal file
BIN
installer/linux-packages/zram-config-main.zip
Normal file
Binary file not shown.
@@ -51,7 +51,7 @@ fi
|
|||||||
grep dwc_otg.fiq_fsm_mask /boot/cmdline.txt >/dev/null
|
grep dwc_otg.fiq_fsm_mask /boot/cmdline.txt >/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
mount -o remount,rw /boot &&
|
mount -o remount,rw /boot &&
|
||||||
sed -i 's/\(.*\)/\1 dwc_otg.fiq_fsm_mask=0x3/' /boot/cmdline.txt
|
sed -i -E 's/(.*)/\1 dwc_otg.fiq_fsm_mask=0x3/' /boot/cmdline.txt
|
||||||
mount -o remount,ro /boot
|
mount -o remount,ro /boot
|
||||||
REBOOT=true
|
REBOOT=true
|
||||||
fi
|
fi
|
||||||
@@ -60,22 +60,22 @@ fi
|
|||||||
grep cgroup_memory /boot/cmdline.txt >/dev/null
|
grep cgroup_memory /boot/cmdline.txt >/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
mount -o remount,rw /boot &&
|
mount -o remount,rw /boot &&
|
||||||
sed -i 's/\(.*\)/\1 cgroup_memory=1/' /boot/cmdline.txt
|
sed -i -E 's/(.*)/\1 cgroup_memory=1/' /boot/cmdline.txt
|
||||||
mount -o remount,ro /boot
|
mount -o remount,ro /boot
|
||||||
REBOOT=true
|
REBOOT=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove Hawkeye
|
# Remove Hawkeye
|
||||||
if [ -e /etc/init.d/hawkeye ]; then
|
if [ -e /etc/init.d/hawkeye ]; then
|
||||||
apt-get remove --purge -y hawkeye
|
apt-get purge -y hawkeye
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Decrease boot delay
|
# Decrease boot delay
|
||||||
sed -i 's/^TimeoutStartSec=.*$/TimeoutStartSec=1/' \
|
sed -i -E 's/^TimeoutStartSec=.*$/TimeoutStartSec=1/' \
|
||||||
/etc/systemd/system/network-online.target.wants/networking.service
|
/etc/systemd/system/network-online.target.wants/networking.service
|
||||||
|
|
||||||
# Change to US keyboard layout
|
# Change to US keyboard layout
|
||||||
sed -i 's/^XKBLAYOUT="gb"$/XKBLAYOUT="us" # Comment stops change on upgrade/' /etc/default/keyboard
|
sed -i -E 's/^XKBLAYOUT="gb"$/XKBLAYOUT="us" # Comment stops change on upgrade/' /etc/default/keyboard
|
||||||
|
|
||||||
# Set the default locale to en_US
|
# Set the default locale to en_US
|
||||||
grep '^en_US.UTF-8 UTF-8' /etc/locale.gen >/dev/null
|
grep '^en_US.UTF-8 UTF-8' /etc/locale.gen >/dev/null
|
||||||
@@ -89,16 +89,33 @@ fi
|
|||||||
diff ./installer/config/11-automount.rules /etc/udev/rules.d/11-automount.rules >/dev/null
|
diff ./installer/config/11-automount.rules /etc/udev/rules.d/11-automount.rules >/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
cp ./installer/config/11-automount.rules /etc/udev/rules.d/
|
cp ./installer/config/11-automount.rules /etc/udev/rules.d/
|
||||||
sed -i 's/^\(MountFlags=slave\)/#\1/' \
|
sed -i -E 's/^(MountFlags=slave)/#\1/' \
|
||||||
/lib/systemd/system/systemd-udevd.service
|
/lib/systemd/system/systemd-udevd.service
|
||||||
REBOOT=true
|
REBOOT=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase swap
|
# Disable disk-based swap
|
||||||
grep 'CONF_SWAPSIZE=1000' /etc/dphys-swapfile >/dev/null
|
if [ -e /etc/dphys-swapfile ]; then
|
||||||
if [ $? -ne 0 ]; then
|
apt-get purge -y dphys-swapfile
|
||||||
sed -i 's/^CONF_SWAPSIZE=.*$/CONF_SWAPSIZE=1000/' /etc/dphys-swapfile
|
rm -f /var/swap
|
||||||
REBOOT=true
|
fi
|
||||||
|
|
||||||
|
# Enable zram swap
|
||||||
|
# See https://github.com/ecdye/zram-config
|
||||||
|
# The zram-config-main.zip is a downloaded snapshot of the git repository
|
||||||
|
if [ ! -e /usr/local/sbin/zram-config ]; then
|
||||||
|
modprobe -a lz4 zram
|
||||||
|
|
||||||
|
unzip ./installer/linux-packages/zram-config-main.zip -d /tmp
|
||||||
|
/tmp/zram-config-main/install.bash
|
||||||
|
|
||||||
|
sed -i -E 's/^(swap\s+)(lzo-rle)(.*)$/\1lz4\3/' /etc/ztab
|
||||||
|
sed -i -E 's/^(swap.*)150\s*$/\1100/' /etc/ztab
|
||||||
|
sed -i -E 's/^(log.*)$/#\1/' /etc/ztab
|
||||||
|
|
||||||
|
systemctl restart zram-config
|
||||||
|
|
||||||
|
rm -rf /tmp/zram-config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install .Xresources & .xinitrc
|
# Install .Xresources & .xinitrc
|
||||||
@@ -119,7 +136,7 @@ fi
|
|||||||
rm -rf /usr/share/plymouth/themes/buildbotics
|
rm -rf /usr/share/plymouth/themes/buildbotics
|
||||||
rm -rf /usr/share/plymouth/themes/onefinity
|
rm -rf /usr/share/plymouth/themes/onefinity
|
||||||
mkdir -p /usr/share/plymouth/themes/onefinity/
|
mkdir -p /usr/share/plymouth/themes/onefinity/
|
||||||
cp -av installer/splash/* /usr/share/plymouth/themes/onefinity/
|
cp -av ./installer/splash/* /usr/share/plymouth/themes/onefinity/
|
||||||
plymouth-set-default-theme -R onefinity
|
plymouth-set-default-theme -R onefinity
|
||||||
|
|
||||||
grep 'quiet splash plymouth.ignore-serial-consoles logo.nologo' /boot/cmdline.txt >/dev/null
|
grep 'quiet splash plymouth.ignore-serial-consoles logo.nologo' /boot/cmdline.txt >/dev/null
|
||||||
@@ -142,7 +159,7 @@ cp ./installer/config/rc.local /etc/
|
|||||||
|
|
||||||
# Install bbctrl
|
# Install bbctrl
|
||||||
if $UPDATE_PY; then
|
if $UPDATE_PY; then
|
||||||
service bbctrl stop
|
systemctl stop bbctrl
|
||||||
|
|
||||||
rm -rf /usr/local/lib/python*/dist-packages/bbctrl-*
|
rm -rf /usr/local/lib/python*/dist-packages/bbctrl-*
|
||||||
|
|
||||||
@@ -154,7 +171,7 @@ if $UPDATE_PY; then
|
|||||||
HTTP_DIR=$(find /usr/local/lib/ -type d -name "http")
|
HTTP_DIR=$(find /usr/local/lib/ -type d -name "http")
|
||||||
chmod 777 $HTTP_DIR
|
chmod 777 $HTTP_DIR
|
||||||
|
|
||||||
service bbctrl restart
|
systemctl restart bbctrl
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install the service that turns off the screen during shutdown
|
# Install the service that turns off the screen during shutdown
|
||||||
|
|||||||
Reference in New Issue
Block a user