[Bug 1869996] [NEW] Hibernation can NOT work due to incorrect RESUME=
Dexuan Cui
decui at microsoft.com
Wed Apr 1 03:09:36 UTC 2020
Public bug reported:
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 at 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 <ubuntu-devel-discuss at lists.ubuntu.com>
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 <debian-kernel at lists.debian.org>
** Affects: initramfs-tools (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1869996
Title:
Hibernation can NOT work due to incorrect RESUME=
Status in initramfs-tools package in Ubuntu:
New
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 at 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 <ubuntu-devel-discuss at lists.ubuntu.com>
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 <debian-kernel at lists.debian.org>
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1869996/+subscriptions
More information about the foundations-bugs
mailing list