* Re: [oe-commits] Chong Lu : kexec-tools: Refine kdump device_tree sort [not found] <20140613113218.C57E750446@opal.openembedded.org> @ 2014-06-15 22:56 ` Martin Jansa 2014-06-16 3:02 ` Chong Lu 0 siblings, 1 reply; 2+ messages in thread From: Martin Jansa @ 2014-06-15 22:56 UTC (permalink / raw) To: openembedded-core; +Cc: openembedded-commits [-- Attachment #1: Type: text/plain, Size: 5807 bytes --] FYI: this will probably break meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb because it doesn't have kexec-tools directory in FILESPATH WARNING: Unable to get checksum for kexec-tools-klibc SRC_URI entry kexec-tools-Refine-kdump-device_tree-sort.patch: file could not be found On Fri, Jun 13, 2014 at 11:32:18AM +0000, git@git.openembedded.org wrote: > Module: openembedded-core.git > Branch: master > Commit: c8722b510f779cd20757477a7f7a7a2a35b9a9c5 > URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=c8722b510f779cd20757477a7f7a7a2a35b9a9c5 > > Author: Chong Lu <Chong.Lu@windriver.com> > Date: Tue Jun 10 18:13:39 2014 +0800 > > kexec-tools: Refine kdump device_tree sort > > The commit b02d735bf was to rearrange the device-tree entries, and > assumed that these entries are sorted in the ascending order. but > acctually when I was validating kexec and kdump, the order of > serial node still is changed. So the patch is to sort these entries > by the directory name in ascending order. > > Signed-off-by: Yang Wei <Wei.Yang@windriver.com> > Signed-off-by: Chong Lu <Chong.Lu@windriver.com> > Signed-off-by: Saul Wold <sgw@linux.intel.com> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> > > --- > > meta/recipes-kernel/kexec/kexec-tools.inc | 3 +- > ...kexec-tools-Refine-kdump-device_tree-sort.patch | 82 ++++++++++++++++++++++ > 2 files changed, 84 insertions(+), 1 deletion(-) > > diff --git a/meta/recipes-kernel/kexec/kexec-tools.inc b/meta/recipes-kernel/kexec/kexec-tools.inc > index 50b448c..6a690c6 100644 > --- a/meta/recipes-kernel/kexec/kexec-tools.inc > +++ b/meta/recipes-kernel/kexec/kexec-tools.inc > @@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ > file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09" > DEPENDS = "zlib xz" > > -SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz" > +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \ > + file://kexec-tools-Refine-kdump-device_tree-sort.patch" > > inherit autotools-brokensep > > 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 > new file mode 100644 > index 0000000..ab1fe96 > --- /dev/null > +++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch > @@ -0,0 +1,82 @@ > +kexec-tools: Refine kdump device_tree sort > + > +The commit b02d735bf was to rearrange the device-tree entries, and > +assumed that these entries are sorted in the ascending order. but > +acctually when I was validating kexec and kdump, the order of > +serial node still is changed. So the patch is to sort these entries > +by the directory name in ascending order. > + > +Upstream-Status: Pending > + > +Signed-off-by: Yang Wei <Wei.Yang@windriver.com> > +Signed-off-by: Chong Lu <Chong.Lu@windriver.com> > +--- > + kexec/arch/ppc/fs2dt.c | 13 ++++++++++--- > + kexec/fs2dt.c | 13 ++++++++++--- > + 2 files changed, 20 insertions(+), 6 deletions(-) > + > +diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c > +index 4121c7d..cc04b04 100644 > +--- a/kexec/arch/ppc/fs2dt.c > ++++ b/kexec/arch/ppc/fs2dt.c > +@@ -296,6 +296,9 @@ static int comparefunc(const void *dentry1, const void *dentry2) > + { > + char *str1 = (*(struct dirent **)dentry1)->d_name; > + char *str2 = (*(struct dirent **)dentry2)->d_name; > ++ char* ptr1 = strchr(str1, '@'); > ++ char* ptr2 = strchr(str2, '@'); > ++ int len1, len2; > + > + /* > + * strcmp scans from left to right and fails to idetify for some > +@@ -303,9 +306,13 @@ static int comparefunc(const void *dentry1, const void *dentry2) > + * Therefore, we get the wrong sorted order like memory@10000000 and > + * memory@f000000. > + */ > +- if (strchr(str1, '@') && strchr(str2, '@') && > +- (strlen(str1) > strlen(str2))) > +- return 1; > ++ if (ptr1 && ptr2) { > ++ len1 = ptr1 - str1; > ++ len2 = ptr2 - str2; > ++ if (!strncmp(str1, str2, len1 >len2 ? len1: len2) && > ++ (strlen(str1) > strlen(str2))) > ++ return 1; > ++ } > + > + return strcmp(str1, str2); > + } > +diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c > +index 5e6b98d..1c0345b 100644 > +--- a/kexec/fs2dt.c > ++++ b/kexec/fs2dt.c > +@@ -475,6 +475,9 @@ static int comparefunc(const struct dirent **dentry1, > + { > + char *str1 = (*(struct dirent **)dentry1)->d_name; > + char *str2 = (*(struct dirent **)dentry2)->d_name; > ++ char* ptr1 = strchr(str1, '@'); > ++ char* ptr2 = strchr(str2, '@'); > ++ int len1, len2; > + > + /* > + * strcmp scans from left to right and fails to idetify for some > +@@ -482,9 +485,13 @@ static int comparefunc(const struct dirent **dentry1, > + * Therefore, we get the wrong sorted order like memory@10000000 and > + * memory@f000000. > + */ > +- if (strchr(str1, '@') && strchr(str2, '@') && > +- (strlen(str1) > strlen(str2))) > +- return 1; > ++ if (ptr1 && ptr2) { > ++ len1 = ptr1 - str1; > ++ len2 = ptr2 - str2; > ++ if (!strncmp(str1, str2, len1 >len2 ? len1: len2) && > ++ (strlen(str1) > strlen(str2))) > ++ return 1; > ++ } > + > + return strcmp(str1, str2); > + } > +-- > +1.7.9.5 > + > > -- > _______________________________________________ > Openembedded-commits mailing list > Openembedded-commits@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-commits -- Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 188 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [oe-commits] Chong Lu : kexec-tools: Refine kdump device_tree sort 2014-06-15 22:56 ` [oe-commits] Chong Lu : kexec-tools: Refine kdump device_tree sort Martin Jansa @ 2014-06-16 3:02 ` Chong Lu 0 siblings, 0 replies; 2+ messages in thread From: Chong Lu @ 2014-06-16 3:02 UTC (permalink / raw) To: Martin Jansa, openembedded-core; +Cc: openembedded-commits [-- Attachment #1: Type: text/plain, Size: 6016 bytes --] On 06/16/2014 06:56 AM, Martin Jansa wrote: > FYI: this will probably break > meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb > > because it doesn't have kexec-tools directory in FILESPATH > > WARNING: Unable to get checksum for kexec-tools-klibc SRC_URI entry > kexec-tools-Refine-kdump-device_tree-sort.patch: file could not be found OK, I will send a new patch to fix this issue. Best Regards Chong > > On Fri, Jun 13, 2014 at 11:32:18AM +0000, git@git.openembedded.org wrote: >> Module: openembedded-core.git >> Branch: master >> Commit: c8722b510f779cd20757477a7f7a7a2a35b9a9c5 >> URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=c8722b510f779cd20757477a7f7a7a2a35b9a9c5 >> >> Author: Chong Lu <Chong.Lu@windriver.com> >> Date: Tue Jun 10 18:13:39 2014 +0800 >> >> kexec-tools: Refine kdump device_tree sort >> >> The commit b02d735bf was to rearrange the device-tree entries, and >> assumed that these entries are sorted in the ascending order. but >> acctually when I was validating kexec and kdump, the order of >> serial node still is changed. So the patch is to sort these entries >> by the directory name in ascending order. >> >> Signed-off-by: Yang Wei <Wei.Yang@windriver.com> >> Signed-off-by: Chong Lu <Chong.Lu@windriver.com> >> Signed-off-by: Saul Wold <sgw@linux.intel.com> >> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> >> >> --- >> >> meta/recipes-kernel/kexec/kexec-tools.inc | 3 +- >> ...kexec-tools-Refine-kdump-device_tree-sort.patch | 82 ++++++++++++++++++++++ >> 2 files changed, 84 insertions(+), 1 deletion(-) >> >> diff --git a/meta/recipes-kernel/kexec/kexec-tools.inc b/meta/recipes-kernel/kexec/kexec-tools.inc >> index 50b448c..6a690c6 100644 >> --- a/meta/recipes-kernel/kexec/kexec-tools.inc >> +++ b/meta/recipes-kernel/kexec/kexec-tools.inc >> @@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ >> file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09" >> DEPENDS = "zlib xz" >> >> -SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz" >> +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \ >> + file://kexec-tools-Refine-kdump-device_tree-sort.patch" >> >> inherit autotools-brokensep >> >> 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 >> new file mode 100644 >> index 0000000..ab1fe96 >> --- /dev/null >> +++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch >> @@ -0,0 +1,82 @@ >> +kexec-tools: Refine kdump device_tree sort >> + >> +The commit b02d735bf was to rearrange the device-tree entries, and >> +assumed that these entries are sorted in the ascending order. but >> +acctually when I was validating kexec and kdump, the order of >> +serial node still is changed. So the patch is to sort these entries >> +by the directory name in ascending order. >> + >> +Upstream-Status: Pending >> + >> +Signed-off-by: Yang Wei <Wei.Yang@windriver.com> >> +Signed-off-by: Chong Lu <Chong.Lu@windriver.com> >> +--- >> + kexec/arch/ppc/fs2dt.c | 13 ++++++++++--- >> + kexec/fs2dt.c | 13 ++++++++++--- >> + 2 files changed, 20 insertions(+), 6 deletions(-) >> + >> +diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c >> +index 4121c7d..cc04b04 100644 >> +--- a/kexec/arch/ppc/fs2dt.c >> ++++ b/kexec/arch/ppc/fs2dt.c >> +@@ -296,6 +296,9 @@ static int comparefunc(const void *dentry1, const void *dentry2) >> + { >> + char *str1 = (*(struct dirent **)dentry1)->d_name; >> + char *str2 = (*(struct dirent **)dentry2)->d_name; >> ++ char* ptr1 = strchr(str1, '@'); >> ++ char* ptr2 = strchr(str2, '@'); >> ++ int len1, len2; >> + >> + /* >> + * strcmp scans from left to right and fails to idetify for some >> +@@ -303,9 +306,13 @@ static int comparefunc(const void *dentry1, const void *dentry2) >> + * Therefore, we get the wrong sorted order like memory@10000000 and >> + * memory@f000000. >> + */ >> +- if (strchr(str1, '@') && strchr(str2, '@') && >> +- (strlen(str1) > strlen(str2))) >> +- return 1; >> ++ if (ptr1 && ptr2) { >> ++ len1 = ptr1 - str1; >> ++ len2 = ptr2 - str2; >> ++ if (!strncmp(str1, str2, len1 >len2 ? len1: len2) && >> ++ (strlen(str1) > strlen(str2))) >> ++ return 1; >> ++ } >> + >> + return strcmp(str1, str2); >> + } >> +diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c >> +index 5e6b98d..1c0345b 100644 >> +--- a/kexec/fs2dt.c >> ++++ b/kexec/fs2dt.c >> +@@ -475,6 +475,9 @@ static int comparefunc(const struct dirent **dentry1, >> + { >> + char *str1 = (*(struct dirent **)dentry1)->d_name; >> + char *str2 = (*(struct dirent **)dentry2)->d_name; >> ++ char* ptr1 = strchr(str1, '@'); >> ++ char* ptr2 = strchr(str2, '@'); >> ++ int len1, len2; >> + >> + /* >> + * strcmp scans from left to right and fails to idetify for some >> +@@ -482,9 +485,13 @@ static int comparefunc(const struct dirent **dentry1, >> + * Therefore, we get the wrong sorted order like memory@10000000 and >> + * memory@f000000. >> + */ >> +- if (strchr(str1, '@') && strchr(str2, '@') && >> +- (strlen(str1) > strlen(str2))) >> +- return 1; >> ++ if (ptr1 && ptr2) { >> ++ len1 = ptr1 - str1; >> ++ len2 = ptr2 - str2; >> ++ if (!strncmp(str1, str2, len1 >len2 ? len1: len2) && >> ++ (strlen(str1) > strlen(str2))) >> ++ return 1; >> ++ } >> + >> + return strcmp(str1, str2); >> + } >> +-- >> +1.7.9.5 >> + >> >> -- >> _______________________________________________ >> Openembedded-commits mailing list >> Openembedded-commits@lists.openembedded.org >> http://lists.openembedded.org/mailman/listinfo/openembedded-commits > > [-- Attachment #2: Type: text/html, Size: 7681 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-16 3:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20140613113218.C57E750446@opal.openembedded.org>
2014-06-15 22:56 ` [oe-commits] Chong Lu : kexec-tools: Refine kdump device_tree sort Martin Jansa
2014-06-16 3:02 ` Chong Lu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox