Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/kexec-tools.git#d5e39c9f7b721b80d2aa1afa85c38754a5be074e
This commit is contained in:
DistroBaker 2020-11-30 11:50:38 +00:00
parent c97bf1e0f8
commit a1014067b4
9 changed files with 169 additions and 504 deletions

View File

@ -298,14 +298,10 @@ kdump_setup_vlan() {
local _netmac="$(kdump_get_mac_addr $_phydev)"
local _kdumpdev
#Just support vlan over bond, it is not easy
#to support all other complex setup
#Just support vlan over bond and team
if kdump_is_bridge "$_phydev"; then
derror "Vlan over bridge is not supported!"
exit 1
elif kdump_is_team "$_phydev"; then
derror "Vlan over team is not supported!"
exit 1
elif kdump_is_bond "$_phydev"; then
kdump_setup_bond "$_phydev"
echo " vlan=$(kdump_setup_ifname $_netdev):$_phydev" > ${initdir}/etc/cmdline.d/43vlan.conf

View File

@ -104,6 +104,11 @@ For the recommended value of X, see 'FADump Memory Requirements' section.
# grubby --args="fadump=on crashkernel=6G" --update-kernel=/boot/vmlinuz-`uname -r`
By default, FADump reserved memory will be initialized as CMA area to make the
memory available through CMA allocator on the production kernel. We can opt out
of this, making reserved memory unavailable to production kernel, by booting the
linux kernel with 'fadump=nocma' instead of 'fadump=on'.
The term 'boot memory' means size of the low memory chunk that is required for
a kernel to boot successfully when booted with restricted memory. By default,
the boot memory size will be the larger of 5% of system RAM or 256MB.
@ -326,9 +331,14 @@ the original command line completely.
How to disable FADump:
Remove "fadump=on" from kernel cmdline parameters:
Remove "fadump=on"/"fadump=nocma" from kernel cmdline parameters OR replace
it with "fadump=off" kernel cmdline parameter:
# grubby --update-kernel=/boot/vmlinuz-`uname -r` --remove-args="fadump=on"
or
# grubby --update-kernel=/boot/vmlinuz-`uname -r` --remove-args="fadump=nocma"
OR
# grubby --update-kernel=/boot/vmlinuz-`uname -r` --args="fadump=off"
If KDump is to be used as the dump capturing mechanism, update the crashkernel
parameter (Else, remove "crashkernel=" parameter too, using grubby):

View File

@ -123,7 +123,7 @@ dump_fs()
ddebug "_mp=$_mp _dev=$_dev _op=$_op"
# If dump path have a corresponding device entry but not mounted, mount it.
if [ -n "$_dev" ]; then
if [ -n "$_dev" ] && [ "$_dev" != "rootfs" ]; then
if ! is_mounted "$_mp"; then
dinfo "dump target $_dev is not mounted, trying to mount..."
mkdir -p $_mp

View File

@ -211,8 +211,8 @@ get_kdump_targets()
# /mnt/bind -> /path/to/src, /mnt/bind/dump -> /path/to/src/dump
#
# findmnt uses the option "-v, --nofsroot" to exclusive the [/dir]
# in the SOURCE column for bind-mounts, then if $_mntpoint equals to
# $_mntpoint_nofsroot, the mountpoint is not bind mounted directory.
# in the SOURCE column for bind-mounts, then if $_src equals to
# $_src_nofsroot, the mountpoint is not bind mounted directory.
#
# Below is just an example for mount info
# /dev/mapper/atomicos-root[/ostree/deploy/rhel-atomic-host/var], if the
@ -220,22 +220,36 @@ get_kdump_targets()
# part is the bind mounted directory which quotes by bracket "[]".
get_bind_mount_source()
{
local _path=$1
# In case it's a sub path in a mount point, get the mount point first
local _mnt_top=$(df $_path | tail -1 | awk '{print $NF}')
local _mntpoint=$(findmnt $_mnt_top | tail -n 1 | awk '{print $2}')
local _mntpoint_nofsroot=$(findmnt -v $_mnt_top | tail -n 1 | awk '{print $2}')
local _mnt=$(df $1 | tail -1 | awk '{print $NF}')
local _path=${1#$_mnt}
if [[ "$_mntpoint" = $_mntpoint_nofsroot ]]; then
echo $_path && return
local _src=$(get_mount_info SOURCE target $_mnt -f)
local _opt=$(get_mount_info OPTIONS target $_mnt -f)
local _fstype=$(get_mount_info FSTYPE target $_mnt -f)
# bind mount in fstab
if [[ -d "$_src" ]] && [[ "$_fstype" = none ]] && (echo "$_opt" | grep -q "\bbind\b"); then
echo $_src$_path && return
fi
_mntpoint=${_mntpoint#*$_mntpoint_nofsroot}
_mntpoint=${_mntpoint#[}
_mntpoint=${_mntpoint%]}
_path=${_path#$_mnt_top}
# direct mount
local _src_nofsroot=$(get_mount_info SOURCE target $_mnt -v -f)
if [[ $_src_nofsroot = $_src ]]; then
echo $_mnt$_path && return
fi
echo $_mntpoint$_path
local _fsroot=${_src#$_src_nofsroot[}
_fsroot=${_fsroot%]}
_mnt=$(get_mount_info TARGET source $_src_nofsroot -f)
# for btrfs, _fsroot will also contain the subvol value as well, strip it
if [[ "$_fstype" = btrfs ]]; then
local _subvol
_subvol=${_opt#*subvol=}
_subvol=${_subvol%,*}
_fsroot=${_fsroot#$_subvol}
fi
echo $_mnt$_fsroot$_path
}
# Return the current underlaying device of a path, ignore bind mounts
@ -256,9 +270,9 @@ is_mounted()
get_mount_info()
{
local _info_type=$1 _src_type=$2 _src=$3; shift 3
local _info=$(findmnt --real -k -n -r -o $_info_type --$_src_type $_src $@)
local _info=$(findmnt -k -n -r -o $_info_type --$_src_type $_src $@)
[ -z "$_info" ] && [ -e "/etc/fstab" ] && _info=$(findmnt --real -s -n -r -o $_info_type --$_src_type $_src $@)
[ -z "$_info" ] && [ -e "/etc/fstab" ] && _info=$(findmnt -s -n -r -o $_info_type --$_src_type $_src $@)
echo $_info
}
@ -455,28 +469,21 @@ get_ifcfg_filename() {
echo -n "${ifcfg_file}"
}
# returns 0 when omission of watchdog module is desired in dracut_args
# returns 0 when omission of a module is desired in dracut_args
# returns 1 otherwise
is_wdt_mod_omitted() {
local dracut_args
local ret=1
is_dracut_mod_omitted() {
local dracut_args dracut_mod=$1
dracut_args=$(grep "^dracut_args" /etc/kdump.conf)
[[ -z $dracut_args ]] && return $ret
set -- $(grep "^dracut_args" /etc/kdump.conf)
while [ $# -gt 0 ]; do
case $1 in
-o|--omit)
[[ " ${2//[^[:alnum:]]/ } " == *" $dracut_mod "* ]] && return 0
esac
shift
done
eval set -- $dracut_args
while :; do
[[ -z $1 ]] && break
case $1 in
-o|--omit)
echo $2 | grep -qw "watchdog"
[[ $? == 0 ]] && ret=0
break
esac
shift
done
return $ret
return 1
}
is_wdt_active() {
@ -744,6 +751,25 @@ prepare_kdump_bootinfo()
fi
}
get_watchdog_drvs()
{
local _wdtdrvs _drv _dir
for _dir in /sys/class/watchdog/*; do
# device/modalias will return driver of this device
[[ -f "$_dir/device/modalias" ]] || continue
_drv=$(< "$_dir/device/modalias")
_drv=$(modprobe --set-version "$KDUMP_KERNELVER" -R $_drv 2>/dev/null)
for i in $_drv; do
if ! [[ " $_wdtdrvs " == *" $i "* ]]; then
_wdtdrvs="$_wdtdrvs $i"
fi
done
done
echo $_wdtdrvs
}
#
# prepare_cmdline <commandline> <commandline remove> <commandline append>
# This function performs a series of edits on the command line.
@ -785,5 +811,21 @@ prepare_cmdline()
if [ ! -z ${id} ] ; then
cmdline=$(append_cmdline "${cmdline}" disable_cpu_apicid ${id})
fi
# If any watchdog is used, set it's pretimeout to 0. pretimeout let
# watchdog panic the kernel first, and reset the system after the
# panic. If the system is already in kdump, panic is not helpful
# and only increase the chance of watchdog failure.
for i in $(get_watchdog_drvs); do
cmdline+=" $i.pretimeout=0"
if [[ $i == hpwdt ]]; then
# hpwdt have a special parameter kdumptimeout, is's only suppose
# to be set to non-zero in first kernel. In kdump, non-zero
# value could prevent the watchdog from resetting the system.
cmdline+=" $i.kdumptimeout=0"
fi
done
echo ${cmdline}
}

182
kdumpctl
View File

@ -430,14 +430,54 @@ check_files_modified()
return 0
}
check_dump_fs_modified()
check_drivers_modified()
{
local _target _new_drivers _old_drivers _module_name _module_filename
# If it's dump target is on block device, detect the block driver
_target=$(get_block_dump_target)
if [[ -n "$_target" ]]; then
_record_block_drivers() {
local _drivers
_drivers=$(udevadm info -a "/dev/block/$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p')
for _driver in $_drivers; do
if ! [[ " $_new_drivers " == *" $_driver "* ]]; then
_new_drivers="$_new_drivers $_driver"
fi
done
ddebug "MAJ:MIN=$1 drivers='$_drivers'"
}
check_block_and_slaves_all _record_block_drivers "$(get_maj_min "$_target")"
fi
# Include watchdog drivers if watchdog module is not omitted
is_dracut_mod_omitted watchdog || _new_drivers+=" $(get_watchdog_drvs)"
[ -z "$_new_drivers" ] && return 0
_old_drivers="$(lsinitrd $TARGET_INITRD -f /usr/lib/dracut/hostonly-kernel-modules.txt | tr '\n' ' ')"
ddebug "Modules required for kdump: '$_new_drivers'"
ddebug "Modules included in old initramfs: '$_old_drivers'"
for _driver in $_new_drivers; do
# Skip deprecated/invalid driver name or built-in module
_module_name=$(modinfo --set-version "$KDUMP_KERNELVER" -F name $_driver 2>/dev/null)
_module_filename=$(modinfo --set-version "$KDUMP_KERNELVER" -n $_driver 2>/dev/null)
if [ $? -ne 0 ] || [ -z "$_module_name" ] || [[ "$_module_filename" = *"(builtin)"* ]]; then
continue
fi
if ! [[ " $_old_drivers " == *" $_module_name "* ]]; then
dinfo "Detected change in block device driver, new loaded module: $_module_name"
return 1
fi
done
}
check_fs_modified()
{
local _old_dev _old_mntpoint _old_fstype
local _new_dev _new_mntpoint _new_fstype
local _target _path _dracut_args
local _target_drivers _module_name _module_filename
local _old_drivers="$(lsinitrd $TARGET_INITRD -f /usr/lib/dracut/hostonly-kernel-modules.txt | tr '\n' ' ')"
local _target _dracut_args
# No need to check in case of mount target specified via "dracut_args".
if is_mount_in_dracut_args; then
@ -450,64 +490,18 @@ check_dump_fs_modified()
return 0
fi
_target=$(get_user_configured_dump_disk)
if [[ -n "$_target" ]]; then
_target=$(to_dev_name $_target)
_new_fstype=$(blkid $_target | awk -F"TYPE=" '{print $2}' | cut -d '"' -f 2)
else
_path=$(get_save_path)
_target=$(get_target_from_path $_path)
_target=$(to_dev_name $_target)
_new_fstype=$(get_fs_type_from_target $_target)
if [[ -z "$_target" || -z "$_new_fstype" ]];then
derror "Dump path $_path does not exist"
return 2
fi
_target=$(get_block_dump_target)
_new_fstype=$(get_fs_type_from_target $_target)
if [[ -z "$_target" ]] || [[ -z "$_new_fstype" ]];then
derror "Dump target is invalid"
return 2
fi
ddebug "_target=$_target _path=$_path _new_fstype=$_new_fstype"
_record_block_drivers() {
local _drivers
if [[ -b /dev/block/$1 ]]; then
_drivers=$(udevadm info -a "/dev/block/$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p')
fi
if [[ -b $1 ]]; then
_drivers=$(udevadm info -a "$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p')
fi
for _driver in $_drivers; do
if ! [[ " $_target_drivers " == *" $_driver "* ]]; then
_target_drivers="$_target_drivers $_driver"
fi
done
ddebug "MAJ:MIN=$1 _drivers=$_drivers _target_drivers=$_targer_drivers"
return 1
}
check_block_and_slaves_all _record_block_drivers "$(get_maj_min "$_target")"
for _driver in $_target_drivers; do
# Skip deprecated/invalid driver name or built-in module
_module_name=$(modinfo --set-version "$KDUMP_KERNELVER" -F name $_driver 2>/dev/null)
_module_filename=$(modinfo --set-version "$KDUMP_KERNELVER" -n $_driver 2>/dev/null)
if [ $? -ne 0 ] || [ -z "$_module_name" ] || [[ "$_module_filename" = *"(builtin)"* ]]; then
continue
fi
if ! [[ " $_old_drivers " == *" $_module_name "* ]]; then
dinfo "Detected change in block device driver, new loaded module: $_module_name"
return 1
fi
done
if [[ $(expr substr $_new_fstype 1 3) = "nfs" ]];then
_new_dev=$_target
else
_new_dev=$(kdump_get_persistent_dev $_target)
if [ -z "$_new_dev" ]; then
derror "Get persistent device name failed"
return 2
fi
ddebug "_target=$_target _new_fstype=$_new_fstype"
_new_dev=$(kdump_get_persistent_dev $_target)
if [ -z "$_new_dev" ]; then
perror "Get persistent device name failed"
return 2
fi
_new_mntpoint="$(get_kdump_mntpoint_from_target $_target)"
@ -535,62 +529,6 @@ check_dump_fs_modified()
return 1
}
check_wdt_modified()
{
local -A _drivers
local _alldrivers _active _wdtdrv _wdtppath _dir
local wd_old wd_new
is_wdt_mod_omitted
[[ $? -eq 0 ]] && return 0
[[ -d /sys/class/watchdog/ ]] || return 0
# Copied logic from dracut 04watchdog/module-setup.sh::installkernel()
for _dir in /sys/class/watchdog/*; do
[[ -d "$_dir" ]] || continue
[[ -f "$_dir/state" ]] || continue
_active=$(< "$_dir/state")
[[ "$_active" = "active" ]] || continue
# device/modalias will return driver of this device
_wdtdrv=$(< "$_dir/device/modalias")
# There can be more than one module represented by same
# modalias. Currently load all of them.
# TODO: Need to find a way to avoid any unwanted module
# represented by modalias
_wdtdrv=$(modprobe --set-version "$KDUMP_KERNELVER" -R $_wdtdrv 2>/dev/null)
if [[ $_wdtdrv ]]; then
for i in $_wdtdrv; do
_drivers[$i]=1
done
fi
# however in some cases, we also need to check that if there is
# a specific driver for the parent bus/device. In such cases
# we also need to enable driver for parent bus/device.
_wdtppath=$(readlink -f "$_dir/device")
while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do
_wdtppath=$(readlink -f "$_wdtppath/..")
[[ -f "$_wdtppath/modalias" ]] || continue
_wdtdrv=$(< "$_wdtppath/modalias")
_wdtdrv=$(modprobe --set-version "$KDUMP_KERNELVER" -R $_wdtdrv 2>/dev/null)
if [[ $_wdtdrv ]]; then
for i in $_wdtdrv; do
_drivers[$i]=1
done
fi
done
done
# ensure that watchdog module is loaded as early as possible
_alldrivers="${!_drivers[*]}"
[[ $_alldrivers ]] && wd_new="rd.driver.pre=${_alldrivers// /,}"
wd_old=$(lsinitrd $TARGET_INITRD -f etc/cmdline.d/00-watchdog.conf)
[[ "$wd_old" = "$wd_new" ]] && return 0
return 1
}
# returns 0 if system is not modified
# returns 1 if system is modified
# returns 2 if system modification is invalid
@ -606,16 +544,16 @@ check_system_modified()
return $ret
fi
check_dump_fs_modified
check_fs_modified
ret=$?
if [ $ret -ne 0 ]; then
return $ret
fi
check_wdt_modified
if [ $? -ne 0 ]; then
dinfo "Detected change in watchdog state"
return 1
check_drivers_modified
ret=$?
if [ $ret -ne 0 ]; then
return $ret
fi
return 0

View File

@ -1,255 +0,0 @@
From 989152e113bfcb4fbfbad6f3aed6f43be4455919 Mon Sep 17 00:00:00 2001
From: Kazuhito Hagio <k-hagio-ab@nec.com>
Date: Tue, 25 Feb 2020 16:04:55 -0500
Subject: [PATCH] Introduce --check-params option
Currently it's difficult to check whether a makedumpfile command-line
is valid or not without an actual panic. This is inefficient and if
a wrong configuration is not tested, you will miss the vmcore when an
actual panic occurs.
In order for kdump facilities like kexec-tools to be able to check
the specified command-line parameters in advance, introduce the
--check-params option that only checks them and exits immediately.
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
---
makedumpfile.8 | 5 ++++
makedumpfile.c | 75 ++++++++++++++++++++++++++++++++++++++------------
print_info.c | 4 +++
4 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/makedumpfile-1.6.7/makedumpfile.8 b/makedumpfile-1.6.7/makedumpfile.8
index bf156a8..c5d4806 100644
--- a/makedumpfile-1.6.7/makedumpfile.8
+++ b/makedumpfile-1.6.7/makedumpfile.8
@@ -632,6 +632,11 @@ Show help message and LZO/snappy support status (enabled/disabled).
\fB\-v\fR
Show the version of makedumpfile.
+.TP
+\fB\-\-check-params\fR
+Only check whether the command-line parameters are valid or not, and exit.
+Preferable to be given as the first parameter.
+
.SH ENVIRONMENT VARIABLES
.TP 8
diff --git a/makedumpfile-1.6.7/makedumpfile.c b/makedumpfile-1.6.7/makedumpfile.c
index 607e07f..f5860a1 100644
--- a/makedumpfile-1.6.7/makedumpfile.c
+++ b/makedumpfile-1.6.7/makedumpfile.c
@@ -10978,12 +10978,6 @@ check_param_for_creating_dumpfile(int argc, char *argv[])
if (info->flag_generate_vmcoreinfo || info->flag_rearrange)
return FALSE;
- if ((message_level < MIN_MSG_LEVEL)
- || (MAX_MSG_LEVEL < message_level)) {
- message_level = DEFAULT_MSG_LEVEL;
- MSG("Message_level is invalid.\n");
- return FALSE;
- }
if ((info->flag_compress && info->flag_elf_dumpfile)
|| (info->flag_read_vmcoreinfo && info->name_vmlinux)
|| (info->flag_read_vmcoreinfo && info->name_xen_syms))
@@ -11013,6 +11007,11 @@ check_param_for_creating_dumpfile(int argc, char *argv[])
if (info->flag_partial_dmesg && !info->flag_dmesg)
return FALSE;
+ if (info->flag_excludevm && !info->working_dir) {
+ MSG("-%c requires --work-dir\n", OPT_EXCLUDE_UNUSED_VM);
+ return FALSE;
+ }
+
if ((argc == optind + 2) && !info->flag_flatten
&& !info->flag_split
&& !info->flag_sadump_diskset) {
@@ -11408,6 +11407,23 @@ int show_mem_usage(void)
return TRUE;
}
+static int set_message_level(char *str_ml)
+{
+ int ml;
+
+ ml = atoi(str_ml);
+ if ((ml < MIN_MSG_LEVEL) || (MAX_MSG_LEVEL < ml)) {
+ message_level = DEFAULT_MSG_LEVEL;
+ MSG("Message_level(%d) is invalid.\n", ml);
+ return FALSE;
+ }
+
+ if (info->flag_check_params)
+ return TRUE;
+
+ message_level = ml;
+ return TRUE;
+}
static struct option longopts[] = {
{"split", no_argument, NULL, OPT_SPLIT},
@@ -11429,6 +11445,7 @@ static struct option longopts[] = {
{"splitblock-size", required_argument, NULL, OPT_SPLITBLOCK_SIZE},
{"work-dir", required_argument, NULL, OPT_WORKING_DIR},
{"num-threads", required_argument, NULL, OPT_NUM_THREADS},
+ {"check-params", no_argument, NULL, OPT_CHECK_PARAMS},
{0, 0, 0, 0}
};
@@ -11527,7 +11544,8 @@ main(int argc, char *argv[])
info->flag_compress = DUMP_DH_COMPRESSED_LZO;
break;
case OPT_MESSAGE_LEVEL:
- message_level = atoi(optarg);
+ if (!set_message_level(optarg))
+ goto out;
break;
case OPT_DUMP_DMESG:
info->flag_dmesg = 1;
@@ -11590,6 +11608,10 @@ main(int argc, char *argv[])
case OPT_NUM_THREADS:
info->num_threads = MAX(atoi(optarg), 0);
break;
+ case OPT_CHECK_PARAMS:
+ info->flag_check_params = TRUE;
+ message_level = DEFAULT_MSG_LEVEL;
+ break;
case '?':
MSG("Commandline parameter is invalid.\n");
MSG("Try `makedumpfile --help' for more information.\n");
@@ -11599,11 +11621,9 @@ main(int argc, char *argv[])
if (flag_debug)
message_level |= ML_PRINT_DEBUG_MSG;
- if (info->flag_excludevm && !info->working_dir) {
- ERRMSG("Error: -%c requires --work-dir\n", OPT_EXCLUDE_UNUSED_VM);
- ERRMSG("Try `makedumpfile --help' for more information\n");
- return COMPLETED;
- }
+ if (info->flag_check_params)
+ /* suppress debugging messages */
+ message_level = DEFAULT_MSG_LEVEL;
if (info->flag_show_usage) {
print_usage();
@@ -11634,6 +11654,9 @@ main(int argc, char *argv[])
MSG("Try `makedumpfile --help' for more information.\n");
goto out;
}
+ if (info->flag_check_params)
+ goto check_ok;
+
if (!open_files_for_generating_vmcoreinfo())
goto out;
@@ -11657,6 +11680,9 @@ main(int argc, char *argv[])
MSG("Try `makedumpfile --help' for more information.\n");
goto out;
}
+ if (info->flag_check_params)
+ goto check_ok;
+
if (!check_dump_file(info->name_dumpfile))
goto out;
@@ -11677,6 +11703,9 @@ main(int argc, char *argv[])
MSG("Try `makedumpfile --help' for more information.\n");
goto out;
}
+ if (info->flag_check_params)
+ goto check_ok;
+
if (!check_dump_file(info->name_dumpfile))
goto out;
@@ -11690,6 +11719,9 @@ main(int argc, char *argv[])
MSG("Try `makedumpfile --help' for more information.\n");
goto out;
}
+ if (info->flag_check_params)
+ goto check_ok;
+
if (!check_dump_file(info->name_dumpfile))
goto out;
if (!dump_dmesg())
@@ -11703,6 +11735,9 @@ main(int argc, char *argv[])
MSG("Try `makedumpfile --help' for more information.\n");
goto out;
}
+ if (info->flag_check_params)
+ goto check_ok;
+
if (!populate_kernel_version())
goto out;
@@ -11721,6 +11756,9 @@ main(int argc, char *argv[])
MSG("Try `makedumpfile --help' for more information.\n");
goto out;
}
+ if (info->flag_check_params)
+ goto check_ok;
+
if (info->flag_split) {
for (i = 0; i < info->num_dumpfile; i++) {
SPLITTING_FD_BITMAP(i) = -1;
@@ -11748,13 +11786,16 @@ main(int argc, char *argv[])
MSG("The dumpfile is saved to %s.\n", info->name_dumpfile);
}
}
+check_ok:
retcd = COMPLETED;
out:
- MSG("\n");
- if (retcd != COMPLETED)
- MSG("makedumpfile Failed.\n");
- else if (!info->flag_mem_usage)
- MSG("makedumpfile Completed.\n");
+ if (!info->flag_check_params) {
+ MSG("\n");
+ if (retcd != COMPLETED)
+ MSG("makedumpfile Failed.\n");
+ else if (!info->flag_mem_usage)
+ MSG("makedumpfile Completed.\n");
+ }
free_for_parallel();
diff --git a/makedumpfile-1.6.7/makedumpfile.h b/makedumpfile-1.6.7/makedumpfile.h
index 7217407..03fb4ce 100644
--- a/makedumpfile-1.6.7/makedumpfile.h
+++ b/makedumpfile-1.6.7/makedumpfile.h
@@ -1303,6 +1303,7 @@ struct DumpInfo {
int flag_read_vmcoreinfo; /* flag of reading vmcoreinfo file */
int flag_show_usage; /* flag of showing usage */
int flag_show_version; /* flag of showing version */
+ int flag_check_params; /* only check parameters */
int flag_flatten; /* flag of outputting flattened
format to a standard out */
int flag_rearrange; /* flag of creating dumpfile from
@@ -2364,6 +2365,7 @@ struct elf_prstatus {
#define OPT_WORKING_DIR OPT_START+15
#define OPT_NUM_THREADS OPT_START+16
#define OPT_PARTIAL_DMESG OPT_START+17
+#define OPT_CHECK_PARAMS OPT_START+18
/*
* Function Prototype.
diff --git a/makedumpfile-1.6.7/print_info.c b/makedumpfile-1.6.7/print_info.c
index 0be12ea..e0c38b4 100644
--- a/makedumpfile-1.6.7/print_info.c
+++ b/makedumpfile-1.6.7/print_info.c
@@ -321,6 +321,10 @@ print_usage(void)
MSG(" [-v]:\n");
MSG(" Show the version of makedumpfile.\n");
MSG("\n");
+ MSG(" [--check-params]:\n");
+ MSG(" Only check whether the command-line parameters are valid or not, and exit.\n");
+ MSG(" Preferable to be given as the first parameter.\n");
+ MSG("\n");
MSG(" VMLINUX:\n");
MSG(" This is a pathname to the first kernel's vmlinux.\n");
MSG(" This file must have the debug information of the first kernel to analyze\n");
--
2.24.1

View File

@ -1,76 +0,0 @@
From efa29d476996a20052be80878767cfe09e4b6224 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 29 Jan 2020 10:59:08 +0800
Subject: [PATCH] makedumpfile: Remove duplicated variable declarations
When building on Fedora 32, following error is observed:
/usr/bin/ld: erase_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:2010:
multiple definition of `crash_reserved_mem_nr'; elf_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:2010: first defined here
/usr/bin/ld: erase_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:2009:
multiple definition of `crash_reserved_mem'; elf_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:2009: first defined here
/usr/bin/ld: erase_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:1278:
multiple definition of `parallel_info_t'; elf_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:1278: first defined here
/usr/bin/ld: erase_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:1265:
multiple definition of `splitting_info_t'; elf_info.o:/builddir/build/BUILD/kexec-tools-2.0.20/makedumpfile-1.6.7/makedumpfile.h:1265: first defined here
And apparently, these variables are wrongly declared multiple times. So
remove duplicated declaration.
Signed-off-by: Kairui Song <kasong@redhat.com>
---
makedumpfile.c | 2 ++
makedumpfile.h | 10 ++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/makedumpfile.c b/makedumpfile.c
index e290fbd..9aad77b 100644
--- a/makedumpfile-1.6.7/makedumpfile.c
+++ b/makedumpfile-1.6.7/makedumpfile.c
@@ -34,6 +34,8 @@ struct array_table array_table;
struct number_table number_table;
struct srcfile_table srcfile_table;
struct save_control sc;
+struct parallel_info parallel_info_t;
+struct splitting_info splitting_info_t;
struct vm_table vt = { 0 };
struct DumpInfo *info = NULL;
diff --git a/makedumpfile.h b/makedumpfile.h
index 68d9691..614764c 100644
--- a/makedumpfile-1.6.7/makedumpfile.h
+++ b/makedumpfile-1.6.7/makedumpfile.h
@@ -1262,7 +1262,8 @@ struct splitting_info {
mdf_pfn_t end_pfn;
off_t offset_eraseinfo;
unsigned long size_eraseinfo;
-} splitting_info_t;
+};
+extern struct splitting_info splitting_info_t;
struct parallel_info {
int fd_memory;
@@ -1275,7 +1276,8 @@ struct parallel_info {
#ifdef USELZO
lzo_bytep wrkmem;
#endif
-} parallel_info_t;
+};
+extern struct parallel_info parallel_info_t;
struct ppc64_vmemmap {
unsigned long phys;
@@ -2006,8 +2008,8 @@ struct memory_range {
};
#define CRASH_RESERVED_MEM_NR 8
-struct memory_range crash_reserved_mem[CRASH_RESERVED_MEM_NR];
-int crash_reserved_mem_nr;
+extern struct memory_range crash_reserved_mem[CRASH_RESERVED_MEM_NR];
+extern int crash_reserved_mem_nr;
unsigned long read_vmcoreinfo_symbol(char *str_symbol);
int readmem(int type_addr, unsigned long long addr, void *bufptr, size_t size);
--
2.24.1

View File

@ -1,10 +1,11 @@
%global eppic_ver d84c3541035d95077aa8571f5d5c3e07c6ef510b
%global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7})
%global mkdf_ver 1.6.7
%global mkdf_ver 1.6.8
%global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7})
Name: kexec-tools
Version: 2.0.20
Release: 20%{?dist}
Release: 21%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@ -16,7 +17,7 @@ Source4: kdump.sysconfig.i386
Source5: kdump.sysconfig.ppc64
Source7: mkdumprd
Source8: kdump.conf
Source9: http://downloads.sourceforge.net/project/makedumpfile/makedumpfile/%{mkdf_ver}/makedumpfile-%{mkdf_ver}.tar.gz
Source9: https://github.com/makedumpfile/makedumpfile/archive/%{mkdf_ver}/makedumpfile-%{mkdf_shortver}.tar.gz
Source10: kexec-kdump-howto.txt
Source11: fadump-howto.txt
Source12: mkdumprd.8
@ -100,9 +101,7 @@ Patch0: kexec-tools-2.0.20-fix-broken-multiboot2-buliding-for-i386.patch
# Patches 601 onward are generic patches
#
Patch601: ./kexec-tools-2.0.20-eppic-Remove-duplicated-variable-declaration.patch
Patch602: ./kexec-tools-2.0.20-makedumpfile-Remove-duplicated-variable-declarations.patch
Patch603: ./kexec-tools-2.0.20-Remove-duplicated-variable-declarations.patch
Patch604: ./kexec-tools-2.0.20-makedumpfile-Introduce-check-params-option.patch
Patch602: ./kexec-tools-2.0.20-Remove-duplicated-variable-declarations.patch
%description
kexec-tools provides /sbin/kexec binary that facilitates a new
@ -122,8 +121,6 @@ tar -z -x -v -f %{SOURCE19}
%patch601 -p1
%patch602 -p1
%patch603 -p1
%patch604 -p1
%ifarch ppc
%define archdef ARCH=ppc
@ -362,6 +359,19 @@ done
%endif
%changelog
* Mon Nov 30 2020 Kairui Song <kasong@redhat.com> - 2.0.20-21
- Rebase makedumpfile to 1.6.8
- fadump-howto: update about 'nocma' and 'off' options for 'fadump=' parameter
- module-setup.sh: enable vlan on team interface
- kdump-lib: Fix get_bind_mount_source to support btrfs and fstab
- Make get_mount_info work with bind mount
- Set watchdog's pretimeout to zero in kdump kernel
- kdump-lib.sh: Use a more generic helper to detect omitted dracut module
- Fix the watchdog drivers detection code
- Add a helper for detecting watchdog drivers
- Remove a redundant nfs check
- kdumpctl: split the driver detection from fs dection function
* Thu Nov 19 2020 Kairui Song <kasong@redhat.com> - 2.0.20-20
- selftest: Fix several test issue with Fedora 33
- selftest: add more detailed log and fix a test failure issue

View File

@ -1,3 +1,3 @@
SHA512 (eppic-d84c354.tar.gz) = 455b3386c3e4cc546b858f1f8b0e6874072aaae708ebe072452fb5f0b6a81b1f3a315b40f94c3967f38525cadd276864a7bc7f0f12fa421655dcc3b15b70914d
SHA512 (kexec-tools-2.0.20.tar.xz) = 3112b6202c1030705c53e3f65a2b58aec14d65333a35aad681d48b9f2bd1c51a2e05c985a1e5e867ab02f8a9c97708483d9d225619db7c6993676f1a242e2d99
SHA512 (makedumpfile-1.6.7.tar.gz) = fdd78bfea5f96eda094269480ebbceead6ae8d9d2bb1184ffa1e18c6effda5c6df296fbcecc25735109194c0690d6f9ca684c37da1825d7d65568ba18a71a940
SHA512 (makedumpfile-1.6.8.tar.gz) = 15e60688b06013bf86e339ec855774ea2c904d425371ea867101704ba0611c69da891eb3cc96f67eb10197d8c42d217ea28bf11bcaa93ddc2495cbf984c0b7ec