Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #62752 > unrolled thread

Bug#916696: initramfs-tools: search for nonexistent resume device

Started byTrek <trek00@inbox.ru>
First post2018-12-17 16:00 +0100
Last post2019-08-23 10:10 +0200
Articles 10 — 3 participants

Back to article view | Back to linux.debian.kernel


Contents

  Bug#916696: initramfs-tools: search for nonexistent resume device Trek <trek00@inbox.ru> - 2018-12-17 16:00 +0100
    Bug#916696: initramfs-tools: search for nonexistent resume device Ben Hutchings <ben@decadent.org.uk> - 2019-02-06 22:30 +0100
      Bug#916696: initramfs-tools: search for nonexistent resume device Trek <trek00@inbox.ru> - 2019-02-10 07:00 +0100
        Bug#916696: initramfs-tools: search for nonexistent resume device Ben Hutchings <ben@decadent.org.uk> - 2019-02-10 18:40 +0100
          Bug#916696: initramfs-tools: search for nonexistent resume device Trek <trek00@inbox.ru> - 2019-02-10 23:40 +0100
            Bug#916696: initramfs-tools: search for nonexistent resume device Ben Hutchings <ben@decadent.org.uk> - 2019-02-10 23:50 +0100
    Processed: Re: initramfs-tools: search for nonexistent resume device "Debian Bug Tracking System" <owner@bugs.debian.org> - 2019-02-06 22:30 +0100
    Processed: Re: initramfs-tools: search for nonexistent resume device "Debian Bug Tracking System" <owner@bugs.debian.org> - 2019-02-10 23:50 +0100
    Bug#916696: marked as done (initramfs-tools: search for  nonexistent resume device) "Debian Bug Tracking System" <owner@bugs.debian.org> - 2019-07-28 03:00 +0200
    Bug#916696: marked as done (initramfs-tools: search for  nonexistent resume device) "Debian Bug Tracking System" <owner@bugs.debian.org> - 2019-08-23 10:10 +0200

#62752 — Bug#916696: initramfs-tools: search for nonexistent resume device

FromTrek <trek00@inbox.ru>
Date2018-12-17 16:00 +0100
SubjectBug#916696: initramfs-tools: search for nonexistent resume device
Message-ID<x62xc-7Pl-13@gated-at.bofh.it>
Package: initramfs-tools
Version: 0.132

at boot, initramfs blocks searching for a resume device

Begin: Waiting for suspend/resume device ...
Begin: Running /scripts/local-block ... done.


I'm using sysvinit and two encrypted swap partitions

the file /etc/initramfs-tools/conf.d/resume does not exist

the contents of /etc/crypttab are:

sda5_crypt /dev/disk/by-id/ata-XXXXXXXXXX-XXXXXX_XXXXXXXX-part5 /dev/urandom
cipher=aes-xts-plain64,size=256,swap
sdb5_crypt /dev/disk/by-id/ata-XXXXXXXXXX-XXXXXX_XXXXXXXX-part5 /dev/urandom
cipher=aes-xts-plain64,size=256,swap


if I disable swap (swapoff -a) and rebuild the initrd, the problem
disappears


can I do something to further investigate the issue?

thank you!

[toc] | [next] | [standalone]


#63276

FromBen Hutchings <ben@decadent.org.uk>
Date2019-02-06 22:30 +0100
Message-ID<xoCVz-11q-5@gated-at.bofh.it>
In reply to#62752

[Multipart message — attachments visible in raw view] — view raw

Control: tag -1 moreinfo

On Mon, 17 Dec 2018 15:48:12 +0100 Trek <trek00@inbox.ru> wrote:
> Package: initramfs-tools
> Version: 0.132
> 
> at boot, initramfs blocks searching for a resume device
> 
> Begin: Waiting for suspend/resume device ...
> Begin: Running /scripts/local-block ... done.
> 
> 
> I'm using sysvinit and two encrypted swap partitions
> 
> the file /etc/initramfs-tools/conf.d/resume does not exist
> 
> the contents of /etc/crypttab are:
> 
> sda5_crypt /dev/disk/by-id/ata-XXXXXXXXXX-XXXXXX_XXXXXXXX-part5 /dev/urandom
> cipher=aes-xts-plain64,size=256,swap
> sdb5_crypt /dev/disk/by-id/ata-XXXXXXXXXX-XXXXXX_XXXXXXXX-part5 /dev/urandom
> cipher=aes-xts-plain64,size=256,swap
> 
> 
> if I disable swap (swapoff -a) and rebuild the initrd, the problem
> disappears
> 
> 
> can I do something to further investigate the issue?

The RESUME variable doesn't have to be set in any particular file.
Please check with:

    grep -rw RESUME /etc/initramfs-tools/initramfs.conf \
        /etc/initramfs-tools/conf.d \
        /usr/share/initramfs-tools/conf.d/

If it's definitely not set, then please:

1. Upgrade to initramfs-tools version 0.133 (I just uploaded this so
   you will have to wait a few hours for it to be available)
2. Run "update-initramfs -u -v >initramfs.log 2>&1"
3. Look in initramfs.log for "Calling hook resume" and send the
   messages after that

Ben.

-- 
Ben Hutchings
Man invented language to satisfy his deep need to complain.
                                                          - Lily Tomlin

[toc] | [prev] | [next] | [standalone]


#63297

FromTrek <trek00@inbox.ru>
Date2019-02-10 07:00 +0100
Message-ID<xpQjL-5yL-1@gated-at.bofh.it>
In reply to#63276

[Multipart message — attachments visible in raw view] — view raw

On Wed, 06 Feb 2019 21:21:57 +0000
Ben Hutchings <ben@decadent.org.uk> wrote:

> The RESUME variable doesn't have to be set in any particular file.
> Please check with:
> 
>     grep -rw RESUME /etc/initramfs-tools/initramfs.conf \
>         /etc/initramfs-tools/conf.d \
>         /usr/share/initramfs-tools/conf.d/

it's empty


> If it's definitely not set, then please:
> 
> 1. Upgrade to initramfs-tools version 0.133 (I just uploaded this so
>    you will have to wait a few hours for it to be available)
> 2. Run "update-initramfs -u -v >initramfs.log 2>&1"
> 3. Look in initramfs.log for "Calling hook resume" and send the
>    messages after that

thanks for your help, now I've managed to debug and fix the resume hook:
when all the swaps are ephemeral, it finishes the for-loop, but the
last if-construct doesn't check the ephemeral variable

I include a patch, tested with and without an ephemeral swap:
- the second block (-79,9 +83,10) is the actual fix
- the first one (-63,9 +63,13) is only to be safer, as it
  checks /dev/random too and it stops searching /etc/crypttab when the
  device is found

ciao!

[toc] | [prev] | [next] | [standalone]


#63307

FromBen Hutchings <ben@decadent.org.uk>
Date2019-02-10 18:40 +0100
Message-ID<xq1fb-415-9@gated-at.bofh.it>
In reply to#63297

[Multipart message — attachments visible in raw view] — view raw

On Sun, 2019-02-10 at 06:31 +0100, Trek wrote:
> On Wed, 06 Feb 2019 21:21:57 +0000
> Ben Hutchings <ben@decadent.org.uk> wrote:
> 
> > The RESUME variable doesn't have to be set in any particular file.
> > Please check with:
> > 
> >     grep -rw RESUME /etc/initramfs-tools/initramfs.conf \
> >         /etc/initramfs-tools/conf.d \
> >         /usr/share/initramfs-tools/conf.d/
> 
> it's empty
> 
> 
> > If it's definitely not set, then please:
> > 
> > 1. Upgrade to initramfs-tools version 0.133 (I just uploaded this so
> >    you will have to wait a few hours for it to be available)
> > 2. Run "update-initramfs -u -v >initramfs.log 2>&1"
> > 3. Look in initramfs.log for "Calling hook resume" and send the
> >    messages after that
> 
> thanks for your help, now I've managed to debug and fix the resume hook:
> when all the swaps are ephemeral, it finishes the for-loop, but the
> last if-construct doesn't check the ephemeral variable
> 
> I include a patch, tested with and without an ephemeral swap:
> - the second block (-79,9 +83,10) is the actual fix

If you would actually send me the log messages I might understand this
fix, but as it is I don't.  I do need to understand it before I will apply it.

Ben.

> - the first one (-63,9 +63,13) is only to be safer, as it
>   checks /dev/random too and it stops searching /etc/crypttab when the
>   device is found
> 
> ciao!
-- 
Ben Hutchings
The world is coming to an end.	Please log off.


[toc] | [prev] | [next] | [standalone]


#63311

FromTrek <trek00@inbox.ru>
Date2019-02-10 23:40 +0100
Message-ID<xq5Vv-6Zl-9@gated-at.bofh.it>
In reply to#63307
On Sun, 10 Feb 2019 17:32:08 +0000
Ben Hutchings <ben@decadent.org.uk> wrote:

> > I include a patch, tested with and without an ephemeral swap:
> > - the second block (-79,9 +83,10) is the actual fix
> If you would actually send me the log messages I might understand this
> fix, but as it is I don't.  I do need to understand it before I will
> apply it.

yes, sorry, you're right

here the log:

Calling hook resume
I: Configuration sets RESUME=
I: Checking swap device /dev/dm-1
I: /dev/dm-1 has device-mapper name sdb5_crypt; checking crypttab
I: Found cryptdev=sda5_crypt keyfile=/dev/urandom
I: Found cryptdev=sdb5_crypt keyfile=/dev/urandom
I: Rejecting /dev/dm-1 since it has no permanent key
I: Checking swap device /dev/dm-0
I: /dev/dm-0 has device-mapper name sda5_crypt; checking crypttab
I: Found cryptdev=sda5_crypt keyfile=/dev/urandom
I: Rejecting /dev/dm-0 since it has no permanent key
I: Found cryptdev=sdb5_crypt keyfile=/dev/urandom
Calling hook thermal


it ends up with the initrd file /main/conf/conf.d/zz-resume-auto
containing:

RESUME=/dev/dm-0


running resume with set -x explain what's going on:

+ report_verbose Rejecting /dev/dm-0 since it has no permanent key
+ test y != y
+ echo I: Rejecting /dev/dm-0 since it has no permanent key
I: Rejecting /dev/dm-0 since it has no permanent key
+ ephemeral=true
+ read -r cryptdev srcdev keyfile junk
+ report_verbose Found cryptdev=sdb5_crypt keyfile=/dev/urandom
+ test y != y
+ echo I: Found cryptdev=sdb5_crypt keyfile=/dev/urandom
I: Found cryptdev=sdb5_crypt keyfile=/dev/urandom
+ [ sdb5_crypt = sda5_crypt ]
+ read -r cryptdev srcdev keyfile junk
+ true
+ [ -n /dev/dm-0 ]
+ true
+ [  = auto ]
+ [ -n /dev/dm-0 ]
+ [ -z /dev/dm-0 ]
+ echo RESUME=/dev/dm-0


basically, it finishes the while-loop
  while read -r cryptdev srcdev keyfile junk; do
  + read -r cryptdev srcdev keyfile junk
then it checks the ephemeral variable inside the for-loop
  $ephemeral || break
  + true
now the for-loop is finished and it evaluates the first if-construct
  if [ -n "$resume_auto" ] && ! $ephemeral; then
  + [ -n /dev/dm-0 ]
  + true
it evaluates the second if-construct (the bug is here, as it doesn't
account for ephemeral)
  if [ "$RESUME" = auto ] || [ -n "$resume_auto" ]; then
  + [  = auto ]
  + [ -n /dev/dm-0 ]
then the inner if-construct 
  if [ -z "$resume_auto" ]; then
  + [ -z /dev/dm-0 ]
and finally it writes the resume file
  echo "RESUME=${resume_auto}" > "${DESTDIR}/conf/conf.d/zz-resume-auto"
  + echo RESUME=/dev/dm-0


my fix is to reset the resume_auto variable if the device is ephemeral,
thus removing the need to check the ephemeral variable in the two
if-construct after the for-loop

  $ephemeral || break	# exit the for-loop if ephemeral=true
  resume_auto=		# otherwise empty resume_auto


that's it :)
thanks again for your time
ciao!

[toc] | [prev] | [next] | [standalone]


#63313

FromBen Hutchings <ben@decadent.org.uk>
Date2019-02-10 23:50 +0100
Message-ID<xq65b-72Z-3@gated-at.bofh.it>
In reply to#63311

[Multipart message — attachments visible in raw view] — view raw

Control: tag -1 - moreinfo
Control: tag -1 patch

On Sun, 2019-02-10 at 23:35 +0100, Trek wrote:
[...]
> my fix is to reset the resume_auto variable if the device is ephemeral,
> thus removing the need to check the ephemeral variable in the two
> if-construct after the for-loop
> 
>   $ephemeral || break	# exit the for-loop if ephemeral=true
>   resume_auto=		# otherwise empty resume_auto
> 
> 
> that's it :)
> thanks again for your time
> ciao!

OK, I understand now, thanks.

Ben.

-- 
Ben Hutchings
The world is coming to an end.	Please log off.


[toc] | [prev] | [next] | [standalone]


#63277 — Processed: Re: initramfs-tools: search for nonexistent resume device

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2019-02-06 22:30 +0100
SubjectProcessed: Re: initramfs-tools: search for nonexistent resume device
Message-ID<xoCVA-11q-21@gated-at.bofh.it>
In reply to#62752
Processing control commands:

> tag -1 moreinfo
Bug #916696 [initramfs-tools] initramfs-tools: search for nonexistent resume device
Added tag(s) moreinfo.

-- 
916696: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916696
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

[toc] | [prev] | [next] | [standalone]


#63312 — Processed: Re: initramfs-tools: search for nonexistent resume device

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2019-02-10 23:50 +0100
SubjectProcessed: Re: initramfs-tools: search for nonexistent resume device
Message-ID<xq65b-72Z-1@gated-at.bofh.it>
In reply to#62752
Processing control commands:

> tag -1 - moreinfo
Bug #916696 [initramfs-tools] initramfs-tools: search for nonexistent resume device
Removed tag(s) moreinfo.
> tag -1 patch
Bug #916696 [initramfs-tools] initramfs-tools: search for nonexistent resume device
Added tag(s) patch.

-- 
916696: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916696
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

[toc] | [prev] | [next] | [standalone]


#64572 — Bug#916696: marked as done (initramfs-tools: search for nonexistent resume device)

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2019-07-28 03:00 +0200
SubjectBug#916696: marked as done (initramfs-tools: search for nonexistent resume device)
Message-ID<yoFHA-1TM-15@gated-at.bofh.it>
In reply to#62752

[Multipart message — attachments visible in raw view] — view raw

Your message dated Sun, 28 Jul 2019 00:50:51 +0000
with message-id <E1hrXOl-0009Ab-Ff@fasolo.debian.org>
and subject line Bug#916696: fixed in initramfs-tools 0.134
has caused the Debian Bug report #916696,
regarding initramfs-tools: search for nonexistent resume device
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
916696: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916696
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

[toc] | [prev] | [next] | [standalone]


#64898 — Bug#916696: marked as done (initramfs-tools: search for nonexistent resume device)

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2019-08-23 10:10 +0200
SubjectBug#916696: marked as done (initramfs-tools: search for nonexistent resume device)
Message-ID<yycNY-11G-33@gated-at.bofh.it>
In reply to#62752

[Multipart message — attachments visible in raw view] — view raw

Your message dated Fri, 23 Aug 2019 07:57:03 +0000
with message-id <E1i14RT-00065M-Dx@fasolo.debian.org>
and subject line Bug#916696: fixed in initramfs-tools 0.133+deb10u1
has caused the Debian Bug report #916696,
regarding initramfs-tools: search for nonexistent resume device
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
916696: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916696
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web