ACPId suspend-to-ram:您可以指定使用键盘事件唤醒吗?

5 gentoo acpi acpid

这是带有 OpenRC(后来更新为 systemd)的 Gentoo Linux,以及ACPI + Intel 内核中的一些电源管理功能。ACPId 已启动并正在运行。我可以暂停使用

\n\n
echo -n "mem" > /sys/power/state\n
Run Code Online (Sandbox Code Playgroud)\n\n

这可行,但我需要使用电源按钮唤醒。有没有办法从键盘事件(例如按空格键)中唤醒?键盘是无线USB键盘。我已经查看了脚本的内容/etc/acpi,但它没有提供执行此操作的见解。我找到的大部分信息通常是针对笔记本电脑用户的。我真的需要旧的东西吗pm-utils来完成这个任务吗?仅使用 acpid 有什么问题吗?

\n\n
cat /proc/acpi/wakeup\nDevice  S-state   Status   Sysfs node\nP0P2      S4    *disabled\nP0P3      S4    *disabled  pci:0000:00:06.0\nP0P1      S4    *disabled  pci:0000:00:1e.0\nPS2K      S4    *enabled   pnp:00:0b\nEUSB      S4    *enabled   pci:0000:00:1d.7\nUSBE      S4    *enabled   pci:0000:00:1a.7\nP0P4      S4    *disabled  pci:0000:00:1c.0\nP0P5      S4    *disabled\nP0P6      S4    *disabled  pci:0000:00:1c.2\nP0P7      S4    *disabled\nP0P8      S4    *disabled\nP0P9      S4    *disabled\nGBEC      S4    *disabled\nUSB0      S4    *enabled   pci:0000:00:1d.0\nUSB1      S4    *enabled   pci:0000:00:1d.1\nUSB2      S4    *enabled   pci:0000:00:1d.2\nUSB3      S4    *disabled\nUSB4      S4    *enabled   pci:0000:00:1a.0\nUSB5      S4    *enabled   pci:0000:00:1a.1\nUSB6      S4    *enabled   pci:0000:00:1a.2\nMBT4      S4    *disabled\n
Run Code Online (Sandbox Code Playgroud)\n\n

使用的看似相关的内核选项(3.10.25-gentoo SMP,64位,IA32emul=off,no-multilib):

\n\n
    \n
  • CONFIG_HOTPLUG_CPU=y 并默认使用 cpu0_hotplug
  • \n
  • 挂起至内存并待机休眠
  • \n
  • 电源管理调试支持
  • \n
  • 暂停/恢复事件跟踪
  • \n
  • ACPI 支持
  • \n
  • CPU 空闲 PM 支持
  • \n
  • 适用于 Intel 处理器的 CPU 驱动程序
  • \n
  • 通过内核中的 Gentoo 选项启用了对 systemd 的支持
  • \n
\n\n

BIOS 设置非常标准:

\n\n
    \n
  • 我已启用 ACPI2.0 额外表
  • \n
  • 没有看到任何 USB 唤醒事件,但我已尝试从 PCI/PCIe/PS2 等唤醒事件,但实际上这是一个无线 USB 键盘
  • \n
  • 董事会是老派冠军 Maximus Formula,采用 Q6600 Core2quad
  • \n
\n\n

OpenRC 已更新,systemd并且内核已重新编译以支持该功能。配置也像这样更新了。对于 systemd,并非在所有情况下都需要 apcid。例如,无需运行,您就可以发出问题systemctl suspend,并且行为...与之前相同,即仅从电源按钮唤醒...

\n\n

pstree输出:

\n\n
systemd \n  \xe2\x94\x9c\xe2\x94\x80acpid -f\n  \xe2\x94\x9c\xe2\x94\x80at-spi-bus-laun\n  \xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork--print-addres\n  \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x802*[{at-spi-bus-laun}]\n  \xe2\x94\x9c\xe2\x94\x80at-spi2-registr --use-gnome-session\n  \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80{at-spi2-registr}\n  \xe2\x94\x9c\xe2\x94\x80dbus-daemon --system --address=systemd: --nofork --nopidfile--systemd-activation\n  \xe2\x94\x9c\xe2\x94\x80dbus-daemon --fork --print-pid 5 --print-address 7 --session\n  \xe2\x94\x9c\xe2\x94\x80dbus-launch --sh-syntax --exit-with-session\n  \xe2\x94\x9c\xe2\x94\x80dhcpcd -q --nobackground\n  \xe2\x94\x9c\xe2\x94\x80login --    \n  \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80bash\n  \xe2\x94\x82       \xe2\x94\x94\xe2\x94\x80startx /usr/bin/startx\n  \xe2\x94\x82           \xe2\x94\x94\xe2\x94\x80xinit /etc/X11/xinit/xinitrc -- /etc/X11/xinit/xserverrc :0 -auth...\n  \xe2\x94\x82               \xe2\x94\x9c\xe2\x94\x80X -nolisten tcp :0 -auth /home/user/.serverauth.3329\n  \xe2\x94\x82               \xe2\x94\x94\xe2\x94\x80openbox --startup /usr/libexec/openbox-autostart OPENBOX\n  \xe2\x94\x82                   \xe2\x94\x9c\xe2\x94\x80firefox\n  \xe2\x94\x82                   \xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80plugin-containe ...\n  \xe2\x94\x82                   \xe2\x94\x82   \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x806*[{plugin-containe}]\n  \xe2\x94\x82                   \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x8035*[{firefox}]\n  \xe2\x94\x82                   \xe2\x94\x94\xe2\x94\x80vlc\n  \xe2\x94\x82                       \xe2\x94\x94\xe2\x94\x804*[{vlc}]\n  \xe2\x94\x9c\xe2\x94\x80lxterminal\n  \xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80bash\n  \xe2\x94\x82   \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80htop\n  \xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80bash\n  \xe2\x94\x82   \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80su\n  \xe2\x94\x82   \xe2\x94\x82       \xe2\x94\x94\xe2\x94\x80bash\n  \xe2\x94\x82   \xe2\x94\x82           \xe2\x94\x94\xe2\x94\x80grc /usr/lib/python-exec/python2.7/grc tail -f ...\n  \xe2\x94\x82   \xe2\x94\x82               \xe2\x94\x9c\xe2\x94\x80grcat /usr/lib/python-exec/python2.7/grcat conf.log\n  \xe2\x94\x82   \xe2\x94\x82               \xe2\x94\x94\xe2\x94\x80tail -f /var/log/emerge.log\n  \xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80bash\n  \xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80gnome-pty-helpe\n  \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80{lxterminal}\n  \xe2\x94\x9c\xe2\x94\x80mount.ntfs /dev/sdb1 /mnt/div -o rw\n  \xe2\x94\x9c\xe2\x94\x80roxterm\n  \xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80bash\n  \xe2\x94\x82   \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80su\n  \xe2\x94\x82   \xe2\x94\x82       \xe2\x94\x94\xe2\x94\x80bash\n  \xe2\x94\x82   \xe2\x94\x82           \xe2\x94\x94\xe2\x94\x80pstree -a\n  \xe2\x94\x82   \xe2\x94\x9c\xe2\x94\x80gnome-pty-helpe\n  \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80{roxterm}\n  \xe2\x94\x9c\xe2\x94\x80systemd --user\n  \xe2\x94\x82   \xe2\x94\x94\xe2\x94\x80(sd-pam)                 \n  \xe2\x94\x9c\xe2\x94\x80systemd-journal\n  \xe2\x94\x9c\xe2\x94\x80systemd-logind\n  \xe2\x94\x9c\xe2\x94\x80systemd-udevd\n  \xe2\x94\x9c\xe2\x94\x80wbar --pos bot-right --taskbar --isize 24\n  \xe2\x94\x94\xe2\x94\x80xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55\n
Run Code Online (Sandbox Code Playgroud)\n

小智 0

这通常也是 BIOS 设置。您可以通过以下方式检查:

grep ^PWRB /proc/acpi/wakeup  
Run Code Online (Sandbox Code Playgroud)

并启用它

echo "PWRB" > /proc/acpi/wakeup  
Run Code Online (Sandbox Code Playgroud)