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" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 6 | LICENSE = "GPL-2.0-only" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ |
| 8 | file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 9 | PV = "2.0.18+git${SRCPV}" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 10 | |
| 11 | DEPENDS = "zlib xz" |
| 12 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 13 | inherit klibc autotools siteinfo |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 14 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 15 | SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git;branch=master" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | SRCREV = "5750980cdbbc33ef75bfba6660295b932376ce15" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 34 | file://0015-vmcore-dmesg-fix-warning.patch \ |
Andrew Geissler | ac970dd | 2021-02-12 15:32:45 -0600 | [diff] [blame] | 35 | file://klibc-reboot.patch \ |
| 36 | file://include_next.patch \ |
| 37 | " |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 38 | |
| 39 | WARNING_FIXES = "" |
| 40 | FROM_OE_CORE = "file://arm_crashdump-fix-buffer-align.patch \ |
| 41 | file://powerpc_change-the-memory-size-limit.patch \ |
| 42 | file://kexec-x32.patch" |
| 43 | |
| 44 | SRC_URI += "${BUILD_PATCHES} ${KLIBC_PATCHES} ${WARNING_FIXES} ${FROM_OE_CORE}" |
| 45 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 46 | SRC_URI:append:arm = " file://arm_crashdump.patch" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 47 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 48 | SRC_URI:append:mips = " file://140-mips_disable_devicetree_support.patch" |
| 49 | SRC_URI:append:mipsel = " file://140-mips_disable_devicetree_support.patch" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 50 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 51 | SRC_URI:append:x86 = " file://x86_sys_io.patch file://x86_basename.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 52 | file://x86_vfscanf.patch file://x86_kexec_test.patch" |
| 53 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 54 | SRC_URI:append:x86-64 = " file://x86_sys_io.patch file://x86_basename.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 55 | file://x86_vfscanf.patch file://x86_kexec_test.patch" |
| 56 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 57 | SRC_URI:append:aarch64 = " file://arm64_kexec-image-header.h-add-missing-le64toh.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 58 | file://arm64-crashdump-arm64.c-fix-warning.patch \ |
| 59 | file://arm64_kexec-arm64.c-workaround-for-getrandom-syscall.patch" |
| 60 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 61 | SRC_URI:append:powerpc = " file://powerpc-purgatory-Makefile-remove-unknown-flags.patch" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 62 | |
| 63 | S = "${WORKDIR}/git" |
| 64 | |
| 65 | EXTRA_OECONF += "--without-zlib --without-lzma --without-xen" |
| 66 | |
| 67 | # fix purgatory/printf.c:2:10: fatal error: limits.h: No such file or directory |
| 68 | # fix include/limits.h:42:10: fatal error: bitsize/limits.h: No such file or directory |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 69 | CFLAGS += "-O2 -I${STAGING_DIR_HOST}${libdir}/klibc/include -I${S}/purgatory/include \ |
| 70 | -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits${SITEINFO_BITS}" |
Andrew Geissler | 1548c07 | 2019-02-22 16:03:50 -0600 | [diff] [blame] | 71 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | do_compile:prepend() { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 73 | # Remove the prepackaged config.h from the source tree as it overrides |
| 74 | # the same file generated by configure and placed in the build tree |
| 75 | rm -f ${S}/include/config.h |
| 76 | |
| 77 | # Remove the '*.d' file to make sure the recompile is OK |
| 78 | for dep in `find ${B} -type f -name '*.d'`; do |
| 79 | dep_no_d="`echo $dep | sed 's#.d$##'`" |
| 80 | # Remove file.d when there is a file.o |
| 81 | if [ -f "$dep_no_d.o" ]; then |
| 82 | rm -f $dep |
| 83 | fi |
| 84 | done |
| 85 | } |
| 86 | |
| 87 | PACKAGES =+ "kexec-klibc vmcore-dmesg-klibc" |
| 88 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 89 | FILES:kexec-klibc = "${sbindir}/kexec" |
| 90 | FILES:vmcore-dmesg-klibc = "${sbindir}/vmcore-dmesg" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 91 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 92 | INSANE_SKIP:${PN} = "arch" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 93 | |
| 94 | COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)' |