summaryrefslogtreecommitdiff
path: root/import-layers/yocto-poky/meta/recipes-kernel/kexec
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-kernel/kexec')
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools.inc1
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-arm64-Disable-PIC.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service12
-rw-r--r--import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb27
5 files changed, 97 insertions, 5 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools.inc b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools.inc
index bdfe024a7..c689bec1f 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools.inc
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools.inc
@@ -11,6 +11,7 @@ DEPENDS = "zlib xz"
SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
file://kdump \
file://kdump.conf \
+ file://kdump.service \
"
PR = "r1"
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch
new file mode 100644
index 000000000..3f2f85e33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch
@@ -0,0 +1,31 @@
+From ea7be6d71b85880e8e8a2c8a4f49a696c5f31ae4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 11:18:49 -0700
+Subject: [PATCH] Disable PIE during link
+
+We have explcitly disabled PIE during compile so we
+just need to match it with linker flags
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ purgatory/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/purgatory/Makefile b/purgatory/Makefile
+index 564bdb7..a08e41f 100644
+--- a/purgatory/Makefile
++++ b/purgatory/Makefile
+@@ -59,7 +59,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+ -Iinclude \
+ -I$(shell $(CC) -print-file-name=include)
+ $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
+- -Wl,--no-undefined -nostartfiles -nostdlib \
++ -Wl,--no-undefined -no-pie -nostartfiles -nostdlib \
+ -nodefaultlibs -e purgatory_start -Wl,-r \
+ -Wl,-Map=$(PURGATORY_MAP)
+
+--
+2.13.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-arm64-Disable-PIC.patch b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-arm64-Disable-PIC.patch
new file mode 100644
index 000000000..84e94d7d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/0001-arm64-Disable-PIC.patch
@@ -0,0 +1,31 @@
+From 3bb73e5e5649b455e15d5ca3a7ad1a90c4960972 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 11:54:36 -0700
+Subject: [PATCH] arm64: Disable PIC
+
+Fix
+| cc1: sorry, unimplemented: code model 'large' with -fPIC
+| make: *** [Makefile:118: purgatory/arch/arm64/entry.o] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ purgatory/arch/arm64/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/purgatory/arch/arm64/Makefile b/purgatory/arch/arm64/Makefile
+index 636abea..80068ca 100644
+--- a/purgatory/arch/arm64/Makefile
++++ b/purgatory/arch/arm64/Makefile
+@@ -1,6 +1,7 @@
+
+ arm64_PURGATORY_EXTRA_CFLAGS = \
+ -mcmodel=large \
++ -fno-PIC \
+ -fno-stack-protector \
+ -fno-asynchronous-unwind-tables \
+ -Wundef \
+--
+2.13.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service
new file mode 100644
index 000000000..4e65a46ac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Reboot and dump vmcore via kexec
+DefaultDependencies=no
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@LIBEXECDIR@/kdump-helper start
+ExecStop=@LIBEXECDIR@/kdump-helper stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb
index 90d598580..0f6398f13 100644
--- a/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb
+++ b/import-layers/yocto-poky/meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb
@@ -19,30 +19,47 @@ SRC_URI += "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.g
file://0001-x86-x86_64-Fix-format-warning-with-die.patch \
file://0002-ppc-Fix-format-warning-with-die.patch \
file://kexec-x32.patch \
+ file://0001-Disable-PIE-during-link.patch \
+ file://0001-arm64-Disable-PIC.patch \
"
SRC_URI[md5sum] = "b2b2c5e6b29d467d6e99d587fb6b7cf5"
SRC_URI[sha256sum] = "b3e69519d2acced256843b1e8f1ecfa00d9b54fa07449ed78f05b9193f239370"
+SECURITY_PIE_CFLAGS_remove = "-fPIE -pie"
+
PACKAGES =+ "kexec kdump vmcore-dmesg"
ALLOW_EMPTY_${PN} = "1"
RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg"
FILES_kexec = "${sbindir}/kexec"
-FILES_kdump = "${sbindir}/kdump ${sysconfdir}/init.d/kdump \
- ${sysconfdir}/sysconfig/kdump.conf"
+FILES_kdump = "${sbindir}/kdump \
+ ${sysconfdir}/sysconfig/kdump.conf \
+ ${sysconfdir}/init.d/kdump \
+ ${libexecdir}/kdump-helper \
+ ${systemd_unitdir}/system/kdump.service \
+"
+
FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg"
-inherit update-rc.d
+inherit update-rc.d systemd
INITSCRIPT_PACKAGES = "kdump"
INITSCRIPT_NAME_kdump = "kdump"
INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ."
do_install_append () {
- install -d ${D}${sysconfdir}/init.d
- install -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
install -d ${D}${sysconfdir}/sysconfig
install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -D -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -D -m 0755 ${WORKDIR}/kdump ${D}${libexecdir}/kdump-helper
+ install -D -m 0644 ${WORKDIR}/kdump.service ${D}${systemd_unitdir}/system/kdump.service
+ sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_unitdir}/system/kdump.service
+ fi
}