[Devel] [PATCH RHEL7 COMMIT] ve: vznetstat and dummy Makefiles altered for Kpatch build
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Oct 8 01:45:08 PDT 2015
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.8.4
------>
commit 78a600908985d33ee300d8186c6309ad9d6ffe56
Author: Evgenii Shatokhin <eshatokhin at odin.com>
Date: Thu Oct 8 12:45:08 2015 +0400
ve: vznetstat and dummy Makefiles altered for Kpatch build
When I try to prepare a binary patch for vzkernel 3.10.0-229.7.2* with
Kpatch, the kernel fails to build. Here are the commands and the
relevant part of the output:
exec gcc -Wp,-MD,kernel/ve/vznetstat/.vznetstat.o.d -nostdinc
-isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
<...>
-I/usr/local/share/kpatch/patch -ffunction-sections -fdata-sections
-DMODULE '-DKBUILD_STR(s)=#s'
'-DKBUILD_BASENAME=KBUILD_STR(vznetstat)'
'-DKBUILD_MODNAME=KBUILD_STR(vznetstat)' -c -o
kernel/ve/vznetstat/.tmp_vznetstat.o
/home/user/.kpatch/src/kernel/ve/vznetstat/vznetstat.c
Assembler messages:
Fatal error: can't create kernel/ve/vznetstat/.tmp_vznetstat.o:
No such file or directory
make[3]: *** [kernel/ve/vznetstat/vznetstat.o] Error 2
make[2]: *** [kernel/ve] Error 2
make[1]: *** [kernel] Error
The directories kernel/ve/vznetstat/ and kernel/ve/dummy/ were not
created in the build tree automatically in this case. If I create
these directories manually, the build completes successfully.
kpatch-build only provides thin wrappers for the compiler and such
to copy the resulting object files elsewhere. The kernel build
system is then used as is, so the problem is likely not in Kpatch.
kernel/ve/Makefile refers to vznetstat/* and dummy/* directly.
This patch makes sure these directories are explicitly added to the
build system. In my experiments, that was enough for both the normal
kernel builds and the Kpatch-based builds to complete successfully.
Note that *vznetstat*.ko modules will now be built in
kernel/ve/vznetstat/ rather than in kernel/ve/ as before, same for
the modules in kernel/ve/dummy/. As long as these modules are loaded
using modprobe and without explicit paths, it should be OK.
https://jira.sw.ru/browse/PSBM-40069
Signed-off-by: Evgenii Shatokhin <eshatokhin at odin.com>
khorenko@: filenames in new Makefile comments fixed
---
kernel/ve/Makefile | 6 ++----
kernel/ve/dummy/Makefile | 9 +++++++++
kernel/ve/vznetstat/Makefile | 7 +++++++
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/kernel/ve/Makefile b/kernel/ve/Makefile
index 718cc36..56da930 100644
--- a/kernel/ve/Makefile
+++ b/kernel/ve/Makefile
@@ -13,7 +13,7 @@ vzmon-objs = vecalls.o
obj-$(CONFIG_VZ_DEV) += vzdev.o
obj-$(CONFIG_VZ_EVENT) += vzevent.o
-obj-$(CONFIG_VE_NETDEV_ACCOUNTING) += vznetstat/vznetstat.o vznetstat/ip_vznetstat.o vznetstat/ip6_vznetstat.o
+obj-$(CONFIG_VE_NETDEV_ACCOUNTING) += vznetstat/
obj-$(CONFIG_VZ_LIST) += vzlist.o
obj-$(CONFIG_VE_CALLS) += vzstat.o
@@ -22,6 +22,4 @@ obj-$(CONFIG_VZ_IOLIMIT) += vziolimit.o
obj-$(CONFIG_VE_IPTABLES) += ve.o
-obj-m += dummy/ip6_vzprivnet.o
-obj-m += dummy/ip_vzprivnet.o
-obj-m += dummy/pio_nfs.o
+obj-y += dummy/
diff --git a/kernel/ve/dummy/Makefile b/kernel/ve/dummy/Makefile
new file mode 100644
index 0000000..c7783df
--- /dev/null
+++ b/kernel/ve/dummy/Makefile
@@ -0,0 +1,9 @@
+#
+# kernel/ve/dummy/Makefile
+#
+# Copyright (c) 2000-2015 Parallels IP Holdings GmbH
+#
+
+obj-m += ip6_vzprivnet.o
+obj-m += ip_vzprivnet.o
+obj-m += pio_nfs.o
diff --git a/kernel/ve/vznetstat/Makefile b/kernel/ve/vznetstat/Makefile
new file mode 100644
index 0000000..aecb5cc
--- /dev/null
+++ b/kernel/ve/vznetstat/Makefile
@@ -0,0 +1,7 @@
+#
+# kernel/ve/vznetstat/Makefile
+#
+# Copyright (c) 2000-2015 Parallels IP Holdings GmbH
+#
+
+obj-$(CONFIG_VE_NETDEV_ACCOUNTING) += vznetstat.o ip_vznetstat.o ip6_vznetstat.o
More information about the Devel
mailing list