blob: 363cdb9adfc751342f3812dfee787aba1ca5717f [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001# the binaries are statically linked against klibc
2SUMMARY = "Kexec tools, statically compiled against klibc"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08003HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/"
4SECTION = "kernel/userland"
Andrew Geissler9aee5002022-03-30 16:27:02 +00005LICENSE = "GPL-2.0-only"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08006LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \
7 file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09"
Patrick Williams73bd93f2024-02-20 08:07:48 -06008PV = "2.0.18+git"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08009
10DEPENDS = "zlib xz"
11
Andrew Geissler32b11992021-03-31 13:37:05 -050012inherit klibc autotools siteinfo
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080013
Andrew Geissler595f6302022-01-24 19:11:47 +000014SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git;branch=master"
Brad Bishop19323692019-04-05 15:28:33 -040015SRCREV = "5750980cdbbc33ef75bfba6660295b932376ce15"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080016
17BUILD_PATCHES = "file://0001-force-static-build.patch \
Patrick Williams73bd93f2024-02-20 08:07:48 -060018 file://0002-Adjust-the-order-of-headers-to-fix-build-for-musl.patch \
19 file://Fix-building-on-x86_64-with-binutils-2.41.patch \
20 "
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021
22KLIBC_PATCHES += " \
23 file://0003-kexec-elf-rel-use-our-elf.h.patch \
24 file://0004-kexec-elf-exec.c-replace-with-our-err.h.patch \
25 file://0005-crashdump-elf.c-work-around-for-sysconf-_SC_NPROCESS.patch \
26 file://0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch \
27 file://0007-kexec.c-add-guard-around-ENOTSUP.patch \
28 file://0008-kexec.c-replace-mising-BLKGETSIZE64.patch \
29 file://0009-vmcore-dmesg.c-work-around-missing-imaxdiv.patch \
30 file://0010-fs2dt.c-work-around-missing-getline.patch \
31 file://0011-purgatory-Makefile-adapt-to-klcc.patch \
32 file://0012-purgatory-string.c-avoid-inclusion-of-string.h.patch \
33 file://0013-sha256.h-avoid-inclusion-of-sys-types.h.patch \
34 file://0014-add-if_nameindex-from-musl.patch \
Brad Bishop19323692019-04-05 15:28:33 -040035 file://0015-vmcore-dmesg-fix-warning.patch \
Andrew Geisslerac970dd2021-02-12 15:32:45 -060036 file://klibc-reboot.patch \
37 file://include_next.patch \
38 "
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039
40WARNING_FIXES = ""
41FROM_OE_CORE = "file://arm_crashdump-fix-buffer-align.patch \
42 file://powerpc_change-the-memory-size-limit.patch \
43 file://kexec-x32.patch"
44
45SRC_URI += "${BUILD_PATCHES} ${KLIBC_PATCHES} ${WARNING_FIXES} ${FROM_OE_CORE}"
46
Patrick Williams213cb262021-08-07 19:21:33 -050047SRC_URI:append:arm = " file://arm_crashdump.patch"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080048
Patrick Williams213cb262021-08-07 19:21:33 -050049SRC_URI:append:mips = " file://140-mips_disable_devicetree_support.patch"
50SRC_URI:append:mipsel = " file://140-mips_disable_devicetree_support.patch"
Brad Bishop19323692019-04-05 15:28:33 -040051
Patrick Williams213cb262021-08-07 19:21:33 -050052SRC_URI:append:x86 = " file://x86_sys_io.patch file://x86_basename.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080053 file://x86_vfscanf.patch file://x86_kexec_test.patch"
54
Patrick Williams213cb262021-08-07 19:21:33 -050055SRC_URI:append:x86-64 = " file://x86_sys_io.patch file://x86_basename.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080056 file://x86_vfscanf.patch file://x86_kexec_test.patch"
57
Patrick Williams213cb262021-08-07 19:21:33 -050058SRC_URI:append:aarch64 = " file://arm64_kexec-image-header.h-add-missing-le64toh.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080059 file://arm64-crashdump-arm64.c-fix-warning.patch \
60 file://arm64_kexec-arm64.c-workaround-for-getrandom-syscall.patch"
61
Patrick Williams213cb262021-08-07 19:21:33 -050062SRC_URI:append:powerpc = " file://powerpc-purgatory-Makefile-remove-unknown-flags.patch"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080063
64S = "${WORKDIR}/git"
65
66EXTRA_OECONF += "--without-zlib --without-lzma --without-xen"
67
68# fix purgatory/printf.c:2:10: fatal error: limits.h: No such file or directory
69# fix include/limits.h:42:10: fatal error: bitsize/limits.h: No such file or directory
Andrew Geissler32b11992021-03-31 13:37:05 -050070CFLAGS += "-O2 -I${STAGING_DIR_HOST}${libdir}/klibc/include -I${S}/purgatory/include \
71 -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits${SITEINFO_BITS}"
Andrew Geissler1548c072019-02-22 16:03:50 -060072
Patrick Williams213cb262021-08-07 19:21:33 -050073do_compile:prepend() {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080074 # Remove the prepackaged config.h from the source tree as it overrides
75 # the same file generated by configure and placed in the build tree
76 rm -f ${S}/include/config.h
77
78 # Remove the '*.d' file to make sure the recompile is OK
79 for dep in `find ${B} -type f -name '*.d'`; do
80 dep_no_d="`echo $dep | sed 's#.d$##'`"
81 # Remove file.d when there is a file.o
82 if [ -f "$dep_no_d.o" ]; then
83 rm -f $dep
84 fi
85 done
86}
87
88PACKAGES =+ "kexec-klibc vmcore-dmesg-klibc"
89
Patrick Williams213cb262021-08-07 19:21:33 -050090FILES:kexec-klibc = "${sbindir}/kexec"
91FILES:vmcore-dmesg-klibc = "${sbindir}/vmcore-dmesg"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080092
Patrick Williams213cb262021-08-07 19:21:33 -050093INSANE_SKIP:${PN} = "arch"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080094
95COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'