From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- meta/recipes-kernel/kexec/kexec-tools.inc | 28 ++++++++ ...kexec-tools-Refine-kdump-device_tree-sort.patch | 82 ++++++++++++++++++++++ meta/recipes-kernel/kexec/kexec-tools_2.0.7.bb | 17 +++++ 3 files changed, 127 insertions(+) create mode 100644 meta/recipes-kernel/kexec/kexec-tools.inc create mode 100644 meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch create mode 100644 meta/recipes-kernel/kexec/kexec-tools_2.0.7.bb (limited to 'meta/recipes-kernel/kexec') diff --git a/meta/recipes-kernel/kexec/kexec-tools.inc b/meta/recipes-kernel/kexec/kexec-tools.inc new file mode 100644 index 0000000000..7e3b7adfc7 --- /dev/null +++ b/meta/recipes-kernel/kexec/kexec-tools.inc @@ -0,0 +1,28 @@ +SUMMARY = "Kexec fast reboot tools" +DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel" +AUTHOR = "Eric Biederman" +HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/" +SECTION = "kernel/userland" +LICENSE = "GPLv2" +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" + +inherit autotools-brokensep + +COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|powerpc.*|mips.*)-(linux|freebsd.*)' + +INSANE_SKIP_${PN} = "arch" + +do_compile_prepend() { + # Remove the '*.d' file to make sure the recompile is OK + for dep in `find ${B} -type f -name '*.d'`; do + dep_no_d="`echo $dep | sed 's#.d$##'`" + # Remove file.d when there is a file.o + if [ -f "$dep_no_d.o" ]; then + rm -f $dep + fi + done +} 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 0000000000..ab1fe96db2 --- /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 +Signed-off-by: Chong Lu +--- + 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 + diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.7.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.7.bb new file mode 100644 index 0000000000..f0ece0d45b --- /dev/null +++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.7.bb @@ -0,0 +1,17 @@ +require kexec-tools.inc +export LDFLAGS = "-L${STAGING_LIBDIR}" +EXTRA_OECONF = " --with-zlib=yes" + +SRC_URI += "file://kexec-tools-Refine-kdump-device_tree-sort.patch" + +SRC_URI[md5sum] = "2309ba43981cb6d39d07ac3a9aac30ab" +SRC_URI[sha256sum] = "dde5c38be39882c6c91f0129647349c4e1943b077d3020af1970b481ee954eb0" + +PACKAGES =+ "kexec kdump vmcore-dmesg" + +ALLOW_EMPTY_${PN} = "1" +RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg" + +FILES_kexec = "${sbindir}/kexec" +FILES_kdump = "${sbindir}/kdump" +FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg" -- cgit v1.2.3-54-g00ecf