Commit Graph

16 Commits

Author SHA1 Message Date
Yannick Cote
21645c6a07
kmod: don't build module by default
The stacktrace internal interface has been updated for v5.2. On x86,
among others, this means that stack_trace_save_tsk* is to be used
instead of instantiating a stack_trace struct. Those routines are
currently not exported for module use.

See linux kernel: <25e39e32b0a3> (livepatch: Simplify stack trace retrieval)
for more info about the stacktrace interface changes.

The kernel/livepatch subsystem is the way forward for using kpatch and
there are plans to phase out 'kmod' altogether in the near future.

It is still possible to build and use kmod by doing something like:
$ env BUILDMOD="yes" make

Closes #966

Signed-off-by: Yannick Cote <ycote@redhat.com>
2019-10-03 22:41:12 -07:00
loretob
c9614c4298 Adding support to upstart systems.
Currently kpatch rely on systemd to load all kmods on startup.
This patch aims to enable kpatch to be used on upstart systems.

Limitations:
With systemd, it would be possible to unload all modules by issuing:
        systemctl stop kpatch
It was not possible to make a reasonable upstart's equivalent of it, so
to unload the modules it will be necessary to call kpatch explicitly:
        kpatch unload --all

I believe this it an non-issue, as it is still possible to unload
the modules by calling kpatch explicitly.

The file /etc/init/kpatch.conf will be installed unconditionally, and
removed on uninstall.

On my tests I have verified that all newly added files by this commit
are also deleted on uninstall.

It was also verified that applied patches are loaded again on startup.

rpmlint does not complain about anything new.

Signed-off-by: Bruno Loreto <loretob@amazon.com>
2018-04-06 16:12:02 +02:00
Simon Ruderich
78bfbcc4a5 Makefile.inc: replace uname -p with uname -m
uname -p returns "unknown" on many systems effectively breaking the
build. Replace it with uname -m which yields the correct architecture.
2017-08-18 18:12:56 +02:00
Josh Poimboeuf
a0adebf861 Makefile: Add a rule to build core module on x86_64 only
core module is currently supported on x86_64. Trying to
build it on powerpc, triggers build failure:

make[3]: Entering directory '/root/kernel/linux'
  CC [M]  /root/upstream/kpatch/kmod/core/core.o
/root/upstream/kpatch/kmod/core/core.c:48:28: fatal error: asm/stacktrace.h: No such file or directory
 #include <asm/stacktrace.h>
                            ^
compilation terminated.
scripts/Makefile.build:294: recipe for target '/root/upstream/kpatch/kmod/core/core.o' failed
make[4]: *** [/root/upstream/kpatch/kmod/core/core.o] Error 1

Add a Makefile rule to build it, only on x86.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
2017-07-26 14:40:21 +05:30
Chris J Arges
e9b9654602 Makefile: add BUILDMOD parameter to select building kmod core
In some cases when packaging it may not be useful to build kmod/core at
package build time (for example if using DKMS). Add a parameter 'BUILDMOD'
that when set to 'yes' will build kmod/core.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
2016-02-10 09:55:45 -06:00
Chris J Arges
06ad01b784 Makefile: make libexec a parameter
Some distributions prefer not to use /usr/libexec. To make things easier
for packaging, allow this directory to be set easily via environment
variables.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
2016-01-12 20:12:59 -06:00
Seth Jennings
bfc088ff89 fixup review comments
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2015-04-29 12:53:39 -05:00
Seth Jennings
3810ff8f2f add kpatch systemd service
Add a systemd service file for loading of the kpatch modules

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2015-04-29 10:16:52 -05:00
Josh Poimboeuf
ec77b26c76 kpatch: change core module path again
On RHEL I'm seeing issues with putting the core module in the "extra"
path.  On the next depmod run, it gets added to modules.dep, and on a
subsequent kpatch install I see the following errors:

    /usr/lib/dracut/modules.d/50drm/module-setup.sh: line 26: /lib/modules/3.10.0-123.4.4.el7.x86_64//weak-updates/kpatch/kpatch.ko: No such file or directory
    /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh: line 14: /lib/modules/3.10.0-123.4.4.el7.x86_64//weak-updates/kpatch/kpatch.ko: No such file or directory
    modinfo: ERROR: Module /lib/modules/3.10.0-123.4.4.el7.x86_64/weak-updates/kpatch/kpatch.ko not found.

Until the core module gets merged into Linux, I think we can put it in
/usr/lib/kpatch, which is also where the patch modules are going to be
delivered in the RHEL RPM.

Making sure the other options still work with the kpatch utility for
now, so as to keep backwards compatibility between a newer kpatch
utility and older core modules.  We can break this compatibility for
kpatch 0.2.0.
2014-07-28 20:30:20 -05:00
Seth Jennings
735dfcb005 allow user-defined LIBDIR in install paths
User reported cases where libraries are in lib32/64 directories, not
lib.

Allow the user to override by setting LIBDIR.

Fixes #167

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-07-15 12:47:39 -05:00
Josh Poimboeuf
ea945f6121 fix DRACUTDIR to be in /usr/lib/dracut
Unforunately the dracut module doesn't work if installed in
/usr/local/lib/dracut.  It must always be installed in
/usr/lib/dracut regardless of the install prefix.
2014-04-14 12:39:19 -05:00
Udo Seidel
177b42d951 adapted Makefile.inc contrib/Makefile and SPEC file for dracut modules 2014-04-10 22:23:00 +02:00
Udo Seidel
fd11e9f5d6 added man pages and updated SPEC file 2014-03-25 08:36:20 +01:00
Josh Poimboeuf
2d728c4f0d make kpatch-build a first class script
kpatch-build is outgrowing the kpatch script and probably is a better
fit as its own utility instead of being wrapped by kpatch.  Install
kpatch-build into /usr/local/bin, remove the kpatch wrapper around it,
and update the README accordingly.
2014-03-11 10:43:48 -05:00
Josh Poimboeuf
8085d0402b build and install core module with make
Build and install the kpatch core module with make and make install,
rather than building it every time with kpatch build.

The only downside to this approach is that the user has to make and make
install kpatch every time they get a new kernel.  But this is only
temporary, until the kpatch module is delivered in an RPM.
2014-02-18 07:44:33 -06:00
Josh Poimboeuf
62de820aab proper makefile support
- setup the makefiles to support "make" and "make install", which builds
  the kpatch-build tools and installs everything in /usr/local.
- update kpatch-build to support new paths
- add "kpatch build" wrapper around kpatch-build
2014-02-13 16:02:10 -06:00