dracut-kdump.sh: Use stat instead of ls to get vmcore size
ls output is fragile, so use stat instead. Signed-off-by: Kairui Song <kasong@redhat.com> Acked-by: Philipp Rudo <prudo@redhat.com>
This commit is contained in:
parent
7a9823b42e
commit
b1c794a2cf
@ -366,7 +366,7 @@ dump_raw()
|
||||
dinfo "saving to raw disk $_raw"
|
||||
|
||||
if ! $(echo -n $CORE_COLLECTOR|grep -q makedumpfile); then
|
||||
_src_size=`ls -l /proc/vmcore | cut -d' ' -f5`
|
||||
_src_size=$(stat --format %s /proc/vmcore)
|
||||
_src_size_mb=$(($_src_size / 1048576))
|
||||
/kdumpscripts/monitor_dd_progress $_src_size_mb &
|
||||
fi
|
||||
|
@ -1029,6 +1029,7 @@ install() {
|
||||
inst "/bin/head" "/bin/head"
|
||||
inst "/bin/awk" "/bin/awk"
|
||||
inst "/bin/sed" "/bin/sed"
|
||||
inst "/bin/stat" "/bin/stat"
|
||||
inst "/sbin/makedumpfile" "/sbin/makedumpfile"
|
||||
inst "/sbin/vmcore-dmesg" "/sbin/vmcore-dmesg"
|
||||
inst "/usr/bin/printf" "/sbin/printf"
|
||||
|
Loading…
Reference in New Issue
Block a user