Package: dracut-core
Version: 060+5-1
Severity: important
File: /usr/lib/dracut/modules.d/95resume/module-setup.sh
Tags: patch

Dear Maintainer,

I have the resume module included:
  $ lsinitrd | grep hiber
  -rwxr-xr-x   1 root     root        27120 Dec  4 17:56 
usr/lib/systemd/systemd-hibernate-resume
  -rwxr-xr-x   1 root     root        27152 Dec  4 17:56 
usr/lib/systemd/system-generators/systemd-hibernate-resume-generator
  $ lsinitrd | grep resume
  Arguments:  -f -a 'resume'
  resume
  -rw-r--r--   1 root     root           30 Dec 26 23:30 
etc/cmdline.d/95resume.conf
  -rwxr-xr-x   1 root     root        27120 Dec  4 17:56 
usr/lib/systemd/systemd-hibernate-resume
  -rwxr-xr-x   1 root     root        27152 Dec  4 17:56 
usr/lib/systemd/system-generators/systemd-hibernate-resume-generator

And it's detected:
  $ journalctl -b | grep resum
  2023-12-27T00:14:10+01:00 rozbian kernel: Command line: 
initrd=\klapki\a2b398a10f5f4af99258999e14093599\6.5.0-5-amd64\initrd.img-6.5.0-5-amd64
 root=zfs:AUTO resume=PARTLABEL=rozbian-swap quiet iommu=on
  2023-12-27T00:14:10+01:00 rozbian kernel: Kernel command line: 
initrd=\klapki\a2b398a10f5f4af99258999e14093599\6.5.0-5-amd64\initrd.img-6.5.0-5-amd64
 root=zfs:AUTO resume=PARTLABEL=rozbian-swap quiet iommu=on
  2023-12-27T00:14:10+01:00 rozbian systemd-hibernate-resume-generator[230]: 
Reported hibernation image: ID=debian kernel=6.5.0-5-amd64 
UUID=5f15dfd6-d0d1-4056-841f-c19b84841f4c offset=0
  2023-12-27T00:14:10+01:00 rozbian dracut-cmdline[295]: Using kernel command 
line parameters:  resume=LABEL=tymekodebian-sw   
initrd=\klapki\a2b398a10f5f4af99258999e14093599\6.5.0-5-amd64\initrd.img-6.5.0-5-amd64
 root=zfs:AUTO resume=PARTLABEL=rozbian-swap quiet iommu=on
  2023-12-26T23:22:48+01:00 rozbian kernel: [drm] PSP is resuming...
  2023-12-26T23:22:48+01:00 rozbian kernel: amdgpu 0000:09:00.0: amdgpu: SMU is 
resuming...
  2023-12-26T23:22:48+01:00 rozbian kernel: amdgpu 0000:09:00.0: amdgpu: SMU is 
resumed successfully!

But resumption simply doesn't work
(/sus/power/resume is 0:0, and it's not attempted at all).

Having investigated this manually by breaking in the initrd,
I've come to the astounding conclusion that the service isn't there.

Well you can see this above, and indeed ls -lR / | grep resum shows the
symlink generated by s-h-r-g and the metadata directory, but no actual
service. So it doesn't work. It definitedly used to so this is a
regression.

Indeed, module-setup.sh shows:
   43     # if systemd is included and has the hibernate-resume tool, use it 
and nothing else
   44     if dracut_module_included "systemd" && [[ -x 
$dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then
   45         inst_multiple -o \
   46             
"$systemdutildir"/system-generators/systemd-hibernate-resume-generator \
   47             "$systemdsystemunitdir"/systemd-hibernate-resume@.service \
   48             "$systemdutildir"/systemd-hibernate-resume
   49         return 0
   50     fi
and conversely:
  $ dpkg -S systemd-hibernate-resume
  systemd: /usr/lib/systemd/systemd-hibernate-resume
  systemd: /usr/share/man/man8/systemd-hibernate-resume-generator.8.gz
  systemd: /usr/lib/systemd/system/systemd-hibernate-resume.service
  systemd: /usr/share/man/man8/systemd-hibernate-resume.service.8.gz
  systemd: /usr/share/man/man8/systemd-hibernate-resume.8.gz
  systemd: /usr/lib/systemd/system-generators/systemd-hibernate-resume-generator
so the setup is just broken.

Maybe it used to work. Hell, it definitely worked because on bookworm I see:
  $ curl -s https://packages.debian.org/bookworm/amd64/systemd/filelist | grep 
hibern
  /lib/systemd/system-generators/systemd-hibernate-resume-generator
  /lib/systemd/system/hibernate.target
  /lib/systemd/system/suspend-then-hibernate.target
  /lib/systemd/system/systemd-hibernate-resume@.service
  /lib/systemd/system/systemd-hibernate.service
  /lib/systemd/system/systemd-suspend-then-hibernate.service
  /lib/systemd/systemd-hibernate-resume
  /usr/share/man/man8/systemd-hibernate-resume-generator.8.gz
  /usr/share/man/man8/systemd-hibernate-resume.8.gz
  /usr/share/man/man8/systemd-hibernate-res...@.service.8.gz
  /usr/share/man/man8/systemd-hibernate.service.8.gz
  /usr/share/man/man8/systemd-suspend-then-hibernate.service.8.gz

So you just need to update this for sid systemd.
Applying the following diff:
-- >8 --
--- module-setup.sh.orig        2023-12-26 23:36:05.265998274 +0100
+++ module-setup.sh     2023-12-26 23:41:01.555605530 +0100
@@ -45,6 +45,7 @@
         inst_multiple -o \
             
"$systemdutildir"/system-generators/systemd-hibernate-resume-generator \
             "$systemdsystemunitdir"/systemd-hibernate-resume@.service \
+            "$systemdsystemunitdir"/systemd-hibernate-resume.service \
             "$systemdutildir"/systemd-hibernate-resume
         return 0
     fi
-- >8 --
I see
  $ lsinitrd | grep resume
  Arguments:  -f -a 'resume'
  resume
  -rw-r--r--   1 root     root           30 Dec 26 23:41 
etc/cmdline.d/95resume.conf
  -rwxr-xr-x   1 root     root        27120 Dec  4 17:56 
usr/lib/systemd/systemd-hibernate-resume
  -rwxr-xr-x   1 root     root        27152 Dec  4 17:56 
usr/lib/systemd/system-generators/systemd-hibernate-resume-generator
  -rw-r--r--   1 root     root          666 Dec  4 17:56 
usr/lib/systemd/system/systemd-hibernate-resume.service

Rebooting to test this. If it doesn't work I'll send a followup.

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-5-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dracut-core depends on:
ii  cpio                         2.13+dfsg-7.1
ii  dracut-core-kpartx [kpartx]  1.0
ii  e2fsprogs                    1.47.0-2+b1
ii  kmod                         30+20230601-2
ii  libc6                        2.37-13
ii  libkmod2                     30+20230601-2
ii  udev                         255~rc4-2

Versions of packages dracut-core recommends:
ii  binutils              2.41.50.20231202-1
ii  console-setup         1.223
pn  cryptsetup            <none>
pn  dmraid                <none>
ii  dmsetup               2:1.02.185-2
ii  lvm2                  2.03.16-2
pn  mdadm                 <none>
ii  pigz                  2.8-1
ii  pkg-config            1.8.1-1
ii  pkgconf [pkg-config]  1.8.1-1
ii  systemd               255~rc4-2

dracut-core suggests no packages.

-- no debconf information

Reply via email to