diff options
| -rw-r--r-- | meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch | 34 | ||||
| -rw-r--r-- | meta/recipes-kernel/kexec/kexec-tools_2.0.9.bb (renamed from meta/recipes-kernel/kexec/kexec-tools_2.0.8.bb) | 4 |
2 files changed, 2 insertions, 36 deletions
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch index ab1fe96db2..8bb4fc49ad 100644 --- a/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch +++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch | |||
| @@ -46,37 +46,3 @@ index 4121c7d..cc04b04 100644 | |||
| 46 | 46 | ||
| 47 | return strcmp(str1, str2); | 47 | return strcmp(str1, str2); |
| 48 | } | 48 | } |
| 49 | diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c | ||
| 50 | index 5e6b98d..1c0345b 100644 | ||
| 51 | --- a/kexec/fs2dt.c | ||
| 52 | +++ b/kexec/fs2dt.c | ||
| 53 | @@ -475,6 +475,9 @@ static int comparefunc(const struct dirent **dentry1, | ||
| 54 | { | ||
| 55 | char *str1 = (*(struct dirent **)dentry1)->d_name; | ||
| 56 | char *str2 = (*(struct dirent **)dentry2)->d_name; | ||
| 57 | + char* ptr1 = strchr(str1, '@'); | ||
| 58 | + char* ptr2 = strchr(str2, '@'); | ||
| 59 | + int len1, len2; | ||
| 60 | |||
| 61 | /* | ||
| 62 | * strcmp scans from left to right and fails to idetify for some | ||
| 63 | @@ -482,9 +485,13 @@ static int comparefunc(const struct dirent **dentry1, | ||
| 64 | * Therefore, we get the wrong sorted order like memory@10000000 and | ||
| 65 | * memory@f000000. | ||
| 66 | */ | ||
| 67 | - if (strchr(str1, '@') && strchr(str2, '@') && | ||
| 68 | - (strlen(str1) > strlen(str2))) | ||
| 69 | - return 1; | ||
| 70 | + if (ptr1 && ptr2) { | ||
| 71 | + len1 = ptr1 - str1; | ||
| 72 | + len2 = ptr2 - str2; | ||
| 73 | + if (!strncmp(str1, str2, len1 >len2 ? len1: len2) && | ||
| 74 | + (strlen(str1) > strlen(str2))) | ||
| 75 | + return 1; | ||
| 76 | + } | ||
| 77 | |||
| 78 | return strcmp(str1, str2); | ||
| 79 | } | ||
| 80 | -- | ||
| 81 | 1.7.9.5 | ||
| 82 | |||
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.8.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.9.bb index c478732300..c0c27279e4 100644 --- a/meta/recipes-kernel/kexec/kexec-tools_2.0.8.bb +++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.9.bb | |||
| @@ -6,8 +6,8 @@ SRC_URI += "file://kexec-tools-Refine-kdump-device_tree-sort.patch \ | |||
| 6 | file://kexec-aarch64.patch \ | 6 | file://kexec-aarch64.patch \ |
| 7 | " | 7 | " |
| 8 | 8 | ||
| 9 | SRC_URI[md5sum] = "45bd2bc676ae202579e4c185563126af" | 9 | SRC_URI[md5sum] = "4ecb7ab7ad9eb6ce413899bdb07a8426" |
| 10 | SRC_URI[sha256sum] = "95083c707577154a2241c5af0985f1eb3412d1ba208ef91813e9158b0a901179" | 10 | SRC_URI[sha256sum] = "c2c6d204fe0911ebd304c40100163237feca4c5a854a2cca382ee36916a573d8" |
| 11 | 11 | ||
| 12 | PACKAGES =+ "kexec kdump vmcore-dmesg" | 12 | PACKAGES =+ "kexec kdump vmcore-dmesg" |
| 13 | 13 | ||
