xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-kernel/kexec/kexec-tools_2.0.23.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun
2*4882a593SmuzhiyunSUMMARY = "Kexec fast reboot tools"
3*4882a593SmuzhiyunDESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel"
4*4882a593SmuzhiyunAUTHOR = "Eric Biederman"
5*4882a593SmuzhiyunHOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/"
6*4882a593SmuzhiyunSECTION = "kernel/userland"
7*4882a593SmuzhiyunLICENSE = "GPL-2.0-only"
8*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \
9*4882a593Smuzhiyun                    file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09"
10*4882a593SmuzhiyunDEPENDS = "zlib xz"
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunSRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
13*4882a593Smuzhiyun           file://kdump \
14*4882a593Smuzhiyun           file://kdump.conf \
15*4882a593Smuzhiyun           file://kdump.service \
16*4882a593Smuzhiyun           file://0001-powerpc-change-the-memory-size-limit.patch \
17*4882a593Smuzhiyun           file://0002-purgatory-Pass-r-directly-to-linker.patch \
18*4882a593Smuzhiyun           file://0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \
19*4882a593Smuzhiyun           file://0005-Disable-PIE-during-link.patch \
20*4882a593Smuzhiyun           file://0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch \
21*4882a593Smuzhiyun           "
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunSRC_URI[sha256sum] = "c7dcc59f5b66004d9d91264324e20e0387ea263dbb449708fbf84a4e5ff7decc"
24*4882a593Smuzhiyun
25*4882a593Smuzhiyuninherit autotools update-rc.d systemd
26*4882a593Smuzhiyun
27*4882a593Smuzhiyunexport LDFLAGS = "-L${STAGING_LIBDIR}"
28*4882a593SmuzhiyunEXTRA_OECONF = " --with-zlib=yes"
29*4882a593Smuzhiyun
30*4882a593Smuzhiyundo_compile:prepend() {
31*4882a593Smuzhiyun    # Remove the prepackaged config.h from the source tree as it overrides
32*4882a593Smuzhiyun    # the same file generated by configure and placed in the build tree
33*4882a593Smuzhiyun    rm -f ${S}/include/config.h
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun    # Remove the '*.d' file to make sure the recompile is OK
36*4882a593Smuzhiyun    for dep in `find ${B} -type f -name '*.d'`; do
37*4882a593Smuzhiyun        dep_no_d="`echo $dep | sed 's#.d$##'`"
38*4882a593Smuzhiyun        # Remove file.d when there is a file.o
39*4882a593Smuzhiyun        if [ -f "$dep_no_d.o" ]; then
40*4882a593Smuzhiyun            rm -f $dep
41*4882a593Smuzhiyun        fi
42*4882a593Smuzhiyun    done
43*4882a593Smuzhiyun}
44*4882a593Smuzhiyun
45*4882a593Smuzhiyundo_install:append () {
46*4882a593Smuzhiyun        install -d ${D}${sysconfdir}/sysconfig
47*4882a593Smuzhiyun        install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun        if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
50*4882a593Smuzhiyun                install -D -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
51*4882a593Smuzhiyun        fi
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun        if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
54*4882a593Smuzhiyun                install -D -m 0755 ${WORKDIR}/kdump ${D}${libexecdir}/kdump-helper
55*4882a593Smuzhiyun                install -D -m 0644 ${WORKDIR}/kdump.service ${D}${systemd_system_unitdir}/kdump.service
56*4882a593Smuzhiyun                sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_system_unitdir}/kdump.service
57*4882a593Smuzhiyun        fi
58*4882a593Smuzhiyun}
59*4882a593Smuzhiyun
60*4882a593SmuzhiyunPACKAGES =+ "kexec kdump vmcore-dmesg"
61*4882a593Smuzhiyun
62*4882a593SmuzhiyunALLOW_EMPTY:${PN} = "1"
63*4882a593SmuzhiyunRRECOMMENDS:${PN} = "kexec kdump vmcore-dmesg"
64*4882a593Smuzhiyun
65*4882a593SmuzhiyunFILES:kexec = "${sbindir}/kexec"
66*4882a593SmuzhiyunFILES:kdump = "${sbindir}/kdump \
67*4882a593Smuzhiyun               ${sysconfdir}/sysconfig/kdump.conf \
68*4882a593Smuzhiyun               ${sysconfdir}/init.d/kdump \
69*4882a593Smuzhiyun               ${libexecdir}/kdump-helper \
70*4882a593Smuzhiyun               ${systemd_system_unitdir}/kdump.service \
71*4882a593Smuzhiyun"
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunFILES:vmcore-dmesg = "${sbindir}/vmcore-dmesg"
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunINITSCRIPT_PACKAGES = "kdump"
76*4882a593SmuzhiyunINITSCRIPT_NAME:kdump = "kdump"
77*4882a593SmuzhiyunINITSCRIPT_PARAMS:kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ."
78*4882a593Smuzhiyun
79*4882a593SmuzhiyunSYSTEMD_PACKAGES = "kdump"
80*4882a593SmuzhiyunSYSTEMD_SERVICE:kdump = "kdump.service"
81*4882a593Smuzhiyun
82*4882a593SmuzhiyunSECURITY_PIE_CFLAGS:remove = "-fPIE -pie"
83*4882a593Smuzhiyun
84*4882a593SmuzhiyunCOMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'
85*4882a593Smuzhiyun
86*4882a593SmuzhiyunINSANE_SKIP:${PN} = "arch"
87