blob: 4b9b5accb6c46c6ae6f66fcf2fd32d6f5e44b8ac [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001
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://0002-powerpc-change-the-memory-size-limit.patch \
17 file://0001-purgatory-Pass-r-directly-to-linker.patch \
18 file://0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \
19 file://kexec-x32.patch \
20 file://0001-Disable-PIE-during-link.patch \
21 file://0001-kexec-fix-for-Unhandled-rela-relocation-R_X86_64_PLT.patch \
22 "
23
24SRC_URI[md5sum] = "8e071ca473694a71e4ae60ed7ef6f377"
25SRC_URI[sha256sum] = "450c87ba048641eb05f9717f5567aca57f063c266149ae663b58a34e5852deaf"
26
27inherit autotools update-rc.d systemd
28
29export LDFLAGS = "-L${STAGING_LIBDIR}"
30EXTRA_OECONF = " --with-zlib=yes"
31
32do_compile_prepend() {
33 # 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
47do_install_append () {
48 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
57 install -D -m 0644 ${WORKDIR}/kdump.service ${D}${systemd_unitdir}/system/kdump.service
58 sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_unitdir}/system/kdump.service
59 fi
60}
61
62PACKAGES =+ "kexec kdump vmcore-dmesg"
63
64ALLOW_EMPTY_${PN} = "1"
65RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg"
66
67FILES_kexec = "${sbindir}/kexec"
68FILES_kdump = "${sbindir}/kdump \
69 ${sysconfdir}/sysconfig/kdump.conf \
70 ${sysconfdir}/init.d/kdump \
71 ${libexecdir}/kdump-helper \
72 ${systemd_unitdir}/system/kdump.service \
73"
74
75FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg"
76
77INITSCRIPT_PACKAGES = "kdump"
78INITSCRIPT_NAME_kdump = "kdump"
79INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ."
80
81SYSTEMD_PACKAGES = "kdump"
82SYSTEMD_SERVICE_kdump = "kdump.service"
83
84SECURITY_PIE_CFLAGS_remove = "-fPIE -pie"
85
86COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'
87
88INSANE_SKIP_${PN} = "arch"