blob: 95ff5e6ef84acd3a6f1e12d65d66586cc8f6827d [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001
2SUMMARY = "Kexec fast reboot tools"
3DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel"
4AUTHOR = "Eric Biederman"
5HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/"
6SECTION = "kernel/userland"
7LICENSE = "GPLv2"
8LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \
9 file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09"
10DEPENDS = "zlib xz"
11
12SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
13 file://kdump \
14 file://kdump.conf \
15 file://kdump.service \
16 file://0001-powerpc-change-the-memory-size-limit.patch \
17 file://0002-purgatory-Pass-r-directly-to-linker.patch \
18 file://0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 file://0005-Disable-PIE-during-link.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050020 file://0007-kexec-un-break-the-build-on-32-bit-x86.patch \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060021 file://0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060022 file://0001-kexec-arch-ppc-kexec-ppc.c-correct-double-definition.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050023 "
24
William A. Kennington IIIac69b482021-06-02 12:28:27 -070025SRC_URI[sha256sum] = "40623d4321be2865ef9ea2cd6ec998d31dcf93d0f74353cbd3aa06d8821e3e41"
Andrew Geissler82c905d2020-04-13 13:39:40 -050026
27inherit autotools update-rc.d systemd
28
29export LDFLAGS = "-L${STAGING_LIBDIR}"
30EXTRA_OECONF = " --with-zlib=yes"
31
Patrick Williams213cb262021-08-07 19:21:33 -050032do_compile:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050033 # Remove the prepackaged config.h from the source tree as it overrides
34 # the same file generated by configure and placed in the build tree
35 rm -f ${S}/include/config.h
36
37 # Remove the '*.d' file to make sure the recompile is OK
38 for dep in `find ${B} -type f -name '*.d'`; do
39 dep_no_d="`echo $dep | sed 's#.d$##'`"
40 # Remove file.d when there is a file.o
41 if [ -f "$dep_no_d.o" ]; then
42 rm -f $dep
43 fi
44 done
45}
46
Patrick Williams213cb262021-08-07 19:21:33 -050047do_install:append () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050048 install -d ${D}${sysconfdir}/sysconfig
49 install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig
50
51 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
52 install -D -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
53 fi
54
55 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
56 install -D -m 0755 ${WORKDIR}/kdump ${D}${libexecdir}/kdump-helper
Andrew Geissler5199d832021-09-24 16:47:35 -050057 install -D -m 0644 ${WORKDIR}/kdump.service ${D}${systemd_system_unitdir}/kdump.service
58 sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_system_unitdir}/kdump.service
Andrew Geissler82c905d2020-04-13 13:39:40 -050059 fi
60}
61
62PACKAGES =+ "kexec kdump vmcore-dmesg"
63
Patrick Williams213cb262021-08-07 19:21:33 -050064ALLOW_EMPTY:${PN} = "1"
65RRECOMMENDS:${PN} = "kexec kdump vmcore-dmesg"
Andrew Geissler82c905d2020-04-13 13:39:40 -050066
Patrick Williams213cb262021-08-07 19:21:33 -050067FILES:kexec = "${sbindir}/kexec"
68FILES:kdump = "${sbindir}/kdump \
Andrew Geissler82c905d2020-04-13 13:39:40 -050069 ${sysconfdir}/sysconfig/kdump.conf \
70 ${sysconfdir}/init.d/kdump \
71 ${libexecdir}/kdump-helper \
Andrew Geissler5199d832021-09-24 16:47:35 -050072 ${systemd_system_unitdir}/kdump.service \
Andrew Geissler82c905d2020-04-13 13:39:40 -050073"
74
Patrick Williams213cb262021-08-07 19:21:33 -050075FILES:vmcore-dmesg = "${sbindir}/vmcore-dmesg"
Andrew Geissler82c905d2020-04-13 13:39:40 -050076
77INITSCRIPT_PACKAGES = "kdump"
Patrick Williams213cb262021-08-07 19:21:33 -050078INITSCRIPT_NAME:kdump = "kdump"
79INITSCRIPT_PARAMS:kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ."
Andrew Geissler82c905d2020-04-13 13:39:40 -050080
81SYSTEMD_PACKAGES = "kdump"
Patrick Williams213cb262021-08-07 19:21:33 -050082SYSTEMD_SERVICE:kdump = "kdump.service"
Andrew Geissler82c905d2020-04-13 13:39:40 -050083
Patrick Williams213cb262021-08-07 19:21:33 -050084SECURITY_PIE_CFLAGS:remove = "-fPIE -pie"
Andrew Geissler82c905d2020-04-13 13:39:40 -050085
86COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'
87
Patrick Williams213cb262021-08-07 19:21:33 -050088INSANE_SKIP:${PN} = "arch"