Debian Bug report logs - #933944
uswsusp: doesn't try to resume if conf.d/resume isn't set, or kernel parameter resume is not given

version graph

Package: uswsusp; Maintainer for uswsusp is Rodolfo García Peñas (kix) <kix@debian.org>; Source for uswsusp is src:uswsusp (PTS, buildd, popcon).

Reported by: Alejandro González <alejandro.gonzalez.correo@gmail.com>

Date: Mon, 5 Aug 2019 11:27:09 UTC

Severity: important

Tags: patch

Found in version uswsusp/1.0+20120915-6.2

Fixed in version 1.0+20120915-6.2+rm

Done: Debian FTP Masters <ftpmaster@ftp-master.debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, alejandro.gonzalez.correo@gmail.com, Rodolfo García Peñas (kix) <kix@debian.org>:
Bug#933944; Package uswsusp. (Mon, 05 Aug 2019 11:27:11 GMT) (full text, mbox, link).


Acknowledgement sent to Alejandro González <alejandro.gonzalez.correo@gmail.com>:
New Bug report received and forwarded. Copy sent to alejandro.gonzalez.correo@gmail.com, Rodolfo García Peñas (kix) <kix@debian.org>. (Mon, 05 Aug 2019 11:27:11 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Alejandro González <alejandro.gonzalez.correo@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: uswsusp: doesn't try to resume if conf.d/resume isn't set, or kernel parameter resume is not given
Date: Mon, 05 Aug 2019 13:22:14 +0200
Package: uswsusp
Version: 1.0+20120915-6.2
Severity: important
Tags: patch

Dear Maintainer,

Before installing the uswsusp package, I configured and activated a 1
GiB swap file inside my root partition, which was encrypted using the
Debian installer, adding it to /etc/fstab. Then I followed the configuration wizard, which set up
the correct defaults needed to use my swap file to hibernate, which can
be seen below.

Then I tried to use s2disk as root. The hibernation process worked fine, but
when turning on my computer again, the initramfs didn't seem to bother
resuming from the supposedly created image.

So I started to debug the cause of the problem. I figured out that, if I
manually added the "resume" and "resume_offset" kernel parameters (editing, in my case, the /etc/default/grub
file), everything worked fine, and the computer resumed well. However,
from a mantainance perspective, it's uncomfortable to have two settings in two different places
set to the same value (kernel parameters and /etc/uswsusp.conf), because it's error-prone. Therefore,
I continued inspecting the problem in order to come up with a better
solution.

I figured out, too, that initramfs-tools-core also includes a resume
script in the initramfs. That script is tightly integrated with the
$resume shell variable, which is initialized from the
/usr/share/initramfs-tools/conf.d/resume configuration file, or the
"resume" kernel parameter. That script basically bails out if the
$resume variable is empty, which in my case it was, because the conf.d
file set the RESUME variable to "none" (its default value). Moreover, as
I didn't use a kernel parameter in the first place, it remained empty.

So I tried to set the "resume" configuration file to the same value that
uswsusp correctly calculated, /dev/dm-1 (my encrypted root partition,
which gets properly decrypted by a previous cryptsetup script in the
initramfs). The result was that I was still unable to boot, because I
still had to provide the "resume_offset" kernel parameter... And, to be
honest, messing with this configuration file is still as messy as the
first solution, because configuration values are replicated all over the
place.

Finally, I inspected the uswsusp local-premount script, and observed
the apparently innocent line 24 on it:

[ -n "${resume}" ] || exit 0;

Which basically means that, if $resume is not set, then we bail out of
the script without error. But that's incorrect: uswsusp doesn't have
anything to do with the default resume initramfs script, including that
variable, and the uswsusp hints that things should work fine out
of the box:

"You will need to set up an initramfs which calls the resume program for
this to work. If you use a package distributed with your Linux
distribution, the kernel package which was made with the --initrd
option and you use mkinitramfs-tools, this package should include the
necessary parts on your initramfs."

Therefore, I commented out that line, ran update-initramfs -u, and tried
s2disk again.

Now my machine resumes from hibernation properly, using the
/etc/uswsusp.conf file that gets copied to the initramfs, and all the
resume-related configurations are centralized in a single place :)

-- System Information:
Debian Release: 10.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-5-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_USER
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8), LANGUAGE=es_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages uswsusp depends on:
ii  debconf [debconf-2.0]  1.5.71
ii  libblkid1              2.33.1-0.1
ii  libc6                  2.28-10
ii  liblzo2-2              2.10-0.1
ii  libpci3                1:3.5.2-1
ii  libx86-1               1.1+ds1-10.2

Versions of packages uswsusp recommends:
ii  initramfs-tools  0.133
ii  mount            2.33.1-0.1

uswsusp suggests no packages.

-- debconf information:
  uswsusp/no_snapshot:
* uswsusp/image_size: 1073741824
* uswsusp/encrypt: false
  uswsusp/RSA_key_file: /etc/uswsusp.key
* uswsusp/compress: true
* uswsusp/early_writeout: true
  uswsusp/resume_offset: 1276408
* uswsusp/shutdown_method: platform
* uswsusp/continue_without_swap: false
  uswsusp/RSA_key_bits: 1024
  uswsusp/no_swap:
* uswsusp/snapshot_device:
* uswsusp/resume_device: /dev/dm-1
* uswsusp/max_loglevel: 6
* uswsusp/suspend_loglevel: 6
  uswsusp/create_RSA_key: false
* uswsusp/compute_checksum: true



Reply sent to Debian FTP Masters <ftpmaster@ftp-master.debian.org>:
You have taken responsibility. (Wed, 18 Mar 2020 02:52:20 GMT) (full text, mbox, link).


Notification sent to Alejandro González <alejandro.gonzalez.correo@gmail.com>:
Bug acknowledged by developer. (Wed, 18 Mar 2020 02:52:20 GMT) (full text, mbox, link).


Message #10 received at 933944-done@bugs.debian.org (full text, mbox, reply):

From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>
To: 513698-done@bugs.debian.org,513871-done@bugs.debian.org,540644-done@bugs.debian.org,544641-done@bugs.debian.org,576909-done@bugs.debian.org,618471-done@bugs.debian.org,637332-done@bugs.debian.org,640323-done@bugs.debian.org,651691-done@bugs.debian.org,684692-done@bugs.debian.org,705688-done@bugs.debian.org,722499-done@bugs.debian.org,758004-done@bugs.debian.org,758995-done@bugs.debian.org,760391-done@bugs.debian.org,760851-done@bugs.debian.org,792142-done@bugs.debian.org,793886-done@bugs.debian.org,803613-done@bugs.debian.org,816750-done@bugs.debian.org,831328-done@bugs.debian.org,837707-done@bugs.debian.org,862743-done@bugs.debian.org,865192-done@bugs.debian.org,866852-done@bugs.debian.org,899156-done@bugs.debian.org,925047-done@bugs.debian.org,932839-done@bugs.debian.org,933944-done@bugs.debian.org,946271-done@bugs.debian.org,
Cc: uswsusp@packages.debian.org
Subject: Bug#954061: Removed package(s) from unstable
Date: Wed, 18 Mar 2020 02:50:06 +0000
Version: 1.0+20120915-6.2+rm

Dear submitter,

as the package uswsusp has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/954061

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 15 Apr 2020 07:30:36 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Tue Jan 30 05:33:13 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.