Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | # the binaries are statically linked against klibc |
| 2 | SUMMARY = "Kexec tools, statically compiled against klibc" |
| 3 | AUTHOR = "Eric Biederman" |
| 4 | HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/" |
| 5 | SECTION = "kernel/userland" |
| 6 | LICENSE = "GPLv2" |
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ |
| 8 | file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09" |
| 9 | PV = "2.0.17+git${SRCPV}" |
| 10 | |
| 11 | DEPENDS = "zlib xz" |
| 12 | |
| 13 | inherit klibc autotools |
| 14 | |
| 15 | SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git" |
| 16 | SRCREV = "b9de21ef51a7ceab7122a707c188602eae22c4ee" |
| 17 | |
| 18 | BUILD_PATCHES = "file://0001-force-static-build.patch \ |
| 19 | file://0002-Adjust-the-order-of-headers-to-fix-build-for-musl.patch" |
| 20 | |
| 21 | KLIBC_PATCHES += " \ |
| 22 | file://0003-kexec-elf-rel-use-our-elf.h.patch \ |
| 23 | file://0004-kexec-elf-exec.c-replace-with-our-err.h.patch \ |
| 24 | file://0005-crashdump-elf.c-work-around-for-sysconf-_SC_NPROCESS.patch \ |
| 25 | file://0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch \ |
| 26 | file://0007-kexec.c-add-guard-around-ENOTSUP.patch \ |
| 27 | file://0008-kexec.c-replace-mising-BLKGETSIZE64.patch \ |
| 28 | file://0009-vmcore-dmesg.c-work-around-missing-imaxdiv.patch \ |
| 29 | file://0010-fs2dt.c-work-around-missing-getline.patch \ |
| 30 | file://0011-purgatory-Makefile-adapt-to-klcc.patch \ |
| 31 | file://0012-purgatory-string.c-avoid-inclusion-of-string.h.patch \ |
| 32 | file://0013-sha256.h-avoid-inclusion-of-sys-types.h.patch \ |
| 33 | file://0014-add-if_nameindex-from-musl.patch \ |
| 34 | file://0015-vmcore-dmesg-fix-warning.patch" |
| 35 | |
| 36 | WARNING_FIXES = "" |
| 37 | FROM_OE_CORE = "file://arm_crashdump-fix-buffer-align.patch \ |
| 38 | file://powerpc_change-the-memory-size-limit.patch \ |
| 39 | file://kexec-x32.patch" |
| 40 | |
| 41 | SRC_URI += "${BUILD_PATCHES} ${KLIBC_PATCHES} ${WARNING_FIXES} ${FROM_OE_CORE}" |
| 42 | |
| 43 | SRC_URI_append_arm = " file://arm_crashdump.patch" |
| 44 | |
| 45 | SRC_URI_append_x86 = " file://x86_sys_io.patch file://x86_basename.patch \ |
| 46 | file://x86_vfscanf.patch file://x86_kexec_test.patch" |
| 47 | |
| 48 | SRC_URI_append_x86-64 = " file://x86_sys_io.patch file://x86_basename.patch \ |
| 49 | file://x86_vfscanf.patch file://x86_kexec_test.patch" |
| 50 | |
| 51 | SRC_URI_append_aarch64 = " file://arm64_kexec-image-header.h-add-missing-le64toh.patch \ |
| 52 | file://arm64-crashdump-arm64.c-fix-warning.patch \ |
| 53 | file://arm64_kexec-arm64.c-workaround-for-getrandom-syscall.patch" |
| 54 | |
| 55 | SRC_URI_append_powerpc = " file://powerpc-purgatory-Makefile-remove-unknown-flags.patch" |
| 56 | |
| 57 | S = "${WORKDIR}/git" |
| 58 | |
| 59 | EXTRA_OECONF += "--without-zlib --without-lzma --without-xen" |
| 60 | |
| 61 | # fix purgatory/printf.c:2:10: fatal error: limits.h: No such file or directory |
| 62 | # fix include/limits.h:42:10: fatal error: bitsize/limits.h: No such file or directory |
| 63 | COMMON_CFLAGS += "-O2 -I${STAGING_DIR_HOST}${libdir}/klibc/include -I${S}/purgatory/include" |
| 64 | CFLAGS_x86_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" |
| 65 | CFLAGS_x86-64_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits64" |
| 66 | CFLAGS_arm_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" |
| 67 | CFLAGS_aarch64_append = "${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits64" |
| 68 | CFLAGS_mips_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" |
Andrew Geissler | 1548c07 | 2019-02-22 16:03:50 -0600 | [diff] [blame^] | 69 | CFLAGS_mipsel_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 70 | CFLAGS_mips64_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits64" |
Andrew Geissler | 1548c07 | 2019-02-22 16:03:50 -0600 | [diff] [blame^] | 71 | CFLAGS_mips64el_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits64" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 72 | CFLAGS_powerpc_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" |
| 73 | |
Andrew Geissler | 1548c07 | 2019-02-22 16:03:50 -0600 | [diff] [blame^] | 74 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 75 | do_compile_prepend() { |
| 76 | # Remove the prepackaged config.h from the source tree as it overrides |
| 77 | # the same file generated by configure and placed in the build tree |
| 78 | rm -f ${S}/include/config.h |
| 79 | |
| 80 | # Remove the '*.d' file to make sure the recompile is OK |
| 81 | for dep in `find ${B} -type f -name '*.d'`; do |
| 82 | dep_no_d="`echo $dep | sed 's#.d$##'`" |
| 83 | # Remove file.d when there is a file.o |
| 84 | if [ -f "$dep_no_d.o" ]; then |
| 85 | rm -f $dep |
| 86 | fi |
| 87 | done |
| 88 | } |
| 89 | |
| 90 | PACKAGES =+ "kexec-klibc vmcore-dmesg-klibc" |
| 91 | |
| 92 | FILES_kexec-klibc = "${sbindir}/kexec" |
| 93 | FILES_vmcore-dmesg-klibc = "${sbindir}/vmcore-dmesg" |
| 94 | |
| 95 | INSANE_SKIP_${PN} = "arch" |
| 96 | |
| 97 | COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)' |