1

Somehow I can't manage so suspend my Surface. I tried this steps in monty47's answer to Ubuntu 18.04 - Dell XPS13 9370 no longer suspends on lid close:

cat /sys/power/mem_sleep
[s2idle]

Any attempt to write that file with sudo throws an error.

I updated GRUB:

cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem_sleep_default=deep"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

But still it won't suspend to mem. journalctl shows:

Dez 14 13:03:31 msf kernel: PM: suspend entry (s2idle)
Dez 14 13:03:33 msf kernel: PM: suspend exit
Eliah Kagan
  • 117,780
marcodl
  • 11

1 Answers1

0

I was able to

activate suspend

by changing the display manager to lightdm by running:

sudo apt install lightdm

and choosing lightdm or if lightdm is already installed

sudo dpkg-reconfigure gdm3

and choosing lightdm

To activate hibernation

Enable resume

  1. find UUID of swap partition

sudo blkid | grep swap

  1. open a new file

sudo -H gedit /etc/initramfs-tools/conf.d/resume

and add

RESUME=UUID=<<UUID of swap partition>>

edited /etc/default/grub

sudo -H gedit /etc/default/grub

and added the UUID to the line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=<UUID of swap partition>"

example

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=4b1c58e1-5bc5-4bce-a64e-e195cb38d01f"

  1. Enable hibernate entry in main menu:

Run

sudo -H gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

copy paste the following contents:

Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes

[Enable hibernate to be run via cron]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions
ResultAny=yes```

To disable Hibernate: change yes to no in the last lines of each entry.

Finally

sudo depmod -a
sudo update-initramfs -u```

and reboot

Vijay
  • 8,056