Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 397321 - <sys-kernel/genkernel-3.4.19 - defaults/initrd.scripts: boot fails with "sh: .gpg: unknown operand" when using genkernel with luks and root_key, root_key_dev
Summary: <sys-kernel/genkernel-3.4.19 - defaults/initrd.scripts: boot fails with "sh: ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-02 01:46 UTC by Christian Kruse
Modified: 2012-01-04 14:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Kruse 2012-01-02 01:46:06 UTC
I'm working on a full disk encryption setup. While this is generally documented not very good, I found a bug regarding keyfiles. My luks setup is a key file on an USB stick. Because I couldn't get GPG encrypted keys working I tried unencrypted keys. This lead to the following error message:

sh: .gpg: unknown operand

I THINK this is because of the following statement in the init script:

f [ $(echo ${LUKS_KEY} | grep -o '.gpg$') = ".gpg" ] && [ -e /sbin/gpg ] ; then

When the left part of the statement is executed, it is empty because grep -o .gpg does not match.

Reproducible: Always

Steps to Reproduce:
1. create luks encrypted root partition using keyfiles
2. use genkernel to create the initramfs image
3. use crypt_root, root_key and root_key_dev
Actual Results:  
Boot process fails with sh: .gpg: unknown operand

Expected Results:  
Booting succeeds
Comment 1 Sebastian Pipping gentoo-dev 2012-01-03 19:55:43 UTC
This issue should be fixed in 3.4.19 and later.  The relevant commit is

http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=3453a0621c20576f9b3249215187f34ed55014f0

Please test with genkernel 3.4.20 and report back.
Comment 2 Christian Kruse 2012-01-04 13:16:28 UTC
confirmed, works with 3.4.20
Comment 3 Sebastian Pipping gentoo-dev 2012-01-04 14:17:24 UTC
okay, thanks.