Skip to content

Instantly share code, notes, and snippets.

@benmezger
Created July 7, 2022 19:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benmezger/fd5a424bb4a2a8649107989dd62dbea0 to your computer and use it in GitHub Desktop.
Save benmezger/fd5a424bb4a2a8649107989dd62dbea0 to your computer and use it in GitHub Desktop.
From 0084195e500acb1e483fb5a6e7fea40e75a3ef3a Mon Sep 17 00:00:00 2001
From: Ben Mezger <me@benmezger.nl>
Date: Sun, 27 Mar 2022 03:03:10 -0300
Subject: [PATCH] hibernate: finally get hibernate to work in xps
---
default/grub | 2 +-
mkinitcpio.conf | 2 +-
systemd/sleep.conf | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/default/grub b/default/grub
index 91a648a..465d7f6 100644
--- a/default/grub
+++ b/default/grub
@@ -4,7 +4,7 @@ GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 splash"
-GRUB_CMDLINE_LINUX="cryptdevice=/dev/nvme0n1p6:luks:allow-discards"
+GRUB_CMDLINE_LINUX="cryptdevice=/dev/nvme0n1p6:luks:allow-discards resume=/dev/mapper/vg0-swap"
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"
diff --git a/mkinitcpio.conf b/mkinitcpio.conf
index 0b182e1..b200338 100644
--- a/mkinitcpio.conf
+++ b/mkinitcpio.conf
@@ -49,7 +49,7 @@ FILES=()
#
## NOTE: If you have /usr on a separate partition, you MUST include the
# usr, fsck and shutdown hooks.
-HOOKS=(base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck)
+HOOKS=(base udev autodetect modconf block encrypt lvm2 resume filesystems keyboard fsck)
# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
diff --git a/systemd/sleep.conf b/systemd/sleep.conf
index 174f5ea..b22531b 100644
--- a/systemd/sleep.conf
+++ b/systemd/sleep.conf
@@ -13,6 +13,8 @@
# See systemd-sleep.conf(5) for details.
[Sleep]
+HibernateState=disk
+HibernateMode=shutdown
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment