diff options
author | Ruslan Bilovol <rbilovol@cisco.com> | 2018-02-01 18:34:18 +0200 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2018-02-11 11:52:54 -0800 |
commit | 6cb84a77bbf537651838bef88f84a55e239c2881 (patch) | |
tree | f7400071525ed66e0a33ba0071eb10875a07901f /meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch | |
parent | f75e11225f5f424abfb672d09728c60c61cd801f (diff) | |
download | meta-openembedded-contrib-6cb84a77bbf537651838bef88f84a55e239c2881.tar.gz |
recipes-kernel: add kpatch dynamic kernel patching infrastructure
kpatch is a Linux dynamic kernel patching infrastructure
which allows you to patch a running kernel without
rebooting or restarting any processes
Currently it is enabled and tested on x86-64 systems,
although can be extended to PPC64 as well.
Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch')
-rw-r--r-- | meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch b/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch new file mode 100644 index 0000000000..a9d8a7f2c5 --- /dev/null +++ b/meta-oe/recipes-kernel/kpatch/kpatch/0002-kpatch-build-allow-overriding-of-distro-name.patch @@ -0,0 +1,62 @@ +From d418d716dae1e2a05131dfb42a19a4da2fc8a85d Mon Sep 17 00:00:00 2001 +From: Ruslan Bilovol <rbilovol@cisco.com> +Date: Tue, 2 Jan 2018 14:50:03 +0200 +Subject: [PATCH] kpatch-build: allow overriding of distro name + +It is sometimes useful to have ability to override +distro name, for example during cross-compilation +build when livepatch modules will be ran on the +target which differs from host. + +This patch adds a new --distro option which +implements all needed functionality + +Upstream-Status: Pending + +Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com> +--- + kpatch-build/kpatch-build | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build +index af24cc4..4f9f78d 100755 +--- a/kpatch-build/kpatch-build ++++ b/kpatch-build/kpatch-build +@@ -383,12 +383,13 @@ usage() { + echo " (can be specified multiple times)" >&2 + echo " --cross-compile Specify the prefix used for all executables" >&2 + echo " used during compilation" >&2 ++ echo " --distro Override distro name" >&2 + echo " --skip-cleanup Skip post-build cleanup" >&2 + echo " --skip-gcc-check Skip gcc version matching check" >&2 + echo " (not recommended)" >&2 + } + +-options="$(getopt -o ha:r:s:c:v:j:t:n:o:d -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,debug,cross-compile:,skip-gcc-check,skip-cleanup" -- "$@")" || die "getopt failed" ++options="$(getopt -o ha:r:s:c:v:j:t:n:o:d -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,debug,cross-compile:,distro:,skip-gcc-check,skip-cleanup" -- "$@")" || die "getopt failed" + + eval set -- "$options" + +@@ -450,6 +451,10 @@ while [[ $# -gt 0 ]]; do + KPATCH_CROSS_COMPILE="$2" + shift + ;; ++ --distro) ++ DISTRO="$2" ++ shift ++ ;; + --skip-cleanup) + echo "Skipping cleanup" + SKIPCLEANUP=1 +@@ -526,7 +531,7 @@ fi + # Don't check external file. + # shellcheck disable=SC1091 + source /etc/os-release +-DISTRO="$ID" ++DISTRO="${DISTRO:-${ID}}" + if [[ "$DISTRO" = fedora ]] || [[ "$DISTRO" = rhel ]] || [[ "$DISTRO" = ol ]] || [[ "$DISTRO" = centos ]]; then + [[ -z "$VMLINUX" ]] && VMLINUX="/usr/lib/debug/lib/modules/$ARCHVERSION/vmlinux" + [[ -e "$VMLINUX" ]] || die "kernel-debuginfo-$ARCHVERSION not installed" +-- +1.9.1 + |