diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-08-02 19:14:55 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-08-02 19:14:55 +0100 |
commit | b24bd25253fe093f722ab576d29fdc41d04cb1ee (patch) | |
tree | 0fcf2afd9f852c4d4c291cf8afaa2c244d598105 /sys-kernel/kpatch | |
parent | 121ed4eec41fbf03e1998d09eede1bf449da63b9 (diff) |
gentoo resync : 02.08.2019
Diffstat (limited to 'sys-kernel/kpatch')
-rw-r--r-- | sys-kernel/kpatch/Manifest | 5 | ||||
-rw-r--r-- | sys-kernel/kpatch/files/kpatch-0.7.1-disable-dwarf-compression.patch | 32 | ||||
-rw-r--r-- | sys-kernel/kpatch/kpatch-0.7.1.ebuild | 97 | ||||
-rw-r--r-- | sys-kernel/kpatch/kpatch-9999.ebuild | 78 |
4 files changed, 181 insertions, 31 deletions
diff --git a/sys-kernel/kpatch/Manifest b/sys-kernel/kpatch/Manifest index cae833fba9cf..859b23b9f870 100644 --- a/sys-kernel/kpatch/Manifest +++ b/sys-kernel/kpatch/Manifest @@ -1,4 +1,7 @@ +AUX kpatch-0.7.1-disable-dwarf-compression.patch 1120 BLAKE2B 443956fb6937973040efdae4a59ed925d6dad6e540bcd88146e08bfb3061b299b4f2a14226f3f52647cb27b163223d93cb729511e564dabc7814e287c8527a16 SHA512 eb51965bfe701cc0235ab442f68cb7c86cac55f6dbacac2beca39ffb94fbc767545bd598cb34c1c85b19dc2e830890eba3e28f28628f16e6a37c155e8a4324ff DIST kpatch-0.6.3.tar.gz 153100 BLAKE2B e95d1880ffc9ff6038bba98902d0f1e97c9f7f8d0f90eedc281c4bf0570217668cf7b701d038d6f06e9885ebdbb4407cc554d5175cf17eb8fd5051381f75deb3 SHA512 0d266dd837ad651d7f46047cf2c8de527d08274a885a154c53354f4b3c5679d91c766d7d42294ffe71cc548e5ee865c7555f24001882b806f2fb48825f9b0c06 +DIST kpatch-0.7.1.tar.gz 181732 BLAKE2B da3ff8a6bbd31c3bdc353a3d2b75c6947b915fb309a6f19c57b31a6cbad1d82b9e1611bc2c412c5d049511e217a01719eb9a017d1fbbe7c7bbf2e5b02a381f40 SHA512 c1b149e9532dc16ee4f7578aadf3eda73b53c889a055229490a7afd1fca8e6df755c98c938353f937b81679fe8d08e065c473a6c31e588b1eb67f2de56bfddea EBUILD kpatch-0.6.3.ebuild 2429 BLAKE2B f5c29e68e94f581ef722fdcca5abb8ffd915eb0d518a6e6633314072ad260d1dc8577706beb54e3166ea6b43ba4981d0ee54e35ad23442e9292d06f24d6136ea SHA512 de23464be4721f19f8be75f58e3203a747c5c2f0193fcfe4c2a56b1a6ac4b8dcba9d7bcad61694313218cd85d574bcc52319cd6f019d6d052527d25dff6a393a -EBUILD kpatch-9999.ebuild 1952 BLAKE2B 40d2f4405a96d90e1162aa05110ffded881e3a2a75edab8716f877495502dc4fa3945ebbef9f6086b30ff97194eeb99a686dd811d5c5e5a0806c2545edbd7189 SHA512 f60f2e00b2194083b84bb92d31c0b8c48bb108cf5ba1ff0837585f91950c9c9101bcd8bfeab59e31dd63320cd4f37212a9f08fe8c68101a0891f675457f30adc +EBUILD kpatch-0.7.1.ebuild 2728 BLAKE2B b70256bf586689d565c51d21025e87961d1e95214bf3f63dd38e126ee64b141bf5793e6396515f0c82fc2bac0d4a3f4ebe4278f2293f563b00f31edb8a7cca40 SHA512 fd1becba93fee81795847ca4524bf07e930b796db7cf7e8583c4ca1b9496f775131ca529f389e9260a2b7941944eccfed977b6f626a89eabd7bd7e94843e8b3f +EBUILD kpatch-9999.ebuild 2664 BLAKE2B f2f5557f0c81390387d2d5ef0b02f46c7bf71ab2ed49ddd56850010afac15012cdcc3854cd4fc8491c9f81b7c0c24227a74cdbe4f8299e6345cde6f5ac9b77ac SHA512 e590b484b014170ce437fdbfe3dc6ed818c90d67410c22a7d447ae38aeef228a53ebd6ee97bc71e64d1555158133e9df3599ce8fdaddbd1bd5c44dbc2b48296a MISC metadata.xml 761 BLAKE2B 04355e1d4a8b0cd049c5957290ae001ea5baf2e849da174eadaa6f527c4288e9f33129c633a90e95e549a76b8339a66f9ff3c1f7a6ea35f49e2600a07dffccf1 SHA512 edfc81d5e271bcdd66c4f79f1c50512092e2e0a46d5124b3a6c2ac31071b0f0e2c8e6a97e5935cf5cca7e9f28ffb1dcd4346977a67c9bb15175454fd94f661b8 diff --git a/sys-kernel/kpatch/files/kpatch-0.7.1-disable-dwarf-compression.patch b/sys-kernel/kpatch/files/kpatch-0.7.1-disable-dwarf-compression.patch new file mode 100644 index 000000000000..85f2862df54a --- /dev/null +++ b/sys-kernel/kpatch/files/kpatch-0.7.1-disable-dwarf-compression.patch @@ -0,0 +1,32 @@ +From fe6e3f51bfe17945205445904c1fc602008ac7dd Mon Sep 17 00:00:00 2001 +From: Stefan Strogin <steils@gentoo.org> +Date: Mon, 29 Jul 2019 13:20:20 +0300 +Subject: [PATCH] create-diff-object: disable DWARF compression explicitly + +On some systems the linker produces compressed debug sections by +default. It is not supported by create-diff-object for now. + +Fixes: #877 + +Upstream-Status: Submitted [https://github.com/dynup/kpatch/pull/1011] +Signed-off-by: Stefan Strogin <steils@gentoo.org> +--- + kpatch-build/kpatch-build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build +index 9ef3809..365655c 100755 +--- a/kpatch-build/kpatch-build ++++ b/kpatch-build/kpatch-build +@@ -748,7 +748,7 @@ if [[ "$ARCH" = "ppc64le" ]]; then + ARCH_KCFLAGS="-mcmodel=large -fplugin=$PLUGINDIR/ppc64le-plugin.so" + fi + +-export KCFLAGS="-I$DATADIR/patch -ffunction-sections -fdata-sections $ARCH_KCFLAGS" ++export KCFLAGS="-I$DATADIR/patch -ffunction-sections -fdata-sections -gz=none $ARCH_KCFLAGS" + + echo "Reading special section data" + find_special_section_data +-- +2.22.0 + diff --git a/sys-kernel/kpatch/kpatch-0.7.1.ebuild b/sys-kernel/kpatch/kpatch-0.7.1.ebuild new file mode 100644 index 000000000000..9aa8f4e44e1e --- /dev/null +++ b/sys-kernel/kpatch/kpatch-0.7.1.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic linux-mod + +if [[ "${PV}" == "9999" ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/dynup/${PN}.git" +else + SRC_URI="https://github.com/dynup/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi + +DESCRIPTION="Dynamic kernel patching for Linux" +HOMEPAGE="https://github.com/dynup/kpatch" + +LICENSE="GPL-2+" +SLOT="0" +IUSE="contrib +kpatch +kpatch-build kmod test" + +RDEPEND=" + app-crypt/pesign + sys-libs/zlib + sys-apps/pciutils +" + +DEPEND=" + ${RDEPEND} + dev-libs/elfutils + sys-devel/bison + test? ( dev-util/shellcheck-bin ) +" + +PATCHES=( "${FILESDIR}"/${P}-disable-dwarf-compression.patch ) + +pkg_setup() { + if use kmod; then + if kernel_is gt 3 9 0; then + if ! linux_config_exists; then + eerror "Unable to check the currently running kernel for kpatch support" + eerror "Please be sure a .config file is available in the kernel src dir" + eerror "and ensure the kernel has been built." + else + # Fail to build if these kernel options are not enabled (see kpatch/kmod/core/Makefile) + CONFIG_CHECK="FUNCTION_TRACER HAVE_FENTRY MODULES SYSFS KALLSYMS_ALL" + ERROR_FUNCTION_TRACER="CONFIG_FUNCTION_TRACER must be enabled in the kernel's config file" + ERROR_HAVE_FENTRY="CONFIG_HAVE_FENTRY must be enabled in the kernel's config file" + ERROR_MODULES="CONFIG_MODULES must be enabled in the kernel's config file" + ERROR_SYSFS="CONFIG_SYSFS must be enabled in the kernel's config file" + ERROR_KALLSYMS_ALL="CONFIG_KALLSYMS_ALL must be enabled in the kernel's config file" + fi + else + eerror + eerror "kpatch is not available for Linux kernels below 4.0.0" + eerror + die "Upgrade the kernel sources before installing kpatch." + fi + check_extra_config + fi + +} + +src_prepare() { + replace-flags '-O?' '-O1' + default +} + +src_compile() { + use kpatch-build && emake -C kpatch-build + use kpatch && emake -C kpatch + use kmod && set_arch_to_kernel && emake -C kmod + use contrib && emake -C contrib + use test && emake check +} + +src_install() { + if use kpatch-build; then + emake DESTDIR="${D}" PREFIX="/usr" install -C kpatch-build + insinto /usr/share/${PN}/patch + doins kmod/patch/kpatch{.lds.S,-macros.h,-patch.h,-patch-hook.c} + doins kmod/patch/{livepatch-patch-hook.c,Makefile,patch-hook.c} + doins kmod/core/kpatch.h + doman man/kpatch-build.1 + fi + + if use kpatch; then + emake DESTDIR="${D}" PREFIX="/usr" install -C kpatch + doman man/kpatch.1 + fi + + use kmod && set_arch_to_kernel && emake DESTDIR="${D}" PREFIX="/usr" install -C kmod + use contrib && emake DESTDIR="${D}" PREFIX="/usr" install -C contrib + + dodoc README.md doc/patch-author-guide.md +} diff --git a/sys-kernel/kpatch/kpatch-9999.ebuild b/sys-kernel/kpatch/kpatch-9999.ebuild index 0d6aa6e706a4..dd2b30d0b351 100644 --- a/sys-kernel/kpatch/kpatch-9999.ebuild +++ b/sys-kernel/kpatch/kpatch-9999.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI="6" +EAPI=7 -inherit linux-info linux-mod flag-o-matic +inherit flag-o-matic linux-mod if [[ "${PV}" == "9999" ]]; then inherit git-r3 @@ -18,45 +18,46 @@ HOMEPAGE="https://github.com/dynup/kpatch" LICENSE="GPL-2+" SLOT="0" -IUSE="examples +modules test" +IUSE="contrib +kpatch +kpatch-build kmod test" RDEPEND=" app-crypt/pesign - dev-libs/openssl:0= sys-libs/zlib sys-apps/pciutils " DEPEND=" ${RDEPEND} - test? ( dev-util/shellcheck ) dev-libs/elfutils sys-devel/bison + test? ( dev-util/shellcheck-bin ) " -pkg_pretend() { - if kernel_is gt 3 9 0; then - if ! linux_config_exists; then - eerror "Unable to check the currently running kernel for kpatch support" - eerror "Please be sure a .config file is available in the kernel src dir" - eerror "and ensure the kernel has been built." +pkg_setup() { + if use kmod; then + if kernel_is gt 3 9 0; then + if ! linux_config_exists; then + eerror "Unable to check the currently running kernel for kpatch support" + eerror "Please be sure a .config file is available in the kernel src dir" + eerror "and ensure the kernel has been built." + else + # Fail to build if these kernel options are not enabled (see kpatch/kmod/core/Makefile) + CONFIG_CHECK="FUNCTION_TRACER HAVE_FENTRY MODULES SYSFS KALLSYMS_ALL" + ERROR_FUNCTION_TRACER="CONFIG_FUNCTION_TRACER must be enabled in the kernel's config file" + ERROR_HAVE_FENTRY="CONFIG_HAVE_FENTRY must be enabled in the kernel's config file" + ERROR_MODULES="CONFIG_MODULES must be enabled in the kernel's config file" + ERROR_SYSFS="CONFIG_SYSFS must be enabled in the kernel's config file" + ERROR_KALLSYMS_ALL="CONFIG_KALLSYMS_ALL must be enabled in the kernel's config file" + fi else - # Fail to build if these kernel options are not enabled (see kpatch/kmod/core/Makefile) - CONFIG_CHECK="FUNCTION_TRACER HAVE_FENTRY MODULES SYSFS KALLSYMS_ALL" - ERROR_FUNCTION_TRACER="CONFIG_FUNCTION_TRACER must be enabled in the kernel's config file" - ERROR_HAVE_FENTRY="CONFIG_HAVE_FENTRY must be enabled in the kernel's config file" - ERROR_MODULES="CONFIG_MODULES must be enabled in the kernel's config file" - ERROR_SYSFS="CONFIG_SYSFS must be enabled in the kernel's config file" - ERROR_KALLSYMS_ALL="CONFIG_KALLSYMS_ALL must be enabled in the kernel's config file" + eerror + eerror "kpatch is not available for Linux kernels below 4.0.0" + eerror + die "Upgrade the kernel sources before installing kpatch." fi - else - eerror - eerror "kpatch is not available for Linux kernels below 4.0.0" - eerror - die "Upgrade the kernel sources before installing kpatch." + check_extra_config fi - check_extra_config } src_prepare() { @@ -65,13 +66,30 @@ src_prepare() { } src_compile() { - set_arch_to_kernel - emake all + use kpatch-build && emake -C kpatch-build + use kpatch && emake -C kpatch + use kmod && set_arch_to_kernel && emake -C kmod + use contrib && emake -C contrib + use test && emake check } src_install() { - set_arch_to_kernel - emake DESTDIR="${D}" PREFIX="/usr" install + if use kpatch-build; then + emake DESTDIR="${D}" PREFIX="/usr" install -C kpatch-build + insinto /usr/share/${PN}/patch + doins kmod/patch/kpatch{.lds.S,-macros.h,-patch.h,-patch-hook.c} + doins kmod/patch/{livepatch-patch-hook.c,Makefile,patch-hook.c} + doins kmod/core/kpatch.h + doman man/kpatch-build.1 + fi + + if use kpatch; then + emake DESTDIR="${D}" PREFIX="/usr" install -C kpatch + doman man/kpatch.1 + fi + + use kmod && set_arch_to_kernel && emake DESTDIR="${D}" PREFIX="/usr" install -C kmod + use contrib && emake DESTDIR="${D}" PREFIX="/usr" install -C contrib - einstalldocs + dodoc README.md doc/patch-author-guide.md } |