From b0b60c8e05adbf4a9ef8a1d3e01c15045bb33802 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Mon, 27 Apr 2015 11:38:26 +0200 Subject: [PATCH 1/3] dracut-functions: use [[ ]] with -n and no quotes --- dracut-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index 37ddca2d..e154b52a 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -977,7 +977,7 @@ inst_rules_wildcard() { _found=$_rule fi done - if [ -n ${hostonly} ] ; then + if [[ -n ${hostonly} ]] ; then for _rule in ${_target}/$1 ; do if [[ -f $_rule ]]; then inst_rule_programs "$_rule" From 04ba4610455d53e6a578b65c833c2d11320e1d80 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Thu, 30 Apr 2015 03:25:14 +0000 Subject: [PATCH 2/3] Fix ask_for_password bug breaking bash without plymouth If crypt-lib.sh is sourced from any #!/bin/sh script, a POSIX shell quirk is in effect that causes variable assignments to "special builtins" (such as "shift") to leak to their context. So the buggy code works even despite the missing semicolons. But if it is sourced by "bash acting under its own name", i.e. from any #!/bin/bash script, the quirk is disabled, tty_cmd/tty_prompt are undefined, and ask_for_password doesn't do anything if plymouth is not present. --- modules.d/90crypt/crypt-lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh index 3f12ea0f..4e980109 100755 --- a/modules.d/90crypt/crypt-lib.sh +++ b/modules.d/90crypt/crypt-lib.sh @@ -42,10 +42,10 @@ ask_for_password() { while [ $# -gt 0 ]; do case "$1" in - --cmd) ply_cmd="$2"; tty_cmd="$2" shift;; + --cmd) ply_cmd="$2"; tty_cmd="$2"; shift;; --ply-cmd) ply_cmd="$2"; shift;; --tty-cmd) tty_cmd="$2"; shift;; - --prompt) ply_prompt="$2"; tty_prompt="$2" shift;; + --prompt) ply_prompt="$2"; tty_prompt="$2"; shift;; --ply-prompt) ply_prompt="$2"; shift;; --tty-prompt) tty_prompt="$2"; shift;; --tries) ply_tries="$2"; tty_tries="$2"; shift;; From 874b0135739e69dba8e80b0cbb08be2507b3b167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20=27Morty=27=20Str=C3=BCbe?= Date: Thu, 30 Apr 2015 11:15:07 +0200 Subject: [PATCH 3/3] Add plymouth-set-default-theme to the plymouth dependencies plymouth-set-default-theme is not shipped with ubuntu and therefore causes errors. --- modules.d/50plymouth/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh index 89e71626..27dafcac 100755 --- a/modules.d/50plymouth/module-setup.sh +++ b/modules.d/50plymouth/module-setup.sh @@ -3,7 +3,7 @@ # called by dracut check() { [[ "$mount_needs" ]] && return 1 - require_binaries plymouthd plymouth + require_binaries plymouthd plymouth plymouth-set-default-theme } # called by dracut