From 057e505536a31408c67cc6396bde93a20fffa4df Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Wed, 3 Nov 2021 15:45:41 +0800 Subject: [PATCH] dracut-module-setup.sh: fix a ambiguous variable reference upstream: fedora resolves: bz2003832 conflict: none commit dfe7555323e22d3f23621fcdae11b2c467754175 Author: Kairui Song Date: Wed Aug 4 15:51:34 2021 +0800 dracut-module-setup.sh: fix a ambiguous variable reference Wrap the variable with {...}, else it may get interpreted as array due to the '[' char next to it. Signed-off-by: Kairui Song Acked-by: Philipp Rudo Signed-off-by: Tao Liu --- dracut-module-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 6af96fb..6f5d754 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -686,11 +686,11 @@ kdump_install_conf() { case "$_opt" in raw) _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev $_val) - sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf + sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf ;; ext[234]|xfs|btrfs|minix) _pdev=$(kdump_get_persistent_dev $_val) - sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf + sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf ;; ssh|nfs) kdump_install_net "$_val"