Mon, Apr 17, 2023 at 09:14:30PM +0300, Marko Mäkelä wrote:
The "rtcwake -m show" straight after the reboot indicated that the alarm is off. I read all journal entries between the two rtcwake commands, which were helpfully logged. The only thing I found was a kernel boot message that said that the RTC device supports wakeup from the ACPI S4 state (hibernate, suspend-to-disk). The normal "soft power off" would be S5. So, I will have to shrink the file system and create a swap partition, to enable the suspend-to-disk. I expect that after this exercise, "rtcwake -m disk -s 300" should actually work, perhaps even without using any "powertop" spells.
After I shrunk the only partition and created a swap partition, I got "rtcwake -m disk -s 300" to wake up the computer, with no need for any tuning with "powertop". After I fixed the resume settings and rebuilt the initial RAM disk, the computer would correctly wake up from the hibernation, and the exit status of the rtcwake would be 0, as expected. Before I fixed that, the computer powered up, but ran a normal boot sequence, including a file system check.
I am going to create a page https://www.linuxtv.org/vdrwiki/index.php/Rtcwake for documenting this. For commodity x86 or x86-64 hardware, rtcwake seems to actually work, with some quirks.
Assuming that the environment has been set up correctly for rtcwake, I believe that my VDR shutdown script in https://www.linuxtv.org/vdrwiki/index.php/Systemd should work as is. I did not test it yet.
Marko