The officially official Devuan Forum!

You are not logged in.

#1 2024-12-06 10:39:25

Altoid
Member
Registered: 2017-05-07
Posts: 1,631  

Devuan Daedalus - hibernation settings

Hello:

This topic is a split from this this thread.
(See posts #19 / #20)

--- split ---

fsmithred wrote:

... want to hibernate to disk, replace "none" with the uuid of your swap partition.

--- /split---

That is exactly what my box has and the UUID is the swap file.
But it happens that I do not keep my system on all day, just shut down and reboot as needed.
ie: there is no hibernation image present, never set it up to hibernate.

At some point my dmesg printout reads:

--- snip ---
[   24.068315] PM: Image not found (code -22)
--- snip ---

Q:
Does the system look for a hibernation image at boot time because the line in /etc/initramfs-tools/conf.d/resume is not set to =none and there is a valid (swap file) UUID present?

If I edit /etc/initramfs-tools/conf.d/resume and set RESUME=none, on updating I get this:

# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-6.1.0-28-amd64
/usr/sbin/mkinitramfs: 5: /etc/initramfs-tools/conf.d/resume: none: not found
I: The initramfs will attempt to resume from /dev/sdb3
I: (UUID=f0187ff0-be52-4bbc-9461-40f744554b85)
I: Set the RESUME variable to override this.
live-boot: core filesystems dm-verity devices utils udev blockdev dns.
# 

The system looks for a swap file and not finding one with a UUID of none, finds one with a valid UUID and uses it.
But like I said, I never set the system up for hibernation and although the system finds a swap file to hibernate, it does not (as dmesg indicates) find an image. (I am assuming it is a hibernation image)

How to solve this?
Thanks in advance.

Best,

A.

Last edited by Altoid (2024-12-06 13:33:38)

Offline

#2 2024-12-06 10:58:07

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,311  

Re: Devuan Daedalus - hibernation settings

Please show your file /etc/initramfs-tools/conf.d/resume.

Is there another file in /etc/initramfs-tools/conf.d/ ? If so, which, and please show it too.

Online

#3 2024-12-06 11:39:25

Altoid
Member
Registered: 2017-05-07
Posts: 1,631  

Re: Devuan Daedalus - hibernation settings

Hello:

ralph.ronnquist wrote:

Please show ...

$ cat /etc/initramfs-tools/conf.d/resume
RESUME=UUID=f0187ff0-be52-4bbc-9461-40f744554b85
$ 
$ sudo blkid
--- snip ---
/dev/sdb3: UUID="f0187ff0-be52-4bbc-9461-40f744554b85" TYPE="swap" PARTUUID="0004a8f4-03"
--- snip ---
$ 
ralph.ronnquist wrote:

Is there another file ...

No, just that one.

$ ls /etc/initramfs-tools/conf.d/
resume
$ 

Thank you for your input.

Best,

A.

Offline

#4 2024-12-06 11:49:03

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,311  

Re: Devuan Daedalus - hibernation settings

Please show the file in that failing use case, when you set RESUME=none and run into the complaint when running update-initramfs.

Online

#5 2024-12-06 12:24:15

Altoid
Member
Registered: 2017-05-07
Posts: 1,631  

Re: Devuan Daedalus - hibernation settings

Hello:

ralph.ronnquist wrote:

Please show the file in that failing use case, when you set RESUME=none ...

I had deleted the edited file and returned to the back-up I saved.
So I re-edited it now.

$ cat /etc/initramfs-tools/conf.d/resume
# changed 06122024
# see https://dev1galaxy.org/viewtopic.php?pid=53266#p53266
# this box does not use hibernation / resume

RESUME=none

# RESUME=UUID=f0187ff0-be52-4bbc-9461-40f744554b85
$ 

But now it works.

# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-6.1.0-28-amd64
live-boot: core filesystems dm-verity devices utils udev blockdev dns.
#

I'm sure I had written / spelled it correctly.

But if it did not work, there was obviously something amiss.
Maybe the added comments?
Not so sure now.  8^/

Thank you very much for your input.

Best,

A.

Offline

#6 2024-12-06 13:03:53

Altoid
Member
Registered: 2017-05-07
Posts: 1,631  

Re: Devuan Daedalus - hibernation settings

Hello.

Altoid wrote:

Not so sure ...

Not willing to let it go at that, I went over the error message again ...

# update-initramfs -u
--- snip ---
/usr/sbin/mkinitramfs: 5: /etc/initramfs-tools/conf.d/resume: none: not found
--- snip ---
#

... because it had to be a spelling or syntax problem.
ie: my bad.

I tried with misspelling none -> nones and got this:

# update-initramfs -u
--- snip ---
W: initramfs-tools configuration sets RESUME=nones
W: but no matching swap device is available.
--- snip ---
#

The system does not find a matching swap device, but that is not the error I previously had.

So I tried using the syntax that the error message actually printed out, ie: resume: none <- a space in the wrong place
and then got the original error message:

# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-6.1.0-28-amd64
/usr/sbin/mkinitramfs: 5: /etc/initramfs-tools/conf.d/resume: none: not found
I: The initramfs will attempt to resume from /dev/sda3
I: (UUID=f0187ff0-be52-4bbc-9461-40f744554b85)
I: Set the RESUME variable to override this.
live-boot: core filesystems dm-verity devices utils udev blockdev dns.
# 

So ...
Mystery solved.
ie: a severe case of PEBCAK.  8^°

Once again, thanks for your input.

Best,

A.

Offline

#7 2024-12-06 21:02:00

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,311  

Re: Devuan Daedalus - hibernation settings

I'd guess you a had a disruptive space on the linemaking it be "RESUME= none" .

Since the file gets processed as a shell script (i.e. sourcing it into the exection of /usr/sbin/mkinitramfs) you got to experience the shell script difference between the two lines lines:

RESUME=none
RESUME= none

The first line sets RESUME to "none" within mkinitramfs while the second line sets RESUME to  the empty string for a sub shell attempting to execute a program named "none".

It's a simple mistake to make and clearly the usability coefficient for initramfs-tools has room to be raised. In fact, one could say that that way of loading variables has big clown feets well into the security risk space.

Online

#8 2024-12-07 01:07:15

Altoid
Member
Registered: 2017-05-07
Posts: 1,631  

Re: Devuan Daedalus - hibernation settings

Hello:

ralph.ronnquist wrote:

... had a disruptive space on the line making it be "RESUME= none" .

I could have sworn I did a copy/paste of the original text by fsmithred.
Evidently not.

ralph.ronnquist wrote:

... the file gets processed as a shell script ...
... experience the shell script difference between the two lines lines:

RESUME=none
RESUME= none

In other words, a syntax error (?)

ralph.ronnquist wrote:

... first line sets RESUME to "none" ...
... second line sets RESUME to  the empty string for a sub shell attempting to execute a program named "none".

Thank you for taking the time to explain all this.
Learn something every day.

ralph.ronnquist wrote:

... simple mistake to make ...
... usability coefficient for initramfs-tools has room to be raised.

And I should have checked ...  8^°

But it worked, I am no longer getting that line in my dmesg:
ie:

--- snip ---
[   24.068315] PM: Image not found (code -22)
--- snip ---

Thank you very much for your input.

Best,

A.

Offline

Board footer