mkinitrd unification across distributions
 help / color / mirror / Atom feed
From: "Amadeusz Żołnowski" <aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>
To: initramfs <initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 4/4] 91crypt-loop: use initqueue for cleanup strategy
Date: Wed, 31 Aug 2011 11:29:48 +0200	[thread overview]
Message-ID: <1314782941-sup-2236@raeviah> (raw)
In-Reply-To: <1314780315-sup-5456@raeviah>

[-- Attachment #1: Type: text/plain, Size: 2194 bytes --]

Excerpts from Amadeusz Żołnowski's message of 2011-08-31 10:51:37 +0200:
> Excerpts from Leho Kraav's message of 2011-08-30 15:36:31 +0200:
> > ---
> >  modules.d/90crypt/crypt-lib.sh           |    3 +++
> >  modules.d/91crypt-loop/crypt-loop-lib.sh |    5 +++++
> >  2 files changed, 8 insertions(+), 0 deletions(-)
> > 
> > diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh
> > index b04512f..3095774 100755
> > --- a/modules.d/90crypt/crypt-lib.sh
> > +++ b/modules.d/90crypt/crypt-lib.sh
> > @@ -225,6 +225,9 @@ readkey() {
> >              if [ -f /lib/dracut-crypt-loop-lib.sh ]; then
> >                  . /lib/dracut-crypt-loop-lib.sh
> >                  loop_decrypt "$mntp" "$keypath" "$keydev" "$device"
> > +                initqueue --onetime --finished --unique --name "crypt-loop-cleanup-99-$(basename $mntp)" \
> > +                    $(command -v umount) "$mntp; " $(command -v rmdir) "$mntp"
> > +                return 0
> >              else
> >                  die "No loop file support to decrypt '$keypath' on '$keydev'."
> >              fi
> > diff --git a/modules.d/91crypt-loop/crypt-loop-lib.sh b/modules.d/91crypt-loop/crypt-loop-lib.sh
> > index 63a553c..6774e7d 100644
> > --- a/modules.d/91crypt-loop/crypt-loop-lib.sh
> > +++ b/modules.d/91crypt-loop/crypt-loop-lib.sh
> > @@ -32,6 +32,11 @@ loop_decrypt() {
> >              --tty-echo-off
> >  
> >          [ -b $key ] || die "Tried setting it up, but keyfile block device was still not found!" 
> > +
> > +        initqueue --onetime --finished --unique --name "crypt-loop-cleanup-10-$(basename $key)" \
> > +            $(command -v cryptsetup) "luksClose $key"
> > +        initqueue --onetime --finished --unique --name "crypt-loop-cleanup-20-$(basename $loopdev)" \
> > +            $(command -v losetup) "-d $loopdev"
> >      else
> >          info "Existing keyfile found, re-using it for $device"
> >      fi
> 
> Always a bit better to use built-ins:
> 
> basename "$x" == echo "${x#**/}"

Ups.  echo ${x##*/}, of course :-)

-- 
Amadeusz Żołnowski

PGP key fpr: C700 CEDE 0C18 212E 49DA  4653 F013 4531 E1DB FAB5

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2011-08-31  9:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-30 13:36 [PATCH 1/4] 91crypt-loop: open root device with a key inside encrypted loop container Leho Kraav
     [not found] ` <1314711391-7149-1-git-send-email-leho-BFEd76tUscAAvxtiuMwx3w@public.gmane.org>
2011-08-30 13:36   ` [PATCH 2/4] 90crypt: recognize .img as loop key container Leho Kraav
2011-08-30 13:36   ` [PATCH 3/4] 90crypt: enhance crypt-lib keydev mounting Leho Kraav
2011-08-30 13:36   ` [PATCH 4/4] 91crypt-loop: use initqueue for cleanup strategy Leho Kraav
     [not found]     ` <1314711391-7149-4-git-send-email-leho-BFEd76tUscAAvxtiuMwx3w@public.gmane.org>
2011-08-31  8:51       ` Amadeusz Żołnowski
2011-08-31  9:29         ` Amadeusz Żołnowski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-22 12:39 [PATCH 1/4] 91crypt-loop: open root device with a key inside encrypted loop container Leho Kraav
     [not found] ` <1314016750-9655-1-git-send-email-leho-BFEd76tUscAAvxtiuMwx3w@public.gmane.org>
2011-08-22 12:39   ` [PATCH 4/4] 91crypt-loop: use initqueue for cleanup strategy Leho Kraav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314782941-sup-2236@raeviah \
    --to=aidecoe-2qtfh70ttyba5ebddlwbiw@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox