From c1a056abb797d7dc5c2c133842cf206ccfde026f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 16 Mar 2017 18:50:39 -0300 Subject: Provision: hibernation support at development script --- share/provision/development | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/share/provision/development b/share/provision/development index bca3847..011c548 100755 --- a/share/provision/development +++ b/share/provision/development @@ -43,3 +43,18 @@ fi apps/inception init apps/metadot/metadot load-bundle development apps/metadot/metadot deps-bundle development + +# Hibernation support +# https://wiki.archlinux.org/index.php/Swap#Swap_file +# https://wiki.archlinux.org/index.php/Uswsusp +if ! grep -q "/swapfile" /etc/fstab; then + echo "Configuring hibernation..." + sudo fallocate -l 2G /swapfile + sudo chmod 600 /swapfile + sudo mkswap /swapfile + sudo swapon /swapfile + echo "/swapfile none swap defaults 0 0" | sudo tee -a /etc/fstab > /dev/null + $APT_INSTALL uswsusp + echo "RESUME=/swapfile" | sudo tee /etc/initramfs-tools/conf.d/resume > /dev/null + sudo update-initramfs -v -u +fi -- cgit v1.2.3