Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 399203 - [patch] sys-kernel/genkernel-3.4.16 ".gpg: unknown operand" error
Summary: [patch] sys-kernel/genkernel-3.4.16 ".gpg: unknown operand" error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-01-17 19:26 UTC by Keith
Modified: 2012-01-17 22:31 UTC (History)
0 users

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


Attachments
Resolve ".gpg: unknown operand" error (genkernel-3.4.16-gpg.patch,594 bytes, patch)
2012-01-17 19:30 UTC, Keith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith 2012-01-17 19:26:29 UTC
defaults/initrd.scripts contains the following test on line 879:

if [ $(echo ${LUKS_KEY} | grep -o '.gpg$') = ".gpg" ]

However, if ${LUKS_KEY} does not end with the string ".gpg" then the LHS of this comparison evaluates to NULL, i.e [ if = ".gpg" ], which produces the ash interpreter error: ".gpg: unknown operand" on the console during the boot sequence.

This is non-fatal, but annoying, and may cause unnecessary concern to those who don't know why this error occurred. It also causes a momentary interruption to the bootsplash.

A better test would be:

if [ ! -z $(echo ${LUKS_KEY} | grep -o '.gpg$') ]

Which tests if the comparison between ${LUKS_KEY} and '.gpg$' is NOT null. If true, then ${LUKS_KEY} = '.gpg$', if false then it isn't equal. This produces the same result as the original test, but without an error.

Patch included.

Reproducible: Always

Steps to Reproduce:
1. Boot Gentoo from on a filesystem encrypted with a LUKS keyfile that isn't GPG signed.
Actual Results:  
Observe ".gpg: unknown operand" error on the initial console.

Expected Results:  
No error should occur.
Comment 1 Keith 2012-01-17 19:30:45 UTC
Created attachment 299177 [details, diff]
Resolve ".gpg: unknown operand" error

+1 submit for testing
Comment 2 Sebastian Pipping gentoo-dev 2012-01-17 22:31:28 UTC
Hello Homer,

this bug should be fixed since genkernel 3.4.19.


# git blame defaults/initrd.scripts | fgrep .gpg
3453a062 defaults/initrd.scripts [..]


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


Please re-open if necessary.