From 6d930905d5662bedac3e1bc097152882aaf77079 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Nov 03 2021 08:15:26 +0000 Subject: dracut-module-setup.sh: remove surrounding $() for subshell upstream: fedora resolves: bz2003832 conflict: none commit 3b0157197b4dcc7c06487d5f44395317c5f4670f Author: Kairui Song Date: Wed Sep 8 15:15:44 2021 +0800 dracut-module-setup.sh: remove surrounding $() for subshell Some functions are executed in subshell to avoid variable environment pollution. But the surrounding $() is not needed, and it may lead to executing output which is unexpected here. See: https://github.com/koalaman/shellcheck/wiki/SC2091 Signed-off-by: Kairui Song Suggested-by: Coiby Xu Signed-off-by: Tao Liu --- diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index a3d83a2..1519f50 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -358,7 +358,7 @@ kdump_setup_bridge() { _dev=${_dev##*/} _kdumpdev=$_dev if kdump_is_bond "$_dev"; then - $(kdump_setup_bond "$_dev" "$(get_nmcli_connection_show_cmd_by_ifname "$_dev")") + (kdump_setup_bond "$_dev" "$(get_nmcli_connection_show_cmd_by_ifname "$_dev")") if [[ $? != 0 ]]; then exit 1 fi @@ -441,7 +441,7 @@ kdump_setup_vlan() { derror "Vlan over bridge is not supported!" exit 1 elif kdump_is_bond "$_phydev"; then - $(kdump_setup_bond "$_phydev" "$(get_nmcli_connection_show_cmd_by_ifname "$_phydev")") + (kdump_setup_bond "$_phydev" "$(get_nmcli_connection_show_cmd_by_ifname "$_phydev")") if [[ $? != 0 ]]; then exit 1 fi @@ -557,7 +557,7 @@ kdump_install_net() { _znet_netdev=$(find_online_znet_device) if [[ -n "$_znet_netdev" ]]; then _nm_show_cmd_znet=$(get_nmcli_connection_show_cmd_by_ifname "$_znet_netdev") - $(kdump_setup_znet "$_znet_netdev" "$_nm_show_cmd_znet") + (kdump_setup_znet "$_znet_netdev" "$_nm_show_cmd_znet") if [[ $? != 0 ]]; then derror "Failed to set up znet" exit 1 @@ -588,7 +588,7 @@ kdump_install_net() { if kdump_is_bridge "$_netdev"; then kdump_setup_bridge "$_netdev" elif kdump_is_bond "$_netdev"; then - $(kdump_setup_bond "$_netdev" "$_nm_show_cmd") + (kdump_setup_bond "$_netdev" "$_nm_show_cmd") if [[ $? != 0 ]]; then exit 1 fi