On Thursday 31 August 2017 08:10 AM, Xunlei Pang wrote:
On 08/29/2017 at 09:45 PM, Hari Bathini wrote:
> As default initrd is used for booting fadump capture kernel, it must be
> rebuilt with dump capture capability when dump mode is fadump. Check if
> default initrd is already fadump capable and rebuild, if necessary.
>
> Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
> ---
>
> * Using `lsinitrd -f` over `lsinitrd -m`, to find if kdumpbase module
> is included, as it is observed to take only about half the time.
>
>
> kdumpctl | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/kdumpctl b/kdumpctl
> index b7a3105..f69a5f0 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -6,6 +6,7 @@ KDUMP_COMMANDLINE=""
> KEXEC_ARGS=""
> KDUMP_CONFIG_FILE="/etc/kdump.conf"
> MKDUMPRD="/sbin/mkdumprd -f"
> +DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
> SAVE_PATH=/var/crash
> SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
> INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
> @@ -693,6 +694,7 @@ check_system_modified()
> check_rebuild()
> {
> local extra_modules
> + local capture_capable_initrd="1"
> local _force_rebuild force_rebuild="0"
> local _force_no_rebuild force_no_rebuild="0"
> local ret system_modified="0"
> @@ -747,6 +749,12 @@ check_rebuild()
> #since last build of the image file
> if [ -f $TARGET_INITRD ]; then
> image_time=`stat -c "%Y" $TARGET_INITRD 2>/dev/null`
> +
> + #in case of fadump mode, check whether the default/target
> + #initrd is already built with dump capture capability
> + if [ "$DEFAULT_DUMP_MODE" == "fadump" ]; then
> + capture_capable_initrd=`lsinitrd -f $DRACUT_MODULES_FILE $TARGET_INITRD | grep
^kdumpbase$ | wc -l`
It's better to use $(..) instead of the deprecated `..`, otherwise:
Reviewed-by: Xunlei Pang <xlpang(a)redhat.com>
Thanks for the review.
Posted v2 with the suggested change.
- Hari