dracut-kdump.sh: reformat with shfmt

upstream: fedora
resolves: bz2003832
conflict: none

commit 7c76611abba248e58172fdf170739a3c0f40e2c6
Author: Kairui Song <kasong@redhat.com>
Date:   Wed Sep 15 23:10:07 2021 +0800

    dracut-kdump.sh: reformat with shfmt

    This is done with `shfmt -w -s dracut-kdump.sh`. There is no behaviour
    change.

    Signed-off-by: Kairui Song <kasong@redhat.com>
    Acked-by: Philipp Rudo <prudo@redhat.com>

Signed-off-by: Tao Liu <ltao@redhat.com>
This commit is contained in:
Tao Liu 2021-11-03 19:11:53 +08:00
parent eb6eafaf18
commit 5e60aafcaf
1 changed files with 385 additions and 383 deletions

View File

@ -182,7 +182,8 @@ dump_fs()
# $1: dmesg collector
# $2: dump path
save_vmcore_dmesg_fs() {
save_vmcore_dmesg_fs()
{
dinfo "saving vmcore-dmesg.txt to $2"
if $1 /proc/vmcore > "$2/vmcore-dmesg-incomplete.txt"; then
mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
@ -202,7 +203,8 @@ save_vmcore_dmesg_fs() {
}
# $1: dump path
save_opalcore_fs() {
save_opalcore_fs()
{
if [ ! -f $OPALCORE ]; then
# Check if we are on an old kernel that uses a different path
if [ -f /sys/firmware/opal/core ]; then
@ -432,7 +434,8 @@ dump_ssh()
# $2: ssh opts
# $3: ssh address in <user>@<host> format
# $4: scp address, similar with ssh address but IPv6 addresses are quoted
save_opalcore_ssh() {
save_opalcore_ssh()
{
if [ ! -f $OPALCORE ]; then
# Check if we are on an old kernel that uses a different path
if [ -f /sys/firmware/opal/core ]; then
@ -458,7 +461,8 @@ save_opalcore_ssh() {
# $2: dump path
# $3: ssh opts
# $4: ssh address in <user>@<host> format
save_vmcore_dmesg_ssh() {
save_vmcore_dmesg_ssh()
{
dinfo "saving vmcore-dmesg.txt to $4:$2"
if $1 /proc/vmcore | ssh $3 "$4" "umask 0077 && dd of='$2/vmcore-dmesg-incomplete.txt'"; then
ssh -q $3 "$4" mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
@ -470,8 +474,7 @@ save_vmcore_dmesg_ssh() {
get_host_ip()
{
if is_nfs_dump_target || is_ssh_dump_target
then
if is_nfs_dump_target || is_ssh_dump_target; then
kdumpnic=$(getarg kdumpnic=)
if [ -z "$kdumpnic" ]; then
derror "failed to get kdumpnic!"
@ -502,8 +505,7 @@ read_kdump_confs()
get_kdump_confs
# rescan for add code for dump target
while read -r config_opt config_val;
do
while read -r config_opt config_val; do
# remove inline comments after the end of a directive.
case "$config_opt" in
dracut_args)