diff --git a/.gitignore b/.gitignore index 4bb367a..129fbb6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -SOURCES/kpatch-dnf-v0.2.tar.gz -SOURCES/v0.9.2.tar.gz -SOURCES/v0.9.3.tar.gz -SOURCES/v0.9.4.tar.gz -SOURCES/v0.9.6.tar.gz +/v0.9.4.tar.gz +/v0.9.7.tar.gz +/kpatch-dnf-v0.4.tar.gz diff --git a/.kpatch.metadata b/.kpatch.metadata deleted file mode 100644 index 9a0d408..0000000 --- a/.kpatch.metadata +++ /dev/null @@ -1,2 +0,0 @@ -74e3123e0edc694676a36994b23094be354f87b5 SOURCES/kpatch-dnf-v0.2.tar.gz -223c224ddd6896c467b9347ab297e3f7f013f5d7 SOURCES/v0.9.6.tar.gz diff --git a/0001-contrib-disable-upstart-kpatch.conf-install.patch b/0001-contrib-disable-upstart-kpatch.conf-install.patch new file mode 100644 index 0000000..44eb5b4 --- /dev/null +++ b/0001-contrib-disable-upstart-kpatch.conf-install.patch @@ -0,0 +1,46 @@ +From f056d60fb309896a52882fd3fc10fb5305f5a47e Mon Sep 17 00:00:00 2001 +From: Joe Lawrence +Date: Thu, 21 Jun 2018 15:40:20 -0400 +Subject: [PATCH] contrib: disable upstart kpatch.conf install + +Do not install the upstart configuration file to avoid this rhpkg +build complaint: + + Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/kpatch-0.6.1-1.el7.noarch + error: Installed (but unpackaged) file(s) found: + /etc/init/kpatch.conf + Installed (but unpackaged) file(s) found: + /etc/init/kpatch.conf + +We'll need to think of a better way to do this upstream, but for now, +just skip the unneeded file on RHEL. + +Signed-off-by: Joe Lawrence +--- + contrib/Makefile | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/contrib/Makefile b/contrib/Makefile +index 0b0eeeb23a56..e873f27d6eae 100644 +--- a/contrib/Makefile ++++ b/contrib/Makefile +@@ -6,12 +6,12 @@ install: all + $(INSTALL) -d $(SYSTEMDDIR) + $(INSTALL) -m 0644 kpatch.service $(SYSTEMDDIR) + sed -i 's~PREFIX~$(PREFIX)~' $(SYSTEMDDIR)/kpatch.service +- $(INSTALL) -d $(UPSTARTDIR) +- $(INSTALL) -m 0644 kpatch.conf $(UPSTARTDIR) +- sed -i 's~PREFIX~$(PREFIX)~' $(UPSTARTDIR)/kpatch.conf ++# $(INSTALL) -d $(UPSTARTDIR) ++# $(INSTALL) -m 0644 kpatch.conf $(UPSTARTDIR) ++# sed -i 's~PREFIX~$(PREFIX)~' $(UPSTARTDIR)/kpatch.conf + + uninstall: + $(RM) $(SYSTEMDDIR)/kpatch.service +- $(RM) $(UPSTARTDIR)/kpatch.conf ++# $(RM) $(UPSTARTDIR)/kpatch.conf + + clean: +-- +1.8.3.1 + diff --git a/0002-kpatch-clarify-unload-unsupport.patch b/0002-kpatch-clarify-unload-unsupport.patch new file mode 100644 index 0000000..b1c0d2d --- /dev/null +++ b/0002-kpatch-clarify-unload-unsupport.patch @@ -0,0 +1,78 @@ +kpatch: clarify that "kpatch unload" isn't supported + +Add a user-prompt to the kpatch unload subcommand and make a similiar +mention in the manual page. + +Provide an undocumented force option so that QE and dev scripts can +still run unload kpatch modules from scripts. + +RHEL-only. + +Signed-off-by: Joe Lawrence +diff -Nupr kpatch-0.6.1.old/kpatch/kpatch kpatch-0.6.1/kpatch/kpatch +--- kpatch-0.9.2.old/kpatch/kpatch 2019-08-28 10:35:01.191259434 -0400 ++++ kpatch-0.9.2/kpatch/kpatch 2019-08-28 16:11:13.067926576 -0400 +@@ -49,8 +49,8 @@ usage () { + echo >&2 + usage_cmd "load --all" "load all installed patch modules into the running kernel" + usage_cmd "load " "load patch module into the running kernel" +- usage_cmd "unload --all" "unload all patch modules from the running kernel" +- usage_cmd "unload " "unload patch module from the running kernel" ++ usage_cmd "unload --all (UNSUPPORTED)" "unload all patch modules from the running kernel" ++ usage_cmd "unload (UNSUPPORTED)" "unload patch module from the running kernel" + echo >&2 + usage_cmd "info " "show information about a patch module" + echo >&2 +@@ -71,6 +71,16 @@ die() { + exit 1 + } + ++confirm_prompt() { ++ local prompt="$1" ++ local answer ++ while true; do ++ read -rp "$prompt [Y/N] " answer ++ [[ $answer == 'Y' || $answer == 'y' ]] && return 0 ++ [[ $answer == 'N' || $answer == 'n' ]] && return 1 ++ done ++} ++ + __find_module () { + MODULE="$1" + [[ -f "$MODULE" ]] && return +@@ -406,6 +416,19 @@ unset MODULE + init_sysfs_var + + [[ "$#" -lt 1 ]] && usage ++ ++# RHEL-specific support options ++case "$1" in ++"force") ++ # For scripting purposes, support "kpatch force unload". ++ # Shift out the "force" to avoid the user-prompt check below. ++ shift ++ ;; ++"unload") ++ confirm_prompt "WARNING: Red Hat doesn't support unloading of kpatches, continue anyway?" || exit 1 ++ ;; ++esac ++ + case "$1" in + "load") + [[ "$#" -ne 2 ]] && usage +diff -Nupr kpatch-0.6.1.old/man/kpatch.1 kpatch-0.6.1/man/kpatch.1 +--- kpatch-0.9.2.old/man/kpatch.1 2019-08-28 10:35:01.191259434 -0400 ++++ kpatch-0.9.2/man/kpatch.1 2019-08-28 14:51:23.268198897 -0400 +@@ -23,10 +23,10 @@ load --all + load + load patch module into the running kernel + +-unload --all ++unload --all (UNSUPPORTED) + unload all patch modules from the running kernel + +-unload ++unload (UNSUPPORTED) + unload patch module from the running kernel + + info diff --git a/0003-do-not-rm-selinux-rpm-owned-directory.patch b/0003-do-not-rm-selinux-rpm-owned-directory.patch new file mode 100644 index 0000000..a38e831 --- /dev/null +++ b/0003-do-not-rm-selinux-rpm-owned-directory.patch @@ -0,0 +1,28 @@ +kpatch: do not rm selinux rpm owned directory + +As part of the kpatch rpm package installation, the /var/lib/kpatch directory +gets created and is set to be selinux owned by the kpatch rpm package. + +There is a problem where uninstalling the last kpatch-patch will also remove +this directory. When another kpatch-patch installation occurs, the +/var/lib/kpatch get recreated but withtout the selinux context which triggers a +policy error. + +Since /var/lib/kpatch is now created by the rpm spec file, do not remove it +from the uinstall target of the kpatch script. This insures selinux context +consistency. + +RHEL-only. + +Signed-off-by: Yannick Cote +diff -Nupr kpatch-0.9.4.old/kpatch/kpatch kpatch-0.9.4/kpatch/kpatch +--- kpatch-0.9.4.old/kpatch/kpatch 2021-08-26 15:31:07.000000000 -0400 ++++ kpatch-0.9.4/kpatch/kpatch 2022-06-10 12:19:55.791538218 -0400 +@@ -584,7 +584,6 @@ case "$1" in + echo "uninstalling $PATCH ($KVER)" + rm -f "$MODULE" || die "failed to uninstall module $PATCH" + rmdir --ignore-fail-on-non-empty "$INSTALLDIR/$KVER" || die "failed to remove directory $INSTALLDIR/$KVER" +- rmdir --ignore-fail-on-non-empty "$INSTALLDIR" || die "failed to remove directory $INSTALLDIR" + + ;; + diff --git a/0100-kpatch-build-for-clang-use-.strtab-if-no-.shstrtab.patch b/0100-kpatch-build-for-clang-use-.strtab-if-no-.shstrtab.patch new file mode 100644 index 0000000..dc9a279 --- /dev/null +++ b/0100-kpatch-build-for-clang-use-.strtab-if-no-.shstrtab.patch @@ -0,0 +1,99 @@ +From 5f6c5965f117cb9b2b21749da49b22b23305d114 Mon Sep 17 00:00:00 2001 +From: Pete Swain +Date: Tue, 27 Sep 2022 15:56:06 -0400 +Subject: [PATCH 100/108] kpatch-build: for clang, use .strtab if no .shstrtab + +While gcc puts strings in .strtab and .shstrtab sections, +llvm toolchain just uses .strtab. + +Adapt kpatch to handle both styles. + +Signed-off-by: Pete Swain +Signed-off-by: Joe Lawrence [small changes] +--- + kpatch-build/kpatch-elf.c | 33 +++++++++++++++++++++++++++++---- + 1 file changed, 29 insertions(+), 4 deletions(-) + +diff --git a/kpatch-build/kpatch-elf.c b/kpatch-build/kpatch-elf.c +index 58dbe1a..c7d12ec 100644 +--- a/kpatch-build/kpatch-elf.c ++++ b/kpatch-build/kpatch-elf.c +@@ -607,7 +607,7 @@ void kpatch_create_shstrtab(struct kpatch_elf *kelf) + + shstrtab = find_section_by_name(&kelf->sections, ".shstrtab"); + if (!shstrtab) +- ERROR("find_section_by_name"); ++ return; + + /* determine size of string table */ + size = 1; /* for initial NULL terminator */ +@@ -648,7 +648,7 @@ void kpatch_create_shstrtab(struct kpatch_elf *kelf) + + void kpatch_create_strtab(struct kpatch_elf *kelf) + { +- struct section *strtab; ++ struct section *strtab, *shstrtab; + struct symbol *sym; + size_t size = 0, offset = 0, len; + char *buf; +@@ -657,6 +657,8 @@ void kpatch_create_strtab(struct kpatch_elf *kelf) + if (!strtab) + ERROR("find_section_by_name"); + ++ shstrtab = find_section_by_name(&kelf->sections, ".shstrtab"); ++ + /* determine size of string table */ + list_for_each_entry(sym, &kelf->symbols, list) { + if (sym->type == STT_SECTION) +@@ -664,6 +666,15 @@ void kpatch_create_strtab(struct kpatch_elf *kelf) + size += strlen(sym->name) + 1; /* include NULL terminator */ + } + ++ /* and when covering for missing .shstrtab ... */ ++ if (!shstrtab) { ++ /* factor out into common (sh)strtab feeder */ ++ struct section *sec; ++ ++ list_for_each_entry(sec, &kelf->sections, list) ++ size += strlen(sec->name) + 1; /* include NULL terminator */ ++ } ++ + /* allocate data buffer */ + buf = malloc(size); + if (!buf) +@@ -682,8 +693,20 @@ void kpatch_create_strtab(struct kpatch_elf *kelf) + offset += len; + } + ++ if (!shstrtab) { ++ struct section *sec; ++ ++ /* populate string table and link with section header */ ++ list_for_each_entry(sec, &kelf->sections, list) { ++ len = strlen(sec->name) + 1; ++ sec->sh.sh_name = (unsigned int)offset; ++ memcpy(buf + offset, sec->name, len); ++ offset += len; ++ } ++ } ++ + if (offset != size) +- ERROR("shstrtab size mismatch"); ++ ERROR("strtab size mismatch"); + + strtab->data->d_buf = buf; + strtab->data->d_size = size; +@@ -928,7 +951,9 @@ void kpatch_write_output_elf(struct kpatch_elf *kelf, Elf *elf, char *outfile, + + shstrtab = find_section_by_name(&kelf->sections, ".shstrtab"); + if (!shstrtab) +- ERROR("missing .shstrtab section"); ++ shstrtab = find_section_by_name(&kelf->sections, ".strtab"); ++ if (!shstrtab) ++ ERROR("missing .shstrtab, .strtab sections"); + + ehout.e_shstrndx = (unsigned short)shstrtab->index; + +-- +2.37.3 + diff --git a/0101-create-diff-object-ignore-clang-s-.llvm_addrsig-sect.patch b/0101-create-diff-object-ignore-clang-s-.llvm_addrsig-sect.patch new file mode 100644 index 0000000..02a0ea9 --- /dev/null +++ b/0101-create-diff-object-ignore-clang-s-.llvm_addrsig-sect.patch @@ -0,0 +1,29 @@ +From 37040572440efb95db9a3193d3b51d7597e1badd Mon Sep 17 00:00:00 2001 +From: Pete Swain +Date: Tue, 27 Sep 2022 15:56:06 -0400 +Subject: [PATCH 101/108] create-diff-object: ignore clang's .llvm_addrsig + sections + +Signed-off-by: Pete Swain +Signed-off-by: Joe Lawrence [subject line] +--- + kpatch-build/create-diff-object.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c +index 918d21c..fa7e07f 100644 +--- a/kpatch-build/create-diff-object.c ++++ b/kpatch-build/create-diff-object.c +@@ -2717,7 +2717,8 @@ static void kpatch_mark_ignored_sections(struct kpatch_elf *kelf) + /* Ignore any discarded sections */ + list_for_each_entry(sec, &kelf->sections, list) { + if (!strncmp(sec->name, ".discard", 8) || +- !strncmp(sec->name, ".rela.discard", 13)) ++ !strncmp(sec->name, ".rela.discard", 13) || ++ !strncmp(sec->name, ".llvm_addrsig", 13)) + sec->ignore = 1; + } + +-- +2.37.3 + diff --git a/0102-create-diff-object-ignore-.llvm.-sections.patch b/0102-create-diff-object-ignore-.llvm.-sections.patch new file mode 100644 index 0000000..5deef12 --- /dev/null +++ b/0102-create-diff-object-ignore-.llvm.-sections.patch @@ -0,0 +1,32 @@ +From 85781b7ea79fb4122efbb51f0bf573ed5fab03e1 Mon Sep 17 00:00:00 2001 +From: Pete Swain +Date: Tue, 27 Sep 2022 15:56:06 -0400 +Subject: [PATCH 102/108] create-diff-object: ignore .llvm.* sections + +Clang FDO adds a new, ignorable ELF section, .llvm.call-graph-profile + +Generalize to ignore all .llvm.* + +Signed-off-by: Pete Swain +Signed-off-by: Joe Lawrence [subject line] +--- + kpatch-build/create-diff-object.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c +index fa7e07f..cdcc13b 100644 +--- a/kpatch-build/create-diff-object.c ++++ b/kpatch-build/create-diff-object.c +@@ -2718,7 +2718,8 @@ static void kpatch_mark_ignored_sections(struct kpatch_elf *kelf) + list_for_each_entry(sec, &kelf->sections, list) { + if (!strncmp(sec->name, ".discard", 8) || + !strncmp(sec->name, ".rela.discard", 13) || +- !strncmp(sec->name, ".llvm_addrsig", 13)) ++ !strncmp(sec->name, ".llvm_addrsig", 13) || ++ !strncmp(sec->name, ".llvm.", 6)) + sec->ignore = 1; + } + +-- +2.37.3 + diff --git a/0103-gcc-plugin-update-headers-for-gcc-12.patch b/0103-gcc-plugin-update-headers-for-gcc-12.patch new file mode 100644 index 0000000..ac3745c --- /dev/null +++ b/0103-gcc-plugin-update-headers-for-gcc-12.patch @@ -0,0 +1,49 @@ +From 13182e50b027c70bd63f53ca43598557d6b41e2e Mon Sep 17 00:00:00 2001 +From: Joe Lawrence +Date: Tue, 27 Sep 2022 16:41:48 -0400 +Subject: [PATCH 103/108] gcc-plugin: update headers for gcc-12 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix build error seen on gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1): + + g++ -MMD -MP -I../kmod/patch -Iinsn -Wall -Wsign-compare -Wno-sign-conversion -g -Werror -shared -I/usr/lib/gcc/ppc64le-redhat-linux/12/plugin/include -Igcc-plugins -fPIC -fno-rtti -O2 -Wall gcc-plugins/ppc64le-plugin.c -o gcc-plugins/ppc64le-plugin.so + In file included from /usr/include/features.h:490, + from /usr/include/bits/libc-header-start.h:33, + from /usr/include/stdio.h:27, + from /usr/lib/gcc/ppc64le-redhat-linux/12/plugin/include/system.h:46, + from /usr/lib/gcc/ppc64le-redhat-linux/12/plugin/include/gcc-plugin.h:28, + from gcc-plugins/gcc-common.h:6, + from gcc-plugins/ppc64le-plugin.c:1: + /usr/include/bits/error-ldbl.h:23:1: error: type of ‘error’ is unknown + 23 | __LDBL_REDIR_DECL (error) + | ^~~~~~~~~~~~~~~~~ + /usr/include/bits/error-ldbl.h:23:1: error: ‘int error’ redeclared as different kind of entity + 23 | __LDBL_REDIR_DECL (error) + | ^~~~~~~~~~~~~~~~~ + In file included from gcc-plugins/ppc64le-plugin.c:2: + /usr/include/error.h:31:13: note: previous declaration ‘void error(int, int, const char*, ...)’ + 31 | extern void error (int __status, int __errnum, const char *__format, ...) + | ^~~~~ + make[1]: *** [Makefile:39: gcc-plugins/ppc64le-plugin.so] Error 1 + +Signed-off-by: Joe Lawrence +--- + kpatch-build/gcc-plugins/ppc64le-plugin.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kpatch-build/gcc-plugins/ppc64le-plugin.c b/kpatch-build/gcc-plugins/ppc64le-plugin.c +index e3ec20f..ba4a01e 100644 +--- a/kpatch-build/gcc-plugins/ppc64le-plugin.c ++++ b/kpatch-build/gcc-plugins/ppc64le-plugin.c +@@ -1,5 +1,5 @@ +-#include "gcc-common.h" + #include ++#include "gcc-common.h" + + #define PLUGIN_NAME "ppc64le-plugin" + +-- +2.37.3 + diff --git a/0104-kpatch-cc-Add-more-file-ignores.patch b/0104-kpatch-cc-Add-more-file-ignores.patch new file mode 100644 index 0000000..cf69849 --- /dev/null +++ b/0104-kpatch-cc-Add-more-file-ignores.patch @@ -0,0 +1,51 @@ +From 1ead10d2b214ec5545ee2cdb25d5b0cdb3b4f735 Mon Sep 17 00:00:00 2001 +From: Josh Poimboeuf +Date: Wed, 17 Aug 2022 12:10:39 -0700 +Subject: [PATCH 104/108] kpatch-cc: Add more file ignores + +These files aren't in the kernel proper, and can be ignored. + +Signed-off-by: Josh Poimboeuf +--- + kpatch-build/kpatch-cc | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/kpatch-build/kpatch-cc b/kpatch-build/kpatch-cc +index 6f0063e..d2bccdd 100755 +--- a/kpatch-build/kpatch-cc ++++ b/kpatch-build/kpatch-cc +@@ -31,22 +31,22 @@ if [[ "$TOOLCHAINCMD" =~ ^(.*-)?gcc$ || "$TOOLCHAINCMD" =~ ^(.*-)?clang$ ]] ; th + vmlinux.o|\ + .tmp_kallsyms1.o|\ + .tmp_kallsyms2.o|\ +- init/version.o|\ +- arch/x86/boot/version.o|\ +- arch/x86/boot/compressed/eboot.o|\ +- arch/x86/boot/header.o|\ +- arch/x86/boot/compressed/efi_stub_64.o|\ +- arch/x86/boot/compressed/piggy.o|\ +- kernel/system_certificates.o|\ +- arch/x86/vdso/*|\ ++ arch/x86/boot/*|\ + arch/x86/entry/vdso/*|\ +- drivers/firmware/efi/libstub/*|\ ++ arch/x86/purgatory/*|\ ++ arch/x86/realmode/*|\ ++ arch/x86/tools/*|\ ++ arch/x86/vdso/*|\ + arch/powerpc/kernel/prom_init.o|\ + arch/powerpc/kernel/vdso64/*|\ + arch/s390/boot/*|\ + arch/s390/purgatory/*|\ + arch/s390/kernel/vdso64/*|\ ++ drivers/firmware/efi/libstub/*|\ ++ init/version.o|\ ++ kernel/system_certificates.o|\ + lib/*|\ ++ tools/*|\ + .*.o|\ + */.lib_exports.o) + break +-- +2.37.3 + diff --git a/0105-kpatch-build-Add-find_kobj-short-circuit-for-OOT-mod.patch b/0105-kpatch-build-Add-find_kobj-short-circuit-for-OOT-mod.patch new file mode 100644 index 0000000..fef1169 --- /dev/null +++ b/0105-kpatch-build-Add-find_kobj-short-circuit-for-OOT-mod.patch @@ -0,0 +1,60 @@ +From 7861240f482aa41bfad41fbb57ac1990cd6b6960 Mon Sep 17 00:00:00 2001 +From: Josh Poimboeuf +Date: Wed, 17 Aug 2022 12:17:19 -0700 +Subject: [PATCH 105/108] kpatch-build: Add find_kobj() short-circuit for OOT + modules + +When patching an OOT module, the parent object is always the OOT module. +Hard-code that to prevent the need for any further special casing in +find_kobj() (e.g., commit 9143e88f16a1 ("kpatch-build: fix +find_parent_obj")). + +Signed-off-by: Josh Poimboeuf +--- + kpatch-build/kpatch-build | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build +index 296fa48..5435a19 100755 +--- a/kpatch-build/kpatch-build ++++ b/kpatch-build/kpatch-build +@@ -479,6 +479,12 @@ find_parent_obj() { + + find_kobj() { + arg="$1" ++ ++ if [[ -n $OOT_MODULE ]]; then ++ KOBJFILE="$OOT_MODULE" ++ return ++ fi ++ + KOBJFILE="$arg" + DEEP_FIND=0 + ERROR_IF_DIFF= +@@ -1093,17 +1099,17 @@ for i in $FILES; do + find_kobj "$i" + cd "$TEMPDIR" || die + if [[ -e "orig/$i" ]]; then +- if [[ "$(basename "$KOBJFILE")" = vmlinux ]]; then +- KOBJFILE_NAME=vmlinux +- KOBJFILE_PATH="$VMLINUX" +- SYMTAB="${TEMPDIR}/${KOBJFILE_NAME}.symtab" +- SYMVERS_FILE="$BUILDDIR/Module.symvers" +- elif [[ "$(basename "$KOBJFILE")" = "$(basename "$OOT_MODULE")" ]]; then ++ if [[ -n $OOT_MODULE ]]; then + KOBJFILE_NAME="$(basename --suffix=.ko "$OOT_MODULE")" + KOBJFILE_NAME="${KOBJFILE_NAME//-/_}" + KOBJFILE_PATH="$OOT_MODULE" + SYMTAB="${TEMPDIR}/module/${KOBJFILE_NAME}.symtab" + SYMVERS_FILE="$TEMPDIR/Module.symvers" ++ elif [[ "$(basename "$KOBJFILE")" = vmlinux ]]; then ++ KOBJFILE_NAME=vmlinux ++ KOBJFILE_PATH="$VMLINUX" ++ SYMTAB="${TEMPDIR}/${KOBJFILE_NAME}.symtab" ++ SYMVERS_FILE="$BUILDDIR/Module.symvers" + else + KOBJFILE_NAME=$(basename "${KOBJFILE%.ko}") + KOBJFILE_NAME="${KOBJFILE_NAME//-/_}" +-- +2.37.3 + diff --git a/0106-kpatch-build-support-Linux-5.19-.cmd-file-format.patch b/0106-kpatch-build-support-Linux-5.19-.cmd-file-format.patch new file mode 100644 index 0000000..94f1a7c --- /dev/null +++ b/0106-kpatch-build-support-Linux-5.19-.cmd-file-format.patch @@ -0,0 +1,299 @@ +From 1d7e8a74bb6c282ebe6c9193e4bd0218ec689e46 Mon Sep 17 00:00:00 2001 +From: Josh Poimboeuf +Date: Wed, 17 Aug 2022 12:21:04 -0700 +Subject: [PATCH 106/108] kpatch-build: support Linux 5.19 .cmd file format + +Rewrite kobj_find() to deal with Linux 5.19, where the .cmd files use +object file paths relative to the .cmd file rather than relative to the +root of the kernel tree. + +While at it, add several performance enhancements to prevent all +currently known deep finds. + +This is all quite fiddly. But it works. + +Fixes #1277. + +Signed-off-by: Josh Poimboeuf +--- + kpatch-build/kpatch-build | 243 +++++++++++++++++++++++++++++--------- + 1 file changed, 188 insertions(+), 55 deletions(-) + +diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build +index 5435a19..bec8010 100755 +--- a/kpatch-build/kpatch-build ++++ b/kpatch-build/kpatch-build +@@ -434,82 +434,215 @@ find_special_section_data() { + return + } + +-filter_parent_obj() +-{ +- local dir="${1}" +- local file="${2}" ++# path of file, relative to dir ++# adapted from https://stackoverflow.com/a/24848739 ++relpath() { ++ local file="$1" ++ local dir="$2" ++ ++ local filedir ++ local common ++ local result ++ ++ filedir="$(dirname "$(readlink -f "$file")")" ++ common="$(readlink -f "$dir")" ++ ++ if [[ "$filedir" = "$common" ]]; then ++ basename "$file" ++ return ++ fi ++ ++ while [[ "${filedir#$common/}" = "$filedir" ]]; do ++ common="$(dirname "$common")" ++ result="../$result" ++ done + +- grep -v "\.mod\.cmd$" | grep -Fv "${dir}/.${file}.cmd" ++ result="${result}${filedir#$common/}" ++ echo "${result}/$(basename "$file")" + } + +-find_parent_obj() { +- dir="$(dirname "$1")" +- absdir="$(readlink -f "$dir")" +- pwddir="$(readlink -f .)" +- pdir="${absdir#$pwddir/}" +- file="$(basename "$1")" +- grepname="${1%.o}" +- grepname="$grepname\\.o" +- if [[ "$DEEP_FIND" -eq 1 ]]; then +- num=0 +- if [[ -n "$last_deep_find" ]]; then +- parent="$(grep -lw "$grepname" "$last_deep_find"/.*.cmd | filter_parent_obj "${pdir}" "${file}" | head -n1)" +- num="$(grep -lw "$grepname" "$last_deep_find"/.*.cmd | filter_parent_obj "${pdir}" "${file}" | wc -l)" ++cmd_file_to_o_file() { ++ local parent="$1" ++ ++ # convert cmd file name to corresponding .o ++ parent_dir="$(dirname "$parent")" ++ parent_dir="${parent_dir#./}" ++ parent="$(basename "$parent")" ++ parent="${parent#.}" ++ parent="${parent%.cmd}" ++ parent="$parent_dir/$parent" ++ ++ [[ -f $parent ]] || die "can't find $parent associated with $1" ++ ++ echo "$parent" ++} ++ ++get_parent_from_parents() { ++ local parents=("$@") ++ ++ [[ ${#parents[@]} -eq 0 ]] && PARENT="" && return ++ [[ ${#parents[@]} -eq 1 ]] && PARENT="${parents[0]}" && return ++ ++ # multiple parents: ++ local parent ++ local mod_name="${parents[0]%.*}" ++ local mod_file ++ for parent in "${parents[@]}"; do ++ # for modules, there can be multiple matches. Some ++ # combination of foo.o, foo.mod, and foo.ko, depending ++ # on kernel version and whether the module is single or ++ # multi-object. Make sure a .mod and/or .ko exists, and no ++ # more than one .mod/.ko exists. ++ ++ [[ $parent = *.o ]] && continue ++ ++ if [[ ${parent%.*} != "$mod_name" ]]; then ++ mod_file="" ++ break + fi +- if [[ "$num" -eq 0 ]]; then +- parent="$(find . -name ".*.cmd" -print0 | xargs -0 grep -lw "$grepname" | filter_parent_obj "${pdir}" "${file}" | cut -c3- | head -n1)" +- num="$(find . -name ".*.cmd" -print0 | xargs -0 grep -lw "$grepname" | filter_parent_obj "${pdir}" "${file}" | wc -l)" +- [[ "$num" -eq 1 ]] && last_deep_find="$(dirname "$parent")" ++ ++ if [[ $parent = *.mod || $parent = *.ko ]]; then ++ mod_file=$parent ++ continue + fi ++ ++ mod_file="" ++ break ++ done ++ ++ if [[ -n $mod_file ]]; then ++ PARENT="$mod_file" ++ return ++ fi ++ ++ ERROR_IF_DIFF="multiple parent matches for $file: ${parents[*]}" ++ PARENT="${parents[0]}" ++} ++ ++__find_parent_obj_in_dir() { ++ local file="$1" ++ local dir="$2" ++ ++ declare -a parents ++ ++ while IFS='' read -r parent; do ++ parent="$(cmd_file_to_o_file "$parent")" ++ [[ $parent -ef $file ]] && continue ++ parents+=("$parent") ++ done < <(grep -El "[ ]${file/./\\.}([ \)]|$)" "$dir"/.*.cmd) ++ ++ get_parent_from_parents "${parents[@]}" ++} ++ ++find_parent_obj_in_dir() { ++ local file="$1" ++ local dir="$2" ++ ++ # make sure the dir has .cmd files ++ if ! compgen -G "$dir"/.*.cmd > /dev/null; then ++ PARENT="" ++ return ++ fi ++ ++ # 5.19+: ../acp/acp_hw.o ++ __find_parent_obj_in_dir "$(relpath "$file" "$dir")" "$dir" ++ [[ -n $PARENT ]] && return ++ ++ # pre-5.19 (and 5.19+ single-object modules): ++ if [[ $file == $dir* ]]; then ++ # arch/x86/kernel/smp.o ++ __find_parent_obj_in_dir "$file" "$dir" + else +- parent="$(grep -lw "$grepname" "$dir"/.*.cmd | filter_parent_obj "${dir}" "${file}" | head -n1)" +- num="$(grep -lw "$grepname" "$dir"/.*.cmd | filter_parent_obj "${dir}" "${file}" | wc -l)" ++ # drivers/gpu/drm/amd/amdgpu/../acp/acp_hw.o ++ __find_parent_obj_in_dir "$dir"/"$(relpath "$file" "$dir")" "$dir" + fi ++} + +- [[ "$num" -eq 0 ]] && PARENT="" && return +- [[ "$num" -gt 1 ]] && ERROR_IF_DIFF="two parent matches for $1" ++find_parent_obj() { ++ local file="$1" ++ ++ # common case: look in same directory ++ find_parent_obj_in_dir "$file" "$(dirname "$file")" ++ [[ -n $PARENT ]] && return + +- dir="$(dirname "$parent")" +- PARENT="$(basename "$parent")" +- PARENT="${PARENT#.}" +- PARENT="${PARENT%.cmd}" +- [[ $dir != "." ]] && PARENT="$dir/$PARENT" +- [[ ! -e "$PARENT" ]] && die "ERROR: can't find parent $PARENT for $1" ++ # if we previously had a successful deep find, try that dir first ++ if [[ -n "$LAST_DEEP_FIND_DIR" ]]; then ++ find_parent_obj_in_dir "$file" "$LAST_DEEP_FIND_DIR" ++ [[ -n "$PARENT" ]] && return ++ fi ++ ++ # prevent known deep finds ++ if [[ $file = drivers/gpu/drm/amd/* ]]; then ++ find_parent_obj_in_dir "$file" "drivers/gpu/drm/amd/amdgpu" ++ [[ -n "$PARENT" ]] && return ++ fi ++ if [[ $file = virt/kvm/* ]]; then ++ find_parent_obj_in_dir "$file" "arch/x86/kvm" ++ [[ -n "$PARENT" ]] && return ++ fi ++ if [[ $file = drivers/oprofile/* ]]; then ++ find_parent_obj_in_dir "$file" "arch/x86/oprofile" ++ [[ -n "$PARENT" ]] && return ++ fi ++ ++ # check higher-level dirs ++ local dir ++ dir="$(dirname "$file")" ++ while [[ ! $dir -ef . ]]; do ++ dir="$(dirname "$dir")" ++ find_parent_obj_in_dir "$file" "$dir" ++ [[ -n $PARENT ]] && return ++ done ++ ++ # slow path: search the entire tree ("deep find") ++ echo 'doing "deep find" for parent object' ++ declare -a parents ++ while IFS= read -r -d '' dir; do ++ find_parent_obj_in_dir "$file" "$dir" ++ if [[ -n $PARENT ]]; then ++ parents+=("$PARENT") ++ LAST_DEEP_FIND_DIR="$dir" ++ fi ++ done < <(find . -type d -print0) ++ ++ get_parent_from_parents "${parents[@]}" + } + ++# find vmlinux or .ko associated with a .o file + find_kobj() { +- arg="$1" ++ local file="$1" + + if [[ -n $OOT_MODULE ]]; then + KOBJFILE="$OOT_MODULE" + return + fi + +- KOBJFILE="$arg" +- DEEP_FIND=0 ++ KOBJFILE="$file" + ERROR_IF_DIFF= + while true; do ++ case "$KOBJFILE" in ++ *.mod) ++ KOBJFILE=${PARENT/.mod/.ko} ++ [[ -e $KOBJFILE ]] || die "can't find .ko for $PARENT" ++ return ++ ;; ++ *.ko) ++ return ++ ;; ++ */built-in.o|\ ++ */built-in.a|\ ++ arch/x86/kernel/ebda.o|\ ++ arch/x86/kernel/head*.o|\ ++ arch/x86/kernel/platform-quirks.o|\ ++ arch/x86/lib/lib.a|\ ++ lib/lib.a) ++ KOBJFILE=vmlinux ++ return ++ ;; ++ esac ++ + find_parent_obj "$KOBJFILE" +- [[ -n "$PARENT" ]] && DEEP_FIND=0 +- if [[ -z "$PARENT" ]]; then +- [[ "$KOBJFILE" = *.ko ]] && return +- case "$KOBJFILE" in +- */built-in.o|\ +- */built-in.a|\ +- arch/x86/lib/lib.a|\ +- arch/x86/kernel/head*.o|\ +- arch/x86/kernel/ebda.o|\ +- arch/x86/kernel/platform-quirks.o|\ +- lib/lib.a) +- KOBJFILE=vmlinux +- return +- esac +- if [[ "$DEEP_FIND" -eq 0 ]]; then +- DEEP_FIND=1 +- continue; +- fi +- die "invalid ancestor $KOBJFILE for $arg" +- fi ++ [[ -z "$PARENT" ]] && die "invalid ancestor $KOBJFILE for $file" + KOBJFILE="$PARENT" + done + } +-- +2.37.3 + diff --git a/0107-create-diff-object-compare-section-name-with-kpatch_.patch b/0107-create-diff-object-compare-section-name-with-kpatch_.patch new file mode 100644 index 0000000..5d016ac --- /dev/null +++ b/0107-create-diff-object-compare-section-name-with-kpatch_.patch @@ -0,0 +1,52 @@ +From ce97c8ef720bd288fbc53aad51969571a1c2c1e6 Mon Sep 17 00:00:00 2001 +From: Song Liu +Date: Wed, 13 Oct 2021 00:10:20 -0700 +Subject: [PATCH 107/108] create-diff-object: compare section name with + kpatch_section_function_name + +Profile-Guided Optimization (PGO) uses profiling data to help the compiler +to evaluate the properties of a function, and thus adds different prefixes +to the section/function. For example, with -ffunction-sections, the +compiler will prefix some sectiones with .text.unlikely. However, if a +function changes from the version in the profiling data, the compiler may +ignore the profiling data. This often happens to the patched function +when kpatch-build builds the patch. As a result, the original function +and the patch function may have different prefix, i.e., one of them has +.text, the other has .text.unlikely. + +To correlate these functions properly, use kpatch_section_function_name() +in kpatch_correlate_sections() to find matching sections. + +Signed-off-by: Song Liu +--- + kpatch-build/create-diff-object.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c +index 1967bd8..6f08c4d 100644 +--- a/kpatch-build/create-diff-object.c ++++ b/kpatch-build/create-diff-object.c +@@ -986,6 +986,8 @@ static void kpatch_correlate_section(struct section *sec_orig, + kpatch_correlate_symbol(sec_orig->sym, sec_patched->sym); + } + ++static char *kpatch_section_function_name(struct section *sec); ++ + static void kpatch_correlate_sections(struct list_head *seclist_orig, + struct list_head *seclist_patched) + { +@@ -995,8 +997,9 @@ static void kpatch_correlate_sections(struct list_head *seclist_orig, + if (sec_orig->twin) + continue; + list_for_each_entry(sec_patched, seclist_patched, list) { +- if (kpatch_mangled_strcmp(sec_orig->name, sec_patched->name) || +- sec_patched->twin) ++ if (sec_patched->twin || ++ kpatch_mangled_strcmp(kpatch_section_function_name(sec_orig), ++ kpatch_section_function_name(sec_patched))) + continue; + + if (is_special_static(is_rela_section(sec_orig) ? +-- +2.37.3 + diff --git a/0108-kpatch-build-add-support-for-clang-pgo.patch b/0108-kpatch-build-add-support-for-clang-pgo.patch new file mode 100644 index 0000000..b88c922 --- /dev/null +++ b/0108-kpatch-build-add-support-for-clang-pgo.patch @@ -0,0 +1,73 @@ +From db5d32876a6c89454aab9e8e9412435fc5b3facd Mon Sep 17 00:00:00 2001 +From: Song Liu +Date: Wed, 13 Oct 2021 01:03:55 -0700 +Subject: [PATCH 108/108] kpatch-build: add support for clang pgo + +For clang with Profile-Guided Optimization (PGO), profile data is needed +to compile the livepatch properly. Add option -p|--profile-data, which +specifies the profile data file. This option is only valid with +CONFIG_CC_IS_CLANG and CONFIG_PGO_CLANG. + +Signed-off-by: Song Liu +--- + kpatch-build/kpatch-build | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build +index bec8010..13bccab 100755 +--- a/kpatch-build/kpatch-build ++++ b/kpatch-build/kpatch-build +@@ -677,9 +677,10 @@ usage() { + echo " --skip-cleanup Skip post-build cleanup" >&2 + echo " --skip-compiler-check Skip compiler version matching check" >&2 + echo " (not recommended)" >&2 ++ echo " -p, --profile-data specify profile data for PGO (clang only)" >&2 + } + +-options="$(getopt -o ha:r:s:c:v:j:t:n:o:dR -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace" -- "$@")" || die "getopt failed" ++options="$(getopt -o ha:r:s:c:v:j:t:n:o:dRp: -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace,profile-data" -- "$@")" || die "getopt failed" + + eval set -- "$options" + +@@ -761,6 +762,10 @@ while [[ $# -gt 0 ]]; do + echo "WARNING: Skipping compiler version matching check (not recommended)" + SKIPCOMPILERCHECK=1 + ;; ++ -p|--profile-data) ++ PROFILE_DATA="$(readlink -f "$2")" ++ shift ++ ;; + *) + [[ "$1" = "--" ]] && shift && continue + [[ ! -f "$1" ]] && die "patch file '$1' not found" +@@ -1056,6 +1061,16 @@ fi + + if [[ -n "$CONFIG_CC_IS_CLANG" ]]; then + echo "WARNING: Clang support is experimental" ++ if [[ -z "$PROFILE_DATA" ]] && [[ -n "$CONFIG_PGO_CLANG" ]]; then ++ die "Please specify profile-data for CONFIG_PGO_CLANG" ++ fi ++ if [[ -n "$PROFILE_DATA" ]] && [[ -z "$CONFIG_PGO_CLANG" ]]; then ++ echo "WARNING profile-data specified w/o CONFIG_PGO_CLANG, ignore it" ++ fi ++else ++ if [[ -n "$PROFILE_DATA" ]]; then ++ die "Only supports profile-data with Clang" ++ fi + fi + + if [[ "$SKIPCOMPILERCHECK" -eq 0 ]]; then +@@ -1107,6 +1122,10 @@ declare -a MAKEVARS + if [[ -n "$CONFIG_CC_IS_CLANG" ]]; then + MAKEVARS+=("CC=${KPATCH_CC_PREFIX}${CLANG}") + MAKEVARS+=("HOSTCC=clang") ++ if [[ -n "$CONFIG_PGO_CLANG" ]]; then ++ MAKEVARS+=("CFLAGS_PGO_CLANG=-fprofile-use=$PROFILE_DATA") ++ MAKEVARS+=("LLVM=1") ++ fi + else + MAKEVARS+=("CC=${KPATCH_CC_PREFIX}${GCC}") + fi +-- +2.37.3 + diff --git a/SOURCES/0001-contrib-disable-upstart-kpatch.conf-install.patch b/SOURCES/0001-contrib-disable-upstart-kpatch.conf-install.patch deleted file mode 100644 index 44eb5b4..0000000 --- a/SOURCES/0001-contrib-disable-upstart-kpatch.conf-install.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f056d60fb309896a52882fd3fc10fb5305f5a47e Mon Sep 17 00:00:00 2001 -From: Joe Lawrence -Date: Thu, 21 Jun 2018 15:40:20 -0400 -Subject: [PATCH] contrib: disable upstart kpatch.conf install - -Do not install the upstart configuration file to avoid this rhpkg -build complaint: - - Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/kpatch-0.6.1-1.el7.noarch - error: Installed (but unpackaged) file(s) found: - /etc/init/kpatch.conf - Installed (but unpackaged) file(s) found: - /etc/init/kpatch.conf - -We'll need to think of a better way to do this upstream, but for now, -just skip the unneeded file on RHEL. - -Signed-off-by: Joe Lawrence ---- - contrib/Makefile | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/contrib/Makefile b/contrib/Makefile -index 0b0eeeb23a56..e873f27d6eae 100644 ---- a/contrib/Makefile -+++ b/contrib/Makefile -@@ -6,12 +6,12 @@ install: all - $(INSTALL) -d $(SYSTEMDDIR) - $(INSTALL) -m 0644 kpatch.service $(SYSTEMDDIR) - sed -i 's~PREFIX~$(PREFIX)~' $(SYSTEMDDIR)/kpatch.service -- $(INSTALL) -d $(UPSTARTDIR) -- $(INSTALL) -m 0644 kpatch.conf $(UPSTARTDIR) -- sed -i 's~PREFIX~$(PREFIX)~' $(UPSTARTDIR)/kpatch.conf -+# $(INSTALL) -d $(UPSTARTDIR) -+# $(INSTALL) -m 0644 kpatch.conf $(UPSTARTDIR) -+# sed -i 's~PREFIX~$(PREFIX)~' $(UPSTARTDIR)/kpatch.conf - - uninstall: - $(RM) $(SYSTEMDDIR)/kpatch.service -- $(RM) $(UPSTARTDIR)/kpatch.conf -+# $(RM) $(UPSTARTDIR)/kpatch.conf - - clean: --- -1.8.3.1 - diff --git a/SOURCES/0002-kpatch-clarify-unload-unsupport.patch b/SOURCES/0002-kpatch-clarify-unload-unsupport.patch deleted file mode 100644 index b1c0d2d..0000000 --- a/SOURCES/0002-kpatch-clarify-unload-unsupport.patch +++ /dev/null @@ -1,78 +0,0 @@ -kpatch: clarify that "kpatch unload" isn't supported - -Add a user-prompt to the kpatch unload subcommand and make a similiar -mention in the manual page. - -Provide an undocumented force option so that QE and dev scripts can -still run unload kpatch modules from scripts. - -RHEL-only. - -Signed-off-by: Joe Lawrence -diff -Nupr kpatch-0.6.1.old/kpatch/kpatch kpatch-0.6.1/kpatch/kpatch ---- kpatch-0.9.2.old/kpatch/kpatch 2019-08-28 10:35:01.191259434 -0400 -+++ kpatch-0.9.2/kpatch/kpatch 2019-08-28 16:11:13.067926576 -0400 -@@ -49,8 +49,8 @@ usage () { - echo >&2 - usage_cmd "load --all" "load all installed patch modules into the running kernel" - usage_cmd "load " "load patch module into the running kernel" -- usage_cmd "unload --all" "unload all patch modules from the running kernel" -- usage_cmd "unload " "unload patch module from the running kernel" -+ usage_cmd "unload --all (UNSUPPORTED)" "unload all patch modules from the running kernel" -+ usage_cmd "unload (UNSUPPORTED)" "unload patch module from the running kernel" - echo >&2 - usage_cmd "info " "show information about a patch module" - echo >&2 -@@ -71,6 +71,16 @@ die() { - exit 1 - } - -+confirm_prompt() { -+ local prompt="$1" -+ local answer -+ while true; do -+ read -rp "$prompt [Y/N] " answer -+ [[ $answer == 'Y' || $answer == 'y' ]] && return 0 -+ [[ $answer == 'N' || $answer == 'n' ]] && return 1 -+ done -+} -+ - __find_module () { - MODULE="$1" - [[ -f "$MODULE" ]] && return -@@ -406,6 +416,19 @@ unset MODULE - init_sysfs_var - - [[ "$#" -lt 1 ]] && usage -+ -+# RHEL-specific support options -+case "$1" in -+"force") -+ # For scripting purposes, support "kpatch force unload". -+ # Shift out the "force" to avoid the user-prompt check below. -+ shift -+ ;; -+"unload") -+ confirm_prompt "WARNING: Red Hat doesn't support unloading of kpatches, continue anyway?" || exit 1 -+ ;; -+esac -+ - case "$1" in - "load") - [[ "$#" -ne 2 ]] && usage -diff -Nupr kpatch-0.6.1.old/man/kpatch.1 kpatch-0.6.1/man/kpatch.1 ---- kpatch-0.9.2.old/man/kpatch.1 2019-08-28 10:35:01.191259434 -0400 -+++ kpatch-0.9.2/man/kpatch.1 2019-08-28 14:51:23.268198897 -0400 -@@ -23,10 +23,10 @@ load --all - load - load patch module into the running kernel - --unload --all -+unload --all (UNSUPPORTED) - unload all patch modules from the running kernel - --unload -+unload (UNSUPPORTED) - unload patch module from the running kernel - - info diff --git a/SOURCES/0200-Makefile-set-install-permission-modes.patch b/SOURCES/0200-Makefile-set-install-permission-modes.patch deleted file mode 100644 index aecd225..0000000 --- a/SOURCES/0200-Makefile-set-install-permission-modes.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 73f6d5cdb2a4ce78cec6f49517116a3c7616f393 Mon Sep 17 00:00:00 2001 -From: Joe Lawrence -Date: Thu, 12 Nov 2020 15:15:47 -0500 -Subject: [PATCH] Makefile: set install permission modes - -By default, the install command will apply rwxr-xr-x permissions (how -intuitive). Give the command expected file modes to avoid rpmbuild -complaints like this: - - *** WARNING: ./usr/lib/python3.9/site-packages/dnf-plugins/kpatch.py is executable but has no shebang, removing executable bit - *** WARNING: ./etc/dnf/plugins/kpatch.conf is executable but has no shebang, removing executable bit - -Signed-off-by: Joe Lawrence ---- - Makefile | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/Makefile b/Makefile -index fb92d06..77c8eb5 100644 ---- a/Makefile -+++ b/Makefile -@@ -23,11 +23,11 @@ all: $(TARGETS) - - install: $(TARGETS) - install -d $(MANDIR) -- install man/dnf.kpatch.8.gz $(MANDIR) -+ install -m 644 man/dnf.kpatch.8.gz $(MANDIR) - install -d $(CONFDIR) -- install conf/kpatch.conf $(CONFDIR) -+ install -m 644 conf/kpatch.conf $(CONFDIR) - install -d $(DNFPLUGINDIR) -- install kpatch.py $(DNFPLUGINDIR) -+ install -m 644 kpatch.py $(DNFPLUGINDIR) - - %.gz: % - gzip --keep $^ --- -2.25.4 - diff --git a/SOURCES/1231.patch b/SOURCES/1231.patch deleted file mode 100644 index 28830d4..0000000 --- a/SOURCES/1231.patch +++ /dev/null @@ -1,119 +0,0 @@ -From ac947f20de981a0da0b63521894cb5777fc10fa3 Mon Sep 17 00:00:00 2001 -From: Song Liu -Date: Wed, 13 Oct 2021 00:10:20 -0700 -Subject: [PATCH 1/2] create-diff-object: compare section name with - kpatch_section_function_name - -Profile-Guided Optimization (PGO) uses profiling data to help the compiler -to evaluate the properties of a function, and thus adds different prefixes -to the section/function. For example, with -ffunction-sections, the -compiler will prefix some sectiones with .text.unlikely. However, if a -function changes from the version in the profiling data, the compiler may -ignore the profiling data. This often happens to the patched function -when kpatch-build builds the patch. As a result, the original function -and the patch function may have different prefix, i.e., one of them has -.text, the other has .text.unlikely. - -To correlate these functions properly, use kpatch_section_function_name() -in kpatch_correlate_sections() to find matching sections. - -Signed-off-by: Song Liu ---- - kpatch-build/create-diff-object.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c -index 826741d0..319ed68d 100644 ---- a/kpatch-build/create-diff-object.c -+++ b/kpatch-build/create-diff-object.c -@@ -1001,6 +1001,8 @@ static void kpatch_correlate_section(struct section *sec_orig, - kpatch_correlate_symbol(sec_orig->sym, sec_patched->sym); - } - -+static char *kpatch_section_function_name(struct section *sec); -+ - static void kpatch_correlate_sections(struct list_head *seclist_orig, - struct list_head *seclist_patched) - { -@@ -1010,8 +1012,9 @@ static void kpatch_correlate_sections(struct list_head *seclist_orig, - if (sec_orig->twin) - continue; - list_for_each_entry(sec_patched, seclist_patched, list) { -- if (kpatch_mangled_strcmp(sec_orig->name, sec_patched->name) || -- sec_patched->twin) -+ if (sec_patched->twin || -+ kpatch_mangled_strcmp(kpatch_section_function_name(sec_orig), -+ kpatch_section_function_name(sec_patched))) - continue; - - if (is_special_static(is_rela_section(sec_orig) ? - -From 085cf5d21aa4f61b617f7a51fdede34ec1061ece Mon Sep 17 00:00:00 2001 -From: Song Liu -Date: Wed, 13 Oct 2021 01:03:55 -0700 -Subject: [PATCH 2/2] kpatch-build: add support for clang pgo - -For clang with Profile-Guided Optimization (PGO), profile data is needed -to compile the livepatch properly. Add option -p|--profile-data, which -specifies the profile data file. This option is only valid with -CONFIG_CC_IS_CLANG and CONFIG_PGO_CLANG. - -Signed-off-by: Song Liu ---- - kpatch-build/kpatch-build | 20 +++++++++++++++++++- - 1 file changed, 19 insertions(+), 1 deletion(-) - -diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build -index 634095d5..1f3fc99b 100755 ---- a/kpatch-build/kpatch-build -+++ b/kpatch-build/kpatch-build -@@ -535,9 +535,10 @@ usage() { - echo " --skip-cleanup Skip post-build cleanup" >&2 - echo " --skip-compiler-check Skip compiler version matching check" >&2 - echo " (not recommended)" >&2 -+ echo " -p, --profile-data specify profile data for PGO (clang only)" >&2 - } - --options="$(getopt -o ha:r:s:c:v:j:t:n:o:dR -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace" -- "$@")" || die "getopt failed" -+options="$(getopt -o ha:r:s:c:v:j:t:n:o:dRp: -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace,profile-data" -- "$@")" || die "getopt failed" - - eval set -- "$options" - -@@ -619,6 +620,10 @@ while [[ $# -gt 0 ]]; do - echo "WARNING: Skipping compiler version matching check (not recommended)" - SKIPCOMPILERCHECK=1 - ;; -+ -p|--profile-data) -+ PROFILE_DATA="$(readlink -f "$2")" -+ shift -+ ;; - *) - [[ "$1" = "--" ]] && shift && continue - [[ ! -f "$1" ]] && die "patch file '$1' not found" -@@ -896,6 +901,16 @@ fi - - if [[ -n "$CONFIG_CC_IS_CLANG" ]]; then - echo "WARNING: Clang support is experimental" -+ if [[ -z "$PROFILE_DATA" ]] && [[ -n "$CONFIG_PGO_CLANG" ]]; then -+ die "Please specify profile-data for CONFIG_PGO_CLANG" -+ fi -+ if [[ -n "$PROFILE_DATA" ]] && [[ -z "$CONFIG_PGO_CLANG" ]]; then -+ echo "WARNING profile-data specified w/o CONFIG_PGO_CLANG, ignore it" -+ fi -+else -+ if [[ -n "$PROFILE_DATA" ]]; then -+ die "Only supports profile-data with Clang" -+ fi - fi - - if [[ "$SKIPCOMPILERCHECK" -eq 0 ]]; then -@@ -943,6 +958,9 @@ declare -a MAKEVARS - if [[ -n "$CONFIG_CC_IS_CLANG" ]]; then - MAKEVARS+=("CC=${KPATCH_CC_PREFIX}${CLANG}") - MAKEVARS+=("HOSTCC=clang") -+ if [[ -n "$CONFIG_PGO_CLANG" ]]; then -+ MAKEVARS+=("CFLAGS_PGO_CLANG=-fprofile-use=$PROFILE_DATA") -+ fi - else - MAKEVARS+=("CC=${KPATCH_CC_PREFIX}${GCC}") - fi diff --git a/SOURCES/3112397f3b7b59f8e9089143965d889165c16d13.patch b/SOURCES/3112397f3b7b59f8e9089143965d889165c16d13.patch deleted file mode 100644 index dbfd56b..0000000 --- a/SOURCES/3112397f3b7b59f8e9089143965d889165c16d13.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3112397f3b7b59f8e9089143965d889165c16d13 Mon Sep 17 00:00:00 2001 -From: Josh Poimboeuf -Date: Mon, 6 Jun 2022 17:05:41 -0700 -Subject: [PATCH] create-diff-object: Create missing section symbol - -Recent toolchains only create a section symbol if it's needed, i.e. if -there's a reference to it. If there's a missing section symbol in -kpatch_create_intermediate_sections(), create one instead of erroring -out. - -Fixes #1272. - -Signed-off-by: Josh Poimboeuf ---- - kpatch-build/create-diff-object.c | 21 ++++++++++++++++----- - 1 file changed, 16 insertions(+), 5 deletions(-) - -diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c -index 319ed68d..420d55d8 100644 ---- a/kpatch-build/create-diff-object.c -+++ b/kpatch-build/create-diff-object.c -@@ -3397,12 +3397,23 @@ static void kpatch_create_intermediate_sections(struct kpatch_elf *kelf, - - /* add rela to fill in krelas[index].dest field */ - ALLOC_LINK(rela2, &krela_sec->rela->relas); -- if (sec->base->secsym) -- rela2->sym = sec->base->secsym; -- else -- ERROR("can't create dynrela for section %s (symbol %s): no bundled or section symbol", -- sec->name, rela->sym->name); -+ if (!sec->base->secsym) { -+ struct symbol *sym; - -+ /* -+ * Newer toolchains are stingy with their -+ * section symbols, create one if it doesn't -+ * exist already. -+ */ -+ ALLOC_LINK(sym, &kelf->symbols); -+ sym->sec = sec->base; -+ sym->sym.st_info = GELF_ST_INFO(STB_LOCAL, STT_SECTION); -+ sym->type = STT_SECTION; -+ sym->bind = STB_LOCAL; -+ sym->name = sec->base->name; -+ sec->base->secsym = sym; -+ } -+ rela2->sym = sec->base->secsym; - rela2->type = absolute_rela_type(kelf); - rela2->addend = rela->offset; - rela2->offset = (unsigned int)(index * sizeof(*krelas) + \ diff --git a/SPECS/kpatch.spec b/SPECS/kpatch.spec deleted file mode 100644 index 347215a..0000000 --- a/SPECS/kpatch.spec +++ /dev/null @@ -1,251 +0,0 @@ -%define kpatch_dnf_ver 0.2 - -Name: kpatch -Version: 0.9.6 -Release: 2.10%{?dist} -Summary: Dynamic kernel patch manager - -Group: System Environment/Kernel -License: GPLv2 -URL: https://github.com/dynup/kpatch -Source0: https://github.com/dynup/kpatch/archive/v%{version}.tar.gz -Source1: kpatch-dnf-v%{kpatch_dnf_ver}.tar.gz - -# RHEL-only -Patch0: 0001-contrib-disable-upstart-kpatch.conf-install.patch -Patch1: 0002-kpatch-clarify-unload-unsupport.patch - -# Upstream backports -Patch100: https://github.com/dynup/kpatch/pull/1231.patch -# PR#1273 backport for 0.9.6 -Patch101: https://github.com/liu-song-6/kpatch/commit/3112397f3b7b59f8e9089143965d889165c16d13.patch - -# kpatch-dnf backports -Patch200: 0200-Makefile-set-install-permission-modes.patch - -# kpatch is only supported on x86_64 and ppc64le -# https://github.com/dynup/kpatch/#supported-architectures -ExcludeArch: aarch64 -ExcludeArch: s390x - -%description -kpatch is a live kernel patch module manager. It allows the user to manage -a collection of binary kernel patch modules which can be used to dynamically -patch the kernel without rebooting. - -%package -n kpatch-runtime -Summary: Dynamic kernel patch manager -Requires: bash kmod binutils -Suggests: kpatch-dnf -Provides: kpatch = %{version}-%{release} -Obsoletes: kpatch < 0.9.4-1.6 -BuildArch: noarch - -%description -n kpatch-runtime -kpatch is a live kernel patch module manager. It allows the user to manage -a collection of binary kernel patch modules which can be used to dynamically -patch the kernel without rebooting. - -%package -n kpatch-dnf -Summary: kpatch-patch manager plugin for DNF -Version: %kpatch_dnf_ver -BuildRequires: python3-devel python3-dnf -Requires: python3-dnf python3-hawkey -BuildArch: noarch - -%description -n kpatch-dnf -kpatch-dnf is a DNF plugin that manages subscription to kpatch-patch updates. -When enabled, kernel packages are automatically subscribed to corresponding -kpatch-patch packages updates. - -%package -n kpatch-build -Summary: Build tool for kpatch -BuildRequires: gcc kernel-devel elfutils elfutils-devel -%description -n kpatch-build -kpatch-build is a tool to build patches for kpatch. - -%prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch100 -p1 -%patch101 -p1 - -%setup -D -T -a 1 -cd kpatch-dnf-%{kpatch_dnf_ver} -%patch200 -p1 -cd .. - -%build -%make_build - -%make_build -C kpatch-dnf-%{kpatch_dnf_ver} - -%install -make install PREFIX=/usr DESTDIR=%{buildroot} -mkdir -p %{buildroot}/%{_sharedstatedir}/kpatch - -make install PREFIX=/usr DESTDIR=%{buildroot} PYTHONSITES=%{python3_sitelib} -C kpatch-dnf-%{kpatch_dnf_ver} - -%files -n kpatch-runtime -%{_sbindir}/kpatch -%{_usr}/lib/systemd/system/kpatch.service -%{_sharedstatedir}/kpatch -%doc %{_mandir}/man1/kpatch.1.gz - -%files -n kpatch-dnf -%{python3_sitelib}/dnf-plugins/kpatch.py -%{python3_sitelib}/dnf-plugins/__pycache__ -%config(noreplace) %{_sysconfdir}/dnf/plugins/kpatch.conf -%doc %{_mandir}/man8/dnf.kpatch.8.gz - -%post -n kpatch-dnf -echo "To enable automatic kpatch-patch subscription, run:" -echo -e "\t$ dnf kpatch auto" - -%files -n kpatch-build -%{_bindir}/kpatch-build -%{_libexecdir}/%{name} -%{_datadir}/%{name} -%{_mandir}/man1/kpatch-build.1* - -%changelog -* Tue Jun 7 2022 Davide Cavalca - 0.9.6-2.10 -- Refresh PR#1231 patch -- Backport PR#1273 - -* Wed Apr 13 2022 Davide Cavalca - 0.9.6-2.9 -- Merge upstream changes from kpatch-0.9.4-2.el8 -- Refresh PR#1231 patch - -* Tue Apr 12 2022 Davide Cavalca - 0.9.6-1.8 -- Fix release - -* Tue Apr 12 2022 Davide Cavalca - 0.9.6-1.1 -- Update to 0.9.6 - -* Fri Jan 14 2022 Yannick Cote 0.9.4-2 -- Add /usr/lib/kpatch to install and files list to appease SELinux (rhbz#2022123) - -* Wed Oct 13 2021 Davide Cavalca - 0.9.4-1.7 -- Backport PR#1231 for clang PGO support -- Exclude aarch64 and s390x as kpatch is not supported there - -* Fri Aug 27 2021 Davide Cavalca - 0.9.4-1.6 -- Add Obsoletes to properly replace kpatch with kpatch-runtime on upgrades - -* Thu Aug 26 2021 Davide Cavalca - 0.9.4-1.5 -- Bump extrarev to ensure kpatch-dnf has a unique NEVRA - -* Thu Aug 26 2021 Davide Cavalca - 0.9.4-1.1 -- Update to 0.9.4 and drop upstreamed patches - -* Fri Jun 4 2021 Davide Cavalca - 0.9.3-1.4 -- Drop patches to ignore.printk_index and _pi.* sections - -* Wed May 26 2021 Davide Cavalca - 0.9.3-1.3 -- Add patch to ignore _pi.* sections - -* Wed May 26 2021 Davide Cavalca - 0.9.3-1.2 -- Backport PR#1183 to add support for atomic replace of cumulative patches - -* Wed May 5 2021 Davide Cavalca - 0.9.3-1.1 -- Update to 0.9.3 and drop upstreamed patches -- Downgrade kpatch-dnf dependency to a Suggests -- Add patch to ignore .printk_index sections - -* Wed May 5 2021 Davide Cavalca - 0.9.2-5.1 -- Add kpatch-build arched subpackage -- Add kpatch-runtime noarch subpackage to provide kpatch - -* Mon Mar 15 2021 Artem Savkov 0.9.2-5 -- Cleanup /var/lib/kpatch directory on uninstall (rhbz#1930108) - -* Thu Mar 11 2021 Joe Lawrence 0.9.2-4 -- Fix kpatch-dnf package description typos (rhbz#1934293) - -* Mon Jan 04 2021 Julien Thierry 0.9.2-3 -- Remove kpatch-dnf dependency on python3 (rhbz#1912224) - -* Fri Nov 20 2020 Julien Thierry 0.9.2-2 -- Fix unload issue under stress (rhbz#1883238) -- Fix dnf-kpatch man file permissions (rhbz#1899341) -- Do not replace dnf kpatch configuration file when reinstalling (rhbz#1898191) - -* Thu Sep 24 2020 Julien Thierry 0.9.2-1 -- Add kpatch-dnf subpackage (rhbz#1798711) - -* Thu Sep 24 2020 Julien Thierry 0.9.2-1 -- update to 0.9.2 (rhbz#1877857) - -* Tue Oct 22 2019 Yannick Cote 0.6.1-6 -- fix patch loading issue caused by recent kernel rebase (rhbz#1754679) - -* Wed Aug 28 2019 Joe Lawrence 0.6.1-5 -- kpatch: clarify that "kpatch unload" isn't supported (rhbz#1746461) - -* Sun Jun 23 2019 Joe Lawrence 0.6.1-4 -- kpatch script: don't fail if module already loaded+enabled (rhbz#1719305) - -* Wed Jun 12 2019 Joe Lawrence 0.6.1-3 -- kpatch: patches shouldn't be unloaded on system shutdown (rhbz#1719305) - -* Wed Jun 5 2019 Josh Poimboeuf 0.6.1-2 -- CI gating test (rhbz#1717417) - -* Tue Aug 14 2018 Joe Lawrence 0.6.1-1 -- update to 0.6.1 (rhbz#1615880) - -* Mon Aug 13 2018 Troy Dawson - 0.4.0-4 -- Release Bumped for el8 Mass Rebuild - -* Thu Nov 16 2017 Joe Lawrence 0.4.0-3 -- kpatch: better livepatch module support (rhbz#1504066) - -* Wed Oct 18 2017 Josh Poimboeuf 0.4.0-2 -- fix backwards compatibility with RHEL 7.3 patches (rhbz#1497735) - -* Mon Mar 13 2017 Josh Poimboeuf 0.4.0-1 -- update to 0.4.0 (rhbz#1427642) - -* Wed Jun 15 2016 Josh Poimboeuf 0.3.2-1 -- update to 0.3.2 (rhbz#1282508) - -* Wed Nov 18 2015 Josh Poimboeuf 0.3.1-1 -- update to 0.3.1 (rhbz#1282508) - -* Tue Sep 16 2014 Seth Jennings 0.1.10-4 -- fix dracut dependencies (rhbz#1170369) - -* Tue Sep 16 2014 Seth Jennings 0.1.10-3 -- support re-enabling forced modules (rhbz#1140268) - -* Thu Sep 11 2014 Seth Jennings 0.1.10-2 -- support modprobe format names (rhbz#1133045) - -* Thu Jul 31 2014 Josh Poimboeuf 0.1.10-1 -- update to kpatch 0.1.10 - -* Wed Jul 23 2014 Josh Poimboeuf 0.1.9-1 -- update to kpatch 0.1.9 - -* Tue Jul 15 2014 Josh Poimboeuf 0.1.8-1 -- update to kpatch 0.1.8 - -* Wed May 21 2014 Josh Poimboeuf 0.1.2-1 -- update to kpatch 0.1.2 - -* Mon May 19 2014 Josh Poimboeuf 0.1.1-2 -- fix initramfs core module path - -* Mon May 19 2014 Josh Poimboeuf 0.1.1-1 -- rebase to kpatch 0.1.1 - -* Fri May 9 2014 Josh Poimboeuf 0.1.0-2 -- modprobe core module - -* Tue May 6 2014 Josh Poimboeuf 0.1.0-1 -- Initial kpatch release 0.1.0 - -* Thu Jan 30 2014 Josh Poimboeuf 0.0-1 -- Initial build diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..c821aac --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: kernel-qe.kernel-ci.general-kpatch.tier0.functional} diff --git a/kpatch.spec b/kpatch.spec new file mode 100644 index 0000000..fbbcd37 --- /dev/null +++ b/kpatch.spec @@ -0,0 +1,168 @@ +%define kpatch_dnf_ver 0.4 + +Name: kpatch +Version: 0.9.7 +Release: 1.1%{?dist} +Summary: Dynamic kernel patch manager + +Group: System Environment/Kernel +License: GPLv2 +URL: https://github.com/dynup/kpatch +Source0: https://github.com/dynup/kpatch/archive/v%{version}.tar.gz +Source1: kpatch-dnf-v%{kpatch_dnf_ver}.tar.gz + +# RHEL-only +Patch0: 0001-contrib-disable-upstart-kpatch.conf-install.patch +Patch1: 0002-kpatch-clarify-unload-unsupport.patch +Patch2: 0003-do-not-rm-selinux-rpm-owned-directory.patch + +# Upstream backports +Patch100: 0100-kpatch-build-for-clang-use-.strtab-if-no-.shstrtab.patch +Patch101: 0101-create-diff-object-ignore-clang-s-.llvm_addrsig-sect.patch +Patch102: 0102-create-diff-object-ignore-.llvm.-sections.patch +Patch103: 0103-gcc-plugin-update-headers-for-gcc-12.patch +Patch104: 0104-kpatch-cc-Add-more-file-ignores.patch +Patch105: 0105-kpatch-build-Add-find_kobj-short-circuit-for-OOT-mod.patch +Patch106: 0106-kpatch-build-support-Linux-5.19-.cmd-file-format.patch +Patch107: 0107-create-diff-object-compare-section-name-with-kpatch_.patch +Patch108: 0108-kpatch-build-add-support-for-clang-pgo.patch + +# kpatch-dnf backports (inactive -- for future reference) +#Patch200: 0200-foo-bar-etcetera.patch + +%description +kpatch is a live kernel patch module manager. It allows the user to manage +a collection of binary kernel patch modules which can be used to dynamically +patch the kernel without rebooting. + +%package -n kpatch-build +Summary: Build tool for kpatch +BuildRequires: gcc kernel-devel elfutils elfutils-devel +ExcludeArch: aarch64 + +%description -n kpatch-build +kpatch-build is a tool to build patches for kpatch. + +%package -n kpatch-runtime +Summary: Dynamic kernel patch manager +Requires: bash kmod binutils +Suggests: kpatch-dnf +Provides: kpatch = %{version}-%{release} +Obsoletes: kpatch < 0.9.4-1.6 +BuildArch: noarch + +%description -n kpatch-runtime +kpatch is a live kernel patch module manager. It allows the user to manage +a collection of binary kernel patch modules which can be used to dynamically +patch the kernel without rebooting. + +%package -n kpatch-dnf +Summary: patch-patch manager plugin for DNF +Version: %kpatch_dnf_ver +BuildRequires: python3-devel python3-dnf +Requires: python3-dnf python3-hawkey +Provides: kpatch-dnf +BuildArch: noarch + +%description -n kpatch-dnf +kpatch-dnf is a DNF plugin that manages subscription to kpatch-patch updates. +When enabled, kernel packages are automatically subscribed to corresponding +kpatch-patch packages updates. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +# Use this to apply upstream patches to kpatch +%patch100 -p1 +%patch101 -p1 +%patch102 -p1 +%patch103 -p1 +%patch104 -p1 +%patch105 -p1 +%patch106 -p1 +%patch107 -p1 +%patch108 -p1 + +%setup -D -T -a 1 + +# Use this to apply patches to kpatch-dnf (inactive) +#cd kpatch-dnf-%{kpatch_dnf_ver} +#%patch200 -p1 +#cd .. + +%build +make + +make -C kpatch-dnf-%{kpatch_dnf_ver} + +%install +make install PREFIX=/usr DESTDIR=%{buildroot} +mkdir -p %{buildroot}/%{_sharedstatedir}/kpatch + +make install PREFIX=/usr DESTDIR=%{buildroot} PYTHONSITES=%{python3_sitelib} -C kpatch-dnf-%{kpatch_dnf_ver} + +%files -n kpatch-build +%{_bindir}/kpatch-build +%{_libexecdir}/%{name} +%{_datadir}/%{name} +%{_mandir}/man1/kpatch-build.1* + +%files -n kpatch-runtime +%{_sbindir}/kpatch +%{_usr}/lib/systemd/system/kpatch.service +%{_sharedstatedir}/kpatch +%doc %{_mandir}/man1/kpatch.1.gz + +%files -n kpatch-dnf +%{python3_sitelib}/dnf-plugins/kpatch.py +%{python3_sitelib}/dnf-plugins/__pycache__ +%config(noreplace) %{_sysconfdir}/dnf/plugins/kpatch.conf +%doc %{_mandir}/man8/dnf.kpatch.8.gz + +%post -n kpatch-dnf +echo "To enable automatic kpatch-patch subscription, run:" +echo -e "\t$ dnf kpatch auto" + +%changelog +* Tue Oct 25 2022 Davide Cavalca - 0.9.7-1.1 +- Update to 0.9.7 +- Backport patches for clang PGO + +* Fri Jun 10 2022 Yannick Cote 0.9.4-3 +- Do not rm selinux rpm owned directory (rhbz#2053413) + +* Thu Jan 27 2022 Yannick Cote 0.9.4-2 +- Add /usr/lib/kpatch to install and files list to appease SELinux (rhbz#2030004) + +* Wed Sep 29 2021 Artem Savkov - 0.9.4-1 +- Rebase to 0.9.4 + +* Fri Sep 03 2021 Davide Cavalca - 0.9.4-1.6 +- Sync with c8s-sig-hyperscale +- Update to 0.9.4 +- Add kpatch-build arched subpackage +- Add kpatch-runtime noarch subpackage to provide and obsolete kpatch + +* Mon Aug 09 2021 Mohan Boddu - 0.9.3-3 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Thu Jun 10 2021 Joe Lawrence - 0.9.3-2 +- Rebase to latest upstream (via backport patch) + +* Tue May 18 2021 Joel Savitz - 0.9.3-1 +- Rebase to latest upstream + +* Fri Apr 16 2021 Mohan Boddu - 0.9.2-5 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Fri Mar 05 2021 Joe Lawrence 0.9.2-4 +- Fix kpatch-dnf package description typos (rhbz#1934292) + +* Mon Jan 04 2021 Julien Thierry 0.9.2-2 +- Remove kpatch-dnf dependency on python3 (rhbz#1912457) + +* Wed Dec 2 2020 Joe Lawrence 0.9.2-1 +- initial kpatch utility build for rhel-9.0.0 (rhbz#1901593) diff --git a/sources b/sources new file mode 100644 index 0000000..670583b --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (v0.9.7.tar.gz) = c876d9b1e5f6e6ab858fa6f302e78152beb3e50cedd93f3c61ab6f747e32199b0601ad4a36d426d43d0e9a37d9bf1d6bbfddccc86df4b31d5e3e6edead6cded3 +SHA512 (kpatch-dnf-v0.4.tar.gz) = d76b2ec5595e06fd560ae928f43ad275b4ce07574a1fc829d184d56c5f09a88ce0cb1d1b05e58eb53e6d934a879886b7f0149f782950d7856fbb99c61ce436c3