Surface Pro 18.04 无法暂停到内存

Surface Pro 18.04 无法暂停到内存

不知为何我无法暂停我的 Surface。我尝试了以下步骤monty47 的回答Ubuntu 18.04 - Dell XPS13 9370 不再因盖子关闭而挂起

cat /sys/power/mem_sleep
[s2idle]

任何使用 sudo 写入该文件的尝试都会引发错误。

我更新了 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"

但它仍然不会暂停记忆。journalctl显示:

Dez 14 13:03:31 msf kernel: PM: suspend entry (s2idle)
Dez 14 13:03:33 msf kernel: PM: suspend exit

答案1

我以前可以

激活暂停

通过运行以下命令将显示管理器更改为 lightdm:

sudo apt install lightdm

并选择 lightdm 或者如果 lightdm 已经安装

sudo dpkg-reconfigure gdm3

并选择 lightdm

激活休眠模式

启用简历

  1. 查找交换分区的 UUID

sudo blkid | grep swap

  1. 打开新文件

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

并添加

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

编辑 /etc/default/grub

sudo -H gedit /etc/default/grub

并将 UUID 添加到行中

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

例子

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

  1. 在主菜单中启用休眠条目:

跑步

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

复制粘贴以下内容:

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```

要禁用 Hibernate:将每个条目的最后一行的“是”更改为“否”。

最后

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

重启

相关内容