diff options
author | Leho Kraav <leho@kraav.com> | 2012-07-24 15:08:55 +0300 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2012-07-25 10:31:43 +0200 |
commit | e88e3b279784ca801996c5e32db8c3bc2df1ec29 (patch) | |
tree | 7d063dc1ca17f2e44296c7f23741201ace614561 /modules.d/91crypt-loop | |
parent | df68781fca048de2f880be37ab9e1ede9bea5051 (diff) | |
download | dracut-e88e3b279784ca801996c5e32db8c3bc2df1ec29.tar.gz dracut-e88e3b279784ca801996c5e32db8c3bc2df1ec29.tar.bz2 dracut-e88e3b279784ca801996c5e32db8c3bc2df1ec29.zip |
91crypt-loop: replace basename calls with string matching
Diffstat (limited to 'modules.d/91crypt-loop')
-rw-r--r-- | modules.d/91crypt-loop/crypt-loop-lib.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules.d/91crypt-loop/crypt-loop-lib.sh b/modules.d/91crypt-loop/crypt-loop-lib.sh index 6774e7d8..244b6ce6 100644 --- a/modules.d/91crypt-loop/crypt-loop-lib.sh +++ b/modules.d/91crypt-loop/crypt-loop-lib.sh @@ -18,13 +18,13 @@ loop_decrypt() { local keydev="$3" local device="$4" - local key="/dev/mapper/$(basename $mntp)" + local key="/dev/mapper/${mntp##*/}" if [ ! -b $key ]; then info "Keyfile has .img suffix, treating it as LUKS-encrypted loop keyfile container to unlock $device" local loopdev=$(losetup -f "${mntp}/${keypath}" --show) - local opts="-d - luksOpen $loopdev $(basename $key)" + local opts="-d - luksOpen $loopdev ${key##*/}" ask_for_password \ --cmd "cryptsetup $opts" \ @@ -33,9 +33,9 @@ loop_decrypt() { [ -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)" \ + initqueue --onetime --finished --unique --name "crypt-loop-cleanup-10-${key##*/}" \ $(command -v cryptsetup) "luksClose $key" - initqueue --onetime --finished --unique --name "crypt-loop-cleanup-20-$(basename $loopdev)" \ + initqueue --onetime --finished --unique --name "crypt-loop-cleanup-20-${loopdev##*/}" \ $(command -v losetup) "-d $loopdev" else info "Existing keyfile found, re-using it for $device" |