Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | |
| 2 | SUMMARY = "Kexec fast reboot tools" |
| 3 | DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel" |
| 4 | AUTHOR = "Eric Biederman" |
| 5 | HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/" |
| 6 | SECTION = "kernel/userland" |
| 7 | LICENSE = "GPLv2" |
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ |
| 9 | file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09" |
| 10 | DEPENDS = "zlib xz" |
| 11 | |
| 12 | SRC_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 Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 19 | file://0004-x86_64-Add-support-to-build-kexec-tools-with-x32-ABI.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | file://0005-Disable-PIE-during-link.patch \ |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 21 | file://0006-kexec-arm-undefine-__NR_kexec_file_load-for-arm.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 22 | file://0007-kexec-un-break-the-build-on-32-bit-x86.patch \ |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 23 | file://0001-kexec-Fix-build-with-fno-common.patch \ |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 24 | file://0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 25 | " |
| 26 | |
Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 27 | SRC_URI[md5sum] = "46724b67f32501c5d3e778161347cad9" |
| 28 | SRC_URI[sha256sum] = "cb16d79818e0c9de3bb3e33ede5677c34a1d28c646379c7ab44e0faa3eb57a16" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 29 | |
| 30 | inherit autotools update-rc.d systemd |
| 31 | |
| 32 | export LDFLAGS = "-L${STAGING_LIBDIR}" |
| 33 | EXTRA_OECONF = " --with-zlib=yes" |
| 34 | |
| 35 | do_compile_prepend() { |
| 36 | # Remove the prepackaged config.h from the source tree as it overrides |
| 37 | # the same file generated by configure and placed in the build tree |
| 38 | rm -f ${S}/include/config.h |
| 39 | |
| 40 | # Remove the '*.d' file to make sure the recompile is OK |
| 41 | for dep in `find ${B} -type f -name '*.d'`; do |
| 42 | dep_no_d="`echo $dep | sed 's#.d$##'`" |
| 43 | # Remove file.d when there is a file.o |
| 44 | if [ -f "$dep_no_d.o" ]; then |
| 45 | rm -f $dep |
| 46 | fi |
| 47 | done |
| 48 | } |
| 49 | |
| 50 | do_install_append () { |
| 51 | install -d ${D}${sysconfdir}/sysconfig |
| 52 | install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig |
| 53 | |
| 54 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 55 | install -D -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump |
| 56 | fi |
| 57 | |
| 58 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 59 | install -D -m 0755 ${WORKDIR}/kdump ${D}${libexecdir}/kdump-helper |
| 60 | install -D -m 0644 ${WORKDIR}/kdump.service ${D}${systemd_unitdir}/system/kdump.service |
| 61 | sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_unitdir}/system/kdump.service |
| 62 | fi |
| 63 | } |
| 64 | |
| 65 | PACKAGES =+ "kexec kdump vmcore-dmesg" |
| 66 | |
| 67 | ALLOW_EMPTY_${PN} = "1" |
| 68 | RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg" |
| 69 | |
| 70 | FILES_kexec = "${sbindir}/kexec" |
| 71 | FILES_kdump = "${sbindir}/kdump \ |
| 72 | ${sysconfdir}/sysconfig/kdump.conf \ |
| 73 | ${sysconfdir}/init.d/kdump \ |
| 74 | ${libexecdir}/kdump-helper \ |
| 75 | ${systemd_unitdir}/system/kdump.service \ |
| 76 | " |
| 77 | |
| 78 | FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg" |
| 79 | |
| 80 | INITSCRIPT_PACKAGES = "kdump" |
| 81 | INITSCRIPT_NAME_kdump = "kdump" |
| 82 | INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ." |
| 83 | |
| 84 | SYSTEMD_PACKAGES = "kdump" |
| 85 | SYSTEMD_SERVICE_kdump = "kdump.service" |
| 86 | |
| 87 | SECURITY_PIE_CFLAGS_remove = "-fPIE -pie" |
| 88 | |
| 89 | COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)' |
| 90 | |
| 91 | INSANE_SKIP_${PN} = "arch" |