Hibernation can NOT work due to incorrect RESUME=

Bug #1869996 reported by Dexuan Cui
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
Undecided
Steve Langasek

Bug Description

In Ubuntu 18.04 I have the below 4 lines, but in Ubuntu 20.04 (dev build) these lines are missing:

--- /usr/share/initramfs-tools/init 2020-04-01 01:15:20.533208700 +0000
+++ /usr/share/initramfs-tools/init 2020-04-01 00:59:43.931655200 +0000
@@ -163,6 +163,10 @@
                ;;
        resume=*)
                RESUME="${x#resume=}"
+ case $RESUME in
+ UUID=*)
+ RESUME="/dev/disk/by-uuid/${RESUME#UUID=}"
+ esac
                ;;
        resume_offset=*)
                resume_offset="${x#resume_offset=}"

As a result, hibernation can not work: the saved state in the swap partition is lost and no resume happens.

The issue is: when I use the "resume=UUID=533b2cd9-31ac-449b-82ff-014f09ab0a9c" kernel parameter for hibernation, due to the missing lines, the variable 'resume' in a later place in "/usr/share/initramfs-tools/init" is set to "UUID=533b2cd9-31ac-449b-82ff-014f09ab0a9c" rather than "/dev/disk/by-uuid/533b2cd9-31ac-449b-82ff-014f09ab0a9c". Next, in /usr/share/initramfs-tools/scripts/local-premount/resume:

DEV=$(readlink "$resume")
DEV=/sys/class/block/${DEV##*/}/dev
if [ -r "$DEV" ]; then
        read -r MAJMIN < "$DEV"
fi
if [ -z "$MAJMIN" ]; then
        exit 1
fi

Here the 'readlink' will fail, so $DEV is not pointing to a valid device, and then $MAJMIN is empty and
we "exit 1", so no resume can happen!

Not sure why the 4 lines are removed in Ubuntu 20.04...

PS, this is my version info:

root@localhost:~# dpkg-query -s initramfs-tools-core
Package: initramfs-tools-core
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 271
Maintainer: Ubuntu Developers <email address hidden>
Architecture: all
Multi-Arch: foreign
Source: initramfs-tools
Version: 0.136ubuntu1
Replaces: initramfs-tools (<< 0.121~)
Depends: busybox-initramfs (>= 1:1.30.1-4ubuntu5~), initramfs-tools-bin (= 0.136ubuntu1), klibc-utils (>= 2.0.4-8~), cpio (>= 2.12), lz4, kmod, udev, coreutils (>= 8.24), logsave | e2fsprogs (<< 1.45.3-1~)
Suggests: bash-completion
Breaks: busybox-initramfs (<< 1:1.30.1-4ubuntu5~), initramfs-tools (<< 0.121~)
Conffiles:
 /etc/initramfs-tools/initramfs.conf 4ec999d424d01b9ca685e65ba0f22a13
Description: generic modular initramfs generator (core tools)
 This package contains the mkinitramfs program that can be used to
 create a bootable initramfs for a Linux kernel. The initramfs should
 be loaded along with the kernel and is then responsible for mounting
 the root filesystem and starting the main init system.
Original-Maintainer: Debian kernel team <email address hidden>

no longer affects: initramfs-tools
Revision history for this message
Steve Langasek (vorlon) wrote :

Yes, this was an overlooked mismerge from Debian which dropped this special casing from the 'init' implementation, but is still needed in Ubuntu because our resume implementation diverges from Debian's.

This fix has been uploaded to the queue and should be accepted after the 20.04 beta freeze ends.

Changed in initramfs-tools (Ubuntu):
assignee: nobody → Steve Langasek (vorlon)
status: New → In Progress
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package initramfs-tools - 0.136ubuntu4

---------------
initramfs-tools (0.136ubuntu4) focal; urgency=medium

  * Skip setting mac-address, unless unsupported unpredictable netnames
    are used.

 -- Dimitri John Ledkov <email address hidden> Sat, 04 Apr 2020 23:39:59 +0100

Changed in initramfs-tools (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Francis Ginther (fginther) wrote :

Removing linux-azure as this appears to be unrelated.

no longer affects: linux-azure (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.