Bug 1663651

Summary: crypt-gpg failed to boot with dash
Product: [Fedora] Fedora Reporter: Danh Doan <congdanhqx>
Component: dracutAssignee: dracut-maint-list
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dracut-maint-list, jonathan, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-06 15:38:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to fix none

Description Danh Doan 2019-01-06 05:17:45 UTC
Steps to reproduce:

- Full disk encryption,
- Luks key is encrypted with gpg
- luks key is embedded in initramfs
- cmdline is: rd.luks.key=/etc/luks/key.gpg:/
- add_dracutmodules+=" dash "
- omit_dracutmodues+=" bash "
- build dracut

Expectation:
- the system should boot with new initramfs

Actual:
- The system failed to pick the key in initramfs
- replace dash by bash and system can pick up the correct key

Root Cause:
There's some bashism inside runtime script, which uses == instead of = to compare.

I've made a patch to fix, see attachment

Comment 1 Danh Doan 2019-01-06 05:47:05 UTC
The patch isn't directly tested.
Since I'm using Void Linux with musl libc, which needs some patch on top of it.

I made the change on top of the tip of master branch of dracut repository.

Then applied the patch on top of my distribution.

The patch worked fine with my particular setup.

Comment 2 Danh Doan 2019-01-06 05:48:28 UTC
Created attachment 1518744 [details]
patch to fix

Comment 3 Zbigniew Jędrzejewski-Szmek 2019-01-06 15:31:36 UTC
*** Bug 1663650 has been marked as a duplicate of this bug. ***

Comment 4 Zbigniew Jędrzejewski-Szmek 2019-01-06 15:38:50 UTC
Patch looks OK. I submitted is as https://github.com/dracutdevs/dracut/pull/516. In the future, please submit patches upstream.