Hi Dave,
On 20/04/2016:10:14:35 AM, Dave Young wrote:
On 04/18/16 at 03:23pm, Pratyush Anand wrote:
> Relevant kdump files are also part of system. Therefore, moving logic of
> file modification checking in is_system_modified() function now.
>
> Signed-off-by: Pratyush Anand <panand(a)redhat.com>
> ---
> kdumpctl | 65 ++++++++++++++++++++++++++++++++++++++++------------------------
> 1 file changed, 41 insertions(+), 24 deletions(-)
>
> diff --git a/kdumpctl b/kdumpctl
> index 64dc92da605b..8ef11501342b 100755
> --- a/kdumpctl
> +++ b/kdumpctl
> @@ -327,19 +327,59 @@ setup_target_initrd()
> fi
> }
>
> +is_files_modified()
> +{
> + local modified_files=""
> +
> + #also rebuild when Pacemaker cluster conf is changed and fence kdump is enabled.
> + modified_files=$(get_pcs_cluster_modified_files $image_time)
> +
> + EXTRA_BINS=`grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2`
> + CHECK_FILES=`grep ^kdump_pre $KDUMP_CONFIG_FILE | cut -d\ -f2`
> + EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
> + CHECK_FILES=`grep ^extra_bins $KDUMP_CONFIG_FILE | cut -d\ -f2-`
> + EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
> + files="$KDUMP_CONFIG_FILE $kdump_kernel $EXTRA_BINS /etc/fstab"
> +
> + check_exist "$files" && check_executable
"$EXTRA_BINS"
> + [ $? -ne 0 ] && return 2
> +
> + for file in $files; do
> + time_stamp=`stat -c "%Y" $file`
> + if [ "$time_stamp" -gt "$image_time" ]; then
Since we use image_time in both this function and check_rebuild, how about
add a global var in the head of the file or passing it as an argument?
Oh..I introduced a bug in my patch and did not notice.
Sure, will correct it. Will use it as a global variable.
Thanks for pointing it out.
~Pratyush