]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Provision: hibernation support at development script
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 16 Mar 2017 21:50:39 +0000 (18:50 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 16 Mar 2017 21:50:39 +0000 (18:50 -0300)
share/provision/development

index bca384786106407b0b8e57f72a80b3fb3ab53d5f..011c54886272a7b3b62bcc830112e8073a2ba94e 100755 (executable)
@@ -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