Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Stange <nstange@suse.de>2018-07-11 13:55:14 +0200
committerMiroslav Benes <mbenes@suse.cz>2018-07-11 14:46:33 +0200
commitd8d2d5918d37d2d48a4ae8cd8142988888f9abf5 (patch)
treeab27d15c0ef04cf70640b6d67148af23738b2cd1
parent56f07295b288469a12dd4fd062faf2510b444f52 (diff)
provide KLP_SHADOW_ID() helper macro
In analogy to the KGR_SHADOW_ID() macro, introduce KLP_SHADOW_ID() for the construction of unique shadow variable id's. Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
-rw-r--r--rpm/kernel-livepatch.spec2
-rwxr-xr-xscripts/register-patches.sh2
-rwxr-xr-xscripts/tar-up.sh1
-rw-r--r--shadow.h6
4 files changed, 10 insertions, 1 deletions
diff --git a/rpm/kernel-livepatch.spec b/rpm/kernel-livepatch.spec
index 17af418..5638494 100644
--- a/rpm/kernel-livepatch.spec
+++ b/rpm/kernel-livepatch.spec
@@ -29,6 +29,7 @@ Source1: Makefile
Source2: livepatch_main.c
Source3: config.sh
Source4: source-timestamp
+Source5: shadow.h
@@KLP_PATCHES_SOURCES@@
BuildRequires: kernel-syms kernel-livepatch-tools-devel libelf-devel
ExclusiveArch: ppc64le x86_64
@@ -43,6 +44,7 @@ This is a live patch for SUSE Linux Enterprise Server kernel.
%setup -c
@@KLP_PATCHES_SETUP_SOURCES@@
cp %_sourcedir/livepatch_main.c .
+cp %_sourcedir/shadow.h .
cp %_sourcedir/Makefile .
%build
diff --git a/scripts/register-patches.sh b/scripts/register-patches.sh
index 82417fc..42b56d7 100755
--- a/scripts/register-patches.sh
+++ b/scripts/register-patches.sh
@@ -265,7 +265,7 @@ EOF
# Finish kernel-livepatch.spec:
## Enumerate the per subpatch source *.tar.bz2.
## Note: Start with Source5
-S=5
+S=6
## First check that none of the to be occupied Source<n> slots has
## been used already.
for i in "${!livepatches[@]}"; do
diff --git a/scripts/tar-up.sh b/scripts/tar-up.sh
index ab8ca4c..e5d3762 100755
--- a/scripts/tar-up.sh
+++ b/scripts/tar-up.sh
@@ -73,6 +73,7 @@ done
source $(dirname $0)/release-version.sh
install -m 644 livepatch_main.c $build_dir
+install -m 644 shadow.h $build_dir
install -m 644 rpm/kernel-livepatch.spec $build_dir/kernel-livepatch-"$RELEASE".spec
scripts/register-patches.sh $build_dir/livepatch_main.c $build_dir/kernel-livepatch-"$RELEASE".spec
install -m 644 rpm/config.sh $build_dir/config.sh
diff --git a/shadow.h b/shadow.h
new file mode 100644
index 0000000..1625fc2
--- /dev/null
+++ b/shadow.h
@@ -0,0 +1,6 @@
+#ifndef _KLP_SHADOW_H
+#define _KLP_SHADOW_H
+
+#define KLP_SHADOW_ID(bsc, id) (((unsigned long)(bsc) << 6) | id)
+
+#endif