dracut-kdump.sh: reformat with shfmt
upstream: fedora
resolves: bz2003832
conflict: none
commit 7c76611abb
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:
parent
eb6eafaf18
commit
5e60aafcaf
@ -182,7 +182,8 @@ dump_fs()
|
|||||||
|
|
||||||
# $1: dmesg collector
|
# $1: dmesg collector
|
||||||
# $2: dump path
|
# $2: dump path
|
||||||
save_vmcore_dmesg_fs() {
|
save_vmcore_dmesg_fs()
|
||||||
|
{
|
||||||
dinfo "saving vmcore-dmesg.txt to $2"
|
dinfo "saving vmcore-dmesg.txt to $2"
|
||||||
if $1 /proc/vmcore > "$2/vmcore-dmesg-incomplete.txt"; then
|
if $1 /proc/vmcore > "$2/vmcore-dmesg-incomplete.txt"; then
|
||||||
mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
|
mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
|
||||||
@ -202,7 +203,8 @@ save_vmcore_dmesg_fs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# $1: dump path
|
# $1: dump path
|
||||||
save_opalcore_fs() {
|
save_opalcore_fs()
|
||||||
|
{
|
||||||
if [ ! -f $OPALCORE ]; then
|
if [ ! -f $OPALCORE ]; then
|
||||||
# Check if we are on an old kernel that uses a different path
|
# Check if we are on an old kernel that uses a different path
|
||||||
if [ -f /sys/firmware/opal/core ]; then
|
if [ -f /sys/firmware/opal/core ]; then
|
||||||
@ -432,7 +434,8 @@ dump_ssh()
|
|||||||
# $2: ssh opts
|
# $2: ssh opts
|
||||||
# $3: ssh address in <user>@<host> format
|
# $3: ssh address in <user>@<host> format
|
||||||
# $4: scp address, similar with ssh address but IPv6 addresses are quoted
|
# $4: scp address, similar with ssh address but IPv6 addresses are quoted
|
||||||
save_opalcore_ssh() {
|
save_opalcore_ssh()
|
||||||
|
{
|
||||||
if [ ! -f $OPALCORE ]; then
|
if [ ! -f $OPALCORE ]; then
|
||||||
# Check if we are on an old kernel that uses a different path
|
# Check if we are on an old kernel that uses a different path
|
||||||
if [ -f /sys/firmware/opal/core ]; then
|
if [ -f /sys/firmware/opal/core ]; then
|
||||||
@ -458,7 +461,8 @@ save_opalcore_ssh() {
|
|||||||
# $2: dump path
|
# $2: dump path
|
||||||
# $3: ssh opts
|
# $3: ssh opts
|
||||||
# $4: ssh address in <user>@<host> format
|
# $4: ssh address in <user>@<host> format
|
||||||
save_vmcore_dmesg_ssh() {
|
save_vmcore_dmesg_ssh()
|
||||||
|
{
|
||||||
dinfo "saving vmcore-dmesg.txt to $4:$2"
|
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
|
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"
|
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()
|
get_host_ip()
|
||||||
{
|
{
|
||||||
if is_nfs_dump_target || is_ssh_dump_target
|
if is_nfs_dump_target || is_ssh_dump_target; then
|
||||||
then
|
|
||||||
kdumpnic=$(getarg kdumpnic=)
|
kdumpnic=$(getarg kdumpnic=)
|
||||||
if [ -z "$kdumpnic" ]; then
|
if [ -z "$kdumpnic" ]; then
|
||||||
derror "failed to get kdumpnic!"
|
derror "failed to get kdumpnic!"
|
||||||
@ -502,8 +505,7 @@ read_kdump_confs()
|
|||||||
get_kdump_confs
|
get_kdump_confs
|
||||||
|
|
||||||
# rescan for add code for dump target
|
# rescan for add code for dump target
|
||||||
while read -r config_opt config_val;
|
while read -r config_opt config_val; do
|
||||||
do
|
|
||||||
# remove inline comments after the end of a directive.
|
# remove inline comments after the end of a directive.
|
||||||
case "$config_opt" in
|
case "$config_opt" in
|
||||||
dracut_args)
|
dracut_args)
|
||||||
|
Loading…
Reference in New Issue
Block a user