<div dir="ltr"><div>Hello, I want to prompt a user for a password and then take action
on that once they input it. I do get the password prompt, and the
"--command" is running, but the command cannot obtain the password in
any way that I've tried. Can you help?<br></div><div><br></div><div>I'm using dracut on CentOS 7.6 to create the ramdisk. <br></div><div><br></div><div>My module-install.sh includes these lines at install:</div><div><br></div><div><span style="font-family:monospace">. . .</span></div><div><span style="font-family:monospace">install() {</span></div><div><span style="font-family:monospace"> . . .</span></div><div><span style="font-family:monospace"> inst_simple "$moddir/opal-unlock.sh" "/lib/dracut-my-unlock.sh"<br> inst_hook pre-mount 60 "$moddir/my-getpass.sh"<br> # dracut_need_initqueue</span></div><div><span style="font-family:monospace"> . . .<br></span></div><div><br></div><div>My-getpass.sh includes these lines:</div><div><br></div><div><span style="font-family:monospace">#!/bin/bash<br># -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-<br># ex: ts=8 sw=4 sts=4 et filetype=sh<br>{ flock -s 9;<br> # Prompt for password with plymouth, if installed and running.<br> if type plymouth >/dev/null 2>&1 && plymouth --ping 2>/dev/null; then<br> plymouth ask-for-password --prompt "enter pass" --number-of-tries=3 --command="/lib/dracut-my-unlock.sh"</span><br></div><div><br></div><div>My-unlock includes these lines; note several failed attempts commented out:</div><div><br></div><div><span style="font-family:monospace">#!/bin/bash<br># -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-<br># ex: ts=8 sw=4 sts=4 et filetype=sh<br># reboot # rebooting here proves this script is getting called. It is.<br>/bin/read SUPASS # does not work<br># /bin/cat >/.foo<br># SUPASS=$(/bin/cat /.foo) # does not work<br># SUPASS="$*" # does not work<br># reboot # is the read command succeeding? YES - gets null input. YES - reboot works here<br># ASDF=$(/bin/env | /bin/grep -iE 'asdf') # does plymouth store pass in env var? No.<br># plymouth ask-question --prompt="I see '${ASDF}' '${SUPASS}'"<br>plymouth ask-question --prompt="I see '${SUPASS}'" # always emits '' for empty string<br>exit 0</span><br></div><div><br></div><div>The problem is, SUPASS is never set in the unlock script. The prompt always comes back with an empty string.<br></div><div><br></div><div>What should I try next?</div><div><br></div><div>Thanks,</div><div>Russ</div></div>