On 05/13/19 at 02:20pm, Kairui Song wrote:
Previously only the symlink's timestamp is used for checking if file are modified, this will not trigger a rebuild if the symlink target it modified.
So check both symlink timestamp and symlink target timestamp, rebuild the initramfs on both symlink changed and target changed.
Also give a proper error message if the file doesn't exist.
Signed-off-by: Kairui Song kasong@redhat.com
kdumpctl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 75eebac..739f162 100755 --- a/kdumpctl +++ b/kdumpctl @@ -338,11 +338,23 @@ check_files_modified() [ $? -ne 0 ] && return 2
for file in $files; do
time_stamp=`stat -c "%Y" $file`if [ "$time_stamp" -gt "$image_time" ]; thenmodified_files="$modified_files $file"
if [ -e "$file" ]; thentime_stamp=`stat -c "%Y" $file`if [ "$time_stamp" -gt "$image_time" ]; thenmodified_files="$modified_files $file"fiif [ -L "$file" ]; thenfile=$(readlink -m $file)time_stamp=`stat -c "%Y" $file`if [ "$time_stamp" -gt "$image_time" ]; thenmodified_files="$modified_files $file"fifielse fi doneecho "$file doesn't exist"- if [ -n "$modified_files" ]; then echo "Detected change(s) in the following file(s):" echo -n " "; echo "$modified_files" | sed 's/\s/\n /g'
-- 2.20.1
Good catch!
Acked-by: Dave Young dyoung@redhat.com
Thanks Dave