Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.kernel > #63311
| From | Trek <trek00@inbox.ru> |
|---|---|
| Newsgroups | linux.debian.bugs.dist, linux.debian.kernel |
| Subject | Bug#916696: initramfs-tools: search for nonexistent resume device |
| Date | 2019-02-10 23:40 +0100 |
| Message-ID | <xq5Vv-6Zl-9@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <xoCVz-11q-5@gated-at.bofh.it> <xpQjL-5yL-1@gated-at.bofh.it> <xq1fb-415-9@gated-at.bofh.it> <x62xc-7Pl-13@gated-at.bofh.it> <xq1fb-415-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Cross-posted to 2 groups.
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!
Back to linux.debian.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
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
csiph-web