Bug 1098332

Summary: Boot with 'init=/bin/bash' fails if root partition is encrypted (decryption prompt is never shown, boot gets stuck)
Product: Red Hat Enterprise Linux 7 Reporter: Adam Williamson <awilliam>
Component: plymouthAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: ahmadsamir3891, AMMullan, awilliam, dracut-maint-list, dvlasenk, fedora, harald, jonathan, luto, rstrode, samuel-rhbugs, vbenes
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: plymouth-0.8.9-0.12.20140113.el7 Doc Type: Bug Fix
Doc Text:
Cause: plymouth doesn't listen to the keyboard if init=/bin/sh is on the kernel command line Consequence: the root partition can not be decrypted because plymouth won't listen for the password Fix: plymouth should listen to the keyboard until the root filesystem is mounted Result: users will be able to decrypt the root partition when using init=/bin/sh on the kernel commandline
Story Points: ---
Clone Of: 1087528 Environment:
Last Closed: 2015-03-05 13:33:38 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:

Description Adam Williamson 2014-05-15 20:27:25 UTC
+++ This bug was initially created as a clone of Bug #1087528 +++

It seems that plymouth can't handle 'init=/bin/bash' with encrypted root partition.  My system uses LVM on LUKS as root, but if I boot with init=/bin/bash, nothing happens, not even a plymouth password prompt.

Presumably the init option should work by running dracut as usual but then launching /bin/bash instead of systemd once the real root is mounted.

I'm happy to debug, but I've never been very good at figuring out what systemd is thinking when it's just sitting there blinking at me.

--- Additional comment from Andy Lutomirski on 2014-04-14 11:17:50 EDT ---

It looks like this is supposed to work.  systemctl (at least the upstream version) has explicit support for init= in /proc/cmdline, and initrd-switch-root.service executes that code.  So the problem is that the boot process isn't getting that far.

--- Additional comment from Adam Williamson on 2014-04-17 18:23:53 EDT ---

seems to be broken even with the original F20 dracut, if you have encrypted / partition. whether you boot with 'rhgb' or not, boot sequence reaches "Started Forward Password Requests to Plymouth." and then just sits there.

--- Additional comment from Harald Hoyer on 2014-05-12 06:32:36 EDT ---

This might be plymouth failing?

Reassigning to plymouth to get a comment, if "init=.." is special for plymouth and why it influences the behaviour in the initrd.

Question for the reporter: Does it work, if you add "rd.plymouth=0 plymouth.enable=0" to the kernel cmdline?

--- Additional comment from Adam Williamson on 2014-05-12 20:43:59 EDT ---

just to confirm harald's theory - yes, that does make it work. Seems to be plymouth at fault here.

--- Additional comment from Ray Strode [halfline] on 2014-05-14 15:29:25 EDT ---

hmm, tricky.  plymouth normally takes over the keyboard during boot (to handle password requests and escape to toggle between splash and details). if 

init=/bin/sh

is on the kernel command line, we don't take over the keyboard since we want the keyboard to be available for /bin/sh.  I guess there are two possible fixes:

1) treat init=/bin/sh like plymouth.enable=0
2) take the keyboard like usual, but relinquish right before switching out of the initrd.

--- Additional comment from Adam Williamson on 2014-05-15 16:23:12 EDT ---

note  you'd at least want to handle 'init=/bin/bash' and 'init=/bin/sh' if you wanted to go the 'special treatment' route - you'll find both commonly used, in Google searches. I don't know if you want to be nice to zsh fans. =)

Comment 2 Ray Strode [halfline] 2014-10-10 18:09:21 UTC
so i ended up making plymouth show splash in the initrd and quit completely on switch root if init=.*sh is on kernel command line

Comment 4 Ray Strode [halfline] 2014-10-29 14:51:50 UTC
*** Bug 1115591 has been marked as a duplicate of this bug. ***

Comment 6 Harald Hoyer 2014-11-11 12:19:06 UTC
*** Bug 1121654 has been marked as a duplicate of this bug. ***

Comment 8 errata-xmlrpc 2015-03-05 13:33:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0566.html