kdump: kdumpctl: sort cores in chronic order
Google-Bug-Id: 317372429
Change-Id: Iab00e32f67909910c349334cf96467c7ac465a96
Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
(cherry picked from commit bf1c017adcba85ed063e89ecf153355f93ceab21)
diff --git a/recipes-google/kdump-core/files/kdumpctl b/recipes-google/kdump-core/files/kdumpctl
index 75179e7..3981195 100644
--- a/recipes-google/kdump-core/files/kdumpctl
+++ b/recipes-google/kdump-core/files/kdumpctl
@@ -8,15 +8,14 @@
exit 1
}
-shopt -s nullglob
exec 2>/dev/null
ram_dir='/run/log/kdump'
emmc_dir='/mnt/luks-mmcblk0_fs/kdump'
function list_core(){
- ls -A1 $emmc_dir | grep 'kcore'
- ls -A1 $ram_dir | grep 'kcore'
+ ls -tA1 $ram_dir | grep 'kcore'
+ ls -tA1 $emmc_dir | grep 'kcore'
return 0
}
@@ -61,8 +60,8 @@
# Internal Command
function list_core_path(){
- echo $emmc_dir/*
- echo $ram_dir/*
+ ls -tA1 $ram_dir/* | grep 'kcore'
+ ls -tA1 $emmc_dir/* | grep 'kcore'
return 0
}